[listener] Rename LISTENER_PLAYLIST to LISTENER_QUEUE
This commit is contained in:
parent
60daf03f66
commit
1258481202
4
src/db.c
4
src/db.c
|
@ -4006,7 +4006,7 @@ db_queue_get_version()
|
|||
}
|
||||
|
||||
/*
|
||||
* Increments the version of the queue in the admin table and notifies listener of LISTENER_PLAYLIST
|
||||
* Increments the version of the queue in the admin table and notifies listener of LISTENER_QUEUE
|
||||
* about the change.
|
||||
*
|
||||
* This function must be called after successfully modifying the queue table in order to send
|
||||
|
@ -4044,7 +4044,7 @@ queue_inc_version_and_notify()
|
|||
|
||||
db_transaction_end();
|
||||
|
||||
listener_notify(LISTENER_PLAYLIST);
|
||||
listener_notify(LISTENER_QUEUE);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -6,8 +6,8 @@ enum listener_event_type
|
|||
{
|
||||
/* The player has been started, stopped or seeked */
|
||||
LISTENER_PLAYER = (1 << 0),
|
||||
/* The current playlist has been modified */
|
||||
LISTENER_PLAYLIST = (1 << 1),
|
||||
/* The current playback queue has been modified */
|
||||
LISTENER_QUEUE = (1 << 1),
|
||||
/* The volume has been changed */
|
||||
LISTENER_VOLUME = (1 << 2),
|
||||
/* A speaker has been enabled or disabled */
|
||||
|
|
|
@ -596,7 +596,7 @@ mpd_command_idle(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
|||
}
|
||||
else if (0 == strcmp(argv[i], "playlist"))
|
||||
{
|
||||
client->events |= LISTENER_PLAYLIST;
|
||||
client->events |= LISTENER_QUEUE;
|
||||
}
|
||||
else if (0 == strcmp(argv[i], "mixer"))
|
||||
{
|
||||
|
@ -617,7 +617,7 @@ mpd_command_idle(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
|||
}
|
||||
}
|
||||
else
|
||||
client->events = LISTENER_PLAYER | LISTENER_PLAYLIST | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS;
|
||||
client->events = LISTENER_PLAYER | LISTENER_QUEUE | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS;
|
||||
|
||||
idle_clients = client;
|
||||
|
||||
|
@ -4544,7 +4544,7 @@ mpd_notify_idle_client(struct idle_client *client, enum listener_event_type type
|
|||
evbuffer_add(client->evbuffer, "changed: player\n", 16);
|
||||
break;
|
||||
|
||||
case LISTENER_PLAYLIST:
|
||||
case LISTENER_QUEUE:
|
||||
evbuffer_add(client->evbuffer, "changed: playlist\n", 18);
|
||||
break;
|
||||
|
||||
|
@ -4871,7 +4871,7 @@ int mpd_init(void)
|
|||
#endif
|
||||
|
||||
idle_clients = NULL;
|
||||
listener_add(mpd_listener_cb, LISTENER_PLAYER | LISTENER_PLAYLIST | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS);
|
||||
listener_add(mpd_listener_cb, LISTENER_PLAYER | LISTENER_QUEUE | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
21
src/player.c
21
src/player.c
|
@ -27,10 +27,25 @@
|
|||
* - notify about playback status changes
|
||||
* - maintain the playback queue
|
||||
*
|
||||
* The player thread should *never* be making operations that may block, since
|
||||
* The player thread should never be making operations that may block, since
|
||||
* that could block callers requesting status (effectively making forked-daapd
|
||||
* unresponsive) and it could also starve the outputs.
|
||||
* unresponsive) and it could also starve the outputs. In practice this rule is
|
||||
* not always obeyed, for instance some outputs do their setup in ways that
|
||||
* could block.
|
||||
*
|
||||
*
|
||||
* About metadata
|
||||
* --------------
|
||||
* The player gets metadata from library + inputs and passes it to the outputs
|
||||
* and other clients (e.g. Remotes). Text metadata is handled differently than
|
||||
* artwork. Here's how text works:
|
||||
*
|
||||
* 1. On playback start, the player will TODO
|
||||
* 2. During playback, the input may signal new metadata by making a
|
||||
* input_write() with the INPUT_FLAG_METADATA flag. When the player read
|
||||
* reaches that data, the player will request the metadata from the input
|
||||
* with input_metadata_get().
|
||||
* 3. If the new metadata is different than the TODO
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -2796,7 +2811,7 @@ playerqueue_clear_history(void *arg, int *retval)
|
|||
|
||||
cur_plversion++; // TODO [db_queue] need to update db queue version
|
||||
|
||||
listener_notify(LISTENER_PLAYLIST);
|
||||
listener_notify(LISTENER_QUEUE);
|
||||
|
||||
*retval = 0;
|
||||
return COMMAND_END;
|
||||
|
|
Loading…
Reference in New Issue