summaryrefslogtreecommitdiff
path: root/apps
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 /apps
parent4a6ab0d03174d7a28979380e06b6f9dfac9a7d37 (diff)
downloadrockbox-6190a0d68d4979a9933c6007b69686a08ec4f457.zip
rockbox-6190a0d68d4979a9933c6007b69686a08ec4f457.tar.gz
rockbox-6190a0d68d4979a9933c6007b69686a08ec4f457.tar.bz2
rockbox-6190a0d68d4979a9933c6007b69686a08ec4f457.tar.xz
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
Diffstat (limited to 'apps')
-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 afd0ba1..9bac368 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -253,7 +253,7 @@ static char *list_get_name_cb(int selected_item,
return buffer;
}
-static void browse_cuesheet(struct cuesheet *cue)
+void browse_cuesheet(struct cuesheet *cue)
{
struct gui_synclist lists;
int action;
diff --git a/apps/cuesheet.h b/apps/cuesheet.h
index ed1207f..51e3860 100644
--- a/apps/cuesheet.h
+++ b/apps/cuesheet.h
@@ -66,7 +66,10 @@ bool parse_cuesheet(char *file, struct cuesheet *cue);
/* reads a cuesheet to find the audio track associated to it */
bool get_trackname_from_cuesheet(char *filename, char *buf);
-/* displays a cuesheet to the screen (it is stored in the plugin buffer) */
+/* display a cuesheet struct */
+void browse_cuesheet(struct cuesheet *cue);
+
+/* display a cuesheet file after parsing and loading it to the plugin buffer */
bool display_cuesheet_content(char* filename);
/* finds the index of the current track played within a cuesheet */
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index e8dcf48..502c9f8 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -10806,3 +10806,17 @@
*: "Playlist Viewer Settings"
</voice>
</phrase>
+<phrase>
+ id: LANG_BROWSE_CUESHEET
+ desc:
+ user:
+ <source>
+ *: "Browse Cuesheet"
+ </source>
+ <dest>
+ *: "Browse Cuesheet"
+ </dest>
+ <voice>
+ *: "Browse Cuesheet"
+ </voice>
+</phrase>
diff --git a/apps/onplay.c b/apps/onplay.c
index 244cd77..ae25ae3 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -64,6 +64,7 @@
#ifdef HAVE_TAGCACHE
#include "tagtree.h"
#endif
+#include "cuesheet.h"
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
#include "backdrop.h"
@@ -925,6 +926,32 @@ MENUITEM_FUNCTION_DYNTEXT(rating_item, 0, set_rating_inline,
ratingitem_callback, Icon_Questionmark);
#endif
+static bool view_cue(void)
+{
+ struct mp3entry* id3 = audio_current_track();
+ if(id3 && cuesheet_is_enabled() && id3->cuesheet_type)
+ {
+ browse_cuesheet(curr_cue);
+ }
+ return false;
+}
+static int view_cue_item_callback(int action,const struct menu_item_ex *this_item)
+{
+ (void)this_item;
+ struct mp3entry* id3 = audio_current_track();
+ switch (action)
+ {
+ case ACTION_REQUEST_MENUITEM:
+ if (!selected_file || !cuesheet_is_enabled()
+ || !id3 || !id3->cuesheet_type)
+ return ACTION_EXIT_MENUITEM;
+ break;
+ }
+ return action;
+}
+MENUITEM_FUNCTION(view_cue_item, 0, ID2P(LANG_BROWSE_CUESHEET),
+ view_cue, NULL, view_cue_item_callback, Icon_NOICON);
+
/* CONTEXT_WPS items */
MENUITEM_FUNCTION(browse_id3_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO),
browse_id3, NULL, NULL, Icon_NOICON);
@@ -1038,7 +1065,7 @@ MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
#ifdef HAVE_TAGCACHE
&rating_item,
#endif
- &bookmark_menu, &browse_id3_item,
+ &bookmark_menu, &browse_id3_item, &view_cue_item,
#ifdef HAVE_PITCHSCREEN
&pitch_screen_item,
#endif