myMPD
Internal API documentation
Loading...
Searching...
No Matches
partition_state.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-3.0-or-later
3 myMPD (c) 2018-2026 Juergen Mang <mail@jcgames.de>
4 https://github.com/jcorporation/mympd
5*/
6
10
11#ifndef MYMPD_PARTITION_STATE_H
12#define MYMPD_PARTITION_STATE_H
13
14#include "dist/sds/sds.h"
18#include "src/lib/event.h"
19#include "src/lib/jukebox.h"
20#include "src/lib/list/list.h"
21
22#include <time.h>
23
28 struct t_config *config;
30 //mpd connection
31 struct mpd_connection *conn;
33 //track player states
35 int song_id;
40 struct mpd_song *song;
41 struct mpd_song *last_song;
42 unsigned queue_version;
43 unsigned queue_length;
49 time_t crossfade;
50 bool auto_play;
53 //partition
54 sds name;
60 enum mpd_idle idle_mask;
62 //local playback
63 unsigned mpd_stream_port;
65 //lists
68 //timers
72 //events
75};
76
80void partition_state_default(struct t_partition_state *partition_state, const char *name,
81 struct t_mpd_state *mpd_state, struct t_config *config);
82void partition_state_free(struct t_partition_state *partition_state);
83
84#endif
Central myMPD configuration definitions.
Event handling.
pfd_type
Definition event.h:21
Central myMPD state for the mympd_api thread.
Jukebox library.
Linked list implementation.
Central myMPD mpd state for the mympd_api thread.
mympd_mpd_conn_states
Definition mympd_mpd_state.h:22
void partition_state_default(struct t_partition_state *partition_state, const char *name, struct t_mpd_state *mpd_state, struct t_config *config)
Definition partition_state.c:29
void partition_state_free(struct t_partition_state *partition_state)
Definition partition_state.c:98
Definition config_def.h:22
Definition jukebox_state.h:22
Definition list.h:33
Definition mympd_mpd_state.h:56
Definition partition_state.h:27
int last_song_id
previous song id from queue
Definition partition_state.h:37
int song_pos
current song pos in queue
Definition partition_state.h:38
sds state_dir
partition state folder
Definition partition_state.h:57
bool is_default
flag for the mpd default partition
Definition partition_state.h:59
struct t_partition_state * next
pointer to next partition;
Definition partition_state.h:58
struct t_jukebox_state jukebox
jukebox
Definition partition_state.h:52
time_t song_end_time
timestamp at which current song should end (starttime + duration)
Definition partition_state.h:45
struct t_list last_played
last_played list
Definition partition_state.h:66
bool * repopulate_pfds
Pointer to repopulate state in mympd_state struct.
Definition partition_state.h:74
int song_id
current song id from queue
Definition partition_state.h:35
sds stream_uri
custom url for local playback
Definition partition_state.h:64
bool player_error
signals mpd player error condition
Definition partition_state.h:51
struct t_config * config
pointer to static config
Definition partition_state.h:28
enum mpd_idle idle_mask
mpd idle mask
Definition partition_state.h:60
unsigned mpd_stream_port
mpd http stream port setting
Definition partition_state.h:63
int last_skipped_id
last skipped event was fired for this song id
Definition partition_state.h:44
struct mpd_song * song
current song
Definition partition_state.h:40
bool set_conn_options
true if mpd connection options should be changed
Definition partition_state.h:61
unsigned queue_length
length of the queue
Definition partition_state.h:43
sds name
partition name
Definition partition_state.h:54
time_t last_song_end_time
timestamp at which previous song should end (starttime + duration)
Definition partition_state.h:46
time_t song_start_time
timestamp at which current song has started
Definition partition_state.h:47
int timer_fd_scrobble
Timerfd for scrobble event.
Definition partition_state.h:70
int timer_fd_jukebox
Timerfd for jukebox runs.
Definition partition_state.h:69
unsigned queue_version
queue version number (increments on queue change)
Definition partition_state.h:42
enum mpd_state play_state
mpd player state
Definition partition_state.h:34
struct mpd_song * last_song
previous song
Definition partition_state.h:41
struct t_list preset_list
Playback presets.
Definition partition_state.h:67
int next_song_id
next song id from queue
Definition partition_state.h:36
time_t song_duration
current song length
Definition partition_state.h:39
time_t crossfade
used for determine when to add next song from jukebox queue
Definition partition_state.h:49
int timer_fd_mpd_connect
Timerfd for mpd reconnection.
Definition partition_state.h:71
struct t_mpd_state * mpd_state
pointer to shared mpd state
Definition partition_state.h:29
struct mpd_connection * conn
mpd connection object from libmpdclient
Definition partition_state.h:31
enum mympd_mpd_conn_states conn_state
mpd connection state
Definition partition_state.h:32
sds highlight_color
highlight color
Definition partition_state.h:55
sds highlight_color_contrast
highlight contrast color
Definition partition_state.h:56
enum pfd_type waiting_events
Bitmask for events.
Definition partition_state.h:73
bool auto_play
start play if queue changes
Definition partition_state.h:50
time_t last_song_start_time
timestamp at which previous song has started
Definition partition_state.h:48