diff options
author | Kalle Wallin <kaw@linux.se> | 2004-04-06 08:45:11 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-04-06 08:45:11 +0000 |
commit | c6b7d4d7119f9d8c12514f8309a25ed618e22512 (patch) | |
tree | e753ebbee7a915b4fc78580790d22de562d17287 /screen.c | |
parent | d25aa528e221c51b46b5a461c15493593294db81 (diff) | |
download | mpd-c6b7d4d7119f9d8c12514f8309a25ed618e22512.tar.gz mpd-c6b7d4d7119f9d8c12514f8309a25ed618e22512.tar.xz mpd-c6b7d4d7119f9d8c12514f8309a25ed618e22512.zip |
Added a welcome message (help).
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@609 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | screen.c | 32 |
1 files changed, 28 insertions, 4 deletions
@@ -87,9 +87,27 @@ paint_top_window(char *header, int volume, int clear) { 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 "); @@ -335,6 +353,7 @@ screen_init(void) screen->findbuf = NULL; screen->painted = 0; screen->input_timestamp = time(NULL); + screen->last_cmd = CMD_NONE; /* create top window */ screen->top_window.rows = 2; @@ -455,7 +474,11 @@ screen_update(mpd_client_t *c) 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; @@ -488,6 +511,7 @@ screen_cmd(mpd_client_t *c, command_t cmd) screen_mode_t new_mode = screen->mode; screen->input_timestamp = time(NULL); + screen->last_cmd = cmd; switch(screen->mode) { case SCREEN_PLAY_WINDOW: |