aboutsummaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-04-05 08:56:50 +0000
committerKalle Wallin <kaw@linux.se>2004-04-05 08:56:50 +0000
commitcc10008d7908ddfe9379c94ae0930b182f078046 (patch)
tree6f6e3bc4c41802b3c313c7658c07d523b19572c9 /screen.c
parentabf8689484dfd459dbac86fc5a623c854ab2a377 (diff)
downloadmpd-cc10008d7908ddfe9379c94ae0930b182f078046.tar.gz
mpd-cc10008d7908ddfe9379c94ae0930b182f078046.tar.xz
mpd-cc10008d7908ddfe9379c94ae0930b182f078046.zip
Added support for (auto) center/focus playlists.
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@604 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/screen.c b/screen.c
index aabc6f033..efd93d1fe 100644
--- a/screen.c
+++ b/screen.c
@@ -79,7 +79,8 @@ paint_top_window(char *header, int volume, int clear)
if(clear)
{
- wclear(w);
+ wmove(w, 0, 0);
+ wclrtoeol(w);
}
if(prev_volume!=volume || clear)
@@ -99,11 +100,24 @@ paint_top_window(char *header, int volume, int clear)
}
mvwaddstr(w, 0, screen->top_window.cols-12, buf);
+#if 1
if( options.enable_colors )
wattron(w, LINE_COLORS);
mvwhline(w, 1, 0, ACS_HLINE, screen->top_window.cols);
if( options.enable_colors )
wattroff(w, LINE_COLORS);
+#else
+ if( options.enable_colors )
+ wattron(w, LINE_COLORS);
+
+ mvwhline(w, 1, 0, ACS_HLINE, screen->top_window.cols);
+ wmove(w,1,screen->top_window.cols-6);
+ waddstr(w, "[rzx]");
+
+ if( options.enable_colors )
+ wattroff(w, LINE_COLORS);
+
+#endif
wnoutrefresh(w);
}
@@ -115,7 +129,7 @@ paint_progress_window(mpd_client_t *c)
double p;
int width;
- if( c->status==NULL || !IS_PLAYING(c->status->state) )
+ if( c->status==NULL || IS_STOPPED(c->status->state) )
{
mvwhline(screen->progress_window.w, 0, 0, ACS_HLINE,
screen->progress_window.cols);
@@ -320,6 +334,7 @@ screen_init(void)
screen->buf_size = screen->cols;
screen->findbuf = NULL;
screen->painted = 0;
+ screen->input_timestamp = time(NULL);
/* create top window */
screen->top_window.rows = 2;
@@ -472,6 +487,7 @@ screen_cmd(mpd_client_t *c, command_t cmd)
int n;
screen_mode_t new_mode = screen->mode;
+ screen->input_timestamp = time(NULL);
switch(screen->mode)
{
case SCREEN_PLAY_WINDOW:
@@ -564,6 +580,11 @@ screen_cmd(mpd_client_t *c, command_t cmd)
screen_status_printf("Find mode: %s",
options.find_wrap ? "Wrapped" : "Normal");
break;
+ case CMD_TOGGLE_AUTOCENTER:
+ options.auto_center = !options.auto_center;
+ screen_status_printf("Auto center mode: %s",
+ options.auto_center ? "On" : "Off");
+ break;
case CMD_SCREEN_PREVIOUS:
if( screen->mode > SCREEN_PLAY_WINDOW )
new_mode = screen->mode - 1;