diff options
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 11 |
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; | |||
69 | static char selected_file_path[MAX_PATH]; | 69 | static char selected_file_path[MAX_PATH]; |
70 | static int selected_file_attr = 0; | 70 | static int selected_file_attr = 0; |
71 | static int onplay_result = ONPLAY_OK; | 71 | static int onplay_result = ONPLAY_OK; |
72 | static bool (*ctx_playlist_insert)(int position, bool queue, bool create_new); | ||
72 | extern struct menu_item_ex file_menu; /* settings_menu.c */ | 73 | extern 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 */ |
478 | static bool add_to_playlist(int position, bool queue) | 479 | static 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 | ||
777 | void onplay_show_playlist_menu(char* path) | 782 | void 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 |