Dear MOC users,
the feature I missed most in moc player was queueing, and I think I am not the only one who would like moc to have this feature. So I decided to try to implement it and here is the patch. Unfortunately, it can't be considered fully working because I ran into a few problems regarding the queue behaviour. So I post it here for you to try and tell me what do you think about it and how do you think it should work:)
Download:
Usage:
By default, use z
to add file to queue, z
again to remove the file from queue, Z
to clear the queue. These keys can be changed in keymap under keywords enqueue_file
, respectively clear_queue
. You can enqueue any file, either from playlist or directory listing.
Behaviour:
The queue is local to current playlist. If you clear playlist (on server), the queue is also cleared; if you send different playlist from another client, it is sent with its own queue. This isn't as noticeable if you have SyncPlaylist
option se to yes
, which I guess is usually the case. If the local queue is non-empty, number of songs in it is displayed between status line and volume bar.
The queue doesn't work when you play a directory (from directory view), not playlist. I'm not sure how it should behave in this case, because when you start playing a directory it is sent as a playlist to the server, but not maintained in any way on the client so it's not possible to have a queue for it (without major modifications to source code). And even if it had it's own queue, if you switched between directory view and playlist and started playing playlist, the queue would be discarded.
Other approach might be to make the queue global -- that it wouldn't depend on the playlist and all clients would share the queue even with SyncPlaylist
turned off. This would personally suit me best, but it goes against mocp's client-server conception a bit. What do you think?
Please note that it is not possible to have two instances of the same file in the queue (as in any playlist in mocp).
I didn't test the patch much with SyncPlaylist
turned off so it's possible I overlooked some major illogicality when using queue in this mode.
In final version, I would also like to be able to display queue contents (in a way e.g. themes menu is displayed) and be able to reorder/delete the items. Maybe also display the order of the files in queue in "winamp style", i.e. show number next to playlist entry indicating on what position is that file in the queue.
Compilation & testing tips:
Make sure to kill your regular mocp server before starting the patched client. Running patched client against normal server will probably result in crash/freeze of one of them.
It might be a good idea to use different config directory than you normally use. The -C
option will accomplish this. If you want to use your regular config directory, there may be tag database libdb version mismatch. In this case, just delete or rename the cache
file.
You will want to install the patched mocp in /usr/local
, or if your regular mocp is already there, in something like ~/.local/
. Pass this directory to --prefix=
parameter of ./configure
(/usr/local
is the default). To uninstall, cd to the directory with source code and do make uninstall
.
If you hit some bug, please include logs and/or backtrace. See http://moc.daper.net/node/96
Thanks for any suggestions/bugreports/comments, with your help this may become usable & maybe even integrated into mainline mocp:)
Martin Milata