Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider creating PR for Allegro5 to add ALLEGRO_AUDIO_DEPTH_UNDEFINED #250

Open
MarkOates opened this issue Oct 3, 2022 · 2 comments
Open

Comments

@MarkOates
Copy link
Collaborator

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
Copy link
Collaborator Author

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

@MarkOates
Copy link
Collaborator Author

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;
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant