summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-05-14 17:34:52 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-05-14 17:34:52 +0000
commit6190a0d68d4979a9933c6007b69686a08ec4f457 (patch)
treec66954e168a56c033ecb01442ff7242e7d383318
parent4a6ab0d03174d7a28979380e06b6f9dfac9a7d37 (diff)
downloadrockbox-6190a0d68d4979a9933c6007b69686a08ec4f457.tar.gz
rockbox-6190a0d68d4979a9933c6007b69686a08ec4f457.zip
Add an item to the WPS context menu to browse a currently playing cuesheet. The menu that appears allows changing tracks within the cuesheet. It was already reachable by selecting the right cuesheet file in the file browser, but this makes it easier to use (and should help users noticing that possibility because many seemed to ignore this viewer existed).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13388 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/cuesheet.c2
-rw-r--r--apps/cuesheet.h5
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/onplay.c29
4 files changed, 47 insertions, 3 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index afd0ba1ea6..9bac3681f3 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -253,7 +253,7 @@ static char *list_get_name_cb(int selected_item,
253 return buffer; 253 return buffer;
254} 254}
255 255
256static void browse_cuesheet(struct cuesheet *cue) 256void browse_cuesheet(struct cuesheet *cue)
257{ 257{
258 struct gui_synclist lists; 258 struct gui_synclist lists;
259 int action; 259 int action;
diff --git a/apps/cuesheet.h b/apps/cuesheet.h
index ed1207f810..51e38605ca 100644
--- a/apps/cuesheet.h
+++ b/apps/cuesheet.h
@@ -66,7 +66,10 @@ bool parse_cuesheet(char *file, struct cuesheet *cue);
66/* reads a cuesheet to find the audio track associated to it */ 66/* reads a cuesheet to find the audio track associated to it */
67bool get_trackname_from_cuesheet(char *filename, char *buf); 67bool get_trackname_from_cuesheet(char *filename, char *buf);
68 68
69/* displays a cuesheet to the screen (it is stored in the plugin buffer) */ 69/* display a cuesheet struct */
70void browse_cuesheet(struct cuesheet *cue);
71
72/* display a cuesheet file after parsing and loading it to the plugin buffer */
70bool display_cuesheet_content(char* filename); 73bool display_cuesheet_content(char* filename);
71 74
72/* finds the index of the current track played within a cuesheet */ 75/* finds the index of the current track played within a cuesheet */
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index e8dcf4867d..502c9f8900 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -10806,3 +10806,17 @@
10806 *: "Playlist Viewer Settings" 10806 *: "Playlist Viewer Settings"
10807 </voice> 10807 </voice>
10808</phrase> 10808</phrase>
10809<phrase>
10810 id: LANG_BROWSE_CUESHEET
10811 desc:
10812 user:
10813 <source>
10814 *: "Browse Cuesheet"
10815 </source>
10816 <dest>
10817 *: "Browse Cuesheet"
10818 </dest>
10819 <voice>
10820 *: "Browse Cuesheet"
10821 </voice>
10822</phrase>
diff --git a/apps/onplay.c b/apps/onplay.c
index 244cd77987..ae25ae37d0 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -64,6 +64,7 @@
64#ifdef HAVE_TAGCACHE 64#ifdef HAVE_TAGCACHE
65#include "tagtree.h" 65#include "tagtree.h"
66#endif 66#endif
67#include "cuesheet.h"
67 68
68#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1)) 69#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
69#include "backdrop.h" 70#include "backdrop.h"
@@ -925,6 +926,32 @@ MENUITEM_FUNCTION_DYNTEXT(rating_item, 0, set_rating_inline,
925 ratingitem_callback, Icon_Questionmark); 926 ratingitem_callback, Icon_Questionmark);
926#endif 927#endif
927 928
929static bool view_cue(void)
930{
931 struct mp3entry* id3 = audio_current_track();
932 if(id3 && cuesheet_is_enabled() && id3->cuesheet_type)
933 {
934 browse_cuesheet(curr_cue);
935 }
936 return false;
937}
938static int view_cue_item_callback(int action,const struct menu_item_ex *this_item)
939{
940 (void)this_item;
941 struct mp3entry* id3 = audio_current_track();
942 switch (action)
943 {
944 case ACTION_REQUEST_MENUITEM:
945 if (!selected_file || !cuesheet_is_enabled()
946 || !id3 || !id3->cuesheet_type)
947 return ACTION_EXIT_MENUITEM;
948 break;
949 }
950 return action;
951}
952MENUITEM_FUNCTION(view_cue_item, 0, ID2P(LANG_BROWSE_CUESHEET),
953 view_cue, NULL, view_cue_item_callback, Icon_NOICON);
954
928/* CONTEXT_WPS items */ 955/* CONTEXT_WPS items */
929MENUITEM_FUNCTION(browse_id3_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO), 956MENUITEM_FUNCTION(browse_id3_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO),
930 browse_id3, NULL, NULL, Icon_NOICON); 957 browse_id3, NULL, NULL, Icon_NOICON);
@@ -1038,7 +1065,7 @@ MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
1038#ifdef HAVE_TAGCACHE 1065#ifdef HAVE_TAGCACHE
1039 &rating_item, 1066 &rating_item,
1040#endif 1067#endif
1041 &bookmark_menu, &browse_id3_item, 1068 &bookmark_menu, &browse_id3_item, &view_cue_item,
1042#ifdef HAVE_PITCHSCREEN 1069#ifdef HAVE_PITCHSCREEN
1043 &pitch_screen_item, 1070 &pitch_screen_item,
1044#endif 1071#endif