Use volume command for relative volume changes instead of setvol

This commit is contained in:
Andrzej Rybczak
2017-03-12 12:34:45 +01:00
parent 00cbbe5593
commit 625a0dff3a
3 changed files with 12 additions and 5 deletions

View File

@@ -623,14 +623,12 @@ void SlaveScreen::run()
void VolumeUp::run()
{
int volume = std::min(Status::State::volume()+Config.volume_change_step, 100u);
Mpd.SetVolume(volume);
Mpd.ChangeVolume(static_cast<int>(Config.volume_change_step));
}
void VolumeDown::run()
{
int volume = std::max(int(Status::State::volume()-Config.volume_change_step), 0);
Mpd.SetVolume(volume);
Mpd.ChangeVolume(-static_cast<int>(Config.volume_change_step));
}
bool AddItemToPlaylist::canBeRun()