feat: adds volume cards

This commit is contained in:
itsscb 2024-10-28 23:11:51 +01:00
parent 90fd1a00ab
commit 8aecb2e518
3 changed files with 6 additions and 1 deletions

View File

@ -3,7 +3,7 @@
"27271E24211E1E26": {
"Play": "02 - Disturbed - Immortalized.mp3"
},
"27271E242121221F": "Shuffle",
"27271E242121221F": "VolumeUp",
"27271E2420222321": {
"Play": "01-13 33 RPM.flac"
}

View File

@ -10,6 +10,8 @@ pub enum Card {
Next,
Previous,
Shuffle,
VolumeUp,
VolumeDown,
ToggleHotspot,
}

View File

@ -76,6 +76,9 @@ pub fn run(rx: &Receiver<Arc<str>>, library: &Arc<Mutex<Library>>) -> Result<(),
toggle_hotspot(!hotspot_enabled)?;
hotspot_enabled = !hotspot_enabled;
}
// TODO: Volume management. Currently the volume is set independetly from the OS which leads to a horrible quality decrease.
Card::VolumeUp => sink.set_volume(sink.volume() + 1.0),
Card::VolumeDown => sink.set_volume(sink.volume() - 1.0),
}
} else {
println!("No music file found for this card");