Friday 28 December 2012

Installing SCANPI SHELLPLAYER

The wee app (SCANPI SHELLPLAYER) is written as a set of 9 shell scripts. It's kind of explained at https://bitbucket.org/parbuthnott/scanpi-shellplayer/overview.

Once you've gone to the bitbucket, downloaded it and sent it off to your PI, it's all ready for linking action.

We put the whole 9 files and in one place, with the 'queue' and 'played' directories created next to the shell files. All are in a loopback mounted drive on the big disc under /mnt/scanpi.

== AFTER INITIAL INSTALLATION AND INDEX RUN ==
(the files and directories in place and tested...)
pi@raspberrypi /mnt/scanpi/shellplayer $ ls -l
-rwxrwxr-x 1 pi       www-pub   1827 Nov 13 10:58 album.sh
-rw-r--r-- 1 pi       pi      705587 Dec 25 14:03 allmusicrandom.txt
-rwxrwxr-x 1 www-data www-pub 707812 Dec 21 01:31 allmusic.txt
-rwxrwxr-x 1 pi       www-pub   1297 Nov 13 10:58 band.sh
-rwxrwxr-x 1 pi       www-pub   1481 Nov 13 10:59 exit.sh
-rwxrwxr-x 1 pi       www-pub    284 Dec 28 16:51 go.sh
drwxrwxr-x 2 www-data www-pub  33792 Dec 28 16:57 played
-rwxrwxr-x 1 pi       www-pub   3359 Nov 18 14:39 play.sh
drwxrwxr-x 2 pi       www-pub   5120 Dec 28 16:57 queue
-rwxrwxr-x 1 pi       www-pub   1124 Nov 18 13:24 queue.sh
-rwxrwxr-x 1 pi       www-pub   1066 Nov 18 22:28 reindex.sh
-rwxrwxr-x 1 pi       www-pub   1243 Nov 25 12:12 skip.sh
-rwxrwxr-x 1 pi       www-pub   2286 Nov 13 10:59 track.sh

== TIE-ING THE SHELLPLAYER BITS TOGETHER ==
(make a pile of shortcuts to the shellplayer for the pi user.)
cd
sudo ln -s /mnt/scanpi/ scanpi
sudo ln -s scanpi/shellplayer/album.sh a
sudo ln -s scanpi/shellplayer/band.sh b
sudo ln -s scanpi/shellplayer/exit.sh e
sudo ln -s scanpi/shellplayer/go.sh g
sudo ln -s scanpi/shellplayer/play.sh p
sudo ln -s scanpi/shellplayer/queue.sh q
sudo ln -s scanpi/shellplayer/reindex.sh r
sudo ln -s scanpi/shellplayer/skip.sh s
sudo ln -s scanpi/shellplayer/track.sh t

With the above in place, you should be able to ssh to your PI and type './g' and press 'enter' to start the playing function. Typing './e' and pressing 'enter' will exit / stop the playing function. Typing './s' and pressing 'enter' will skip the current playing track.

If there isn't anything in the queue directory, the shellplayer takes the next line from the allmusicrandom.txt file and plays and removes that. The allmusicrandom.txt file is a randomized list of all the available '.mp3' files in the relevant music directory and is created and updated with the 'reindex.sh' or './r' function.

Queueing something up can be done at an artist / band ('./b'), album ('./a') or track ('./t') level. If you understand the syntax, a specific track can be queued up using the queue function ('./q') directly.

Have fun and feel free to comment on all of this. We've got a browser based queue and playing function all ready in the wings and will post about that soon.

No comments:

Post a Comment