static void log_scratched(void *v, const char *track, const char *user);
static void log_state(void *v, unsigned long state);
static void log_volume(void *v, int l, int r);
+static void log_rescanned(void *v);
/** @brief Callbacks for server state monitoring */
const disorder_eclient_log_callbacks log_callbacks = {
log_removed,
log_scratched,
log_state,
- log_volume
+ log_volume,
+ log_rescanned
};
/** @brief State monitor
}
}
+/** @brief Called when a rescan completes */
+static void log_rescanned(void attribute((unused)) *v) {
+ added_update();
+}
+
/** @brief Add a monitor to the list
* @param callback Function to call
* @param u User data to pass to @p callback
Queue entry \fIID\fR was removed. This is used both for explicit removal (when
\fIUSER\fR is present) and when playing a track (when it is absent).
.TP
+.B rescanned
+A rescan completed.
+.TP
.B scratched \fITRACK\fR \fIUSER\fR
\fITRACK\fR was scratched by \fIUSER\fR.
.TP
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)
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;
void (*scratched)(void *v, const char *track, const char *user);
void (*state)(void *v, unsigned long state);
void (*volume)(void *v, int left, int right);
+ void (*rescanned)(void *v);
} disorder_eclient_log_callbacks;
/* State bits */
D(("disorderd-rescan terminate: %s", wstat(status)));
/* Our cache of file lookups is out of date now */
cache_clean(&cache_files_type);
+ eventlog("rescanned", (char *)0);
return 0;
}