do not fetch status after succesful setvol command, set it locally
This commit is contained in:
@@ -482,13 +482,19 @@ void Connection::SetRandom(bool mode) const
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::SetVolume(int vol) const
|
||||
void Connection::SetVolume(int vol)
|
||||
{
|
||||
if (isConnected)
|
||||
{
|
||||
mpd_sendSetvolCommand(itsConnection, vol);
|
||||
if (!isCommandsListEnabled)
|
||||
mpd_finishCommand(itsConnection);
|
||||
if (!itsConnection->error && itsUpdater)
|
||||
{
|
||||
itsCurrentStatus->volume = vol;
|
||||
StatusChanges ch;
|
||||
ch.Volume = 1;
|
||||
itsUpdater(this, ch, itsStatusUpdaterUserdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,8 +137,8 @@ namespace MPD
|
||||
|
||||
void SetRepeat(bool) const;
|
||||
void SetRandom(bool) const;
|
||||
void SetVolume(int) const;
|
||||
void SetCrossfade(int) const;
|
||||
void SetVolume(int);
|
||||
|
||||
int AddSong(const std::string &); // returns id of added song
|
||||
int AddSong(const Song &); // returns id of added song
|
||||
|
||||
@@ -414,10 +414,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
# endif // HAVE_TAGLIB_H
|
||||
else
|
||||
{
|
||||
Mpd->SetVolume(Mpd->GetVolume()+1);
|
||||
Mpd->UpdateStatus();
|
||||
}
|
||||
}
|
||||
else if (Keypressed(input, Key.VolumeDown))
|
||||
{
|
||||
@@ -436,10 +433,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
# endif // HAVE_TAGLIB_H
|
||||
else
|
||||
{
|
||||
Mpd->SetVolume(Mpd->GetVolume()-1);
|
||||
Mpd->UpdateStatus();
|
||||
}
|
||||
}
|
||||
else if (Keypressed(input, Key.Delete))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user