pub struct SoundManager {
pub channels: Vec<SndChannel>,
pub pending_callbacks: Vec<PendingDoubleBackCallback>,
pub pending_sound_callbacks: Vec<PendingSoundCallback>,
pub debug_cmd_count: u32,
pub debug_buffer_cmd_count: u32,
pub debug_double_buffer_count: u32,
pub debug_samples_mixed: u64,
pub debug_unhandled_cmds: Vec<u16>,
pub debug_cmd_codes_seen: Vec<u16>,
pub debug_file_play_count: u32,
}Expand description
Top-level sound manager state, owned by TrapDispatcher.
Fields§
§channels: Vec<SndChannel>§pending_callbacks: Vec<PendingDoubleBackCallback>Pending double-buffer callbacks to fire on the next frame.
pending_sound_callbacks: Vec<PendingSoundCallback>Pending sound callback procedures / completion routines.
debug_cmd_count: u32Debug counters for diagnosing sound issues.
debug_buffer_cmd_count: u32§debug_double_buffer_count: u32SndPlayDoubleBuffer submissions (SoundDispatch routine
$20). Separate counter because Marathon 2 uses this path
exclusively and bufferCmd-based games like EV use the other
path; both feed mix_frame but through different dispatch.
debug_samples_mixed: u64§debug_unhandled_cmds: Vec<u16>§debug_cmd_codes_seen: Vec<u16>Deduplicated list of distinct SndCommand cmd codes seen via
execute_sound_command. Sibling of debug_unhandled_cmds
(which only tracks the _ => arm); this tracks ALL cmd codes
including the matched ones.
debug_file_play_count: u32SndStartFilePlay (SoundDispatch routine $00) submissions.
M2’s primary audio path goes through this trap and DOES NOT
increment debug_buffer_cmd_count or debug_double_buffer_count.
Per-path visibility: EV uses bufferCmd
(debug_buffer_cmd_count), M2 uses SndStartFilePlay
(debug_file_play_count), other games can use
SndPlayDoubleBuffer (debug_double_buffer_count).
Implementations§
Source§impl SoundManager
impl SoundManager
pub fn new() -> Self
Sourcepub fn find_channel_mut(&mut self, guest_ptr: u32) -> Option<&mut SndChannel>
pub fn find_channel_mut(&mut self, guest_ptr: u32) -> Option<&mut SndChannel>
Find a channel by its guest pointer.
Sourcepub fn take_channel(&mut self, guest_ptr: u32) -> Option<SndChannel>
pub fn take_channel(&mut self, guest_ptr: u32) -> Option<SndChannel>
Remove and return a channel by guest pointer.
Sourcepub fn remove_channel(&mut self, guest_ptr: u32) -> bool
pub fn remove_channel(&mut self, guest_ptr: u32) -> bool
Remove a channel by guest pointer. Returns true if found.
Trait Implementations§
Source§impl Clone for SoundManager
impl Clone for SoundManager
Source§fn clone(&self) -> SoundManager
fn clone(&self) -> SoundManager
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more