source:
remctl/lib/gutenbach/cd-play
@
9c0279e
Last change on this file since 9c0279e was 9c0279e, checked in by Jessica B. Hamrick <jhamrick@…>, 14 years ago | |
---|---|
|
|
File size: 570 bytes |
Rev | Line | |
---|---|---|
[5c45626] | 1 | #!/bin/sh |
[6bb3ffb] | 2 | PATH="$(dirname $0):$PATH" |
[5c45626] | 3 | |
4 | CDDB= | |
5 | ||
6 | CACHE=$(cd-cddb-get) | |
7 | ||
[53936a5] | 8 | printername=$(/usr/lib/gutenbach/gutenbach-get-config queue) |
9 | ||
[5c45626] | 10 | if [ "$?" = 0 ]; then |
11 | CDDB=1 | |
12 | fi | |
13 | ||
14 | . "$CACHE" | |
15 | ||
16 | play_one () { | |
17 | T=$1 | |
18 | if [ -n "$CDDB" ]; then | |
19 | DESC=" - "$(eval 'echo $TRACK'$T) | |
20 | fi | |
21 | ||
[53936a5] | 22 | echo "cdda://$(($T - 1))" | mit-lpr -P"$queue"@localhost -J "Track $T$DESC"; |
[5c45626] | 23 | echo "Queued Track $T$DESC"; |
24 | } | |
25 | ||
26 | TOPLAY="$2" | |
27 | ||
28 | if [ -z "$TOPLAY" -o "$TOPLAY" = "all" ]; then | |
29 | for i in $(seq 1 "$TRACKS"); do | |
30 | play_one $i | |
31 | done | |
32 | else | |
33 | shift; | |
34 | for i in "$@"; do | |
35 | play_one $i | |
36 | done | |
37 | fi |
Note: See TracBrowser
for help on using the repository browser.