CDrummond / cantata

Qt5 Graphical MPD Client
GNU General Public License v3.0
1.04k stars 184 forks source link

[Enhancement] Add sidebar browsing local files #1180

Closed parkmino closed 6 years ago

parkmino commented 6 years ago

I'd like to know what you think about adding sidebar to browse local files as well as drag-and-drop and context menu. Cantata would provide most convenient way to add local files to play queue in this way. It will work like other music players and make up for the MPD's weak points e.g. mounting huge music library, the need of Upmpdcli and DLNA/UPnP server.

CDrummond commented 6 years ago

I'm not 100% convinced about this. I guess to be useful it would need to parse the song files, and show meta data. This could slow it down. To be honest, what does it gain over drag'n'drop? A file manager is going to have a much better interface for this than Cantata.

parkmino commented 6 years ago

I think that the internal file manager in Cantata would have full screen access and more consistent user interface. Simple music file name browsing would be good enough for me. As you said, Cantata already provide decent ways to add local files, and definitely it is up to you whether to implement this or not.

CDrummond commented 6 years ago

I have an initial stab at this in the 1180-local-fs-browsing branch. This works, as in allows you to branch and drag'n'drop. Note that dragging of folders will only add songs in the direct folder.

TODO:

  1. Look deeper into folders when drag and drop
  2. Support the + and |> actions (the ones shown on mouse over, etc)
parkmino commented 6 years ago

Great! I'll look forward to see this feature soon.

FYI, I cannot build 1180-local-fs-browsing branch with following errors.

[ 59%] Building CXX object CMakeFiles/cantata.dir/devices/deviceoptions.cpp.o /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp: In member function ‘void LocalFolderBrowsePage::itemDoubleClicked(const QModelIndex&)’: /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp:83:22: error: ‘BrowseModel’ does not name a type if (!static_cast<BrowseModel::Item >(selected.at(0).internalPointer())->isFolder()) { ^ /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp:83:33: error: expected ‘>’ before ‘::’ token if (!static_cast<BrowseModel::Item >(selected.at(0).internalPointer())->isFolder()) { ^ /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp:83:33: error: expected ‘(’ before ‘::’ token /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp:83:33: error: ‘::Item’ has not been declared /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp:83:41: error: expected primary-expression before ‘>’ token if (!static_cast<BrowseModel::Item >(selected.at(0).internalPointer())->isFolder()) { ^ /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp:83:76: error: ‘void’ is not a pointer-to-object type if (!static_cast<BrowseModel::Item >(selected.at(0).internalPointer())->isFolder()) { ^ /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp:83:90: error: expected ‘)’ before ‘{’ token if (!static_cast<BrowseModel::Item >(selected.at(0).internalPointer())->isFolder()) { ^ /home/parkmino/Downloads/mpd/cantata-1180-local-fs-browsing/gui/localfolderpage.cpp:86:1: error: expected primary-expression before ‘}’ token } ^ CMakeFiles/cantata.dir/build.make:1526: recipe for target 'CMakeFiles/cantata.dir/gui/localfolderpage.cpp.o' failed make[2]: [CMakeFiles/cantata.dir/gui/localfolderpage.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... CMakeFiles/Makefile2:103: recipe for target 'CMakeFiles/cantata.dir/all' failed make[1]: [CMakeFiles/cantata.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: [all] Error 2

CDrummond commented 6 years ago

Branch should compile now. Please update, and let me know your thoughts.

parkmino commented 6 years ago

Wow, 'Home' and 'Root' local files are seamlessly integrated into 'Folders'! ;-)

Here's my quick reviews. 1) Some embedded covers are not shown in play queue I do not know the reason or pattern. Let me know if you need more debug. 2) Clicking '<' to go back to folders not responsive sometimes. 3) Add Menu for trees and list view, same as 'Server Folders'. 4) External covers(png, jpg, ...) can be supported? Another enhancement. 5) Playlists(m3u8, cue, ...) can be visible and supported? Another enhancement. Overall, this feature seems to quite mature and ready for beta review. I will look into this for more.

CDrummond commented 6 years ago
  1. This feature works the same as drag'n'drop - it calls the same code to add items to the queue. Embedded coves have never worked here. Issue #1191 raised
  2. Yeah, I've noticed this. Not related to this issue though - its a change in master so that the left and right views look more balanced when this header is shown.
  3. Yeah, I'll add at least the add/replace, 'Open in File Manager', and 'Custom Actions'. I might also add 'Edit Tags' and 'Replay Gain' - but that's about it.
  4. As per (1)
  5. I've raised issue #1192 to cover adding playlists via drag'n'drop - when its added there, its just a matter of showing the files here. Cantata does parse cue files, but (AFAIK) there would be no way to add these in a track-by-track fashion - so support for these is probably out of the question.
parkmino commented 6 years ago

Now I see most of issues are resolved. However, how about adding 'Menu' for basic/simple/detailed trees and list as well as 'Server Folders'

CDrummond commented 6 years ago

Merged into master now.

parkmino commented 6 years ago

I really appreciate your hard work and wonderful results! Now I can see the whole tags in 'Home' and 'Root' under 'Folders', though metadata is disabled in mpd.conf ;-)