allegroflare / allegro_flare

Application toolkit for Allegro 5
https://clubcatt.com/allegroflare
MIT License
35 stars 6 forks source link

Consider creating PR for Allegro5 to add ALLEGRO_AUDIO_DEPTH_UNDEFINED #250

Open MarkOates opened 2 years ago

MarkOates commented 2 years ago

Currently the constants are defined here: https://github.com/liballeg/allegro5/blob/f818aee0ba95ecbf2c3caba8d6e56e594d66470b/addons/audio/allegro5/allegro_audio.h

Having an *_UNDEFINED for this enumeration (as well as several others), will allow objects to have default properties that are "not set" or "empty".

MarkOates commented 2 years ago

Also consider renaming ALLEGRO_AUDIO_VOICE, ALLEGRO_AUDIO_MIXER, constants from audio to ALLEGRO_AUDIO_VOICE, and ALLEGRO_AUDIO_MIXER.

MarkOates commented 2 years ago

use al_get_channel_count to replace logic code in this example: https://github.com/liballeg/allegro5/blob/d25c4cff7621db614e5236a1646f5d76309ca73f/examples/ex_synth.cpp#L156-L166

   switch (al_get_mixer_channels(mixer)) {
      case ALLEGRO_CHANNEL_CONF_1:
         nch = 1;
         break;
      case ALLEGRO_CHANNEL_CONF_2:
         nch = 2;
         break;
      default:
         /* Not supported. */
         return;
   }