There is a new utility disorder-decode which can decode OGG, MP3, WAV
and FLAC. The example config file uses it.
+** Web Interface
+
+The "New" screen display tracks recently added to the database. From
+here they can be played or their preferences changed.
+
** Network Play
DisOrder can broadcast audio over a network, allowing it to be played on
/*
* This file is part of DisOrder.
- * Copyright (C) 2004, 2005, 2006 Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2006, 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) 2004, 2005, 2006 Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2006, 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
disorder_queue(ds->g->client, &ds->g->queue);
if(need & DC_PLAYING)
disorder_playing(ds->g->client, &ds->g->playing);
+ if(need & DC_NEW)
+ disorder_new_tracks(ds->g->client, &ds->g->new, &ds->g->nnew, 0);
if(need & DC_RECENT) {
/* we need to reverse the order of the list */
disorder_recent(ds->g->client, &r);
cgi_sink *output,
void *u) {
dcgi_state *ds = u;
- long length;
+ long length = 0;
if(ds->track
&& (ds->track->state == playing_started
&& ds->track->sofar >= 0)
cgi_output(output, "%ld:%02ld/",
ds->track->sofar / 60, ds->track->sofar % 60);
- if(!ds->track || disorder_length(ds->g->client, ds->track->track, &length))
- length = 0;
+ length = 0;
+ if(ds->track)
+ disorder_length(ds->g->client, ds->track->track, &length);
+ else if(ds->tracks)
+ disorder_length(ds->g->client, ds->tracks[0], &length);
if(length)
cgi_output(output, "%ld:%02ld", length / 60, length % 60);
else
}
}
+static void exp_new(int attribute((unused)) nargs,
+ char **args,
+ cgi_sink *output,
+ void *u) {
+ dcgi_state *ds = u;
+ dcgi_state s;
+
+ lookups(ds, DC_NEW);
+ memset(&s, 0, sizeof s);
+ s.g = ds->g;
+ s.first = 1;
+ for(s.index = 0; s.index < ds->g->nnew; ++s.index) {
+ s.last = s.index + 1 < ds->g->nnew;
+ s.tracks = &ds->g->new[s.index];
+ expandstring(output, args[0], &s);
+ s.first = 0;
+ }
+}
+
static void exp_url(int attribute((unused)) nargs,
char attribute((unused)) **args,
cgi_sink *output,
sink_printf(output->sink, "%s", bool2str(!!ds->g->recent));
}
+static void exp_isnew(int attribute((unused)) nargs,
+ char attribute((unused)) **args,
+ cgi_sink *output,
+ void *u) {
+ dcgi_state *ds = u;
+
+ lookups(ds, DC_NEW);
+ sink_printf(output->sink, "%s", bool2str(!!ds->g->nnew));
+}
+
static void exp_id(int attribute((unused)) nargs,
char attribute((unused)) **args,
cgi_sink *output,
{ "isfiles", 0, 0, 0, exp_isfiles },
{ "isfirst", 0, 0, 0, exp_isfirst },
{ "islast", 0, 0, 0, exp_islast },
+ { "isnew", 0, 0, 0, exp_isnew },
{ "isplaying", 0, 0, 0, exp_isplaying },
{ "isqueue", 0, 0, 0, exp_isqueue },
{ "isrecent", 0, 0, 0, exp_isrecent },
{ "length", 0, 0, 0, exp_length },
{ "navigate", 2, 2, EXP_MAGIC, exp_navigate },
{ "ne", 2, 2, 0, exp_ne },
+ { "new", 1, 1, EXP_MAGIC, exp_new },
{ "nfiles", 0, 0, 0, exp_nfiles },
{ "nonce", 0, 0, 0, exp_nonce },
{ "not", 1, 1, 0, exp_not },
#define DC_VOLUME 0x0008
#define DC_DIRS 0x0010
#define DC_FILES 0x0020
+#define DC_NEW 0x0040
struct queue_entry *queue, *playing, *recent;
int volume_left, volume_right;
char **files, **dirs;
int nfiles, ndirs;
+ char **new;
+ int nnew;
} dcgi_global;
typedef struct dcgi_state {
/*
* 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
/*
* This file is part of DisOrder
- * Copyright (C) 2005, 2006 Richard Kettlewell
+ * Copyright (C) 2005, 2006, 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
pkgdata_DATA=about.html choose.html credits.html playing.html recent.html \
stdhead.html stylesheet.html search.html about.html volume.html \
sidebar.html prefs.html help.html choosealpha.html topbar.html \
- sidebarend.html topbarend.html error.html \
+ sidebarend.html topbarend.html error.html new.html \
options options.labels \
options.columns
static_DATA=disorder.css
<img class=button src="@label:images.edit@"
title="@label:choose.prefsverbose@" alt="@label:choose.prefs@">
</a>
- <a class=file href="@url@?action=play&file=@urlquote{@file@}@&back=@urlquote{@thisurl@}@&nonce=@nonce@">
- @transform{@file@}{track}{display}@
- </a>
+ <a class=file
+ href="@url@?action=play&file=@urlquote{@file@}@&back=@urlquote{@thisurl@}@&nonce=@nonce@"
+ title="@label:choose.play@">@transform{@file@}{track}{display}@</a>
@if{@eq{@trackstate{@file@}@}{playing}@}{[<b>playing</b>]}@
@if{@eq{@trackstate{@file@}@}{queued}@}{[<b>queued</b>]}@
</p>
font-size: 18pt
}
-/* playing and recent *********************************************************/
+/* playing, recent and new ***************************************************/
/* table of current and future tracks */
table.playing {
border-spacing: 0 /* no unsightly gaps between cells */
}
+/* table of newly added played tracks */
+table.new {
+ width: 100%; /* use the full available width */
+ border-spacing: 0 /* no unsightly gaps between cells */
+}
+
/* titles in tables */
th {
text-align: left
</div>
+ <h2 class=sidebarlink><a name=new>New</a></h2>
+
+ <div class=helpsection>
+
+ <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@"
+ 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>
+
+ <p>The time tracks are remembered for is controlled by the server
+ configuration. See the "noticed_history" option in <a
+ href="@url@?action=disorder_config.5">disorder_config(5)</a> for
+ more details.</p>
+
+ </div>
+
<h2 class=sidebarlink><a name=choose>Choose</a></h2>
<div class=helpsection>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<!--
+This file is part of DisOrder.
+Copyright (C) 2004, 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
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+-->
+<html>
+ <head>
+@include:stdhead@
+ <title>@label:new.title@</title>
+ </head>
+ <body>
+@include{@label{menu}@}@
+ <h1 class=title>@label:new.title@</h1>
+
+@#{only display the table if there is something to put in it}@
+@if{@isnew@}{
+ <table class=new>
+ <tr class=headings>
+ <th class=artist>@label:heading.artist@</th>
+ <th class=album>@label:heading.album@</th>
+ <th class=title>@label:heading.title@</th>
+ <th class=length>@label:heading.length@</th>
+ <th class=button> </th>
+ </tr>
+ @new{
+ <tr class=@parity@>
+ <td class=artist><a class=directory href="@url@?action=choose&directory=@urlquote{@dirname{@dirname{@part:path@}@}@}@">@part:artist@</a></td>
+ <td class=album><a class=directory href="@url@?action=choose&directory=@urlquote{@dirname{@part:path@}@}@">@part:album@</a></td>
+ <td class=title><a
+ class=file
+ href="@url@?action=play&file=@urlquote{@file@}@&back=@urlquote{@thisurl@}@&nonce=@nonce@"
+ title="@label:choose.play@">@part:title@</a></td>
+ <td class=length>@length@</td>
+ <td class=imgbutton><a class=imgbutton
+ href="@url@?action=prefs&nonce=@nonce@&0_file=@urlquote{@file@}@"><img
+ class=button src="@label:images.edit@"
+ title="@label:choose.prefsverbose@"
+ alt="@label:choose.prefs@"></a></td>
+ </tr>
+ }@
+ </table>
+}@
+
+@include{@label{menu}@end}@
+ </body>
+</html>
+@@
+<!--
+Local variables:
+mode:sgml
+sgml-always-quote-attributes:nil
+sgml-indent-step:1
+sgml-indent-data:t
+End:
+-->
# <TITLE> for recently played page
label recent.title "Recently Played"
+# <TITLE> for new tracks page
+label new.title "New tracks"
+
# <TITLE> for choose track page
label choose.title "Pick track"
label choose.allprefs "Edit all"
label choose.allprefsverbose "edit all track information"
+# Caption for play-track links
+label choose.play "Add track to queue"
+
# <TITLE> for search page
label search.title Search
label sidebar.random Random
label sidebar.search Search
label sidebar.recent Recent
+label sidebar.new New
label sidebar.about About
label sidebar.volume Volume
label sidebar.help Help
label sidebar.chooseverbose "choose tracks"
label sidebar.searchverbose "word search among track names"
label sidebar.recentverbose "recently played tracks"
+label sidebar.newverbose "newly added tracks"
label sidebar.aboutverbose "about DisOrder"
label sidebar.volumeverbose "volume control"
label sidebar.helpverbose "basic user guide"
<p class=sidebarlink>
<a class=sidebarlink href="@url@?action=recent&nonce=@nonce@">@label:sidebar.recent@</a>
</p>
+ <p class=sidebarlink>
+ <a class=sidebarlink href="@url@?action=new&nonce=@nonce@">@label:sidebar.new@</a>
+ </p>
<p class=sidebarlink>
<a class=sidebarlink href="@url@?action=@label:sidebar.choosewhich@&nonce=@nonce@">@label:sidebar.choose@</a>
</p>
@@
<!--
This file is part of DisOrder.
-Copyright (C) 2004, 2005 Richard Kettlewell
+Copyright (C) 2004, 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
<a class=@if{@eq{@action@}{recent}@}{activemenu}{inactivemenu}@
href="@url@?action=recent&nonce=@nonce@"
title="@label:sidebar.recentverbose@">@label:sidebar.recent@</a>
+ <a class=@if{@eq{@action@}{new}@}{activemenu}{inactivemenu}@
+ href="@url@?action=new&nonce=@nonce@"
+ title="@label:sidebar.newverbose@">@label:sidebar.new@</a>
<a class=@if{@or{@eq{@action@}{choose}@}
{@eq{@action@}{choosealpha}@}@}
{activemenu}
@@
<!--
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