fix blocking playlist update
This commit is contained in:
@@ -199,8 +199,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
TraceMpdStatus();
|
TraceMpdStatus();
|
||||||
|
|
||||||
BlockItemListUpdate = 0;
|
|
||||||
Playlist::BlockUpdate = 0;
|
|
||||||
MessagesAllowed = 1;
|
MessagesAllowed = 1;
|
||||||
|
|
||||||
// header stuff
|
// header stuff
|
||||||
@@ -463,6 +461,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
size_t id = myPlaylist->Main()->Choice();
|
size_t id = myPlaylist->Main()->Choice();
|
||||||
TraceMpdStatus();
|
TraceMpdStatus();
|
||||||
|
Playlist::BlockUpdate = 1;
|
||||||
myPlaylist->UpdateTimer();
|
myPlaylist->UpdateTimer();
|
||||||
// needed for keeping proper position of now playing song.
|
// needed for keeping proper position of now playing song.
|
||||||
if (myPlaylist->NowPlaying > myPlaylist->CurrentSong()->GetPosition()-del_counter)
|
if (myPlaylist->NowPlaying > myPlaylist->CurrentSong()->GetPosition()-del_counter)
|
||||||
@@ -619,7 +618,6 @@ int main(int argc, char *argv[])
|
|||||||
if (myScreen == myPlaylist && !myPlaylist->Main()->Empty())
|
if (myScreen == myPlaylist && !myPlaylist->Main()->Empty())
|
||||||
{
|
{
|
||||||
CHECK_PLAYLIST_FOR_FILTERING;
|
CHECK_PLAYLIST_FOR_FILTERING;
|
||||||
Playlist::BlockUpdate = 1;
|
|
||||||
myPlaylist->Main()->SetTimeout(50);
|
myPlaylist->Main()->SetTimeout(50);
|
||||||
if (myPlaylist->Main()->hasSelected())
|
if (myPlaylist->Main()->hasSelected())
|
||||||
{
|
{
|
||||||
@@ -635,6 +633,7 @@ int main(int argc, char *argv[])
|
|||||||
while (Keypressed(input, Key.MvSongUp) && list.front() > 0)
|
while (Keypressed(input, Key.MvSongUp) && list.front() > 0)
|
||||||
{
|
{
|
||||||
TraceMpdStatus();
|
TraceMpdStatus();
|
||||||
|
Playlist::BlockUpdate = 1;
|
||||||
myPlaylist->UpdateTimer();
|
myPlaylist->UpdateTimer();
|
||||||
for (vector<size_t>::iterator it = list.begin(); it != list.end(); it++)
|
for (vector<size_t>::iterator it = list.begin(); it != list.end(); it++)
|
||||||
{
|
{
|
||||||
@@ -662,6 +661,7 @@ int main(int argc, char *argv[])
|
|||||||
while (Keypressed(input, Key.MvSongUp) && to > 0)
|
while (Keypressed(input, Key.MvSongUp) && to > 0)
|
||||||
{
|
{
|
||||||
TraceMpdStatus();
|
TraceMpdStatus();
|
||||||
|
Playlist::BlockUpdate = 1;
|
||||||
myPlaylist->UpdateTimer();
|
myPlaylist->UpdateTimer();
|
||||||
to--;
|
to--;
|
||||||
myPlaylist->Main()->at(from).SetPosition(to);
|
myPlaylist->Main()->at(from).SetPosition(to);
|
||||||
@@ -729,7 +729,6 @@ int main(int argc, char *argv[])
|
|||||||
if (myScreen == myPlaylist && !myPlaylist->Main()->Empty())
|
if (myScreen == myPlaylist && !myPlaylist->Main()->Empty())
|
||||||
{
|
{
|
||||||
CHECK_PLAYLIST_FOR_FILTERING;
|
CHECK_PLAYLIST_FOR_FILTERING;
|
||||||
Playlist::BlockUpdate = 1;
|
|
||||||
myPlaylist->Main()->SetTimeout(50);
|
myPlaylist->Main()->SetTimeout(50);
|
||||||
if (myPlaylist->Main()->hasSelected())
|
if (myPlaylist->Main()->hasSelected())
|
||||||
{
|
{
|
||||||
@@ -745,6 +744,7 @@ int main(int argc, char *argv[])
|
|||||||
while (Keypressed(input, Key.MvSongDown) && list.back() < myPlaylist->Main()->Size()-1)
|
while (Keypressed(input, Key.MvSongDown) && list.back() < myPlaylist->Main()->Size()-1)
|
||||||
{
|
{
|
||||||
TraceMpdStatus();
|
TraceMpdStatus();
|
||||||
|
Playlist::BlockUpdate = 1;
|
||||||
myPlaylist->UpdateTimer();
|
myPlaylist->UpdateTimer();
|
||||||
for (vector<size_t>::reverse_iterator it = list.rbegin(); it != list.rend(); it++)
|
for (vector<size_t>::reverse_iterator it = list.rbegin(); it != list.rend(); it++)
|
||||||
{
|
{
|
||||||
@@ -772,6 +772,7 @@ int main(int argc, char *argv[])
|
|||||||
while (Keypressed(input, Key.MvSongDown) && to < myPlaylist->Main()->Size()-1)
|
while (Keypressed(input, Key.MvSongDown) && to < myPlaylist->Main()->Size()-1)
|
||||||
{
|
{
|
||||||
TraceMpdStatus();
|
TraceMpdStatus();
|
||||||
|
Playlist::BlockUpdate = 1;
|
||||||
myPlaylist->UpdateTimer();
|
myPlaylist->UpdateTimer();
|
||||||
to++;
|
to++;
|
||||||
myPlaylist->Main()->at(from).SetPosition(to);
|
myPlaylist->Main()->at(from).SetPosition(to);
|
||||||
|
|||||||
@@ -109,6 +109,8 @@ void TraceMpdStatus()
|
|||||||
if (Mpd->Connected() && now.tv_sec > past.tv_sec)
|
if (Mpd->Connected() && now.tv_sec > past.tv_sec)
|
||||||
{
|
{
|
||||||
Mpd->UpdateStatus();
|
Mpd->UpdateStatus();
|
||||||
|
BlockItemListUpdate = 0;
|
||||||
|
Playlist::BlockUpdate = 0;
|
||||||
gettimeofday(&past, 0);
|
gettimeofday(&past, 0);
|
||||||
}
|
}
|
||||||
wFooter->Refresh();
|
wFooter->Refresh();
|
||||||
|
|||||||
Reference in New Issue
Block a user