block displaying elapsed time while seeking properly (alternative ui)
This commit is contained in:
@@ -44,6 +44,7 @@ namespace Global
|
||||
|
||||
extern bool UpdateStatusImmediately;
|
||||
extern bool MessagesAllowed;
|
||||
extern bool SeekingInProgress;
|
||||
extern bool RedrawHeader;
|
||||
extern bool RedrawStatusbar;
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ size_t Global::MainHeight;
|
||||
bool Global::BlockItemListUpdate = 0;
|
||||
|
||||
bool Global::MessagesAllowed = 0;
|
||||
bool Global::SeekingInProgress = 0;
|
||||
bool Global::RedrawHeader = 1;
|
||||
|
||||
namespace
|
||||
@@ -1108,6 +1109,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
songpos = Mpd.GetElapsedTime();
|
||||
|
||||
SeekingInProgress = 1;
|
||||
while (Keypressed(input, Key.SeekForward) || Keypressed(input, Key.SeekBackward))
|
||||
{
|
||||
TraceMpdStatus();
|
||||
@@ -1172,6 +1174,7 @@ int main(int argc, char *argv[])
|
||||
wFooter->Refresh();
|
||||
}
|
||||
Mpd.Seek(songpos);
|
||||
SeekingInProgress = 0;
|
||||
UpdateStatusImmediately = 1;
|
||||
|
||||
UnlockProgressbar();
|
||||
|
||||
@@ -447,8 +447,7 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
|
||||
size_t second_margin = (std::max(player_state.length(), size_t(8))+1)*2;
|
||||
size_t second_start = second_len < COLS-second_margin ? (COLS-second_len)/2 : player_state.length()+1;
|
||||
|
||||
if (!block_progressbar_update // if blocked, seeking in progress
|
||||
|| lock_statusbar_delay >= 0) // do not block it if message is displayed
|
||||
if (!SeekingInProgress)
|
||||
*wHeader << XY(0, 0) << wclrtoeol << tracklength;
|
||||
*wHeader << XY(first_start, 0);
|
||||
first.Write(*wHeader, first_line_scroll_begin, COLS-tracklength.length()-VolumeState.length()-1, U(" ** "));
|
||||
|
||||
Reference in New Issue
Block a user