Skip to content

Commit

Permalink
ui: blink song timer on playlist page if paused
Browse files Browse the repository at this point in the history
as there is no other visual indication that the song is paused.

Also made 'blink' a static function variable in scr_main.c.
  • Loading branch information
superctr committed Nov 12, 2016
1 parent dfb9429 commit f51b9e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ui/scr_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 15 additions & 2 deletions src/ui/scr_playlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -83,20 +86,30 @@ void scr_playlist()

int SongReq = Game->PlaylistSongID & 0x800 ? 8 : 0;

disp_timer=0;
switch(Game->PlaylistControl)
{
case 0:
SCRN(3,1,FCOLUMNS-2,"Playlist not currently active");
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;
}

Expand Down

0 comments on commit f51b9e3

Please sign in to comment.