static void log_volume(void *v, int l, int r);
static void log_rescanned(void *v);
static void log_rights_changed(void *v, rights_type r);
+static void log_adopted(void *v, const char *id, const char *user);
/** @brief Callbacks for server state monitoring */
const disorder_eclient_log_callbacks log_callbacks = {
.state = log_state,
.volume = log_volume,
.rescanned = log_rescanned,
- .rights_changed = log_rights_changed
+ .rights_changed = log_rights_changed,
+ .adopted = log_adopted
};
/** @brief Update everything */
--suppress_actions;
}
+/** @brief Called when a track is adopted */
+static void log_adopted(void attribute((unused)) *v,
+ const char attribute((unused)) *id,
+ const char attribute((unused)) *who) {
+ event_raise("queue-changed", 0);
+}
+
/*
Local Variables:
c-basic-offset:2
static void logentry_user_delete(disorder_eclient *c, int nvec, char **vec);
static void logentry_user_edit(disorder_eclient *c, int nvec, char **vec);
static void logentry_rights_changed(disorder_eclient *c, int nvec, char **vec);
+static void logentry_adopted(disorder_eclient *c, int nvec, char **vec);
/* Tables ********************************************************************/
/** @brief Table for parsing log entries */
static const struct logentry_handler logentry_handlers[] = {
#define LE(X, MIN, MAX) { #X, MIN, MAX, logentry_##X }
+ LE(adopted, 2, 2),
LE(completed, 1, 1),
LE(failed, 2, 2),
LE(moved, 1, 1),
return d->vec;
}
+static void logentry_adopted(disorder_eclient *c,
+ int attribute((unused)) nvec, char **vec) {
+ if(c->log_callbacks->adopted)
+ c->log_callbacks->adopted(c->log_v, vec[0], vec[1]);
+}
+
/*
Local Variables:
c-basic-offset:2
/** @brief Called when your rights change */
void (*rights_changed)(void *v, rights_type new_rights);
+
+ /** @brief Called when a track is adopted */
+ void (*adopted)(void *v, const char *id, const char *who);
} disorder_eclient_log_callbacks;
/* State bits */