diff --git a/doc/ncmpcpp_keys b/doc/ncmpcpp_keys index e2260e84..7e348efd 100644 --- a/doc/ncmpcpp_keys +++ b/doc/ncmpcpp_keys @@ -35,6 +35,8 @@ # #key_volume_down = 260 '-' # +#key_toggle_space_mode = 't' +# #key_screen_switcher = 9 # #key_help = '1' 265 @@ -47,6 +49,8 @@ # #key_media_library = '5' 269 # +#key_playlist_editor = '6' 270 +# #key_stop = 's' # #key_pause = 'P' @@ -93,6 +97,8 @@ # #key_deselect_all = 'V' # +#key_add_selected_items = 'A' +# #key_clear = 'c' # #key_crop = 'C' diff --git a/doc/ncmpcpprc b/doc/ncmpcpprc index 01374a1b..cef3dc38 100644 --- a/doc/ncmpcpprc +++ b/doc/ncmpcpprc @@ -80,7 +80,9 @@ # #repeat_one_mode = "no" # -#find_mode = "wrapped" +#default_find_mode = "wrapped" +# +#default_space_mode = "add" # #header_visibility = "yes" # @@ -110,5 +112,5 @@ # #statusbar_color = "default" # -#library_active_column_color = "red" +#active_column_color = "red" # diff --git a/src/helpers.cpp b/src/helpers.cpp index ddc961f7..6c29363c 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -29,10 +29,12 @@ extern Menu *mPlaylist; extern Menu *mBrowser; extern Menu *mTagEditor; extern Menu *mSearcher; +extern Menu *mPlaylistEditor; extern Window *wFooter; extern SongList vPlaylist; +extern SongList vPlaylistContent; extern ItemList vBrowser; extern NcmpcppScreen current_screen; @@ -70,6 +72,14 @@ void DeleteSong(int id) mPlaylist->DeleteOption(id+1); } +void PlaylistDeleteSong(const string &path, int id) +{ + Mpd->QueueDeleteFromPlaylist(path, id); + delete vPlaylistContent[id]; + vPlaylistContent.erase(vPlaylistContent.begin()+id); + mPlaylistEditor->DeleteOption(id+1); +} + bool MoveSongUp(int pos) { if (pos > 0 && !mPlaylist->Empty() && current_screen == csPlaylist) @@ -96,6 +106,30 @@ bool MoveSongDown(int pos) return false; } +bool PlaylistMoveSongUp(const string &path, int pos) +{ + if (pos > 0 && !mPlaylistEditor->Empty() && current_screen == csPlaylistEditor) + { + mPlaylistEditor->Swap(pos, pos-1); + Mpd->Move(path, pos, pos-1); + return true; + } + else + return false; +} + +bool PlaylistMoveSongDown(const string &path, int pos) +{ + if (pos+1 < mPlaylistEditor->MaxChoice() && !mPlaylistEditor->Empty() && current_screen == csPlaylistEditor) + { + mPlaylistEditor->Swap(pos+1, pos); + Mpd->Move(path, pos, pos+1); + return true; + } + else + return false; +} + string DisplayKeys(int *key, int size) { bool backspace = 1; diff --git a/src/helpers.h b/src/helpers.h index edc5d15f..58b7a20d 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -31,8 +31,11 @@ extern ncmpcpp_config Config; void DeleteSong(int); +void PlaylistDeleteSong(const string &, int); bool MoveSongUp(int); bool MoveSongDown(int); +bool PlaylistMoveSongUp(const string &, int); +bool PlaylistMoveSongDown(const string &, int); string DisplayKeys(int *, int = 2); bool Keypressed(int, const int *); diff --git a/src/menu.cpp b/src/menu.cpp index 283f5534..826c9dc4 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -21,6 +21,23 @@ #include "menu.h" #include "misc.h" +Menu::Menu(const Menu &m) : Window(m) +{ + for (vector