diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/onplay.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index e7f7e589db..6f29df57cb 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -477,7 +477,18 @@ MAKE_ONPLAYMENU( wps_playlist_menu, ID2P(LANG_PLAYLIST), | |||
477 | /* CONTEXT_[TREE|ID3DB] playlist options */ | 477 | /* CONTEXT_[TREE|ID3DB] playlist options */ |
478 | static bool add_to_playlist(int position, bool queue) | 478 | static bool add_to_playlist(int position, bool queue) |
479 | { | 479 | { |
480 | bool new_playlist = !(audio_status() & AUDIO_STATUS_PLAY) && (global_status.resume_index == -1 || playlist_resume() == -1); | 480 | bool new_playlist = false; |
481 | if (!(audio_status() & AUDIO_STATUS_PLAY)) | ||
482 | { | ||
483 | if (position == PLAYLIST_REPLACE) | ||
484 | { | ||
485 | new_playlist = true; | ||
486 | position = PLAYLIST_INSERT; | ||
487 | } | ||
488 | else if (global_status.resume_index == -1 || playlist_resume() == -1) | ||
489 | new_playlist = true; | ||
490 | } | ||
491 | |||
481 | const char *lines[] = { | 492 | const char *lines[] = { |
482 | ID2P(LANG_RECURSE_DIRECTORY_QUESTION), | 493 | ID2P(LANG_RECURSE_DIRECTORY_QUESTION), |
483 | selected_file | 494 | selected_file |
@@ -594,7 +605,7 @@ static int treeplaylist_callback(int action, | |||
594 | /* insert items */ | 605 | /* insert items */ |
595 | MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT), | 606 | MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT), |
596 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT, | 607 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT, |
597 | NULL, Icon_Playlist); | 608 | treeplaylist_callback, Icon_Playlist); |
598 | MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST), | 609 | MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST), |
599 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT_FIRST, | 610 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT_FIRST, |
600 | treeplaylist_wplayback_callback, Icon_Playlist); | 611 | treeplaylist_wplayback_callback, Icon_Playlist); |
@@ -630,7 +641,7 @@ MENUITEM_FUNCTION(q_last_shuf_pl_item, MENU_FUNC_USEPARAM, | |||
630 | /* replace playlist */ | 641 | /* replace playlist */ |
631 | MENUITEM_FUNCTION(replace_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_REPLACE), | 642 | MENUITEM_FUNCTION(replace_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_REPLACE), |
632 | playlist_insert_func, (intptr_t*)PLAYLIST_REPLACE, | 643 | playlist_insert_func, (intptr_t*)PLAYLIST_REPLACE, |
633 | treeplaylist_wplayback_callback, Icon_Playlist); | 644 | NULL, Icon_Playlist); |
634 | 645 | ||
635 | /* others */ | 646 | /* others */ |
636 | MENUITEM_FUNCTION(view_playlist_item, 0, ID2P(LANG_VIEW), | 647 | MENUITEM_FUNCTION(view_playlist_item, 0, ID2P(LANG_VIEW), |
@@ -680,11 +691,17 @@ static int treeplaylist_callback(int action, | |||
680 | return action; | 691 | return action; |
681 | } | 692 | } |
682 | } | 693 | } |
694 | else if (this_item == &i_pl_item) | ||
695 | { | ||
696 | if (global_status.resume_index != -1) | ||
697 | return action; | ||
698 | } | ||
683 | else if (this_item == &i_shuf_pl_item) | 699 | else if (this_item == &i_shuf_pl_item) |
684 | { | 700 | { |
685 | if ((audio_status() & AUDIO_STATUS_PLAY) || | 701 | if ((global_status.resume_index != -1) && |
686 | (selected_file_attr & ATTR_DIRECTORY) || | 702 | ((audio_status() & AUDIO_STATUS_PLAY) || |
687 | ((selected_file_attr & FILE_ATTR_MASK) == FILE_ATTR_M3U)) | 703 | (selected_file_attr & ATTR_DIRECTORY) || |
704 | ((selected_file_attr & FILE_ATTR_MASK) == FILE_ATTR_M3U))) | ||
688 | { | 705 | { |
689 | return action; | 706 | return action; |
690 | } | 707 | } |