From: Francois B <mrs...@us...> - 2004-09-08 00:51:44
|
Update of /cvsroot/openneo/openneo/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25851 Modified Files: browse.c Log Message: Removed DOT folder, better handling of empty folders Index: browse.c =================================================================== RCS file: /cvsroot/openneo/openneo/apps/browse.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** browse.c 23 Aug 2004 03:14:30 -0000 1.5 --- browse.c 8 Sep 2004 00:51:24 -0000 1.6 *************** *** 144,151 **** whats_playing = dj_is_playing(); - - - whats_playing = dj_is_playing(); - switch( attr ) { case DIR_ATTR_DIR: --- 144,147 ---- *************** *** 162,169 **** #endif ! if( cursor_index == 0 ) ! dj_queue_directory( dir_buffer_path(), -1 ); ! else ! dj_queue_directory( path, -1 ); //Reload current directory --- 158,165 ---- #endif ! if( global_settings.enable_queuing == false ) ! dj_reset(); ! ! dj_queue_directory( path, -1 ); //Reload current directory *************** *** 198,210 **** #endif //Queue up a playlist file dj_queue_playlist( path, attr, -1 ); ! //Put cursor back ! lcd_putc( 0, cursor_line, RARROW_CHAR ); ! lcd_update(); ! if( global_settings.wps_on_play && (whats_playing != DJ_TYPE_PLAYLIST) ) *new_state = GO_PLAYER1; break; --- 194,214 ---- #endif + if( global_settings.enable_queuing == false ) + dj_reset(); + //Queue up a playlist file dj_queue_playlist( path, attr, -1 ); ! if( global_settings.wps_on_play && (whats_playing != DJ_TYPE_PLAYLIST) ) { ! //No need to reset cursor since we are leaving the file browser *new_state = GO_PLAYER1; + } + else { + + //Put cursor back + lcd_putc( 0, cursor_line, RARROW_CHAR ); + lcd_update(); + } break; *************** *** 224,228 **** #endif ! dj_queue_track( path, -1 ); sleep(HZ/6); --- 228,236 ---- #endif ! //If queing is disabled clear playlist ! if( global_settings.enable_queuing == false ) ! dj_reset(); ! ! dj_queue_track( path, -1, false ); sleep(HZ/6); *************** *** 231,236 **** lcd_update(); ! if( global_settings.wps_on_play && (whats_playing != DJ_TYPE_PLAYLIST) ) *new_state = GO_PLAYER1; break; --- 239,254 ---- lcd_update(); ! if( global_settings.wps_on_play && (whats_playing != DJ_TYPE_PLAYLIST) ) { ! ! //No need to reset cursor since we are leaving the file browser *new_state = GO_PLAYER1; + } + else { + + //Put cursor back + lcd_putc( 0, cursor_line, RARROW_CHAR ); + lcd_update(); + } + break; *************** *** 351,355 **** lcd_clear(false); ! for( i = 0; i< 4 && (index < dir_buffer_count()); i++, index++ ) draw_line( index, i, (bool)(cursor_index == index), talk ); --- 369,373 ---- lcd_clear(false); ! for( i = 0; i< 4 && (index < dir_buffer_count()); i++, index++ ) draw_line( index, i, (bool)(cursor_index == index), talk ); *************** *** 474,480 **** if( attr == DIR_ATTR_DIR ) { - if( cursor_index == 0 ) - break; - if( current_depth == (MAX_DIR_DEPTH-1) ) break; //Can't go deeper :-) --- 492,495 ---- *************** *** 488,495 **** //Load and sort dir dir_buffer_load( cwd, global_settings.dirfilter ); ! current_depth++; ! first_displayed_index = 0; ! cursor_index = 0; ! flags |= FLAGS_REDRAW_ALL; } else { --- 503,529 ---- //Load and sort dir dir_buffer_load( cwd, global_settings.dirfilter ); ! ! if( dir_buffer_count() == 0 ) { ! ! msg_splash( HZ, MSG_CENTER|MSG_VCENTER, "Empty folder" ); ! ! //Revert back to previous folder ! memcpy( cwd, dir_buffer_path(), MAX_PATH ); ! ! len = strlen(cwd); ! cwd[len-1] = 0; ! dot = strrchr( cwd, '/' );//Skip last slash ! dot[1] = 0; ! ! //Load and sort dir ! dir_buffer_load( cwd, global_settings.dirfilter ); ! } ! else { ! ! current_depth++; ! first_displayed_index = 0; ! cursor_index = 0; ! flags |= FLAGS_REDRAW_ALL; ! } } else { *************** *** 568,571 **** dj_enable_music(true); #endif ! return return_state; } --- 602,606 ---- dj_enable_music(true); #endif ! ! return return_state; } |