myMPD
Internal API documentation
Loading...
Searching...
No Matches
settings.h File Reference

myMPD settings API More...

#include "dist/sds/sds.h"
#include "src/lib/json/json_query.h"
#include "src/lib/mympd_state.h"
#include "src/lib/validate.h"
Include dependency graph for settings.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool settings_to_webserver (struct t_mympd_state *mympd_state)
 
void mympd_api_settings_statefiles_global_read (struct t_mympd_state *mympd_state)
 
void mympd_api_settings_statefiles_partition_read (struct t_partition_state *partition_state)
 
sds mympd_api_settings_get (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, sds buffer, unsigned request_id)
 
bool mympd_api_settings_view_save (struct t_mympd_state *mympd_state, sds view, sds mode, sds cols)
 
bool mympd_api_settings_set (const char *path, sds key, sds value, enum json_vtype vtype, validate_callback vcb, void *userdata, struct t_json_parse_error *error)
 
bool mympd_api_settings_mpd_options_set (const char *path, sds key, sds value, enum json_vtype vtype, validate_callback vcb, void *userdata, struct t_json_parse_error *error)
 
bool mympd_api_settings_connection_save (const char *path, sds key, sds value, enum json_vtype vtype, validate_callback vcb, void *userdata, struct t_json_parse_error *error)
 
bool mympd_api_settings_partition_set (const char *path, sds key, sds value, enum json_vtype vtype, validate_callback vcb, void *userdata, struct t_json_parse_error *error)
 

Detailed Description

myMPD settings API

Function Documentation

◆ mympd_api_settings_connection_save()

bool mympd_api_settings_connection_save ( const char *  path,
sds  key,
sds  value,
enum json_vtype  vtype,
validate_callback  vcb,
void *  userdata,
struct t_json_parse_error error 
)

Saves connection specific settings

Parameters
pathjsonrpc path
keysetting key
valuesetting value
vtypevalue type
vcbvalidation callback (unused)
userdatapointer to the t_mympd_state struct
errorpointer to t_json_parse_error
Returns
true on success, else false

◆ mympd_api_settings_get()

sds mympd_api_settings_get ( struct t_mympd_state mympd_state,
struct t_partition_state partition_state,
sds  buffer,
unsigned  request_id 
)

Prints all settings

Parameters
mympd_statepointer to mympd state
partition_statepointer to partition state
bufferalready allocated sds string to append the response
request_idjsonrpc request id
Returns
pointer to buffer

◆ mympd_api_settings_mpd_options_set()

bool mympd_api_settings_mpd_options_set ( const char *  path,
sds  key,
sds  value,
enum json_vtype  vtype,
validate_callback  vcb,
void *  userdata,
struct t_json_parse_error error 
)

Sets mpd options and jukebox settings

Parameters
pathjsonrpc path
keysetting key
valuesetting value
vtypevalue type
vcbvalidation callback (unused)
userdatapointer to the t_partition_state struct
errorpointer to t_json_parse_error
Returns
true on success, else false

◆ mympd_api_settings_partition_set()

bool mympd_api_settings_partition_set ( const char *  path,
sds  key,
sds  value,
enum json_vtype  vtype,
validate_callback  vcb,
void *  userdata,
struct t_json_parse_error error 
)

Saves partition settings

Parameters
pathjsonrpc path
keysetting key
valuesetting value
vtypevalue type
vcbvalidation callback (unused)
userdatapointer to partition state
errorpointer to t_json_parse_error
Returns
true on success, else false

◆ mympd_api_settings_set()

bool mympd_api_settings_set ( const char *  path,
sds  key,
sds  value,
enum json_vtype  vtype,
validate_callback  vcb,
void *  userdata,
struct t_json_parse_error error 
)

Saves settings

Parameters
pathjsonrpc path
keysetting key
valuesetting value
vtypevalue type
vcbvalidation callback (unused)
userdatapointer to central myMPD state
errorpointer to t_json_parse_error
Returns
true on success, else false

◆ mympd_api_settings_statefiles_global_read()

void mympd_api_settings_statefiles_global_read ( struct t_mympd_state mympd_state)

Reads the settings from the state files. If the state file does not exist, it is populated with the default value and created.

Parameters
mympd_statepointer to the t_mympd_state struct

◆ mympd_api_settings_statefiles_partition_read()

void mympd_api_settings_statefiles_partition_read ( struct t_partition_state partition_state)

Reads the partition specific settings from the state files. If the state file does not exist, it is populated with the default value and created.

Parameters
partition_statepointer to the t_partition_state struct

◆ mympd_api_settings_view_save()

bool mympd_api_settings_view_save ( struct t_mympd_state mympd_state,
sds  view,
sds  mode,
sds  fields 
)

Saves columns

Parameters
mympd_statepointer to the t_mympd_state struct
viewsave columns for this view
modemode for this view: table, grid
fieldsjson object with the columns
Returns
true on success, else false

◆ settings_to_webserver()

bool settings_to_webserver ( struct t_mympd_state mympd_state)

Pushes some settings to the webserver thread

Parameters
mympd_statepointer to central myMPD state
Returns
true on success, else false