diff options
-rw-r--r-- | apps/recorder/icons.c | 6 | ||||
-rw-r--r-- | apps/recorder/icons.h | 2 | ||||
-rw-r--r-- | apps/tree.c | 96 | ||||
-rw-r--r-- | apps/wps.c | 35 |
4 files changed, 61 insertions, 78 deletions
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 440902a83a..0501a3f0c0 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c | |||
@@ -97,7 +97,11 @@ unsigned char bitmap_icons_7x8[][7] = | |||
97 | /* Repeat playmode */ | 97 | /* Repeat playmode */ |
98 | {0x38,0x44,0x44,0x4e,0x5f,0x44,0x38}, | 98 | {0x38,0x44,0x44,0x4e,0x5f,0x44,0x38}, |
99 | /* Shuffle playmode (dice) */ | 99 | /* Shuffle playmode (dice) */ |
100 | {0x3e,0x41,0x51,0x41,0x45,0x41,0x3e} | 100 | {0x3e,0x41,0x51,0x41,0x45,0x41,0x3e}, |
101 | /* Down-arrow */ | ||
102 | {0x04,0x0c,0x1c,0x3c,0x1c,0x0c,0x04}, | ||
103 | /* Up-arrow */ | ||
104 | {0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, | ||
101 | }; | 105 | }; |
102 | 106 | ||
103 | unsigned char rockbox112x37[]={ | 107 | unsigned char rockbox112x37[]={ |
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index 46b7c3d2d9..3102093898 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h | |||
@@ -50,6 +50,8 @@ enum icons_7x8 { | |||
50 | Icon_Normal, | 50 | Icon_Normal, |
51 | Icon_Repeat, | 51 | Icon_Repeat, |
52 | Icon_Shuffle, | 52 | Icon_Shuffle, |
53 | Icon_DownArrow, | ||
54 | Icon_UpArrow, | ||
53 | Icon_Last | 55 | Icon_Last |
54 | }; | 56 | }; |
55 | 57 | ||
diff --git a/apps/tree.c b/apps/tree.c index c9cbf4dae2..a190d78ff5 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -327,18 +327,17 @@ static int showdir(char *path, int start) | |||
327 | default: | 327 | default: |
328 | icon_type = 0; | 328 | icon_type = 0; |
329 | } | 329 | } |
330 | |||
331 | if (icon_type) { | ||
330 | #ifdef HAVE_LCD_BITMAP | 332 | #ifdef HAVE_LCD_BITMAP |
331 | if (icon_type) | ||
332 | lcd_bitmap(bitmap_icons_6x8[icon_type], | 333 | lcd_bitmap(bitmap_icons_6x8[icon_type], |
333 | CURSOR_X * 6 + CURSOR_WIDTH, | 334 | CURSOR_X * 6 + CURSOR_WIDTH, |
334 | MARGIN_Y+(i-start)*line_height, 6, 8, true); | 335 | MARGIN_Y+(i-start)*line_height, 6, 8, true); |
335 | #else | 336 | #else |
336 | if(icon_type!=0) | ||
337 | { | ||
338 | lcd_define_pattern((i-start)*8,tree_icons_5x7[icon_type],8); | 337 | lcd_define_pattern((i-start)*8,tree_icons_5x7[icon_type],8); |
339 | lcd_putc(LINE_X-1, i-start, i-start); | 338 | lcd_putc(LINE_X-1, i-start, i-start); |
340 | } | ||
341 | #endif | 339 | #endif |
340 | } | ||
342 | 341 | ||
343 | /* if MP3 filter is on, cut off the extension */ | 342 | /* if MP3 filter is on, cut off the extension */ |
344 | if (global_settings.mp3filter && | 343 | if (global_settings.mp3filter && |
@@ -476,9 +475,12 @@ bool dirbrowse(char *root) | |||
476 | char buf[MAX_PATH]; | 475 | char buf[MAX_PATH]; |
477 | int i; | 476 | int i; |
478 | int lasti=-1; | 477 | int lasti=-1; |
479 | int rc; | ||
480 | int button; | 478 | int button; |
481 | int tree_max_on_screen; | 479 | int tree_max_on_screen; |
480 | bool reload_root = false; | ||
481 | bool lastfilter = global_settings.mp3filter; | ||
482 | bool lastsortcase = global_settings.sort_case; | ||
483 | bool lastshowhidden = global_settings.show_hidden_files; | ||
482 | #ifdef LOADABLE_FONTS | 484 | #ifdef LOADABLE_FONTS |
483 | int fh; | 485 | int fh; |
484 | unsigned char *font = lcd_getcurrentldfont(); | 486 | unsigned char *font = lcd_getcurrentldfont(); |
@@ -629,15 +631,8 @@ bool dirbrowse(char *root) | |||
629 | status_set_playmode(STATUS_PLAY); | 631 | status_set_playmode(STATUS_PLAY); |
630 | status_draw(); | 632 | status_draw(); |
631 | lcd_stop_scroll(); | 633 | lcd_stop_scroll(); |
632 | rc = wps_show(); | 634 | if ( wps_show() == SYS_USB_CONNECTED ) { |
633 | if(rc == SYS_USB_CONNECTED) | 635 | reload_root = true; |
634 | { | ||
635 | /* Force a re-read of the root directory */ | ||
636 | strcpy(currdir, "/"); | ||
637 | lastdir[0] = 0; | ||
638 | dirlevel = 0; | ||
639 | dircursor = 0; | ||
640 | start = 0; | ||
641 | global_settings.resume_index = -1; | 636 | global_settings.resume_index = -1; |
642 | } | 637 | } |
643 | #ifdef LOADABLE_FONTS | 638 | #ifdef LOADABLE_FONTS |
@@ -721,38 +716,18 @@ bool dirbrowse(char *root) | |||
721 | } | 716 | } |
722 | break; | 717 | break; |
723 | 718 | ||
724 | case TREE_MENU: { | 719 | case TREE_MENU: |
725 | bool lastfilter = global_settings.mp3filter; | ||
726 | bool lastsortcase = global_settings.sort_case; | ||
727 | bool show_hidden_files = global_settings.show_hidden_files; | ||
728 | Menu result; | ||
729 | |||
730 | lcd_stop_scroll(); | 720 | lcd_stop_scroll(); |
731 | result = main_menu(); | 721 | main_menu(); |
732 | /* do we need to rescan dir? */ | ||
733 | if (result == MENU_DISK_CHANGED || | ||
734 | lastfilter != global_settings.mp3filter || | ||
735 | lastsortcase != global_settings.sort_case || | ||
736 | show_hidden_files != global_settings.show_hidden_files) | ||
737 | lastdir[0] = 0; | ||
738 | restore = true; | 722 | restore = true; |
739 | break; | 723 | break; |
740 | } | ||
741 | 724 | ||
742 | case BUTTON_ON: | 725 | case BUTTON_ON: |
743 | if (mpeg_is_playing()) | 726 | if (mpeg_is_playing()) |
744 | { | 727 | { |
745 | lcd_stop_scroll(); | 728 | lcd_stop_scroll(); |
746 | rc = wps_show(); | 729 | if (wps_show() == SYS_USB_CONNECTED) |
747 | if(rc == SYS_USB_CONNECTED) | 730 | reload_root = true; |
748 | { | ||
749 | /* Force a re-read of the root directory */ | ||
750 | strcpy(currdir, "/"); | ||
751 | lastdir[0] = 0; | ||
752 | dirlevel = 0; | ||
753 | dircursor = 0; | ||
754 | start = 0; | ||
755 | } | ||
756 | #ifdef LOADABLE_FONTS | 731 | #ifdef LOADABLE_FONTS |
757 | tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh; | 732 | tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh; |
758 | #else | 733 | #else |
@@ -764,24 +739,14 @@ bool dirbrowse(char *root) | |||
764 | 739 | ||
765 | #ifdef HAVE_RECORDER_KEYPAD | 740 | #ifdef HAVE_RECORDER_KEYPAD |
766 | case BUTTON_F2: | 741 | case BUTTON_F2: |
767 | if (f2_screen()) { | 742 | if (f2_screen()) |
768 | /* reread root dir */ | 743 | reload_root = true; |
769 | strcpy(currdir, "/"); | ||
770 | lastdir[0] = 0; | ||
771 | dirlevel = 0; | ||
772 | dircursor = 0; | ||
773 | } | ||
774 | restore = true; | 744 | restore = true; |
775 | break; | 745 | break; |
776 | 746 | ||
777 | case BUTTON_F3: | 747 | case BUTTON_F3: |
778 | if (f3_screen()) { | 748 | if (f3_screen()) |
779 | /* reread root dir */ | 749 | reload_root = true; |
780 | strcpy(currdir, "/"); | ||
781 | lastdir[0] = 0; | ||
782 | dirlevel = 0; | ||
783 | dircursor = 0; | ||
784 | } | ||
785 | #ifdef LOADABLE_FONTS | 750 | #ifdef LOADABLE_FONTS |
786 | tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh; | 751 | tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh; |
787 | #else | 752 | #else |
@@ -805,12 +770,7 @@ bool dirbrowse(char *root) | |||
805 | backlight_time(global_settings.backlight); | 770 | backlight_time(global_settings.backlight); |
806 | 771 | ||
807 | /* Force a re-read of the root directory */ | 772 | /* Force a re-read of the root directory */ |
808 | restore = true; | 773 | reload_root = true; |
809 | strcpy(currdir, "/"); | ||
810 | lastdir[0] = 0; | ||
811 | dirlevel = 0; | ||
812 | dircursor = 0; | ||
813 | start = 0; | ||
814 | } | 774 | } |
815 | break; | 775 | break; |
816 | #endif | 776 | #endif |
@@ -819,6 +779,26 @@ bool dirbrowse(char *root) | |||
819 | if ( button ) | 779 | if ( button ) |
820 | ata_spin(); | 780 | ata_spin(); |
821 | 781 | ||
782 | /* do we need to rescan dir? */ | ||
783 | if (reload_root || | ||
784 | lastfilter != global_settings.mp3filter || | ||
785 | lastsortcase != global_settings.sort_case || | ||
786 | lastshowhidden != global_settings.show_hidden_files) | ||
787 | { | ||
788 | if ( reload_root ) { | ||
789 | strcpy(currdir, "/"); | ||
790 | dirlevel = 0; | ||
791 | reload_root = false; | ||
792 | } | ||
793 | dircursor = 0; | ||
794 | start = 0; | ||
795 | lastdir[0] = 0; | ||
796 | lastfilter = global_settings.mp3filter; | ||
797 | lastsortcase = global_settings.sort_case; | ||
798 | lastshowhidden = global_settings.show_hidden_files; | ||
799 | restore = true; | ||
800 | } | ||
801 | |||
822 | if ( restore ) { | 802 | if ( restore ) { |
823 | /* restore display */ | 803 | /* restore display */ |
824 | /* We need to adjust if the number of lines on screen have | 804 | /* We need to adjust if the number of lines on screen have |
diff --git a/apps/wps.c b/apps/wps.c index 029ed44f55..e894cad774 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -638,15 +638,7 @@ bool f2_screen(void) | |||
638 | 638 | ||
639 | while (!exit) { | 639 | while (!exit) { |
640 | int w,h; | 640 | int w,h; |
641 | char* ptr; | 641 | char buf[32]; |
642 | |||
643 | ptr = "Repeat"; | ||
644 | #ifdef LCD_PROPFONTS | ||
645 | lcd_getstringsize(ptr,0,&w,&h); | ||
646 | #else | ||
647 | lcd_getfontsize(0,&w,&h); | ||
648 | w *= strlen(ptr); | ||
649 | #endif | ||
650 | 642 | ||
651 | lcd_clear_display(); | 643 | lcd_clear_display(); |
652 | 644 | ||
@@ -657,13 +649,18 @@ bool f2_screen(void) | |||
657 | lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], | 649 | lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], |
658 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8, true); | 650 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8, true); |
659 | 651 | ||
660 | /* commented out until we really can disable repeat | 652 | snprintf(buf, sizeof buf, "Dir filter: %s", |
661 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, ptr, 0); | 653 | global_settings.mp3filter ? "on" : "off"); |
662 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, "mode:", 0); | 654 | #ifdef LCD_PROPFONTS |
663 | lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, "on", 0 ); | 655 | lcd_getstringsize(buf,0,&w,&h); |
664 | lcd_bitmap(bitmap_icons_7x8[Icon_FastForward], | 656 | #else |
665 | LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8, true); | 657 | lcd_getfontsize(0,&w,&h); |
666 | */ | 658 | w *= strlen(buf); |
659 | #endif | ||
660 | lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, buf, 0); | ||
661 | lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], | ||
662 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8, true); | ||
663 | |||
667 | lcd_update(); | 664 | lcd_update(); |
668 | 665 | ||
669 | switch (button_get(true)) { | 666 | switch (button_get(true)) { |
@@ -678,9 +675,9 @@ bool f2_screen(void) | |||
678 | sort_playlist(true); | 675 | sort_playlist(true); |
679 | break; | 676 | break; |
680 | 677 | ||
681 | case BUTTON_RIGHT: | 678 | case BUTTON_DOWN: |
682 | case BUTTON_F2 | BUTTON_RIGHT: | 679 | case BUTTON_F2 | BUTTON_DOWN: |
683 | /* toggle repeat */ | 680 | global_settings.mp3filter = !global_settings.mp3filter; |
684 | break; | 681 | break; |
685 | 682 | ||
686 | #ifdef SIMULATOR | 683 | #ifdef SIMULATOR |