Jump from playlist to playlist - 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: Jump from playlist to playlist (/showthread.php?tid=2225) Pages:
1
2
|
Jump from playlist to playlist - avior - 02-29-2020 Can someone please tell if is possible to move from playlist to playlist ? is there a cmd command or am i missing something ? at the moment i am trying to use this command on momentary switches mpc toggle this works mpc next this works mpc prev this works /var/www/vol.sh up 10 this works /var/www/vol.sh dn 10 this works sudo poweroff this works mpc load playlist1 dont work mpc load playlist2 dont work any idea what am doing wrong i am using version 6.4.2 Thank You LATEST RELEASE IS 6.4.2 LATEST RELEASE IS 6.4.2 RE: Jump from playlist to playlist - TheOldPresbyope - 02-29-2020 (02-29-2020, 01:54 PM)avior Wrote: Can someone please tell if is possible to move from playlist to playlist ? is there a cmd command or am i missing something ? Do these playlists exist? You could ask mpc to be sure: Code: pi@moodevu:~ $ mpc lsplaylists Regards, Kent RE: Jump from playlist to playlist - Tim Curtis - 02-29-2020 (02-29-2020, 01:54 PM)avior Wrote: Can someone please tell if is possible to move from playlist to playlist ? is there a cmd command or am i missing something ? U are using the GPIO button handler correct? If the playlist name has embedded spaces it will not be parsed correctly because the code is splitting the CMD string using space as the delimiter. For example. Code: >>> For the upcoming r650 release I should probably change to a specific delimiter for CMD. Something like comma perhaps. In the meantime use underscore instead of space. For example My_Playlist -Tim RE: Jump from playlist to playlist - avior - 02-29-2020 (02-29-2020, 02:10 PM)TheOldPresbyope Wrote:(02-29-2020, 01:54 PM)avior Wrote: Can someone please tell if is possible to move from playlist to playlist ? is there a cmd command or am i missing something ? thank you for your quick response I have checked with mpc lsplaylists and it show all the lists that i ve made I have also change the number of the switch in the ui to see i not got faulty connection but still the same thing it just wouldnt change i ve tried mpc load Default Playlist mpc_load_Default Playlist mpc_load_Default_Playlist mpc load_Default_playlist mpc load default_playlist and same with just "Playlist" but still no good yet the other cmd work maybe i ll have wait for next version RE: Jump from playlist to playlist - TheOldPresbyope - 02-29-2020 @avior My apology for overlooking the dreaded space-character issue. Thank Tim for catching it. <oops, hit return too soon> Try, for example, Code: mpc load "Default Playlist" Regards, Kent RE: Jump from playlist to playlist - Tim Curtis - 02-29-2020 I don't think that will work. You prolly end up with below after string.split(' ') Code: ['mpc', 'load', '"My', 'Playlist"'] OP could try the following to see if an error occurs Code: pi@rp3:~ $ python RE: Jump from playlist to playlist - TheOldPresbyope - 02-29-2020 (02-29-2020, 06:16 PM)Tim Curtis Wrote: I don't think that will work. ... Yeah, my bad twice-over. I was thinking only of the command line. What you suggest at the end of your post is exactly what is in the code in my guide (so is the use of vol.sh) I'm having a bad day wrestling a real-world problem. I should just ignore this distracting computer for a while Regards, Kent RE: Jump from playlist to playlist - avior - 03-01-2020 (02-29-2020, 06:35 PM)TheOldPresbyope Wrote:(02-29-2020, 06:16 PM)Tim Curtis Wrote: I don't think that will work. ... thank you for reply this what i got pi@moode:~ $ python Python 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> import subprocess >>> subprocess.call(['mpc', 'load', 'Default Playlist']) loading: Default Playlist 0 RE: Jump from playlist to playlist - TheOldPresbyope - 03-01-2020 @avior Ok, that test returned 0 which means it was successful. You should have seen the tracks in the Default Playlist appear on the playback screen. It's been difficult to determine how you are going wrong because you reference Remy's Python script for momentary switches but you keep showing us command line syntax instead of your code in your posts. In Remy's script, switch "pl2" is programmed to load his example playlist named "MUSIC_STREAM" Code: ... If you change that 'MUSIC_STREAM' to 'Default Playlist' you should get the behavior you want for switch "pl2". Obviously this can be done for the switch of choice. Note that Remy was a bit overcautious with his admonition to "Make sure no spaces on playlists names." Regards, Kent RE: Jump from playlist to playlist - Tim Curtis - 03-01-2020 (03-01-2020, 12:31 PM)avior Wrote: thank you for reply this what i got Now try below with underscore in the playlist name. Code: subprocess.call(['mpc', 'load', 'Default_Playlist']) If this works then in GPIO button handler CMD field specify the string below substituting your own playlist name. Just make sure it does not contain any embedded spaces for example DefaultPlaylist, Default_Playlist, My_Playlist, MyPlaylist, etc. Code: mpc load Default_Playlist |