Esempio n. 1
0
void
view_time_changed(int te, int tt){
	char newstr[TIMESTR_LEN];
	int newval;
	
	sec2hms(newstr, te);
	strlcat(newstr, " / ", sizeof(newstr));	
	
	if (0 == tt)				// shoutcast ! 
		strlcat(newstr+8, "--:--", sizeof(newstr)-8);
	else
		sec2hms(newstr+8, tt);
	
	win_new_text(&time_win, newstr);
		
	if ( (te < 0) || (tt < 0) || (0 == tt ) )	// elapsed == UNKNOWN or total == UNKNOWN or Shoutcast
		newval = 0;
	else
		newval = (te * 100) / tt;
	
	if ( (win->flags & WINFLG_VISIBLE))
		draw_progressbar(time_prog_win.start_row+1, time_prog_win.start_col, time_prog_win.height-2, 
							time_prog_win.fg_color, time_prog_win.bg_color, time_prog_win.cur_char, newval);
	time_prog_win.cur_char = newval;
};
Esempio n. 2
0
void
view_time_changed(int te, int tt){
	char newstr[TIMESTR_LEN];
	int newval;
	
	sec2hms(newstr, te);
	strlcat(newstr, " / ", sizeof(newstr));	
	sec2hms(newstr+8, tt);
	win_new_text(&time_win, newstr);
		
	newval = (te * 100) / tt;
	
	if ( (win->flags & WINFLG_VISIBLE))
		draw_progressbar(time_prog_win.start_row+1, time_prog_win.start_col, time_prog_win.height-2, 
							time_prog_win.fg_color, time_prog_win.bg_color, time_prog_win.cur_char, newval);
	time_prog_win.cur_char = newval;
};