summaryrefslogtreecommitdiff
path: root/apps/playlist_viewer.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist_viewer.c')
-rw-r--r--apps/playlist_viewer.c85
1 files changed, 18 insertions, 67 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 46482cb7fa..7c73b2bad9 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -48,6 +48,7 @@
48#include "statusbar.h" 48#include "statusbar.h"
49#include "splash.h" 49#include "splash.h"
50#include "playlist_menu.h" 50#include "playlist_menu.h"
51#include "action.h"
51 52
52/* Maximum number of tracks we can have loaded at one time */ 53/* Maximum number of tracks we can have loaded at one time */
53#define MAX_PLAYLIST_ENTRIES 200 54#define MAX_PLAYLIST_ENTRIES 200
@@ -614,7 +615,7 @@ bool playlist_viewer_ex(char* filename)
614{ 615{
615 bool ret = false; /* return value */ 616 bool ret = false; /* return value */
616 bool exit=false; /* exit viewer */ 617 bool exit=false; /* exit viewer */
617 int button, lastbutton = BUTTON_NONE; 618 int button;
618 struct gui_synclist playlist_lists; 619 struct gui_synclist playlist_lists;
619 if (!playlist_viewer_init(&viewer, filename, false)) 620 if (!playlist_viewer_init(&viewer, filename, false))
620 goto exit; 621 goto exit;
@@ -661,7 +662,7 @@ bool playlist_viewer_ex(char* filename)
661 } 662 }
662 663
663 /* Timeout so we can determine if play status has changed */ 664 /* Timeout so we can determine if play status has changed */
664 button = button_get_w_tmo(HZ/2); 665 button = get_action(CONTEXT_TREE,HZ/2);
665 int list_action; 666 int list_action;
666 if( (list_action=gui_synclist_do_button(&playlist_lists, button))!=0 ) 667 if( (list_action=gui_synclist_do_button(&playlist_lists, button))!=0 )
667 { 668 {
@@ -669,7 +670,7 @@ bool playlist_viewer_ex(char* filename)
669 if(playlist_buffer_needs_reload(&viewer.buffer, 670 if(playlist_buffer_needs_reload(&viewer.buffer,
670 viewer.selected_track)) 671 viewer.selected_track))
671 playlist_buffer_load_entries_screen(&viewer.buffer, 672 playlist_buffer_load_entries_screen(&viewer.buffer,
672 list_action==LIST_NEXT? 673 list_action==ACTION_STD_NEXT?
673 FORWARD 674 FORWARD
674 : 675 :
675 BACKWARD 676 BACKWARD
@@ -677,36 +678,11 @@ bool playlist_viewer_ex(char* filename)
677 } 678 }
678 switch (button) 679 switch (button)
679 { 680 {
680 case TREE_EXIT | BUTTON_REL: 681 case ACTION_STD_CANCEL:
681 if (lastbutton != TREE_EXIT)
682 break;
683#ifdef TREE_RC_EXIT
684 case TREE_RC_EXIT:
685#endif
686#ifdef TREE_OFF
687 case TREE_OFF:
688#endif
689 exit = true; 682 exit = true;
690 break; 683 break;
691 684 case ACTION_STD_OK:
692#ifdef TREE_ENTER 685 {
693 case TREE_ENTER | BUTTON_REL:
694 if (lastbutton != TREE_ENTER)
695 break;
696#endif
697#ifdef TREE_RC_RUN
698 case TREE_RC_RUN:
699#endif
700 case TREE_RUN:
701#ifdef TREE_RUN_PRE
702 if (((button == TREE_RUN)
703#ifdef TREE_RC_RUN_PRE
704 || (button == TREE_RC_RUN))
705 && ((lastbutton != TREE_RC_RUN_PRE)
706#endif
707 && (lastbutton != TREE_RUN_PRE)))
708 break;
709#endif
710 struct playlist_entry * current_track = 686 struct playlist_entry * current_track =
711 playlist_buffer_get_track(&viewer.buffer, 687 playlist_buffer_get_track(&viewer.buffer,
712 viewer.selected_track); 688 viewer.selected_track);
@@ -744,14 +720,8 @@ bool playlist_viewer_ex(char* filename)
744 gui_synclist_draw(&playlist_lists); 720 gui_synclist_draw(&playlist_lists);
745 721
746 break; 722 break;
747 723 }
748 case TREE_CONTEXT: 724 case ACTION_STD_CONTEXT:
749#ifdef TREE_CONTEXT2
750 case TREE_CONTEXT2:
751#endif
752#ifdef TREE_RC_CONTEXT
753 case TREE_RC_CONTEXT:
754#endif
755 { 725 {
756 /* ON+PLAY menu */ 726 /* ON+PLAY menu */
757 int ret; 727 int ret;
@@ -774,14 +744,7 @@ bool playlist_viewer_ex(char* filename)
774 gui_synclist_draw(&playlist_lists); 744 gui_synclist_draw(&playlist_lists);
775 break; 745 break;
776 } 746 }
777#ifdef TREE_MENU_PRE 747 case ACTION_STD_MENU:
778 case TREE_MENU_PRE:
779#else
780 case TREE_MENU:
781#endif
782#ifdef TREE_RC_MENU
783 case TREE_RC_MENU:
784#endif
785 if (viewer_menu()) 748 if (viewer_menu())
786 { 749 {
787 ret = true; 750 ret = true;
@@ -795,7 +758,7 @@ bool playlist_viewer_ex(char* filename)
795 gui_synclist_draw(&playlist_lists); 758 gui_synclist_draw(&playlist_lists);
796 break; 759 break;
797 760
798 case BUTTON_NONE: 761 case ACTION_NONE:
799 gui_syncstatusbar_draw(&statusbars, false); 762 gui_syncstatusbar_draw(&statusbars, false);
800 break; 763 break;
801 764
@@ -807,12 +770,12 @@ bool playlist_viewer_ex(char* filename)
807 } 770 }
808 break; 771 break;
809 } 772 }
810 lastbutton = button;
811 } 773 }
812 774
813exit: 775exit:
814 if (viewer.playlist) 776 if (viewer.playlist)
815 playlist_close(viewer.playlist); 777 playlist_close(viewer.playlist);
778 action_signalscreenchange();
816 return ret; 779 return ret;
817} 780}
818char * playlist_search_callback_name(int selected_item, void * data, char *buffer) 781char * playlist_search_callback_name(int selected_item, void * data, char *buffer)
@@ -860,7 +823,7 @@ bool search_playlist(void)
860 str(LANG_OFF_ABORT) 823 str(LANG_OFF_ABORT)
861#endif 824#endif
862 ); 825 );
863 if (SETTINGS_CANCEL == button_get(false)) 826 if (action_userabort(TIMEOUT_NOBLOCK))
864 return ret; 827 return ret;
865 playlist_get_track_info(viewer.playlist,i,&track); 828 playlist_get_track_info(viewer.playlist,i,&track);
866 if (strcasestr(track.filename,search_str)) 829 if (strcasestr(track.filename,search_str))
@@ -883,35 +846,22 @@ bool search_playlist(void)
883 gui_synclist_draw(&playlist_lists); 846 gui_synclist_draw(&playlist_lists);
884 while (!exit) 847 while (!exit)
885 { 848 {
886 button = button_get(true); 849 button = get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
887 if (gui_synclist_do_button(&playlist_lists, button)) 850 if (gui_synclist_do_button(&playlist_lists, button))
888 continue; 851 continue;
889 switch (button) 852 switch (button)
890 { 853 {
891 case TREE_EXIT: 854 case ACTION_STD_CANCEL:
892#ifdef TREE_RC_EXIT
893 case TREE_RC_EXIT:
894#endif
895#ifdef TREE_OFF
896 case TREE_OFF:
897#endif
898 exit = true; 855 exit = true;
899 break; 856 break;
900 857
901#ifdef TREE_ENTER 858 case ACTION_STD_OK:
902 case TREE_ENTER:
903 case TREE_ENTER | BUTTON_REPEAT:
904#endif
905#ifdef TREE_RC_RUN
906 case TREE_RC_RUN:
907#endif
908 case TREE_RUN:
909 playlist_start( 859 playlist_start(
910 found_indicies[gui_synclist_get_sel_pos(&playlist_lists)] 860 found_indicies[gui_synclist_get_sel_pos(&playlist_lists)]
911 ,0); 861 ,0);
912 exit = 1; 862 exit = 1;
913 break; 863 break;
914 case BUTTON_NONE: 864 case ACTION_NONE:
915 break; 865 break;
916 default: 866 default:
917 if(default_event_handler(button) == SYS_USB_CONNECTED) 867 if(default_event_handler(button) == SYS_USB_CONNECTED)
@@ -922,6 +872,7 @@ bool search_playlist(void)
922 break; 872 break;
923 } 873 }
924 } 874 }
875 action_signalscreenchange();
925 return ret; 876 return ret;
926} 877}
927 878