JV22QZEHUOIQD6B3P5F3CT5H3FFR4VH5Q64XG2TQKSTSXEVBH6MAC
GVXGUTXFNHGTF6ZYK5OEWKJ4N3IXZTRBK65D6KXB4JQG5GFLKWAQC
7UOD3DXGSU55P6N63FZC7556JSBKOUS6JQ2W6NAXRMV66DBSQIYAC
ZJ2DSL63RVPSNXIGTAZNPV6HLHOKLWC5RSK5EAAM3HIYUJ5Y3ISQC
ASIORORAPGGVNLR42J6PZRTG7JKK34GYXBYSKSTJFXSFW6YXBJJQC
ZW67OU7OPHAITCJS3GHQYFBRY5YGOIGRD7B4CKULAXAEXHM42KYQC
KZU3YXA22IYIPZICQTMZ4XILKCWOI5O6W4H72PDXDUTZDFVMVGVQC
5VMLVYL7NPW4FW3NP45VJZCQIO4UAFOKVLAGNW42HG6OJEBMFFQQC
SXVH6NSJG4KSPJPFDXV4SKU6KL2BU2J62SO5VKQ2IUTHBE3VIZXAC
ZQD7OQ6OQB2E6CPKKT5MILYDWSR2QDNYDPCUTG3DXGY25H6ANHZQC
LJJL6IBEQCCIVNJHDMXA7HBVI3CVROFUSFTXB3CSARCMJFM25Z5AC
ZTJ4E5YFRAUZ5KQVQGW4VEWZ2GMSGIWVXLQHNZTFQRRDVJXP4DXAC
MKB2A5XCWBZO2E6QFE6PD36LF3IGMJCGJB5TGMRAPSKCKHS75ISAC
/// Labels for audio systems
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, SystemSet)]
pub enum FundspAudioSystemSet {
/// Label for systems in [`CoreStage::PreUpdate`] that clean up tracked audio instances
// InstanceCleanup,
/// Label for system in [`CoreStage::PostUpdate`] that processes audio commands for dynamic channels
// PlayDynamicChannels,
/// Label for systems in [`CoreStage::PostUpdate`] that process audio commands for typed channels
PlayTypedChannels,
}
.add_systems(
PostUpdate,
load_next_machine::<T>.in_set(FundspAudioSystemSet::PlayTypedChannels),
)
}
}
fn load_next_machine<T: Resource>(
mut output: NonSendMut<FundspAudioOutput>,
mut track: ResMut<Track<T>>,
) {
if let Some(machine) = track.next_machine.take() {
output.play(machine, &mut *track);
impl<T: AudioUnit32> TypePath for Machine<T> {
fn type_path() -> &'static str {
static TYPE_PATH: OnceLock<String> = OnceLock::new();
TYPE_PATH
.get_or_init(|| {
let machine_type_name = std::any::type_name::<T>();
format!("{}::Machine<{machine_type_name}>", module_path!())
})
.as_str()
}
fn short_type_path() -> &'static str {
static SHORT_TYPE_PATH: OnceLock<String> = OnceLock::new();
SHORT_TYPE_PATH
.get_or_init(|| {
let machine_type_name = std::any::type_name::<T>();
format!("Machine<{machine_type_name}>")
})
.as_str()
}
}