do not fetch status after succesful setvol command, set it locally

This commit is contained in:
Andrzej Rybczak
2009-03-23 16:30:12 +01:00
parent 8e350292ad
commit f78e88e6aa
3 changed files with 10 additions and 10 deletions

View File

@@ -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);
mpd_finishCommand(itsConnection);
if (!itsConnection->error && itsUpdater)
{
itsCurrentStatus->volume = vol;
StatusChanges ch;
ch.Volume = 1;
itsUpdater(this, ch, itsStatusUpdaterUserdata);
}
}
}