#include <unistd.h>
#include <pcre.h>
#include <ctype.h>
+#include <gcrypt.h>
+ #include <langinfo.h>
#include "configuration.h"
#include "syscalls.h"
#include "vector.h"
#include "version.h"
#include "dateparse.h"
+#include "trackdb.h"
+ #include "inputline.h"
static disorder_client *client;
choose.c choose-menu.c choose-search.c popup.c misc.c \
control.c properties.c menu.c log.c progress.c login.c rtp.c \
help.c ../lib/memgc.c settings.c users.c lookup.c choose.h \
- popup.h
+ popup.h playlists.c
disobedience_LDADD=../lib/libdisorder.a $(LIBPCRE) $(LIBGC) $(LIBGCRYPT) \
- $(LIBASOUND) $(COREAUDIO) $(LIBDB)
+ $(LIBASOUND) $(COREAUDIO) $(LIBDB) $(LIBICONV)
disobedience_LDFLAGS=$(GTK_LIBS)
install-exec-hook:
table.c table.h \
timeval.h \
$(TRACKDB) trackdb.h trackdb-int.h \
+ trackdb-playlists.c \
trackname.c trackorder.c trackname.h \
tracksort.c \
+ uaudio.c uaudio-thread.c uaudio.h uaudio-apis.c \
+ uaudio-oss.c uaudio-alsa.c \
+ uaudio-coreaudio.c \
+ uaudio-rtp.c uaudio-command.c uaudio-schedule.c \
url.h url.c \
user.h user.c \
unicode.h unicode.c \
{ C(nice_speaker), &type_integer, validate_any },
{ C(noticed_history), &type_integer, validate_positive },
{ C(password), &type_string, validate_any },
+ { C(pause_mode), &type_string, validate_pausemode },
{ C(player), &type_stringlist_accum, validate_player },
+ { C(playlist_lock_timeout), &type_integer, validate_positive },
+ { C(playlist_max) , &type_integer, validate_positive },
{ C(plugins), &type_string_accum, validate_isdir },
{ C(prefsync), &type_integer, validate_positive },
{ C(queue_pad), &type_integer, validate_positive },
/** @brief Sox syntax generation */
long sox_generation;
- /** @brief API used to play sound
- *
- * Choices are @ref BACKEND_ALSA, @ref BACKEND_COMMAND or @ref
- * BACKEND_NETWORK.
- */
- int api;
+ /** @brief API used to play sound */
+ const char *api;
-/* These values had better be non-negative */
-#define BACKEND_ALSA 0 /**< Use ALSA (Linux only) */
-#define BACKEND_COMMAND 1 /**< Execute a command */
-#define BACKEND_NETWORK 2 /**< Transmit RTP */
-#define BACKEND_COREAUDIO 3 /**< Use Core Audio (Mac only) */
-#define BACKEND_OSS 4 /**< Use OSS */
-
-#if HAVE_ALSA_ASOUNDLIB_H
-# define DEFAULT_BACKEND BACKEND_ALSA
-#elif HAVE_SYS_SOUNDCARD_H || EMPEG_HOST
-# define DEFAULT_BACKEND BACKEND_OSS
-#elif HAVE_COREAUDIO_AUDIOHARDWARE_H
-# define DEFAULT_BACKEND BACKEND_COREAUDIO
-#else
-# error Cannot choose a default backend
-#endif
-
+ /** @brief Maximum size of a playlist */
+ long playlist_max;
+
+ /** @brief Maximum lifetime of a playlist lock */
+ long playlist_lock_timeout;
+
/** @brief Home directory for state files */
const char *home;
trackdb_noticeddb = open_db("noticed.db",
DB_DUPSORT, DB_BTREE, dbflags, 0666);
trackdb_scheduledb = open_db("schedule.db", 0, DB_HASH, dbflags, 0666);
- if(!trackdb_existing_database) {
+ if(!trackdb_existing_database && !(flags & TRACKDB_READ_ONLY)) {
+ trackdb_playlistsdb = open_db("playlists.db", 0, DB_HASH, dbflags, 0666);
/* Stash the database version */
char buf[32];
static int c_users(struct conn *c,
char attribute((unused)) **vec,
int attribute((unused)) nvec) {
- /* TODO de-dupe with c_tags */
- char **users = trackdb_listusers();
-
- sink_writes(ev_writer_sink(c->w), "253 User list follows\n");
- while(*users) {
- sink_printf(ev_writer_sink(c->w), "%s%s\n",
- **users == '.' ? "." : "", *users);
- ++users;
- }
- sink_writes(ev_writer_sink(c->w), ".\n");
- return 1; /* completed */
+ return list_response(c, "User list follows", trackdb_listusers());
}
-/** @brief Base64 mapping table for confirmation strings
- *
- * This is used with generic_to_base64() and generic_base64(). We cannot use
- * the MIME table as that contains '+' and '=' which get quoted when
- * URL-encoding. (The CGI still does the URL encoding but it is desirable to
- * avoid it being necessary.)
- */
-static const char confirm_base64_table[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/.*";
-
static int c_register(struct conn *c,
char **vec,
int attribute((unused)) nvec) {
TESTS=cookie.py dbversion.py dump.py files.py play.py queue.py \
recode.py search.py user-upgrade.py user.py aliases.py \
- schedule.py hashes.py
- schedule.py playlists.py
++ schedule.py hashes.py playlists.py
TESTS_ENVIRONMENT=${PYTHON} -u