summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d25aa52)
raw | patch | inline | side by side (parent: d25aa52)
author | Kalle Wallin <kaw@linux.se> | |
Tue, 6 Apr 2004 08:45:11 +0000 (08:45 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Tue, 6 Apr 2004 08:45:11 +0000 (08:45 +0000) |
screen.c | patch | blob | history | |
screen.h | patch | blob | history |
diff --git a/screen.c b/screen.c
index efd93d1fec9e76f903b3229626bb3aa9a9c700f7..95fe85d4b399d73d3b560eec0955c32e7b3e6ec5 100644 (file)
--- a/screen.c
+++ b/screen.c
{
char buf[12];
- wattron(w, A_BOLD);
- mvwaddstr(w, 0, 0, header);
- wattroff(w, A_BOLD);
+ if( header[0] )
+ {
+ wattron(w, A_BOLD);
+ mvwaddstr(w, 0, 0, header);
+ wattroff(w, A_BOLD);
+ }
+ else
+ {
+ wattron(w, A_BOLD);
+ waddstr(w, "F1");
+ wattroff(w, A_BOLD);
+ waddstr(w, ":Help ");
+ wattron(w, A_BOLD);
+ waddstr(w, "F2");
+ wattroff(w, A_BOLD);
+ waddstr(w, ":Playlist ");
+ wattron(w, A_BOLD);
+ waddstr(w, "F3");
+ wattroff(w, A_BOLD);
+ waddstr(w, ":Browse");
+ }
if( volume==MPD_STATUS_NO_VOLUME )
{
snprintf(buf, 12, "Volume n/a ");
screen->findbuf = NULL;
screen->painted = 0;
screen->input_timestamp = time(NULL);
+ screen->last_cmd = CMD_NONE;
/* create top window */
screen->top_window.rows = 2;
switch(screen->mode)
{
case SCREEN_PLAY_WINDOW:
- paint_top_window(TOP_HEADER_PLAY, c->status->volume, 0);
+ if( screen->last_cmd==CMD_NONE &&
+ time(NULL)-screen->input_timestamp <= SCREEN_WELCOME_TIME)
+ paint_top_window("", c->status->volume, 0);
+ else
+ paint_top_window(TOP_HEADER_PLAY, c->status->volume, 0);
play_update(screen, c);
lw = screen->playlist;
break;
screen_mode_t new_mode = screen->mode;
screen->input_timestamp = time(NULL);
+ screen->last_cmd = cmd;
switch(screen->mode)
{
case SCREEN_PLAY_WINDOW:
diff --git a/screen.h b/screen.h
index 452490996fcb351990ea3a7b18a6a729661fc32a..b23a1da0e5a4926998ef732cbb8909eebd391b79 100644 (file)
--- a/screen.h
+++ b/screen.h
/* timeout for non blocking read [ms] */
#define SCREEN_TIMEOUT 250
+/* welcome message time [s] */
+#define SCREEN_WELCOME_TIME 10
+
#define IS_PLAYING(s) (s==MPD_STATUS_STATE_PLAY)
#define IS_PAUSED(s) (s==MPD_STATUS_STATE_PAUSE)
#define IS_STOPPED(s) (!(IS_PLAYING(s) | IS_PAUSED(s)))
time_t status_timestamp;
time_t input_timestamp;
+ command_t last_cmd;
list_window_t *playlist;
list_window_t *filelist;