From f51b9e3c1252b99fc21d416b8102a1c6e7387a90 Mon Sep 17 00:00:00 2001 From: Ian Karlsson Date: Sat, 12 Nov 2016 17:53:14 +0100 Subject: [PATCH] ui: blink song timer on playlist page if paused as there is no other visual indication that the song is paused. Also made 'blink' a static function variable in scr_main.c. --- src/ui/scr_main.c | 4 ++-- src/ui/scr_playlist.c | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/ui/scr_main.c b/src/ui/scr_main.c index f3c53cb..658c0ec 100644 --- a/src/ui/scr_main.c +++ b/src/ui/scr_main.c @@ -19,14 +19,14 @@ int curr_val_edit; // Temp value used in editing. int curr_val_type; // Type of current selected value (song request / register) int curr_val_offset; // Offset in song req/register table. - int blink; - char tempstring[512]; const char regmatrix_key[] = "+0/8 +1/9 +2/a +3/b +4/c +5/d +6/e +7/f"; void drawreg(int val,int y,int x) { + static int blink; + uint16_t v, a; colorsel_t c = COLOR_N_GREY; diff --git a/src/ui/scr_playlist.c b/src/ui/scr_playlist.c index 72e2959..86c3b0c 100644 --- a/src/ui/scr_playlist.c +++ b/src/ui/scr_playlist.c @@ -69,6 +69,9 @@ void scr_playlist_input() void scr_playlist() { + static int blink; + int disp_timer; + if(refresh & R_SCR_PLAYLIST) { refresh &= ~R_SCR_PLAYLIST; @@ -83,6 +86,7 @@ void scr_playlist() int SongReq = Game->PlaylistSongID & 0x800 ? 8 : 0; + disp_timer=0; switch(Game->PlaylistControl) { case 0: @@ -90,13 +94,22 @@ void scr_playlist() default: break; case 1: + disp_timer=1; case 2: SCRN(3,1,FCOLUMNS-6,"Playing song %02d: %s", Game->PlaylistPosition+1, Game->Playlist[Game->PlaylistPosition].Title); - SCRN(3,FCOLUMNS-6,6,"%2.0f:%02.0f", - floor(QDrv->SongTimer[SongReq]/60),floor(fmod(QDrv->SongTimer[SongReq],60))); + if(Audio->Enabled && disp_timer) + { + blink++; + if(blink&0x20) + disp_timer=0; + } + + if(disp_timer) + SCRN(3,FCOLUMNS-6,6,"%2.0f:%02.0f", + floor(QDrv->SongTimer[SongReq]/60),floor(fmod(QDrv->SongTimer[SongReq],60))); break; }