myMPD settings API
More...
|
| static void | set_invalid_value (struct t_json_parse_error *error, const char *path, sds key, sds value, const char *message) |
| |
| static void | set_invalid_field (struct t_json_parse_error *error, const char *path, sds key) |
| |
| static void | enable_set_conn_options (struct t_mympd_state *mympd_state) |
| |
| bool | settings_to_webserver (struct t_mympd_state *mympd_state) |
| |
| 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_view_save (struct t_mympd_state *mympd_state, sds view, sds mode, sds fields) |
| |
| 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_partition_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) |
| |
| 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) |
| |
◆ enable_set_conn_options()
| static void enable_set_conn_options |
( |
struct t_mympd_state * |
mympd_state | ) |
|
|
static |
Enables the set_conn_options flag for all partitions
- Parameters
-
| mympd_state | pointer to central myMPD state |
◆ mympd_api_settings_connection_save()
Saves connection specific settings
- Parameters
-
| path | jsonrpc path |
| key | setting key |
| value | setting value |
| vtype | value type |
| vcb | validation callback (unused) |
| userdata | pointer to the t_mympd_state struct |
| error | pointer to t_json_parse_error |
- Returns
- true on success, else false
◆ mympd_api_settings_get()
Prints all settings
- Parameters
-
| mympd_state | pointer to mympd state |
| partition_state | pointer to partition state |
| buffer | already allocated sds string to append the response |
| request_id | jsonrpc request id |
- Returns
- pointer to buffer
◆ mympd_api_settings_mpd_options_set()
Sets mpd options and jukebox settings
- Parameters
-
| path | jsonrpc path |
| key | setting key |
| value | setting value |
| vtype | value type |
| vcb | validation callback (unused) |
| userdata | pointer to the t_partition_state struct |
| error | pointer to t_json_parse_error |
- Returns
- true on success, else false
◆ mympd_api_settings_partition_set()
Saves partition settings
- Parameters
-
| path | jsonrpc path |
| key | setting key |
| value | setting value |
| vtype | value type |
| vcb | validation callback (unused) |
| userdata | pointer to partition state |
| error | pointer to t_json_parse_error |
- Returns
- true on success, else false
◆ mympd_api_settings_set()
Saves settings
- Parameters
-
| path | jsonrpc path |
| key | setting key |
| value | setting value |
| vtype | value type |
| vcb | validation callback (unused) |
| userdata | pointer to central myMPD state |
| error | pointer 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_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
-
◆ 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_state | pointer to the t_mympd_state struct |
| view | save columns for this view |
| mode | mode for this view: table, grid |
| fields | json object with the columns |
- Returns
- true on success, else false
◆ set_invalid_field()
| static void set_invalid_field |
( |
struct t_json_parse_error * |
error, |
|
|
const char * |
path, |
|
|
sds |
key |
|
) |
| |
|
static |
Helper function to set an error message
- Parameters
-
◆ set_invalid_value()
| static void set_invalid_value |
( |
struct t_json_parse_error * |
error, |
|
|
const char * |
path, |
|
|
sds |
key, |
|
|
sds |
value, |
|
|
const char * |
message |
|
) |
| |
|
static |
Private declarations
Privat functions Helper function to set an error message
- Parameters
-
| error | pointer to t_json_parse_error |
| path | jsonrpc path |
| key | setting key |
| value | setting value |
| message | the message to print, leave empty for generic invalid message |
◆ settings_to_webserver()
Pushes some settings to the webserver thread
- Parameters
-
| mympd_state | pointer to central myMPD state |
- Returns
- true on success, else false