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

master
Andrzej Rybczak 17 years ago
parent 8e350292ad
commit f78e88e6aa
  1. 12
      src/mpdpp.cpp
  2. 2
      src/mpdpp.h
  3. 6
      src/ncmpcpp.cpp

@ -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);
}
}
}

@ -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))
{

Loading…
Cancel
Save