volume_button.connect_value_changed(move |_, value| {
// 1
SwApplication::default().player().set_volume(value);
// 2
SwApplication::default()
.imp()
.legacy_player
.set_volume(value);
});
So I'm trying to port everything to a new SwPlayer class. Setting volume only works for 1 but not for 2 . But both are calling the exactly same methods
legacy / 1 set_volume method
pub fn set_volume(&self, volume: f64) {
debug!("Set volume: {}", &volume);
self.backend.borrow().gstreamer.set_volume(volume);
settings_manager::set_double(Key::PlaybackVolume, volume);
}
new SwPlayer set_volume method:
fn set_volume(&self, volume: f64) {
debug!("Set volume: {}", &volume);
self.backend.borrow().gstreamer.set_volume(volume);
self.volume.set(volume);
settings_manager::set_double(Key::PlaybackVolume, volume);
}
I can verify that both are calling gstreamer.set_volume which calls
pulsesink.set_property("volume", pa_volume);
dbg!(pulsesink.property::<f64>("volume"));
Both are coming from the same thread. But only 1 actually sets the volume. 2 doesn't change the volume, but sets the same pulsesink property (= I can see the debug output)
???
|