myMPD
Internal API documentation
Loading...
Searching...
No Matches
mympd_state.c File Reference

Central myMPD state for the mympd_api thread. More...

#include "compile_time.h"
#include "src/lib/mympd_state.h"
#include "src/lib/cache/cache_rax_album.h"
#include "src/lib/event.h"
#include "src/lib/last_played.h"
#include "src/lib/mem.h"
#include "src/lib/sds_extras.h"
#include "src/lib/timer.h"
#include "src/lib/utility.h"
#include "src/lib/webradio.h"
#include "src/mympd_api/home.h"
#include "src/mympd_api/timer.h"
#include "src/mympd_api/trigger.h"
#include "src/mympd_client/presets.h"
#include <string.h>
Include dependency graph for mympd_state.c:

Functions

void mympd_state_save (struct t_mympd_state *mympd_state, bool free_data)
 
void mympd_state_default (struct t_mympd_state *mympd_state, struct t_config *config)
 
void mympd_state_free (struct t_mympd_state *mympd_state)
 
void mympd_mpd_state_default (struct t_mpd_state *mpd_state, struct t_config *config)
 
void mympd_mpd_state_copy (struct t_mpd_state *src, struct t_mpd_state *dst)
 
void mympd_mpd_state_features_default (struct t_mpd_features *feat)
 
void mympd_mpd_state_features_copy (struct t_mpd_features *src, struct t_mpd_features *dst)
 
void mympd_mpd_state_free (struct t_mpd_state *mpd_state)
 
void partition_state_default (struct t_partition_state *partition_state, const char *name, struct t_mpd_state *mpd_state, struct t_config *config)
 
void partition_state_free (struct t_partition_state *partition_state)
 
void jukebox_state_default (struct t_jukebox_state *jukebox_state)
 
void jukebox_state_free (struct t_jukebox_state *jukebox_state)
 
void jukebox_state_copy (struct t_jukebox_state *src, struct t_jukebox_state *dst)
 
void stickerdb_state_default (struct t_stickerdb_state *stickerdb, struct t_config *config)
 
void stickerdb_state_free (struct t_stickerdb_state *stickerdb)
 

Detailed Description

Central myMPD state for the mympd_api thread.

Function Documentation

◆ jukebox_state_copy()

void jukebox_state_copy ( struct t_jukebox_state src,
struct t_jukebox_state dst 
)

Copies the jukebox settings

Parameters
srcsource
dstdestination

◆ jukebox_state_default()

void jukebox_state_default ( struct t_jukebox_state jukebox_state)

Sets jukebox state defaults

Parameters
jukebox_statepointer to t_jukebox_state struct

◆ jukebox_state_free()

void jukebox_state_free ( struct t_jukebox_state jukebox_state)

Frees the t_jukebox_state struct

Parameters
jukebox_statepointer to t_jukebox_state struct

◆ mympd_mpd_state_copy()

void mympd_mpd_state_copy ( struct t_mpd_state src,
struct t_mpd_state dst 
)

Copy mpd state

Parameters
srcsource
dstdestination

◆ mympd_mpd_state_default()

void mympd_mpd_state_default ( struct t_mpd_state mpd_state,
struct t_config config 
)

Sets mpd_state defaults.

Parameters
mpd_statepointer to mpd_state
configpointer to static config

◆ mympd_mpd_state_features_copy()

void mympd_mpd_state_features_copy ( struct t_mpd_features src,
struct t_mpd_features dst 
)

Copy mpd state feature flags

Parameters
srcsource
dstdestination

◆ mympd_mpd_state_features_default()

void mympd_mpd_state_features_default ( struct t_mpd_features feat)

Sets all feature states to default

Parameters
featpointer to mpd feature struct

◆ mympd_mpd_state_free()

void mympd_mpd_state_free ( struct t_mpd_state mpd_state)

Frees the t_mpd_state struct

Parameters
mpd_statePointer to mpd_state

◆ mympd_state_default()

void mympd_state_default ( struct t_mympd_state mympd_state,
struct t_config config 
)

Sets mympd_state defaults.

Parameters
mympd_statepointer to central myMPD state
configpointer to static config

◆ mympd_state_free()

void mympd_state_free ( struct t_mympd_state mympd_state)

Frees the myMPD state, frees also the referenced structs.

Parameters
mympd_statepointer to central myMPD state

◆ mympd_state_save()

void mympd_state_save ( struct t_mympd_state mympd_state,
bool  free_data 
)

Saves in-memory states to disc. This is done on shutdown and on SIGHUP.

Parameters
mympd_statepointer to central myMPD state
free_datatrue=free the struct, else not

◆ partition_state_default()

void partition_state_default ( struct t_partition_state partition_state,
const char *  name,
struct t_mpd_state mpd_state,
struct t_config config 
)

Sets per partition state defaults

Parameters
partition_statepointer to t_partition_state struct
namepartition name
mpd_statepointer to shared mpd state
configpointer to static config

◆ partition_state_free()

void partition_state_free ( struct t_partition_state partition_state)

Frees the t_partition_state struct

Parameters
partition_statepointer to t_partition_state struct

◆ stickerdb_state_default()

void stickerdb_state_default ( struct t_stickerdb_state stickerdb,
struct t_config config 
)

Sets stickerdb state defaults

Parameters
stickerdbpointer to stickerdb state
configpointer to static config

◆ stickerdb_state_free()

void stickerdb_state_free ( struct t_stickerdb_state stickerdb)

Frees the t_stickerdb_state struct

Parameters
stickerdbpointer to struct