summaryrefslogtreecommitdiff
path: root/apps/onplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index 93c7c93624..61ef8acad5 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -69,6 +69,7 @@ static const char *selected_file = NULL;
69static char selected_file_path[MAX_PATH]; 69static char selected_file_path[MAX_PATH];
70static int selected_file_attr = 0; 70static int selected_file_attr = 0;
71static int onplay_result = ONPLAY_OK; 71static int onplay_result = ONPLAY_OK;
72static bool (*ctx_playlist_insert)(int position, bool queue, bool create_new);
72extern struct menu_item_ex file_menu; /* settings_menu.c */ 73extern struct menu_item_ex file_menu; /* settings_menu.c */
73 74
74/* redefine MAKE_MENU so the MENU_EXITAFTERTHISMENU flag can be added easily */ 75/* redefine MAKE_MENU so the MENU_EXITAFTERTHISMENU flag can be added easily */
@@ -474,7 +475,7 @@ MAKE_ONPLAYMENU( wps_playlist_menu, ID2P(LANG_PLAYLIST),
474 &playlist_save_item, &reshuffle_item, &playing_time_item 475 &playlist_save_item, &reshuffle_item, &playing_time_item
475 ); 476 );
476 477
477/* CONTEXT_[TREE|ID3DB] playlist options */ 478/* CONTEXT_[TREE|ID3DB|STD] playlist options */
478static bool add_to_playlist(int position, bool queue) 479static bool add_to_playlist(int position, bool queue)
479{ 480{
480 bool new_playlist = false; 481 bool new_playlist = false;
@@ -510,6 +511,10 @@ static bool add_to_playlist(int position, bool queue)
510 { 511 {
511 tagtree_insert_selection_playlist(position, queue); 512 tagtree_insert_selection_playlist(position, queue);
512 } 513 }
514 else if (context == CONTEXT_STD && ctx_playlist_insert != NULL)
515 {
516 ctx_playlist_insert(position, queue, false);
517 }
513 else 518 else
514#endif 519#endif
515 { 520 {
@@ -774,9 +779,10 @@ static int treeplaylist_callback(int action,
774 return action; 779 return action;
775} 780}
776 781
777void onplay_show_playlist_menu(char* path) 782void onplay_show_playlist_menu(const char* path, void (*playlist_insert_cb))
778{ 783{
779 context = CONTEXT_STD; 784 context = CONTEXT_STD;
785 ctx_playlist_insert = playlist_insert_cb;
780 selected_file = path; 786 selected_file = path;
781 if (dir_exists(path)) 787 if (dir_exists(path))
782 selected_file_attr = ATTR_DIRECTORY; 788 selected_file_attr = ATTR_DIRECTORY;
@@ -1939,6 +1945,7 @@ int onplay(char* file, int attr, int from, bool hotkey)
1939 const struct menu_item_ex *menu; 1945 const struct menu_item_ex *menu;
1940 onplay_result = ONPLAY_OK; 1946 onplay_result = ONPLAY_OK;
1941 context = from; 1947 context = from;
1948 ctx_playlist_insert = NULL;
1942 if (file == NULL) 1949 if (file == NULL)
1943 selected_file = NULL; 1950 selected_file = NULL;
1944 else 1951 else