3 # Copyright (C) 2010 Jason Woofenden
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 HIDE_PREFIX="$HOME/music/"
20 # escape / and \ so we can pass this to sed
21 HIDE_PREFIX="`echo "$HIDE_PREFIX" | sed -e 's/\([\\\/]\)/\\\\\1/g'`"
27 PLAYLIST="$HOME/.cmus/lib.pl"
32 PLAY_LINK='<a href="do.php?action=play&file='
33 PLAY_LINK2='">play</a>'
34 QUEUE_LINK='<a href="do.php?action=queue&file='
35 QUEUE_LINK2='">queue</a>'
38 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
39 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
41 <html xmlns="http://www.w3.org/1999/xhtml">
43 <title>cmus command page</title>
44 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
45 <script type="text/javascript">
47 var loading = \$('#loading');
48 \$('a').click(function(event) {
49 event.preventDefault();
50 loading.html('connecting...');
51 loading.load(this.href);
58 <div style="position: fixed; width: 100%; height: 20px; background: #ffc; padding: 3px; border: 2px solid #ee0; top: 0; left: 0"><a href="do.php?action=pause">pause</a> <a href="do.php?action=prev">prev</a> <a href="do.php?action=next">next</a> <a href="do.php?action=voldown">quieter</a> <a href="do.php?action=volup">louder</a> — Status: <span id="loading">OK</span></div>
59 <div style="height: 25px"></div>
65 DISPLAY="`echo "$REPLY" | sed -e "s/$HIDE_PREFIX//"`"
66 #echo sed -e "s/$HIDE_PREFIX//"
67 echo "<div>$DISPLAY $PLAY_LINK$FILEPATH$PLAY_LINK2 $QUEUE_LINK$FILEPATH$QUEUE_LINK2</div>"