diff options
author | Andreas Obergrusberger <tradiaz@yahoo.de> | 2007-02-16 15:42:08 +0000 |
---|---|---|
committer | Andreas Obergrusberger <tradiaz@yahoo.de> | 2007-02-16 15:42:08 +0000 |
commit | ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec (patch) | |
tree | f933858d5f7adbb49ed73e4be6d536eb3963906d /src/screen.c | |
parent | 35c6c1651c0c5d67a5bbba8bf2b5726ba7721a5d (diff) | |
download | mpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.tar.gz mpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.tar.xz mpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.zip |
way too much stuff to describe here
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/src/screen.c b/src/screen.c index 13e1975c1..93d305d78 100644 --- a/src/screen.c +++ b/src/screen.c @@ -356,26 +356,30 @@ paint_status_window(mpdclient_t *c) if( IS_PLAYING(status->state) || IS_PAUSED(status->state) ) { if( status->totalTime > 0 ) - { - - /*checks the conf to see whether to display elapsed or remaining time */ - if(!strcmp(options.timedisplay_type,"elapsed")) - { - timestr= " [%i:%02i/%i:%02i]"; - elapsedTime = c->status->elapsedTime; - } - else if(!strcmp(options.timedisplay_type,"remaining")) - { - timestr= " [-%i:%02i/%i:%02i]"; - elapsedTime = (c->status->totalTime - c->status->elapsedTime); - } - if( c->song && seek_id == c->song->id ) - elapsedTime = seek_target_time; - /*write out the time*/ - g_snprintf(screen->buf, screen->buf_size, - timestr, - elapsedTime/60, elapsedTime%60, - status->totalTime/60, status->totalTime%60 ); + { + /*checks the conf to see whether to display elapsed or remaining time */ + if(!strcmp(options.timedisplay_type,"elapsed")) + elapsedTime = c->status->elapsedTime; + else if(!strcmp(options.timedisplay_type,"remaining")) + elapsedTime = (c->status->totalTime - c->status->elapsedTime); + + if( c->song && seek_id == c->song->id ) + elapsedTime = seek_target_time; + /*write out the time, using hours if time over 60 minutes*/ + if (c->status->totalTime > 3600) + { + g_snprintf(screen->buf, screen->buf_size, + " [%i:%02i:%02i/%i:%02i:%02i]", + elapsedTime/3600, (elapsedTime%3600)/60, elapsedTime%60, + status->totalTime/3600, (status->totalTime%3600)/60, status->totalTime%60); + } + else + { + g_snprintf(screen->buf, screen->buf_size, + " [%i:%02i/%i:%02i]", + elapsedTime/60, elapsedTime%60, + status->totalTime/60, status->totalTime%60 ); + } } else { @@ -404,10 +408,10 @@ paint_status_window(mpdclient_t *c) colors_use(w, COLOR_STATUS); /* scroll if the song name is to long */ - if( my_strlen(songname) > width ) + if( options.scroll && my_strlen(songname) > width ) { static scroll_state_t st = { 0, 0 }; - char *tmp = strscroll(songname, " *** ", width, &st); + char *tmp = strscroll(songname, options.scroll_sep, width, &st); g_strlcpy(songname, tmp, MAX_SONGNAME_LENGTH); g_free(tmp); |