Skip to content

Commit

Permalink
Removed AllowChangeFlag::NONE and AllowChangeFlag::ANY in favor o…
Browse files Browse the repository at this point in the history
…f bitflags `empty()` and `all()` function
  • Loading branch information
Henrique194 committed Mar 5, 2025
1 parent f30f118 commit a02f6f7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sdl2/mixer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,10 @@ bitflags!(
bitflags!(
/// Which audio format changes are allowed when opening a device ([`open_audio_device`]).
pub struct AllowChangeFlag: u32 {
const NONE = 0;
const FREQUENCY = sys::SDL_AUDIO_ALLOW_FREQUENCY_CHANGE;
const FORMAT = sys::SDL_AUDIO_ALLOW_FORMAT_CHANGE;
const CHANNELS = sys::SDL_AUDIO_ALLOW_CHANNELS_CHANGE;
const SAMPLES = sys::SDL_AUDIO_ALLOW_SAMPLES_CHANGE;
const ANY = sys::SDL_AUDIO_ALLOW_ANY_CHANGE;
}
);

Expand Down Expand Up @@ -201,7 +199,7 @@ pub fn open_audio(
/// `SDL_mixer` can select what the hardware demands instead of the app. For a given
/// [`AllowChangeFlag`], If it is not specified, `SDL_mixer` must convert data behind the scenes
/// between what the app demands and what the hardware requires. If your app needs precisely what
/// is requested, specify [`AllowChangeFlag::NONE`].
/// is requested, specify [`AllowChangeFlag::empty`].
///
/// * `frequency`: The frequency to playback audio at (in Hz).
/// * `format`: Audio format ([`AudioFormat`]).
Expand All @@ -219,7 +217,8 @@ pub fn open_audio_device<D>(
chunksize: i32,
device: D,
allowed_changes: AllowChangeFlag,
) -> Result<(), String> where
) -> Result<(), String>
where
D: Into<Option<&str>>,
{
let ret = unsafe {
Expand Down

0 comments on commit a02f6f7

Please sign in to comment.