[player/dacp/mpd] Pass additional information to speaker enum callback

This commit is contained in:
chme 2017-10-31 09:02:13 +01:00 committed by ejurgensen
parent b363c0dac2
commit f696229fff
4 changed files with 9 additions and 5 deletions

View File

@ -510,7 +510,7 @@ playqueuecontents_add_queue_item(struct evbuffer *songlist, struct db_queue_item
} }
static void static void
speaker_enum_cb(uint64_t id, const char *name, int relvol, int absvol, struct spk_flags flags, void *arg) speaker_enum_cb(uint64_t id, const char *name, const char *output_type, int relvol, int absvol, struct spk_flags flags, void *arg)
{ {
struct evbuffer *evbuf; struct evbuffer *evbuf;
int len; int len;

View File

@ -3254,7 +3254,7 @@ mpd_command_password(struct evbuffer *evbuf, int argc, char **argv, char **errms
* Adds a new struct output to the given struct outputs in *arg for the given speaker (id, name, etc.). * Adds a new struct output to the given struct outputs in *arg for the given speaker (id, name, etc.).
*/ */
static void static void
outputs_enum_cb(uint64_t id, const char *name, int relvol, int absvol, struct spk_flags flags, void *arg) outputs_enum_cb(uint64_t id, const char *name, const char *output_type, int relvol, int absvol, struct spk_flags flags, void *arg)
{ {
struct outputs *outputs; struct outputs *outputs;
struct output *output; struct output *output;
@ -3549,7 +3549,7 @@ mpd_command_toggleoutput(struct evbuffer *evbuf, int argc, char **argv, char **e
* outputvolume: 50 * outputvolume: 50
*/ */
static void static void
speaker_enum_cb(uint64_t id, const char *name, int relvol, int absvol, struct spk_flags flags, void *arg) speaker_enum_cb(uint64_t id, const char *name, const char *output_type, int relvol, int absvol, struct spk_flags flags, void *arg)
{ {
struct evbuffer *evbuf; struct evbuffer *evbuf;

View File

@ -2385,8 +2385,10 @@ speaker_enumerate(void *arg, int *retval)
flags.selected = device->selected; flags.selected = device->selected;
flags.has_password = device->has_password; flags.has_password = device->has_password;
flags.has_video = device->has_video; flags.has_video = device->has_video;
flags.requires_auth = device->requires_auth;
flags.needs_auth_key = (device->requires_auth && device->auth_key == NULL);
spk_enum->cb(device->id, device->name, device->relvol, device->volume, flags, spk_enum->arg); spk_enum->cb(device->id, device->name, device->type_name, device->relvol, device->volume, flags, spk_enum->arg);
#ifdef DEBUG_RELVOL #ifdef DEBUG_RELVOL
DPRINTF(E_DBG, L_PLAYER, "*** %s: abs %d rel %d\n", device->name, device->volume, device->relvol); DPRINTF(E_DBG, L_PLAYER, "*** %s: abs %d rel %d\n", device->name, device->volume, device->relvol);

View File

@ -31,6 +31,8 @@ enum repeat_mode {
struct spk_flags { struct spk_flags {
unsigned selected:1; unsigned selected:1;
unsigned has_password:1; unsigned has_password:1;
unsigned requires_auth:1;
unsigned needs_auth_key:1;
unsigned has_video:1; unsigned has_video:1;
}; };
@ -55,7 +57,7 @@ struct player_status {
uint32_t len_ms; uint32_t len_ms;
}; };
typedef void (*spk_enum_cb)(uint64_t id, const char *name, int relvol, int absvol, struct spk_flags flags, void *arg); typedef void (*spk_enum_cb)(uint64_t id, const char *name, const char *output_type, int relvol, int absvol, struct spk_flags flags, void *arg);
struct player_history struct player_history
{ {