/*
* This file is part of DisOrder.
- * Copyright (C) 2006 Richard Kettlewell
+ * Copyright (C) 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
static void logentry_scratched(disorder_eclient *c, int nvec, char **vec);
static void logentry_state(disorder_eclient *c, int nvec, char **vec);
static void logentry_volume(disorder_eclient *c, int nvec, char **vec);
+static void logentry_rescanned(disorder_eclient *c, int nvec, char **vec);
/* Tables ********************************************************************/
LE(recent_added, 2, INT_MAX),
LE(recent_removed, 1, 1),
LE(removed, 1, 2),
+ LE(rescanned, 0, 0),
LE(scratched, 2, 2),
LE(state, 1, 1),
LE(volume, 2, 2)
"nop", (char *)0);
}
+/** @brief Get the last @p max added tracks
+ * @param c Client
+ * @param completed Called with list
+ * @param max Number of tracks to get, 0 for all
+ * @param v Passed to @p completed
+ *
+ * The first track in the list is the most recently added.
+ */
+int disorder_eclient_new_tracks(disorder_eclient *c,
+ disorder_eclient_list_response *completed,
+ int max,
+ void *v) {
+ char limit[32];
+
+ sprintf(limit, "%d", max);
+ return simple(c, list_response_opcallback, (void (*)())completed, v,
+ "new", limit, (char *)0);
+}
+
/* Log clients ***************************************************************/
/** @brief Monitor the server log
c->log_callbacks->removed(c->log_v, vec[0], vec[1]);
}
+static void logentry_rescanned(disorder_eclient *c,
+ int attribute((unused)) nvec,
+ char attribute((unused)) **vec) {
+ if(!c->log_callbacks->rescanned) return;
+ c->log_callbacks->rescanned(c->log_v);
+}
+
static void logentry_scratched(disorder_eclient *c,
int attribute((unused)) nvec, char **vec) {
if(!c->log_callbacks->scratched) return;