[SOLVED] Random album script - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: [SOLVED] Random album script (/showthread.php?tid=1592) |
Random album script - Pieter - 08-10-2019 Hi all I'm trying to beef up my Denon RC-1173 remote with moOde-tied functionality and would like to set a button queuing up a random album, behaving exactly like the random album icon on the playback panel in the web interface. As far as I can tell this is the javascript responsible for the functionality but I don't know how to call it as a script that irexec can run. Could anyone shed some light on this? /www/js/scripts-library.js lines 654-694 Code: // Random album instant play (button on Playback panel) RE: Random album script - swizzle - 08-10-2019 Looking a bit at how irexec works with moode (sends commands to mpc) you probably need additional software like this: http://lirc.org/html/irxevent.html It looks like can simulate button clicks by using screen coordinates but it’d be better if keyboard shortcuts were added. RE: Random album script - Tim Curtis - 08-10-2019 We also have a mechanism (engine-cmd.php) to send commands from the server to the client so in theory it should be possible to use it to provide an interface to the non-MPD features of the UI. There are a lot of moving parts though so not a trivial dev project. It would be something like below - LIRC maps button X to command: /var/www/command/new_script.php 'random_album' - When X is pressed new_script.php executes function sendEngCmd($cmd); - JS code running in Browser receives 'random_album' command and performs $('.ralbum).click() Something like that. RE: Random album script - Pieter - 08-30-2019 Update: I found a solution much simpler than emulating button presses in X: https://github.com/cbumae/mpdrandom Calling mpdrandom will select an album at random from the current playlist, and by calling the option -l the script will select, queue and play an album from the entire library. The script offers a daemon function as well, queuing an entire album when the end of the playlist is reached. I'm an album guy so will replace the ashuffle implementation with this. RE: Random album script - Tim Curtis - 08-30-2019 Added to TODO list, thanks. My thought is to change the Auto-shuffle option in Audio Config from ON/OFF to a dropdown that contains Off Tracks Albums |