mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
NoteCut support
This commit is contained in:
parent
a9236531c7
commit
1b8f4bbdc9
|
@ -48,6 +48,7 @@ pub enum PatternEffect {
|
||||||
Panning(Num<i16, 4>),
|
Panning(Num<i16, 4>),
|
||||||
Volume(Num<i16, 4>),
|
Volume(Num<i16, 4>),
|
||||||
VolumeSlide(Num<i16, 4>),
|
VolumeSlide(Num<i16, 4>),
|
||||||
|
NoteCut(u32),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "quote")]
|
#[cfg(feature = "quote")]
|
||||||
|
@ -202,6 +203,7 @@ impl quote::ToTokens for PatternEffect {
|
||||||
let amount = amount.to_raw();
|
let amount = amount.to_raw();
|
||||||
quote! { VolumeSlide(agb_tracker::__private::Num::from_raw(#amount))}
|
quote! { VolumeSlide(agb_tracker::__private::Num::from_raw(#amount))}
|
||||||
}
|
}
|
||||||
|
PatternEffect::NoteCut(wait) => quote! { NoteCut(#wait) },
|
||||||
};
|
};
|
||||||
|
|
||||||
tokens.append_all(quote! {
|
tokens.append_all(quote! {
|
||||||
|
|
|
@ -208,6 +208,12 @@ impl TrackerChannel {
|
||||||
channel.volume(self.volume);
|
channel.volume(self.volume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
PatternEffect::NoteCut(wait) => {
|
||||||
|
if tick == *wait {
|
||||||
|
channel.volume(0);
|
||||||
|
self.volume = 0.into();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,6 +219,10 @@ pub fn parse_module(module: &Module) -> TokenStream {
|
||||||
PatternEffect::None
|
PatternEffect::None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
0xE => match slot.effect_parameter >> 4 {
|
||||||
|
0xC => PatternEffect::NoteCut((slot.effect_parameter & 0xf).into()),
|
||||||
|
_ => PatternEffect::None,
|
||||||
|
},
|
||||||
_ => PatternEffect::None,
|
_ => PatternEffect::None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue