Jukebox functions.
More...
|
| static void | jukebox_get_last_played_add (struct t_partition_state *partition_state, struct mpd_song *song, struct t_list *queue_list, enum jukebox_modes jukebox_mode) |
| |
| static struct t_list * | jukebox_get_last_played (struct t_partition_state *partition_state, enum jukebox_modes jukebox_mode) |
| |
| void | jukebox_clear_all (struct t_mympd_state *mympd_state) |
| |
| void | jukebox_disable (struct t_partition_state *partition_state) |
| |
| bool | jukebox_trigger_script (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, bool add_to_queue) |
| |
| static bool | jukebox_request_worker (struct t_partition_state *partition_state, enum mympd_cmd_ids cmd_id, unsigned add_songs) |
| |
| bool | jukebox_run (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, struct t_cache *album_cache) |
| |
| bool | jukebox_add_to_queue (struct t_partition_state *partition_state, struct t_cache *album_cache, unsigned add_songs, sds *error) |
| |
◆ jukebox_add_to_queue()
| bool jukebox_add_to_queue |
( |
struct t_partition_state * |
partition_state, |
|
|
struct t_cache * |
album_cache, |
|
|
unsigned |
add_songs, |
|
|
sds * |
error |
|
) |
| |
Adds songs or albums from the jukebox queue to the MPD queue and starts playing.
- Parameters
-
| partition_state | pointer to myMPD partition state |
| album_cache | pointer to album cache |
| add_songs | number of songs to add |
| error | pointer to allocated sds for error message |
- Returns
- true on success, else false
◆ jukebox_clear_all()
Public functions Clears the jukebox queue of all partitions.
- Parameters
-
| mympd_state | pointer to central myMPD state. |
◆ jukebox_disable()
Disables the jukebox timer
- Parameters
-
| partition_state | pointer to partition state |
◆ jukebox_get_last_played()
Gets the songs or albums from queue and last played. This list is used to enforce the uniq tag constraint
- Parameters
-
| partition_state | pointer to myMPD partition state |
| jukebox_mode | the jukebox mode |
- Returns
- a newly allocated list with songs or albums
◆ jukebox_get_last_played_add()
Private functions Adds an album or song to the jukebox last played list
- Parameters
-
| partition_state | pointer to myMPD partition state |
| song | mpd_song struct to append |
| queue_list | list to append the entry |
| jukebox_mode | the jukebox mode |
◆ jukebox_request_worker()
Sends a request to the mympd_api thread to start worker to fill the jukebox queue
- Parameters
-
| partition_state | Pointer to myMPD partition state |
| cmd_id | MYMPD_API_JUKEBOX_REFILL or MYMPD_API_JUKEBOX_REFILL_ADD |
| add_songs | Number of songs to add |
- Returns
- true on success, else false
◆ jukebox_run()
The real jukebox function. It determines if a song must be added or not and starts playing.
- Parameters
-
| mympd_state | Pointer to myMPD state |
| partition_state | Pointer to myMPD partition state |
| album_cache | Pointer to album cache |
- Returns
- true on success, else false
◆ jukebox_trigger_script()
Executes the jukebox script trigger
- Parameters
-
| mympd_state | Pointer to myMPD state |
| partition_state | Pointer to myMPD partition state |
| add_to_queue | Add entries to MPD queue |
- Returns
- true on success, else false