Create correct source types based on presence of panning components.
This commit is contained in:
parent
7d3a0ba156
commit
c6bf921a72
23
src/lib.rs
23
src/lib.rs
|
@ -256,6 +256,29 @@ pub fn update_sound_properties(
|
||||||
.add_generator(generator)
|
.add_generator(generator)
|
||||||
.expect("Unable to add generator");
|
.expect("Unable to add generator");
|
||||||
sound.source = Some(source.into());
|
sound.source = Some(source.into());
|
||||||
|
} else if let Some(scalar_pan) = scalar_pan {
|
||||||
|
let source = syz::ScalarPannedSource::new(
|
||||||
|
&context,
|
||||||
|
syz::PannerStrategy::Delegate,
|
||||||
|
**scalar_pan,
|
||||||
|
)
|
||||||
|
.expect("Failed to create source");
|
||||||
|
source
|
||||||
|
.add_generator(generator)
|
||||||
|
.expect("Failed to add generator");
|
||||||
|
sound.source = Some(source.into());
|
||||||
|
} else if let Some(angular_pan) = angular_pan {
|
||||||
|
let source = syz::AngularPannedSource::new(
|
||||||
|
&context,
|
||||||
|
syz::PannerStrategy::Delegate,
|
||||||
|
angular_pan.azimuth,
|
||||||
|
angular_pan.elevation,
|
||||||
|
)
|
||||||
|
.expect("Failed to create source");
|
||||||
|
source
|
||||||
|
.add_generator(generator)
|
||||||
|
.expect("Failed to add generator");
|
||||||
|
sound.source = Some(source.into());
|
||||||
} else {
|
} else {
|
||||||
let source =
|
let source =
|
||||||
syz::DirectSource::new(&context).expect("Failed to create source");
|
syz::DirectSource::new(&context).expect("Failed to create source");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user