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
This commit is contained in:
Nicolas Pennequin 2007-05-14 17:34:52 +00:00
parent 4a6ab0d031
commit 6190a0d68d
4 changed files with 47 additions and 3 deletions

View file

@ -253,7 +253,7 @@ static char *list_get_name_cb(int selected_item,
return buffer; return buffer;
} }
static void browse_cuesheet(struct cuesheet *cue) void browse_cuesheet(struct cuesheet *cue)
{ {
struct gui_synclist lists; struct gui_synclist lists;
int action; int action;

View file

@ -66,7 +66,10 @@ bool parse_cuesheet(char *file, struct cuesheet *cue);
/* reads a cuesheet to find the audio track associated to it */ /* reads a cuesheet to find the audio track associated to it */
bool get_trackname_from_cuesheet(char *filename, char *buf); 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); bool display_cuesheet_content(char* filename);
/* finds the index of the current track played within a cuesheet */ /* finds the index of the current track played within a cuesheet */

View file

@ -10806,3 +10806,17 @@
*: "Playlist Viewer Settings" *: "Playlist Viewer Settings"
</voice> </voice>
</phrase> </phrase>
<phrase>
id: LANG_BROWSE_CUESHEET
desc:
user:
<source>
*: "Browse Cuesheet"
</source>
<dest>
*: "Browse Cuesheet"
</dest>
<voice>
*: "Browse Cuesheet"
</voice>
</phrase>

View file

@ -64,6 +64,7 @@
#ifdef HAVE_TAGCACHE #ifdef HAVE_TAGCACHE
#include "tagtree.h" #include "tagtree.h"
#endif #endif
#include "cuesheet.h"
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1)) #if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
#include "backdrop.h" #include "backdrop.h"
@ -925,6 +926,32 @@ MENUITEM_FUNCTION_DYNTEXT(rating_item, 0, set_rating_inline,
ratingitem_callback, Icon_Questionmark); ratingitem_callback, Icon_Questionmark);
#endif #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 */ /* CONTEXT_WPS items */
MENUITEM_FUNCTION(browse_id3_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO), MENUITEM_FUNCTION(browse_id3_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO),
browse_id3, NULL, NULL, Icon_NOICON); browse_id3, NULL, NULL, Icon_NOICON);
@ -1038,7 +1065,7 @@ MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
#ifdef HAVE_TAGCACHE #ifdef HAVE_TAGCACHE
&rating_item, &rating_item,
#endif #endif
&bookmark_menu, &browse_id3_item, &bookmark_menu, &browse_id3_item, &view_cue_item,
#ifdef HAVE_PITCHSCREEN #ifdef HAVE_PITCHSCREEN
&pitch_screen_item, &pitch_screen_item,
#endif #endif