fix handling playlist highlight
This commit is contained in:
@@ -256,7 +256,7 @@ void Playlist::EnableHighlighting()
|
|||||||
|
|
||||||
void Playlist::UpdateTimer()
|
void Playlist::UpdateTimer()
|
||||||
{
|
{
|
||||||
itsTimer = Global::Timer;
|
std::time(&itsTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Playlist::TotalLength()
|
std::string Playlist::TotalLength()
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ struct Playlist: Screen<NC::Menu<MPD::Song>>, Filterable, HasSongs, Searchable,
|
|||||||
|
|
||||||
void EnableHighlighting();
|
void EnableHighlighting();
|
||||||
void UpdateTimer();
|
void UpdateTimer();
|
||||||
timeval Timer() const { return itsTimer; }
|
time_t Timer() const { return itsTimer; }
|
||||||
|
|
||||||
void PlayNewlyAddedSongs();
|
void PlayNewlyAddedSongs();
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ private:
|
|||||||
size_t itsRemainingTime;
|
size_t itsRemainingTime;
|
||||||
size_t itsScrollBegin;
|
size_t itsScrollBegin;
|
||||||
|
|
||||||
timeval itsTimer;
|
time_t itsTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Playlist *myPlaylist;
|
extern Playlist *myPlaylist;
|
||||||
|
|||||||
@@ -93,8 +93,7 @@ void Status::trace()
|
|||||||
applyToVisibleWindows(&BaseScreen::update);
|
applyToVisibleWindows(&BaseScreen::update);
|
||||||
|
|
||||||
if (isVisible(myPlaylist)
|
if (isVisible(myPlaylist)
|
||||||
&& Timer.tv_sec == myPlaylist->Timer().tv_sec+Config.playlist_disable_highlight_delay
|
&& Timer.tv_sec == myPlaylist->Timer()+Config.playlist_disable_highlight_delay
|
||||||
&& Timer.tv_usec > myPlaylist->Timer().tv_usec
|
|
||||||
&& myPlaylist->main().isHighlighted()
|
&& myPlaylist->main().isHighlighted()
|
||||||
&& Config.playlist_disable_highlight_delay)
|
&& Config.playlist_disable_highlight_delay)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user