"Nothing but another drug, a licence that you buy and sell"
DisOrder - select and play digital audio files
-Copyright (C) 2003-2007 Richard Kettlewell
+Copyright (C) 2003-2008 Richard Kettlewell
Portions copyright (C) 2007 Ross Younger
Portions copyright (C) 2007 Mark Wooding
Portions extracted from MPG321, http://mpg321.sourceforge.net/
#
# This file is part of DisOrder
-# Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
+# Copyright (C) 2004-2008 Richard Kettlewell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
EXTRA_DIST=README.Debian config.disorder-server control \
copyright README.RTP \
- etc.disorder.options etc.disorder.config htaccess \
+ etc.disorder.options.user etc.disorder.config htaccess \
postinst.disorder-server prerm.disorder-server \
postrm.disorder-server \
templates.disorder-server conffiles.disorder-server \
/etc/disorder/config
/etc/disorder/options
+/etc/disorder/options.user
/etc/init.d/disorder
+++ /dev/null
-# debian-specific disorder options
-include options.labels
-
-# default columns
-include options.columns
-
-# trackname transformations - supply your own or keep the default
-include options.transform
-
-# where to find static web content
-label url.static /disorder/
-label links.css /disorder/disorder.css
-
-# user overrides - you supply this
-include options.user
--- /dev/null
+# This file is included from /etc/disorder/options as its last act, so you can
+# use it to override any of the default settings.
#! /usr/bin/make -f
#
-# Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
+# Copyright (C) 2004-2008 Richard Kettlewell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
debian/disorder-server/etc/init.d/disorder
$(INSTALL_DATA) debian/etc.disorder.config \
debian/disorder-server/etc/disorder/config
- $(INSTALL_DATA) debian/etc.disorder.options \
+ $(INSTALL_DATA) templates/options \
debian/disorder-server/etc/disorder/options
+ $(INSTALL_DATA) debian/etc.disorder.options.user \
+ debian/disorder-server/etc/disorder/options.user
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) server/disorder.cgi \
$(shell pwd)/debian/disorder-server/usr/lib/cgi-bin/disorder
dpkg-shlibdeps -Tdebian/substvars.disorder-server \
FALSE/*fill*/,
1/*padding*/);
gtk_box_pack_start(GTK_BOX(vbox),
- gtk_label_new("\xC2\xA9 2004-2007 Richard Kettlewell"),
+ gtk_label_new("\xC2\xA9 2004-2008 Richard Kettlewell"),
FALSE/*expand*/,
FALSE/*fill*/,
1/*padding*/);
.\"
-.\" Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
+.\" Copyright (C) 2004-2008 Richard Kettlewell
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
If \fIBOOL\fR expands to \fBtrue\fR then expands to \fITRUEPART\fR, otherwise
to \fIFALSEPART\fR (which may be omitted).
.TP
-.B @include:\fIPATH\fR@
+.B @image:\fINAME\fB@
+Expands to the (possibly relative) URL for image \fINAME\fR.
+.IP
+If there is a label \fBimages.\fINAME\fR then that will be the image base name.
+Otherwise the image base name is \fINAME\fB.png\fR or just \fINAME\fR if it
+alraedy has an extension. Thus labels may be defined to give images role
+names.
+.IP
+If there is a label \fBurl.static\fR then that is the base URL for images. If
+it is not defined then \fB/disorder\fR is used as a default.
+.TP
+.B @include:\fIPATH\fB@
Include the named file as if it were a template file. If \fIPATH\fR
starts with a \fB/\fR then it is used as-is; otherwise, ".html" is
appended and the template path is searched.
/*
* This file is part of DisOrder.
- * Copyright (C) 2004, 2005, 2006 Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2006, 2008 Richard Kettlewell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return label;
}
+int cgi_label_exists(const char *key) {
+ read_options();
+ return kvp_get(labels, key) ? 1 : 0;
+}
+
char **cgi_columns(const char *name, int *ncolumns) {
struct column *c;
/*
* This file is part of DisOrder.
- * Copyright (C) 2004, 2005 Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2008 Richard Kettlewell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
const char *cgi_label(const char *key);
/* look up the translated label @key@ */
+int cgi_label_exists(const char *key);
+
char **cgi_columns(const char *name, int *nheadings);
/* return the list of columns for @name@ */
/*
* This file is part of DisOrder.
- * Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
+ * Copyright (C) 2004-2008 Richard Kettlewell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
cgi_output(output, "%s", value);
}
+static void exp_image(int attribute((unused)) nargs,
+ char **args,
+ cgi_sink *output,
+ void attribute((unused)) *u) {
+ char *labelname;
+ const char *imagestem;
+
+ byte_xasprintf(&labelname, "images.%s", args[0]);
+ if(cgi_label_exists(labelname))
+ imagestem = cgi_label(labelname);
+ else if(strchr(args[0], '.'))
+ imagestem = args[0];
+ else
+ byte_xasprintf((char **)&imagestem, "%s.png", args[0]);
+ if(cgi_label_exists("url.static"))
+ cgi_output(output, "%s/%s", cgi_label("url.static"), imagestem);
+ else
+ cgi_output(output, "/disorder/%s", imagestem);
+}
+
static const struct cgi_expansion expansions[] = {
{ "#", 0, INT_MAX, EXP_MAGIC, exp_comment },
{ "action", 0, 0, 0, exp_action },
{ "fullname", 0, 0, 0, exp_fullname },
{ "id", 0, 0, 0, exp_id },
{ "if", 2, 3, EXP_MAGIC, exp_if },
+ { "image", 1, 1, 0, exp_image },
{ "include", 1, 1, 0, exp_include },
{ "index", 0, 0, 0, exp_index },
{ "isdirectories", 0, 0, 0, exp_isdirectories },
version @version@</a> - select and play digital
audio files</p>
- <p>Copyright © 2003-2007 <a href="http://www.greenend.org.uk/rjk/">Richard Kettlewell</a><br>
+ <p>Copyright © 2003-2008 <a href="http://www.greenend.org.uk/rjk/">Richard Kettlewell</a><br>
Portions copyright © 2007 <a href="http://www.chiark.greenend.org.uk/~ryounger/">Ross Younger</a><br>
Portions copyright © 2007 Mark Wooding</p>
@right{prefs}{<a class=imgprefs
href="@url@?action=prefs&0_file=@urlquote{@resolve{@file@}@}@&nonce=@nonce@"
><img class=button
- src="@label:images.edit@"
+ src="@@image:edit@"
title="@label:choose.prefsverbose@"
alt="@label:choose.prefs@"></a>}@
<a class=file
@right{prefs}{<a class=imgprefs
href="@url@?action=prefs&directory=@urlquote{@arg:directory@}@&nonce=@nonce@&back=@urlquote{@thisurl@}@"
><img class=button
- src="@label:images.edit@"
+ src="@@image:edit@"
title="@label:choose.allprefsverbose@"
alt="@label:choose.allprefs@"></a>}@
<a class=allfiles href="@url@?action=play&directory=@urlquote{@arg:directory@}@&nonce=@nonce@&back=@urlquote{@thisurl@}@">
<p class=credits><a
href="http://www.greenend.org.uk/rjk/disorder/"
title="DisOrder web site">DisOrder
-version @version@</a> © 2003-2007 Richard Kettlewell</p>
+version @version@</a> © 2003-2008 Richard Kettlewell</p>
@@
<!--
This file is part of DisOrder.
-Copyright (C) 2004, 2005, 2006 Richard Kettlewell
+Copyright (C) 2004-2007 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
/*
This file is part of DisOrder.
-Copyright (C) 2003, 2004, 2005, 2007 Richard Kettlewell
+Copyright (C) 2003-2007 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
This file is part of DisOrder.
-Copyright (C) 2005 Richard Kettlewell
+Copyright (C) 2005 ,2007 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
This file is part of DisOrder.
-Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
+Copyright (C) 2004-2008 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
given.</p>
<p>Each track has a <img class=button
- src="@label:images.scratch@"
+ src="@image:scratch@"
title="@label:playing.scratch@"
alt="@label:playing.scratch@"> button next to it. For the
currently playing track this can be used to stop playing the
<ul>
<li>Pause. This button can be used to pause playing (provided the
player supports it). <img width=16 height=16 class=imgbutton
- src="@label:images.enabled@"> indicates that playing is paused,
+ src="@image:enabled@"> indicates that playing is paused,
<img width=16 height=16 class=imgbutton
- src="@label:images.disabled@"> that it is not.</li>
+ src="@image:disabled@"> that it is not.</li>
<li>Enable/disable random play. If disabled then queued tracks
will still be played but if the queue is empty nothing will be
picked at random. <img width=16 height=16 class=imgbutton
- src="@label:images.enabled@"> indicates that random play is
+ src="@image:enabled@"> indicates that random play is
enabled, <img width=16 height=16 class=imgbutton
- src="@label:images.disabled@"> that it is disabled.</li>
+ src="@image:disabled@"> that it is disabled.</li>
<li>Enable/disable play. If disabled then tracks in the queue
will not be played, but will remain in the queue instead. <img
- width=16 height=16 class=imgbutton src="@label:images.enabled@">
+ width=16 height=16 class=imgbutton src="@image:enabled@">
indicates that play is enabled, <img width=16 height=16
- class=imgbutton src="@label:images.disabled@"> that it is
+ class=imgbutton src="@image:disabled@"> that it is
disabled.</li>
<li>Volume control. You can use the <img class=button
- src="@label:images.up@"
+ src="@image:up@"
title="@label:volume.increase@"
alt="@label:volume.increase@"> and <img
- src="@label:images.down@"
+ src="@image:down@"
title="@label:volume.reduce@"
alt="@label:volume.reduce@"> buttons to increase or
decrease the volume, or enter new volume settings for the left
<p>Below this is the same table of current and queued tracks as for
the main playing screen, but with extra buttons for managing the
queue.
- The <img class=button src="@label:images.up@"
+ The <img class=button src="@image:up@"
title="@label:playing.up@" alt="@label:playing.up@"> and <img
- src="@label:images.down@" title="@label:playing.down@"
+ src="@image:down@" title="@label:playing.down@"
alt="@label:playing.down@"> buttons on each track move that
track around in the queue. Similarly the <img class=button
- src="@label:images.upall@" title="@label:playing.upall@"
+ src="@image:upall@" title="@label:playing.upall@"
alt="@label:playing.upall@"> and <img
- src="@label:images.downall@" title="@label:playing.downall@"
+ src="@image:downall@" title="@label:playing.downall@"
alt="@label:playing.downall@"> buttons move each track to the head or
tail of the queue.
Depending on server configuration, it may be that only trusted
<div class=helpsection>
<p>This screen displays recently played tracks, most recent first.
- The <img class=button src="@label:images.edit@"
+ The <img class=button src="@image:edit@"
title="@label:choose.prefs@" alt="@label:choose.prefs@">
button can be used to edit the details for a track; see <a
href="#prefs">Editing Preferences</a> below.</p>
<p>This screen displays tracks recently added to the database,
most recent first. The <img class=button
- src="@label:images.edit@" title="@label:choose.prefs@"
+ src="@image:edit@" title="@label:choose.prefs@"
alt="@label:choose.prefs@"> button can be used to edit the details
for a track; see <a href="#prefs">Editing Preferences</a> below,
and clicking on the track title will add it to the queue.</p>
<tbody>
<tr>
<td class=helpbuttons><img
- class=button src="@label:images.edit@"
+ class=button src="@image:edit@"
title="@label:choose.prefs@"
alt="@label:choose.prefs@"></td>
<td class=helpbuttons>This button can be used to edit the details for a
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
This file is part of DisOrder.
-Copyright (C) 2004, 2005, 2007 Richard Kettlewell
+Copyright (C) 2004-2008 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@right{prefs}{
<td class=imgbutton><a class=imgbutton
href="@url@?action=prefs&nonce=@nonce@&0_file=@urlquote{@file@}@"><img
- class=button src="@label:images.edit@"
+ class=button src="@image:edit@"
title="@label:choose.prefsverbose@"
alt="@label:choose.prefs@"></a></td>
</tr>}@
label heading.title Title
label heading.length Length
-# (Possibly relative) URL to images. This be a URL for the directory
-# containing the icons used by the web interface (which might be
-# /usr/local/share/disorder/static/).
-label url.static /disorder/
-
-# Stylesheet. As above, a (possibly relative) URL, but this time pointing
-# to the stylesheet to use in all DisOrder web pages.
-label links.css /disorder/disorder.css
-
+# Role images. See the documentation for @images:NAME@.
+label images.enabled tick.png
+label images.disabled cross.png
+label images.scratch cross.png
+label images.noscratch nocross.png
+label images.noup noup.png
+label images.upall upup.png
+label images.noupall noupup.png
+label images.downall downdown.png
+label images.nodownall nodowndown.png
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
This file is part of DisOrder.
-Copyright (C) 2004, 2005 Richard Kettlewell
+Copyright (C) 2004-2008 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
title="@label:playing.resumeverbose@">@label:playing.pause@</a>
</a>
</span>
- <img width=16 height=16 class=imgbutton src="@label:images.tick@">
+ <img width=16 height=16 class=imgbutton src="@image:enabled@">
}{
<!-- not paused -->
<span class=button>
title="@label:playing.pauseverbose@">@label:playing.pause@</a>
</a>
</span>
- <img width=16 height=16 class=imgbutton src="@label:images.cross@">
+ <img width=16 height=16 class=imgbutton src="@image:disabled@">
}@
@if{@random-enabled@}{
<!-- random played enabled -->
title="@label:playing.randomdisableverbose@">@label:playing.random@</a>
</a>
</span>
- <img width=16 height=16 class=imgbutton src="@label:images.tick@">
+ <img width=16 height=16 class=imgbutton src="@image:enabled@">
}{
<!-- random played disabled -->
<span class=button>
title="@label:playing.randomenableverbose@">@label:playing.random@</a>
</a>
</span>
- <img width=16 height=16 class=imgbutton src="@label:images.cross@">
+ <img width=16 height=16 class=imgbutton src="@image:disabled@">
}@
@if{@enabled@}{
<!-- playing enabled -->
title="@label:playing.disableverbose@">@label:playing.playing@</a>
</a>
</span>
- <img width=16 height=16 class=imgbutton src="@label:images.tick@">
+ <img width=16 height=16 class=imgbutton src="@image:enabled@">
}{
<!-- playing disabled -->
<span class=button>
title="@label:playing.enableverbose@">@label:playing.playing@</a>
</a>
</span>
- <img width=16 height=16 class=imgbutton src="@label:images.cross@">
+ <img width=16 height=16 class=imgbutton src="@image:disabled@">
}@
<form class=volume action="@url@" method=POST
enctype="multipart/form-data" accept-charset=utf-8>
@label:playing.volume@
@right{volume}{<a class=imgbutton
href="@url@?action=volume&delta=-@label:volume.resolution@&back=@urlquote{@thisurl@?mgmt=true}@">
- <img class=button src="@label:images.down@"
+ <img class=button src="@image:down@"
alt="@label:volume.reduce@" title="@label:volume.reduceverbose@">
- </a>}{<img class=button src="@label:images.nodown@">}@
+ </a>}{<img class=button src="@image:nodown@">}@
@label:volume.left@ <input size=3 name=left type=text value="@volume:left@">
@label:volume.right@ <input size=3 name=right type=text value="@volume:right@">
<input name=nonce type=hidden value="@nonce@">
</button>}@
@right{volume}{<a class=imgbutton
href="@url@?action=volume&delta=@label:volume.resolution@&back=@urlquote{@thisurl@?mgmt=true}@">
- <img class=button src="@label:images.up@"
+ <img class=button src="@image:up@"
alt="@label:volume.increase@" title="@label:volume.increaseverbose@">
- </a>}{<img class=button src="@label:images.noup@">}@
+ </a>}{<img class=button src="@image:noup@">}@
</form>
</span>
}@
<td class=length>@length@</td>
<td class=imgbutton>@if{@scratchable@}{<a class=imgbutton
href="@url@?action=scratch&nonce=@nonce@&id=@id@&mgmt=@arg:mgmt@"><img
- class=button src="@label:images.scratch@"
+ class=button src="@image:scratch@"
title="@label:playing.scratchverbose@"
alt="@label:playing.scratch@"></a>}{<img
- class=button src="@label:images.noscratch@"
+ class=button src="@image:noscratch@"
title="@label:playing.scratchverbose@"
alt="@label:playing.scratch@">}@</td>
@if{@arg:mgmt@}{
<td class=length>@length@</td>
<td class=imgbutton>@if{@removable@}{<a class=imgbutton
href="@url@?action=remove&nonce=@nonce@&id=@id@&mgmt=@arg:mgmt@"><img
- class=button src="@label:images.scratch@"
+ class=button src="@image:scratch@"
title="@label:playing.removeverbose@"
alt="@label:playing.remove@"></a>}{<img
- class=button src="@label:images.noscratch@"
+ class=button src="@image:noscratch@"
title="@label:playing.removeverbose@"
alt="@label:playing.remove@">}@</td>
<!-- cannot move up -->
<td class=imgbutton>
<img
- class=button src="@label:images.noupup@"
+ class=button src="@image:noupall@"
title="@label:playing.upallverbose@" alt="">
<td class=imgbutton>
<img
- class=button src="@label:images.noup@"
+ class=button src="@image:noup@"
title="@label:playing.upverbose@" alt="">
}{
<!-- can move up -->
<td class=imgbutton>
<a class=imgbutton
href="@url@?action=move&nonce=@nonce@&id=@id@&delta=2147483647&mgmt=true"><img
- class=button src="@label:images.upup@"
+ class=button src="@image:upall@"
title="@label:playing.upallverbose@"
alt="@label:playing.upall@"></a>
<td class=imgbutton>
<a class=imgbutton
href="@url@?action=move&nonce=@nonce@&id=@id@&delta=1&mgmt=true"><img
- class=button src="@label:images.up@"
+ class=button src="@image:up@"
title="@label:playing.upverbose@" alt="@label:playing.up@"></a>
}@
<!-- cannot move down -->
<td class=imgbutton>
<img
- class=button src="@label:images.nodowndown@"
+ class=button src="@image:nodownall@"
title="@label:playing.downallverbose@" alt="">
<td class=imgbutton>
<img
- class=button src="@label:images.nodown@"
+ class=button src="@image:nodown@"
title="@label:playing.downverbose@" alt="">
}{
<!-- can move down -->
<td class=imgbutton>
<a class=imgbutton
href="@url@?action=move&nonce=@nonce@&id=@id@&delta=-2147483647&mgmt=true"><img
- class=button src="@label:images.downdown@"
+ class=button src="@image:downall@"
title="@label:playing.downallverbose@"
alt="@label:playing.downall@"></a>
<td class=imgbutton>
<a class=imgbutton
href="@url@?action=move&nonce=@nonce@&id=@id@&delta=-1&mgmt=true"><img
- class=button src="@label:images.down@"
+ class=button src="@image:down@"
title="@label:playing.downverbose@" alt="@label:playing.down@"></a>
}@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
This file is part of DisOrder.
-Copyright (C) 2004, 2005 Richard Kettlewell
+Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@right{prefs}{
<td class=imgbutton><a class=imgbutton
href="@url@?action=prefs&nonce=@nonce@&0_file=@urlquote{@file@}@"><img
- class=button src="@label:images.edit@"
+ class=button src="@image:edit@"
title="@label:choose.prefsverbose@"
alt="@label:choose.prefs@"></a></td>
</tr>}@
- <link rel=stylesheet type="text/css" href="@label:links.css@">
+ <link rel=stylesheet type="text/css" href="@image:disorder.css@">
@@
This file is a standard place to put a link to a stylesheet,
or an embedded stylesheet.
<!--
This file is part of DisOrder.
-Copyright (C) 2005 Richard Kettlewell
+Copyright (C) 2005, 2007, 2008 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
This file is part of DisOrder.
-Copyright (C) 2004, 2005 Richard Kettlewell
+Copyright (C) 2004, 2005, 2008 Richard Kettlewell
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
<p class=volume>
<a class=imgbutton
href="@url@?action=volume&delta=-@label:volume.resolution@">
- <img class=button src="@label:images.down@"
+ <img class=button src="@image:down@"
alt="@label:volume.reduce@" title="@label:volume.reduceverbose@">
</a>
@label:volume.left@ <input size=3 name=left type=text value="@volume:left@">
</button>
<a class=imgbutton
href="@url@?action=volume&delta=@label:volume.resolution@">
- <img class=button src="@label:images.up@"
+ <img class=button src="@image:up@"
alt="@label:volume.increase@" title="@label:volume.increaseverbose@">
</a>
</p>