diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-07-18 13:54:12 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-07-18 13:54:12 +0000 |
| commit | da0525f54f0479f545bfe120f180ca14c256e28f (patch) | |
| tree | 61ed91bef7e27f8c06b78e3d817249c3f63fdf9b /apps/onplay.c | |
| parent | d4100c4cb1747e1a20be53b411abec4f00b05c88 (diff) | |
| download | rockbox-da0525f54f0479f545bfe120f180ca14c256e28f.zip rockbox-da0525f54f0479f545bfe120f180ca14c256e28f.tar.gz rockbox-da0525f54f0479f545bfe120f180ca14c256e28f.tar.bz2 rockbox-da0525f54f0479f545bfe120f180ca14c256e28f.tar.xz | |
Patch #5179 by Sebastian Henriksen and Hardeep Sidhu - Playlist catalog
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10232 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/onplay.c')
| -rw-r--r-- | apps/onplay.c | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index bc486d1..d552e41 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -63,6 +63,7 @@ #include "eq_menu.h" #endif #include "playlist_menu.h" +#include "playlist_catalog.h" static int context; static char* selected_file = NULL; @@ -222,6 +223,50 @@ static bool view_playlist(void) return result; } +bool cat_add_to_a_playlist(void) +{ + return catalog_add_to_a_playlist(selected_file, selected_file_attr, + false); +} + +bool cat_add_to_a_new_playlist(void) +{ + return catalog_add_to_a_playlist(selected_file, selected_file_attr, true); +} + +static bool cat_playlist_options(void) +{ + struct menu_item items[3]; + int m, i=0, result; + bool ret = false; + + if ((audio_status() & AUDIO_STATUS_PLAY && context == CONTEXT_WPS) || + context == CONTEXT_TREE) + { + if (context == CONTEXT_WPS) + { + items[i].desc = ID2P(LANG_CATALOG_VIEW); + items[i].function = catalog_view_playlists; + i++; + } + + items[i].desc = ID2P(LANG_CATALOG_ADD_TO); + items[i].function = cat_add_to_a_playlist; + i++; + items[i].desc = ID2P(LANG_CATALOG_ADD_TO_NEW); + items[i].function = cat_add_to_a_new_playlist; + i++; + } + + m = menu_init( items, i, NULL, NULL, NULL, NULL ); + result = menu_show(m); + if(result >= 0) + ret = items[result].function(); + menu_exit(m); + + return ret; +} + /* Sub-menu for playlist options */ static bool playlist_options(void) { @@ -773,9 +818,9 @@ static int onplay_callback(int key, int menu) int onplay(char* file, int attr, int from) { #if CONFIG_CODEC == SWCODEC - struct menu_item items[13]; /* increase this if you add entries! */ + struct menu_item items[14]; /* increase this if you add entries! */ #else - struct menu_item items[11]; + struct menu_item items[12]; #endif int m, i=0, result; #ifdef HAVE_LCD_COLOR @@ -803,6 +848,9 @@ int onplay(char* file, int attr, int from) items[i].desc = ID2P(LANG_PLAYLIST); items[i].function = playlist_options; i++; + items[i].desc = ID2P(LANG_CATALOG); + items[i].function = cat_playlist_options; + i++; } if (context == CONTEXT_WPS) |