Audio Controller - aaronboult/emulator-8080 GitHub Wiki
A struct used to manage the audio that should be played through the machine. The volume initializes at 64 (50% of max volume)
pub fn close(&mut self)
Wraps the close_audio()
method on the sdl2::mixer
module
pub fn play_track(&mut self, track_index: u8, number_of_repeats: i32)
Plays the track that was loaded at index track_index
and repeats the track as specified in number_of_repeats
pub fn stop_track(&mut self, track_index: u8)
Stops all channels playing the track that was loaded at index track_index
pub fn volume_up(&mut self)
Increases the volume by a value of 1; the volume does not change if the volume is already at it's maximum value of 128
pub fn volume_down(&mut self)
Decreases the volume by a value of 1; the volume does not change if the volume is already 0
pub fn toggle_mute(&mut self)
Mutes the volume if it is not already muted, otherwise the audio is unmuted