use flag to force status update rather than doing additional update

This commit is contained in:
Andrzej Rybczak
2009-04-01 16:15:19 +02:00
parent 89c06db1f4
commit 7f85a0dcd1
4 changed files with 22 additions and 18 deletions

View File

@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
{
ShowMessage("Connected to %s!", Mpd->GetHostname().c_str());
MessagesAllowed = 0;
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
}
@@ -551,17 +551,17 @@ int main(int argc, char *argv[])
else if (Keypressed(input, Key.Prev))
{
Mpd->Prev();
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.Next))
{
Mpd->Next();
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.Pause))
{
Mpd->Pause();
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.SavePlaylist))
{
@@ -618,7 +618,7 @@ int main(int argc, char *argv[])
else if (Keypressed(input, Key.Stop))
{
Mpd->Stop();
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.MvSongUp))
{
@@ -991,7 +991,7 @@ int main(int argc, char *argv[])
wFooter->Refresh();
}
Mpd->Seek(songpos);
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
UnlockProgressbar();
UnlockStatusbar();
@@ -1081,17 +1081,17 @@ int main(int argc, char *argv[])
else if (Keypressed(input, Key.ToggleRepeat))
{
Mpd->SetRepeat(!Mpd->GetRepeat());
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.Shuffle))
{
Mpd->Shuffle();
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.ToggleRandom))
{
Mpd->SetRandom(!Mpd->GetRandom());
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.ToggleSingle))
{
@@ -1106,18 +1106,18 @@ int main(int argc, char *argv[])
else
{
Mpd->SetSingle(!Mpd->GetSingle());
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
}
else if (Keypressed(input, Key.ToggleConsume))
{
Mpd->SetConsume(!Mpd->GetConsume());
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.ToggleCrossfade))
{
Mpd->SetCrossfade(Mpd->GetCrossfade() ? 0 : Config.crossfade_time);
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.SetCrossfade))
{
@@ -1130,7 +1130,7 @@ int main(int argc, char *argv[])
{
Config.crossfade_time = cf;
Mpd->SetCrossfade(cf);
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
}
else if (Keypressed(input, Key.EditTags))
@@ -1345,7 +1345,7 @@ int main(int argc, char *argv[])
else
ShowMessage("Out of bounds, 1-99 possible for %, %d given.", newpos);
}
Mpd->UpdateStatus();
UpdateStatusImmediately = 1;
}
else if (Keypressed(input, Key.ReverseSelection))
{
@@ -1551,7 +1551,6 @@ int main(int argc, char *argv[])
{
Mpd->ClearPlaylist();
}
Mpd->UpdateStatus();
ShowMessage("Cleared playlist!");
}
}