From: Francois B <mrs...@us...> - 2004-08-23 03:26:19
|
Update of /cvsroot/openneo/openneo/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12836 Modified Files: wps.h wps-display.h wps-display.c Log Message: Fixed WPS drawing Index: wps-display.c =================================================================== RCS file: /cvsroot/openneo/openneo/apps/wps-display.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wps-display.c 9 Jul 2004 22:20:35 -0000 1.20 --- wps-display.c 23 Aug 2004 03:26:00 -0000 1.21 *************** *** 45,49 **** #include "id3.h" #include "settings.h" ! #include "playlist.h" #include "kernel.h" #include "system.h" --- 45,49 ---- #include "id3.h" #include "settings.h" ! //#include "playlist.h" #include "kernel.h" #include "system.h" *************** *** 59,65 **** --- 59,79 ---- #include "flags.h" #include "gui.h" + #include "dj.h" #define MAX_LINES 4 + + + + /* constants used in line_type for wps_refresh */ + #define WPS_TYPE_TRACK_INFO 0x01 + #define WPS_TYPE_TIME_PROGRESS 0x02 + #define WPS_TYPE_SETTING 0x04 + #define WPS_TYPE_STATUS 0x08 + #define WPS_TYPE_SCROLL 0x10 + #define WPS_TYPE_PROGRESS_BAR 0x20 + #define WPS_TYPE_ALL 0x2f + + #define FORMAT_BUFFER_SIZE 600 *************** *** 188,192 **** break; ! strim(line); if( !line[0] ) --- 202,206 ---- break; ! strtrim(line, " \t\r\n"); if( !line[0] ) *************** *** 426,430 **** { case 'f': /* full-line progress bar */ ! *flags |= WPS_TYPE_PROGRESS|WPS_TYPE_TRACK_TIME; full_line_progressbar=1; /* we need 20 characters (full line) for --- 440,444 ---- { case 'f': /* full-line progress bar */ ! *flags |= WPS_TYPE_PROGRESS_BAR; full_line_progressbar=1; /* we need 20 characters (full line) for *************** *** 442,464 **** case 'p': /* Playlist Position */ *flags |= WPS_TYPE_TRACK_INFO; ! snprintf(buf, buf_size, "%d", playlist_get_display_index()); return buf; ! case 'n': /* Playlist Name (without path) */ ! *flags |= WPS_TYPE_TRACK_INFO; ! return playlist_name(buf, buf_size); case 'e': /* Playlist Total Entries */ *flags |= WPS_TYPE_TRACK_INFO; ! snprintf(buf, buf_size, "%d", playlist_amount()); return buf; case 'c': /* Current Time in Song */ ! *flags |= WPS_TYPE_TRACK_TIME; format_time(buf, buf_size, id3->elapsed + ff_rewind_count); return buf; case 'r': /* Remaining Time in Song */ ! *flags |= WPS_TYPE_TRACK_TIME; format_time(buf, buf_size, id3->length - id3->elapsed - ff_rewind_count); --- 456,478 ---- case 'p': /* Playlist Position */ *flags |= WPS_TYPE_TRACK_INFO; ! snprintf(buf, buf_size, "%d", dj_get_playing_index()+1); return buf; ! //case 'n': /* Playlist Name (without path) */ ! //*flags |= WPS_TYPE_TRACK_INFO; ! //return playlist_name(buf, buf_size); case 'e': /* Playlist Total Entries */ *flags |= WPS_TYPE_TRACK_INFO; ! snprintf(buf, buf_size, "%d", dj_playlist_count()); return buf; case 'c': /* Current Time in Song */ ! *flags |= WPS_TYPE_TIME_PROGRESS; format_time(buf, buf_size, id3->elapsed + ff_rewind_count); return buf; case 'r': /* Remaining Time in Song */ ! *flags |= WPS_TYPE_TIME_PROGRESS; format_time(buf, buf_size, id3->length - id3->elapsed - ff_rewind_count); *************** *** 813,845 **** break; ! if ((line_type[nb][i][curr_subline[nb][i]] & refresh_mode) || (refresh_mode == FLAGS_REDRAW_ALL) || new_subline_refresh) { ! flags = 0; ! format_display(buf, sizeof(buf), id3, ! format_lines[nb][i][curr_subline[nb][i]], ! &time_mult[nb][i][curr_subline[nb][i]], &flags); ! ! line_type[nb][i][curr_subline[nb][i]] = flags; ! /* progress */ ! if( flags & WPS_TYPE_PROGRESS ){ ! if( (refresh_mode & (FLAGS_REDRAW_PROGRESS|FLAGS_REDRAW_TRACK_TIME)) || new_subline_refresh ) { ! if (full_line_progressbar) ! draw_player_fullbar(buf, sizeof(buf), id3, ff_rewind_count); ! else ! draw_player_progress(id3, ff_rewind_count); ! lcd_puts(0, i, buf); ! } ! } ! else if( flags & WPS_TYPE_SCROLL) { ! /* scroll line */ ! if( (refresh_mode & FLAGS_REDRAW_TRACK_DATA) || new_subline_refresh ) ! lcd_puts_scroll(0, i, buf); } ! else { ! /* dynamic / static line */ ! if( refresh_mode & (FLAGS_REDRAW_TRACK_DATA|FLAGS_REDRAW_TRACK_TIME|FLAGS_REDRAW_SETTING|FLAGS_REDRAW_STATUS) || new_subline_refresh ) ! lcd_puts(0, i, buf); } } --- 827,880 ---- break; ! ! /* progress */ ! if( line_type[nb][i][curr_subline[nb][i]] & WPS_TYPE_PROGRESS_BAR ){ ! if( (refresh_mode & FLAGS_REDRAW_TIME_PROGRESS) || new_subline_refresh ) { ! ! flags = 0; ! format_display(buf, sizeof(buf), id3, ! format_lines[nb][i][curr_subline[nb][i]], ! &time_mult[nb][i][curr_subline[nb][i]], &flags); ! ! line_type[nb][i][curr_subline[nb][i]] = flags; ! ! ! if (full_line_progressbar) ! draw_player_fullbar(buf, sizeof(buf), id3, ff_rewind_count); ! else ! draw_player_progress(id3, ff_rewind_count); ! ! lcd_puts(0, i, buf); ! } ! } ! else if( line_type[nb][i][curr_subline[nb][i]] & WPS_TYPE_SCROLL) { ! /* scroll line */ ! if( (refresh_mode & FLAGS_REDRAW_TRACK_DATA) || new_subline_refresh ) { ! flags = 0; ! format_display(buf, sizeof(buf), id3, ! format_lines[nb][i][curr_subline[nb][i]], ! &time_mult[nb][i][curr_subline[nb][i]], &flags); ! ! line_type[nb][i][curr_subline[nb][i]] = flags; ! ! ! lcd_puts_scroll(0, i, buf); } ! } ! else { ! /* dynamic / static line */ ! if( refresh_mode & (FLAGS_REDRAW_TRACK_DATA|FLAGS_REDRAW_TIME_PROGRESS|FLAGS_REDRAW_SETTING|FLAGS_REDRAW_STATUS) || new_subline_refresh ) { ! ! flags = 0; ! format_display(buf, sizeof(buf), id3, ! format_lines[nb][i][curr_subline[nb][i]], ! &time_mult[nb][i][curr_subline[nb][i]], &flags); ! ! line_type[nb][i][curr_subline[nb][i]] = flags; ! ! lcd_puts(0, i, buf); } } *************** *** 909,913 **** unsigned int songpos,time,i; // unsigned int lcd_char_pos; ! char timestr[7]; if(id3->elapsed >= id3->length) --- 944,948 ---- unsigned int songpos,time,i; // unsigned int lcd_char_pos; ! char timestr[8]; if(id3->elapsed >= id3->length) Index: wps-display.h =================================================================== RCS file: /cvsroot/openneo/openneo/apps/wps-display.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wps-display.h 9 Jul 2004 22:20:35 -0000 1.4 --- wps-display.h 23 Aug 2004 03:26:00 -0000 1.5 *************** *** 33,60 **** #ifndef WPS_DISPLAY #define WPS_DISPLAY - #include <stdbool.h> #include "id3.h" - #include "flags.h" - - /* constants used in line_type and as refresh_mode for wps_refresh */ - #define WPS_TYPE_TRACK_INFO FLAGS_REDRAW_TRACK_DATA - #define WPS_TYPE_TRACK_TIME FLAGS_REDRAW_TRACK_TIME - #define WPS_TYPE_PROGRESS FLAGS_REDRAW_PROGRESS - #define WPS_TYPE_SETTING FLAGS_REDRAW_SETTING - #define WPS_TYPE_STATUS FLAGS_REDRAW_STATUS - #define WPS_TYPE_SCROLL 0x20 - #define WPS_TYPE_ALL FLAGS_REDRAW_ALL|0x20 - - - //#define WPS_REFRESH_STATIC 1 /* line doesn't change over time */ - ///#define WPS_REFRESH_DYNAMIC 2 /* line may change (e.g. time flag) */ - //#define WPS_REFRESH_SCROLL 4 /* line scrolls */ - ///#define WPS_REFRESH_PLAYER_PROGRESS 8 /* line contains a progress bar */ - //#define WPS_REFRESH_PEAK_METER 16 /* line contains a peak meter */ - //#define WPS_REFRESH_ALL 0xff /* to refresh all line types */ - /* to refresh only those lines that change over time */ - //#define WPS_REFRESH_NON_STATIC (WPS_REFRESH_ALL & ~WPS_REFRESH_STATIC & ~WPS_REFRESH_SCROLL) - bool wps_refresh(struct mp3entry* id3, int nb, int ffwd_offset, unsigned int refresh_mode); --- 33,38 ---- Index: wps.h =================================================================== RCS file: /cvsroot/openneo/openneo/apps/wps.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wps.h 19 May 2004 01:40:25 -0000 1.5 --- wps.h 23 Aug 2004 03:25:49 -0000 1.6 *************** *** 47,60 **** #define WPS_EXIT -1 - /* Function called by softkeys */ - int wps_mute(void); - int wps_playpause(void); - int wps_shuffle(void); - int wps_browse(void); - int wps_volume_up(void); - int wps_volume_down(void); - int wps_menu(void); - int wps_stop(void); - int wps_ff(void); - int wps_rw(void); #endif --- 47,49 ---- |