move some functions from helpers to status_checker

This commit is contained in:
Andrzej Rybczak
2008-12-28 19:11:05 +01:00
parent b4d8c273bb
commit d92dde1fb1
4 changed files with 51 additions and 58 deletions

View File

@@ -57,6 +57,7 @@ extern bool block_progressbar_update;
extern bool block_playlist_update;
extern bool block_item_list_update;
extern bool messages_allowed;
extern bool redraw_header;
extern bool reload_lyrics;
@@ -72,6 +73,27 @@ bool allow_statusbar_unlock = 1;
bool header_update_status = 0;
bool repeat_one_allowed = 0;
void LockStatusbar()
{
if (Config.statusbar_visibility)
block_statusbar_update = 1;
else
block_progressbar_update = 1;
allow_statusbar_unlock = 0;
}
void UnlockStatusbar()
{
allow_statusbar_unlock = 1;
if (lock_statusbar_delay < 0)
{
if (Config.statusbar_visibility)
block_statusbar_update = 0;
else
block_progressbar_update = 0;
}
}
void TraceMpdStatus()
{
Mpd->UpdateStatus();
@@ -440,3 +462,26 @@ void NcmpcppStatusChanged(Connection *Mpd, StatusChanges changed, void *)
wFooter->Refresh();
}
void ShowMessage(const char *format, ...)
{
if (messages_allowed)
{
time_of_statusbar_lock = time(NULL);
lock_statusbar_delay = Config.message_delay_time;
if (Config.statusbar_visibility)
block_statusbar_update = 1;
else
block_progressbar_update = 1;
wFooter->GotoXY(0, Config.statusbar_visibility);
wFooter->Bold(0);
va_list list;
va_start(list, format);
wmove(wFooter->Raw(), Config.statusbar_visibility, 0);
vw_printw(wFooter->Raw(), format, list);
wclrtoeol(wFooter->Raw());
va_end(list);
wFooter->Bold(1);
wFooter->Refresh();
}
}