Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Playlist Viewer: slight simplification

1) Don't re-initialize the Playlist Viewer before
closing it, after making an on-disk playlist the
current playlist. It's obviously wasteful and this
seems to have only historical reasons that don't
apply anymore.

2) Naming adjustments:
- change "onplay" prefix to "context" (e.g.
pv_context_result context_menu, instead of
pv_onplay_result onplay_menu), since onplay requires
being aware of the history for it to make any sense
- rename update_lists to update_gui, to differentiate
it from update_playlist
- change update_viewer_with_changes to update_viewer

3) gui_synclist_del_item(playlist_lists) is not
needed anymore after removing a track, because we
already indiscriminately reset the synclist's
number of items and reselect within the list's
new bounds from update_viewer_with_changes.

As a result, MODIFIED is applicable to both
reshuffling and to removing a track, so
ITEM_REMOVED can be eliminated as its own
enum value.

Plus, SAVED does not require a special case and
can be renamed to PL_UPDATE, so it is usable
when track display is adjusted, in order to
force an update of the playlist buffer.

Change-Id: Ic5202e03223a1ddbb9ff87e388a16ecde39165ef

+121 -155
+121 -155
apps/playlist_viewer.c
··· 52 52 #include "yesno.h" 53 53 #include "playback.h" 54 54 55 - /* Maximum number of tracks we can have loaded at one time */ 55 + /* Maximum number of tracks we can have loaded at one time */ 56 56 #define MAX_PLAYLIST_ENTRIES 200 57 57 58 58 /* Maximum amount of space required for the name buffer. For each 59 - entry, we store the file name as well as, possibly, metadata */ 59 + entry, we store the file name as well as, possibly, metadata */ 60 60 #define MAX_NAME_BUFFER_SZ (MAX_PLAYLIST_ENTRIES * 2 * MAX_PATH) 61 61 62 - /* Over-approximation of view_text plugin size */ 62 + /* Over-approximation of view_text plugin size */ 63 63 #define VIEW_TEXT_PLUGIN_SZ 5000 64 64 65 65 /* The number of items between the selected one and the end/start of 66 - * the buffer under which the buffer must reload */ 66 + * the buffer under which the buffer must reload */ 67 67 #define MIN_BUFFER_MARGIN (screens[0].getnblines()+1) 68 68 69 69 /* Information about a specific track */ 70 70 struct playlist_entry { 71 - char *name; /* track path */ 72 - int index; /* Playlist index */ 73 - int display_index; /* Display index */ 74 - int attr; /* Is track queued?; Is track marked as bad?*/ 71 + char *name; /* track path */ 72 + int index; /* Playlist index */ 73 + int display_index; /* Display index */ 74 + int attr; /* Is track queued?; Is track marked as bad? */ 75 75 }; 76 76 77 77 enum direction ··· 80 80 BACKWARD 81 81 }; 82 82 83 - enum pv_onplay_result { 84 - PV_ONPLAY_USB, 85 - PV_ONPLAY_USB_CLOSED, 86 - PV_ONPLAY_WPS_CLOSED, 87 - PV_ONPLAY_CLOSED, 88 - PV_ONPLAY_ITEM_REMOVED, 89 - PV_ONPLAY_CHANGED, 90 - PV_ONPLAY_UNCHANGED, 91 - PV_ONPLAY_SAVED, 83 + /* Describes possible outcomes from context (menu or hotkey) action */ 84 + enum pv_context_result { 85 + PV_CONTEXT_CLOSED, /* Playlist Viewer has been closed */ 86 + PV_CONTEXT_USB, /* USB-connection initiated */ 87 + PV_CONTEXT_USB_CLOSED, /* USB-connection initiated (+viewer closed) */ 88 + PV_CONTEXT_WPS_CLOSED, /* WPS requested (+viewer closed) */ 89 + PV_CONTEXT_MODIFIED, /* Playlist was modified in some way */ 90 + PV_CONTEXT_UNCHANGED, /* No change to playlist, as far as we know */ 91 + PV_CONTEXT_PL_UPDATE, /* Playlist buffer requires reloading */ 92 92 }; 93 93 94 94 struct playlist_buffer 95 95 { 96 96 struct playlist_entry tracks[MAX_PLAYLIST_ENTRIES]; 97 97 98 - char *name_buffer; /* Buffer used to store track names */ 99 - int buffer_size; /* Size of name buffer */ 98 + char *name_buffer; /* Buffer used to store track names */ 99 + int buffer_size; /* Size of name buffer */ 100 100 101 - int first_index; /* Real index of first track loaded inside 102 - the buffer */ 101 + int first_index; /* Real index of first track loaded inside 102 + the buffer */ 103 103 104 - enum direction direction; /* Direction of the buffer (if the buffer 105 - was loaded BACKWARD, the last track in 106 - the buffer has a real index < to the 107 - real index of the the first track)*/ 104 + enum direction direction; /* Direction of the buffer (if the buffer 105 + was loaded BACKWARD, the last track in 106 + the buffer has a real index < to the 107 + real index of the the first track) */ 108 108 109 - int num_loaded; /* Number of track entries loaded in buffer */ 109 + int num_loaded; /* Number of track entries loaded in buffer */ 110 110 }; 111 111 112 112 /* Global playlist viewer settings */ ··· 401 401 if (!buffer || buffer_size <= MAX_PATH + id3_size) 402 402 return false; 403 403 404 - /* Index buffer is required, unless playback is stopped or we're 405 - showing the current playlist (i.e. filename == NULL) */ 406 404 if (require_index_buffer) 407 405 index_buffer_size = playlist_get_index_bufsz(buffer_size - id3_size - (MAX_PATH + 1)); 408 406 ··· 493 491 switch (global_settings.playlist_viewer_track_display) 494 492 { 495 493 case PLAYLIST_VIEWER_ENTRY_SHOW_FILE_NAME: 496 - case PLAYLIST_VIEWER_ENTRY_SHOW_ID3_TITLE_AND_ALBUM: /* If loading from tags failed, only display the file name */ 497 - case PLAYLIST_VIEWER_ENTRY_SHOW_ID3_TITLE: /* If loading from tags failed, only display the file name */ 494 + /* If loading from tags failed, only display the file name */ 495 + case PLAYLIST_VIEWER_ENTRY_SHOW_ID3_TITLE_AND_ALBUM: 496 + case PLAYLIST_VIEWER_ENTRY_SHOW_ID3_TITLE: 498 497 default: 499 498 { 500 499 /* Only display the filename */ ··· 528 527 { 529 528 track->attr |= PLAYLIST_ATTR_RETRIEVE_ID3_ATTEMPTED; 530 529 bool retrieve_success = retrieve_id3_tags(track->index, track->name, 531 - viewer.id3, METADATA_EXCLUDE_ID3_PATH); 530 + viewer.id3, 531 + METADATA_EXCLUDE_ID3_PATH); 532 532 if (retrieve_success) 533 533 { 534 534 if (!id3viewc) ··· 559 559 cur_str[2] = (char) ' '; 560 560 cur_str += 3; 561 561 rem_space -= 3; 562 - cur_str = strmemccpy(cur_str, pid3->album && pid3->album[0] != '\0' ? 563 - pid3->album : (char*) str(LANG_TAGNAVI_UNTAGGED), rem_space); 562 + cur_str = strmemccpy(cur_str, (pid3->album && 563 + pid3->album[0] != '\0') ? pid3->album : 564 + (char*) str(LANG_TAGNAVI_UNTAGGED), 565 + rem_space); 564 566 if (cur_str) 565 567 track->attr |= PLAYLIST_ATTR_RETRIEVE_ID3_SUCCEEDED; 566 568 } 567 569 } 568 570 } 569 571 else if (global_settings.playlist_viewer_track_display == 570 - PLAYLIST_VIEWER_ENTRY_SHOW_ID3_TITLE) 572 + PLAYLIST_VIEWER_ENTRY_SHOW_ID3_TITLE) 571 573 { 572 574 /* Just the title */ 573 575 if (pid3->title && pid3->title[0] != '\0' && 574 - strmemccpy(id3viewc, pid3->title, MAX_PATH) 575 - ) 576 + strmemccpy(id3viewc, pid3->title, MAX_PATH)) 577 + { 576 578 track->attr |= PLAYLIST_ATTR_RETRIEVE_ID3_SUCCEEDED; 579 + } 577 580 } 578 581 /* Yield to reduce as much as possible the perceived UI lag, 579 582 because retrieving id3 tags is an expensive operation */ ··· 617 620 return 0; 618 621 } 619 622 620 - static enum pv_onplay_result show_track_info(const struct playlist_entry *current_track) 623 + static enum pv_context_result show_track_info(const struct playlist_entry *current_track) 621 624 { 622 625 bool id3_retrieval_successful = retrieve_id3_tags(current_track->index, 623 626 current_track->name, ··· 627 630 browse_id3_ex(viewer.id3, viewer.playlist, current_track->display_index, 628 631 viewer.num_tracks, NULL, 1, 629 632 viewer.allow_view_text_plugin ? NULL : &view_text)) ? 630 - PV_ONPLAY_USB : PV_ONPLAY_UNCHANGED; 633 + PV_CONTEXT_USB : PV_CONTEXT_UNCHANGED; 631 634 } 632 635 633 636 static void close_playlist_viewer(void) ··· 651 654 } 652 655 653 656 #if defined(HAVE_HOTKEY) || defined(HAVE_TAGCACHE) 654 - static enum pv_onplay_result 657 + static enum pv_context_result 655 658 open_with_plugin(const struct playlist_entry *current_track, 656 659 const char* plugin_name, 657 660 int (*loadplugin)(const char* plugin, const char* file)) ··· 667 670 switch (plugin_return) 668 671 { 669 672 case PLUGIN_USB_CONNECTED: 670 - return PV_ONPLAY_USB_CLOSED; 673 + return PV_CONTEXT_USB_CLOSED; 671 674 case PLUGIN_GOTO_WPS: 672 - return PV_ONPLAY_WPS_CLOSED; 675 + return PV_CONTEXT_WPS_CLOSED; 673 676 default: 674 - return PV_ONPLAY_CLOSED; 677 + return PV_CONTEXT_CLOSED; 675 678 } 676 679 } 677 680 ··· 682 685 (void)plugin; 683 686 return filetype_list_viewers(file); 684 687 } 685 - static enum pv_onplay_result open_with(const struct playlist_entry *current_track) 688 + static enum pv_context_result open_with(const struct playlist_entry *current_track) 686 689 { 687 690 return open_with_plugin(current_track, "", &list_viewers); 688 691 } 689 692 #endif /* HAVE_HOTKEY */ 690 693 691 694 #ifdef HAVE_TAGCACHE 692 - static enum pv_onplay_result open_pictureflow(const struct playlist_entry *current_track) 695 + static enum pv_context_result open_pictureflow(const struct playlist_entry *current_track) 693 696 { 694 697 return open_with_plugin(current_track, "pictureflow", &filetype_load_plugin); 695 698 } 696 699 #endif 697 700 #endif /*defined(HAVE_HOTKEY) || defined(HAVE_TAGCACHE)*/ 698 701 699 - static enum pv_onplay_result delete_track(int current_track_index, 702 + static enum pv_context_result delete_track(int current_track_index, 700 703 int index, bool current_was_playing) 701 704 { 702 705 playlist_delete(viewer.playlist, current_track_index); ··· 718 721 } 719 722 } 720 723 } 721 - return PV_ONPLAY_ITEM_REMOVED; 724 + return PV_CONTEXT_MODIFIED; 722 725 } 723 726 724 - /* Menu of playlist commands. Invoked via ON+PLAY on main viewer screen. */ 725 - static enum pv_onplay_result onplay_menu(int index) 727 + static enum pv_context_result context_menu(int index) 726 728 { 727 - int result, ret = PV_ONPLAY_UNCHANGED; 728 - struct playlist_entry * current_track = 729 - playlist_buffer_get_track(&viewer.buffer, index); 729 + struct playlist_entry *current_track = playlist_buffer_get_track(&viewer.buffer, 730 + index); 731 + bool current_was_playing = (current_track->index == viewer.current_playing_track); 732 + 730 733 MENUITEM_STRINGLIST(menu_items, ID2P(LANG_PLAYLIST), NULL, 731 734 ID2P(LANG_PLAYING_NEXT), ID2P(LANG_ADD_TO_PL), 732 - ID2P(LANG_REMOVE), ID2P(LANG_MOVE), ID2P(LANG_MENU_SHOW_ID3_INFO), 733 - ID2P(LANG_SHUFFLE), 734 - ID2P(LANG_SAVE), 735 + ID2P(LANG_REMOVE), ID2P(LANG_MOVE), 736 + ID2P(LANG_MENU_SHOW_ID3_INFO), 737 + ID2P(LANG_SHUFFLE), ID2P(LANG_SAVE), 735 738 ID2P(LANG_PLAYLISTVIEWER_SETTINGS) 736 739 #ifdef HAVE_TAGCACHE 737 740 ,ID2P(LANG_ONPLAY_PICTUREFLOW) 738 741 #endif 739 742 ); 740 - 741 - bool current_was_playing = (current_track->index == viewer.current_playing_track); 742 - 743 - result = do_menu(&menu_items, NULL, NULL, false); 744 - if (result == MENU_ATTACHED_USB) 745 - { 746 - ret = PV_ONPLAY_USB; 747 - } 748 - else if (result >= 0) 743 + int sel = do_menu(&menu_items, NULL, NULL, false); 744 + if (sel == MENU_ATTACHED_USB) 745 + return PV_CONTEXT_USB; 746 + else if (sel >= 0) 749 747 { 750 748 /* Abort current move */ 751 749 viewer.moving_track = -1; 752 750 viewer.moving_playlist_index = -1; 753 751 754 - switch (result) 752 + switch (sel) 755 753 { 756 754 case 0: 757 - /* playlist */ 755 + /* Playing Next... menu */ 758 756 onplay_show_playlist_menu(current_track->name, FILE_ATTR_AUDIO, NULL); 759 - ret = PV_ONPLAY_UNCHANGED; 760 - break; 757 + return PV_CONTEXT_UNCHANGED; 761 758 case 1: 762 - /* add to catalog */ 759 + /* Add to Playlist... menu */ 763 760 onplay_show_playlist_cat_menu(current_track->name, FILE_ATTR_AUDIO, NULL); 764 - ret = PV_ONPLAY_UNCHANGED; 765 - break; 761 + return PV_CONTEXT_UNCHANGED; 766 762 case 2: 767 - ret = delete_track(current_track->index, index, current_was_playing); 768 - break; 763 + return delete_track(current_track->index, index, current_was_playing); 769 764 case 3: 770 765 /* move track */ 771 766 viewer.moving_track = index; 772 767 viewer.moving_playlist_index = current_track->index; 773 - ret = PV_ONPLAY_UNCHANGED; 774 - break; 768 + return PV_CONTEXT_UNCHANGED; 775 769 case 4: 776 - ret = show_track_info(current_track); 777 - break; 770 + return show_track_info(current_track); 778 771 case 5: 779 772 /* shuffle */ 780 773 playlist_sort(viewer.playlist, !viewer.playlist); 781 774 playlist_randomise(viewer.playlist, current_tick, !viewer.playlist); 782 775 viewer.selected_track = 0; 783 - ret = PV_ONPLAY_CHANGED; 784 - break; 776 + return PV_CONTEXT_MODIFIED; 785 777 case 6: 786 778 save_playlist_screen(viewer.playlist); 787 779 /* playlist indices of current playlist may have changed */ 788 - ret = viewer.playlist ? PV_ONPLAY_UNCHANGED : PV_ONPLAY_SAVED; 789 - break; 780 + return viewer.playlist ? PV_CONTEXT_UNCHANGED : PV_CONTEXT_PL_UPDATE; 790 781 case 7: 791 782 { 792 - int last_display = global_settings.playlist_viewer_track_display; 793 783 /* playlist viewer settings */ 794 - result = do_menu(&viewer_settings_menu, NULL, NULL, false); 795 - 796 - 797 - if (result == MENU_ATTACHED_USB) 798 - ret = PV_ONPLAY_USB; 784 + sel = global_settings.playlist_viewer_track_display; 785 + if (MENU_ATTACHED_USB == do_menu(&viewer_settings_menu, NULL, NULL, false)) 786 + return PV_CONTEXT_USB; 799 787 else 800 - { 801 - if (last_display != global_settings.playlist_viewer_track_display) 802 - update_playlist(true);/* reload buffer */ 803 - 804 - ret = PV_ONPLAY_UNCHANGED; 805 - } 806 - break; 788 + return (sel == global_settings.playlist_viewer_track_display) ? 789 + PV_CONTEXT_UNCHANGED : PV_CONTEXT_PL_UPDATE; 807 790 } 808 791 #ifdef HAVE_TAGCACHE 809 792 case 8: 810 - ret = open_pictureflow(current_track); 811 - break; 793 + return open_pictureflow(current_track); 812 794 #endif 813 795 } 814 796 } 815 - return ret; 816 - } 817 - 818 - /* View current playlist */ 819 - enum playlist_viewer_result playlist_viewer(void) 820 - { 821 - return playlist_viewer_ex(NULL, NULL); 797 + return PV_CONTEXT_UNCHANGED; 822 798 } 823 799 824 800 static int get_track_num(struct playlist_viewer *local_viewer, ··· 928 904 return 0; 929 905 } 930 906 931 - static void update_lists(struct gui_synclist * playlist_lists, bool init) 907 + static void update_gui(struct gui_synclist * playlist_lists, bool init) 932 908 { 933 909 if (init) 934 910 gui_synclist_init(playlist_lists, playlist_callback_name, ··· 946 922 gui_synclist_speak_item(playlist_lists); 947 923 } 948 924 949 - static bool update_viewer_with_changes(struct gui_synclist *playlist_lists, enum pv_onplay_result res) 925 + static bool update_viewer(struct gui_synclist *playlist_lists, enum pv_context_result res) 950 926 { 951 927 bool exit = false; 952 - if (res == PV_ONPLAY_CHANGED || 953 - res == PV_ONPLAY_SAVED || 954 - res == PV_ONPLAY_ITEM_REMOVED) 955 - { 956 - if (res != PV_ONPLAY_SAVED) 957 - playlist_set_modified(viewer.playlist, true); 958 - 959 - if (res == PV_ONPLAY_ITEM_REMOVED) 960 - gui_synclist_del_item(playlist_lists); 928 + if (res == PV_CONTEXT_MODIFIED) 929 + playlist_set_modified(viewer.playlist, true); 961 930 931 + if (res == PV_CONTEXT_MODIFIED || res == PV_CONTEXT_PL_UPDATE) 932 + { 962 933 update_playlist(true); 963 - 964 934 if (viewer.num_tracks <= 0) 965 935 exit = true; 966 936 967 937 if (viewer.selected_track >= viewer.num_tracks) 968 938 viewer.selected_track = viewer.num_tracks-1; 969 939 } 970 - 971 - /* the show_icons option in the playlist viewer settings 972 - * menu might have changed */ 973 - update_lists(playlist_lists, false); 940 + update_gui(playlist_lists, false); 974 941 return exit; 975 942 } 976 943 ··· 983 950 if (!playlist_viewer_init(&viewer, filename, reload, most_recent_selection)) 984 951 return false; 985 952 986 - update_lists(playlist_lists, true); 953 + update_gui(playlist_lists, true); 987 954 988 955 return true; 989 956 } ··· 1072 1039 struct playlist_entry * current_track = 1073 1040 playlist_buffer_get_track(&viewer.buffer, 1074 1041 viewer.selected_track); 1075 - int ret_val; 1042 + int ret_val, start_index = current_track->index; 1076 1043 if (viewer.moving_track >= 0) 1077 1044 { 1078 1045 /* Move track */ ··· 1102 1069 playlist_start(current_track->index, 0, 0); 1103 1070 update_playlist(false); 1104 1071 } 1105 - else 1072 + else if (warn_on_pl_erase()) 1106 1073 { 1107 - int start_index = current_track->index; 1108 - if (!warn_on_pl_erase()) 1109 - { 1110 - gui_synclist_set_title(&playlist_lists, playlist_lists.title, playlist_lists.title_icon); 1111 - gui_synclist_draw(&playlist_lists); 1112 - break; 1113 - } 1114 - /* New playlist */ 1074 + /* Turn it into the current playlist */ 1115 1075 ret_val = playlist_set_current(viewer.playlist); 1116 1076 1117 - /* Playlist effectively closed */ 1077 + /* Previously loaded playlist is now effectively closed */ 1118 1078 viewer.playlist = NULL; 1119 1079 1120 - if (ret_val < 0) 1121 - goto exit; 1122 - if (global_settings.playlist_shuffle) 1123 - start_index = playlist_shuffle(current_tick, start_index); 1124 - playlist_start(start_index, 0, 0); 1080 + if (!ret_val) 1081 + { 1082 + if (global_settings.playlist_shuffle) 1083 + start_index = playlist_shuffle(current_tick, start_index); 1084 + playlist_start(start_index, 0, 0); 1125 1085 1126 - if (viewer.initial_selection) 1127 - *(viewer.initial_selection) = viewer.selected_track; 1128 - 1129 - /* Our playlist is now the current list */ 1130 - if (!playlist_viewer_init(&viewer, NULL, true, NULL)) 1131 - goto exit; 1132 - exit = true; 1086 + if (viewer.initial_selection) 1087 + *(viewer.initial_selection) = viewer.selected_track; 1088 + } 1089 + goto exit; 1133 1090 } 1091 + else 1092 + gui_synclist_set_title(&playlist_lists, playlist_lists.title, 1093 + playlist_lists.title_icon); 1134 1094 gui_synclist_draw(&playlist_lists); 1135 1095 gui_synclist_speak_item(&playlist_lists); 1136 1096 ··· 1138 1098 } 1139 1099 case ACTION_STD_CONTEXT: 1140 1100 { 1141 - int pv_onplay_result = onplay_menu(viewer.selected_track); 1101 + int pv_context_result = context_menu(viewer.selected_track); 1142 1102 1143 - if (pv_onplay_result == PV_ONPLAY_USB) 1103 + if (pv_context_result == PV_CONTEXT_USB) 1144 1104 { 1145 1105 ret = PLAYLIST_VIEWER_USB; 1146 1106 goto exit; 1147 1107 } 1148 - else if (pv_onplay_result == PV_ONPLAY_USB_CLOSED) 1108 + else if (pv_context_result == PV_CONTEXT_USB_CLOSED) 1149 1109 return PLAYLIST_VIEWER_USB; 1150 - else if (pv_onplay_result == PV_ONPLAY_WPS_CLOSED) 1110 + else if (pv_context_result == PV_CONTEXT_WPS_CLOSED) 1151 1111 return PLAYLIST_VIEWER_OK; 1152 - else if (pv_onplay_result == PV_ONPLAY_CLOSED) 1112 + else if (pv_context_result == PV_CONTEXT_CLOSED) 1153 1113 { 1154 1114 if (!open_playlist_viewer(filename, &playlist_lists, true, NULL)) 1155 1115 { ··· 1158 1118 } 1159 1119 break; 1160 1120 } 1161 - if (update_viewer_with_changes(&playlist_lists, pv_onplay_result)) 1121 + if (update_viewer(&playlist_lists, pv_context_result)) 1162 1122 { 1163 1123 exit = true; 1164 1124 ret = PLAYLIST_VIEWER_CANCEL; ··· 1181 1141 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 1182 1142 } 1183 1143 update_playlist(true); 1184 - update_lists(&playlist_lists, true); 1144 + update_gui(&playlist_lists, true); 1185 1145 } 1186 1146 break; 1187 1147 #endif ··· 1191 1151 struct playlist_entry *current_track = playlist_buffer_get_track( 1192 1152 &viewer.buffer, 1193 1153 viewer.selected_track); 1194 - enum pv_onplay_result (*do_plugin)(const struct playlist_entry *) = NULL; 1154 + enum pv_context_result (*do_plugin)(const struct playlist_entry *) = NULL; 1195 1155 #ifdef HAVE_TAGCACHE 1196 1156 if (global_settings.hotkey_tree == HOTKEY_PICTUREFLOW) 1197 1157 do_plugin = &open_pictureflow; ··· 1203 1163 { 1204 1164 int plugin_result = do_plugin(current_track); 1205 1165 1206 - if (plugin_result == PV_ONPLAY_USB_CLOSED) 1166 + if (plugin_result == PV_CONTEXT_USB_CLOSED) 1207 1167 return PLAYLIST_VIEWER_USB; 1208 - else if (plugin_result == PV_ONPLAY_WPS_CLOSED) 1168 + else if (plugin_result == PV_CONTEXT_WPS_CLOSED) 1209 1169 return PLAYLIST_VIEWER_OK; 1210 1170 else if (!open_playlist_viewer(filename, &playlist_lists, true, NULL)) 1211 1171 { ··· 1215 1175 } 1216 1176 else if (global_settings.hotkey_tree == HOTKEY_PROPERTIES) 1217 1177 { 1218 - if (show_track_info(current_track) == PV_ONPLAY_USB) 1178 + if (show_track_info(current_track) == PV_CONTEXT_USB) 1219 1179 { 1220 1180 ret = PLAYLIST_VIEWER_USB; 1221 1181 goto exit; 1222 1182 } 1223 - update_lists(&playlist_lists, false); 1183 + update_gui(&playlist_lists, false); 1224 1184 } 1225 1185 else if (global_settings.hotkey_tree == HOTKEY_DELETE) 1226 1186 { 1227 - if (update_viewer_with_changes(&playlist_lists, 1187 + if (update_viewer(&playlist_lists, 1228 1188 delete_track(current_track->index, 1229 1189 viewer.selected_track, 1230 1190 (current_track->index == viewer.current_playing_track)))) ··· 1252 1212 pop_current_activity_without_refresh(); 1253 1213 close_playlist_viewer(); 1254 1214 return ret; 1215 + } 1216 + 1217 + /* View current playlist */ 1218 + enum playlist_viewer_result playlist_viewer(void) 1219 + { 1220 + return playlist_viewer_ex(NULL, NULL); 1255 1221 } 1256 1222 1257 1223 static const char* playlist_search_callback_name(int selected_item, void * data,