Specify that it is the volume envelope

This commit is contained in:
Gwilym Inzani 2023-08-04 23:19:07 +01:00
parent 826fdd881a
commit d29a641a44
2 changed files with 5 additions and 5 deletions

View file

@ -22,7 +22,7 @@ pub struct Sample<'a> {
pub should_loop: bool, pub should_loop: bool,
pub restart_point: u32, pub restart_point: u32,
pub volume: Num<i16, 8>, pub volume: Num<i16, 8>,
pub envelope: Option<usize>, pub volume_envelope: Option<usize>,
} }
#[derive(Debug)] #[derive(Debug)]
@ -176,10 +176,10 @@ impl<'a> quote::ToTokens for Sample<'a> {
should_loop, should_loop,
restart_point, restart_point,
volume, volume,
envelope, volume_envelope,
} = self; } = self;
let envelope = match envelope { let volume_envelope = match volume_envelope {
Some(index) => quote!(Some(#index)), Some(index) => quote!(Some(#index)),
None => quote!(None), None => quote!(None),
}; };
@ -198,7 +198,7 @@ impl<'a> quote::ToTokens for Sample<'a> {
should_loop: #should_loop, should_loop: #should_loop,
restart_point: #restart_point, restart_point: #restart_point,
volume: agb_tracker::__private::Num::from_raw(#volume), volume: agb_tracker::__private::Num::from_raw(#volume),
envelope: #envelope, volume_envelope: #volume_envelope,
} }
} }
}); });

View file

@ -377,7 +377,7 @@ pub fn parse_module(module: &Module) -> TokenStream {
should_loop: sample.should_loop, should_loop: sample.should_loop,
restart_point: sample.restart_point, restart_point: sample.restart_point,
volume: sample.volume, volume: sample.volume,
envelope: None, volume_envelope: None,
}) })
.collect(); .collect();