Header for prefs.c.
More...
#include <glib.h>
Go to the source code of this file.
|
void | prefs_load (void) |
|
void | prefs_save (void) |
|
void | prefs_ensure_save_dir (void) |
|
gboolean | prefs_get_boolean (const gchar *key, gboolean def) |
|
gint | prefs_get_integer (const gchar *key, gint def) |
|
gdouble | prefs_get_double (const gchar *key, gdouble def) |
|
gchar * | prefs_get_string (const gchar *key, const gchar *def) |
|
gdouble * | prefs_get_double_list (const gchar *key, gsize *n) |
|
gchar * | prefs_get_channel (const gchar *card) |
|
void | prefs_set_boolean (const gchar *key, gboolean value) |
|
void | prefs_set_integer (const gchar *key, gint value) |
|
void | prefs_set_double (const gchar *key, gdouble value) |
|
void | prefs_set_string (const gchar *key, const gchar *value) |
|
void | prefs_set_double_list (const gchar *key, gdouble *list, gsize n) |
|
void | prefs_set_channel (const gchar *card, const gchar *channel) |
|
Header for prefs.c.
Header for prefs.c.
Definition in file prefs.h.
◆ prefs_ensure_save_dir()
void prefs_ensure_save_dir |
( |
void |
| ) |
|
Checks if the preferences dir for saving is present and accessible. Creates it if doesn't exist. Reports errors via run_error_dialog().
Definition at line 405 of file prefs.c.
◆ prefs_get_boolean()
gboolean prefs_get_boolean |
( |
const gchar * |
key, |
|
|
gboolean |
def |
|
) |
| |
Gets a boolean value from preferences. On error, returns def as default value.
- Parameters
-
key | the specific settings key |
def | the default value to return on error |
- Returns
- the preference value or def on error
Definition at line 102 of file prefs.c.
◆ prefs_get_channel()
gchar* prefs_get_channel |
( |
const gchar * |
card | ) |
|
Gets the currently selected channel of the specified Alsa Card from the global keyFile and returns the result.
- Parameters
-
card | the Alsa Card to get the currently selected channel of |
- Returns
- the currently selected channel as newly allocated string, NULL on failure
Definition at line 259 of file prefs.c.
◆ prefs_get_double()
gdouble prefs_get_double |
( |
const gchar * |
key, |
|
|
gdouble |
def |
|
) |
| |
Gets a double value from preferences. On error, returns def as default value.
- Parameters
-
key | the specific settings key |
def | the default value to return on error |
- Returns
- the preference value or def on error
Definition at line 148 of file prefs.c.
◆ prefs_get_double_list()
gdouble* prefs_get_double_list |
( |
const gchar * |
key, |
|
|
gsize * |
n |
|
) |
| |
Gets a list of doubles from preferences. On error, returns NULL.
- Parameters
-
key | the specific settings key |
n | integer pointer that will contain the returned array size |
- Returns
- the preference value or NULL on error
Definition at line 206 of file prefs.c.
◆ prefs_get_integer()
gint prefs_get_integer |
( |
const gchar * |
key, |
|
|
gint |
def |
|
) |
| |
Gets an int value from a preferences. On error, returns def as default value.
- Parameters
-
key | the specific settings key |
def | the default value to return on error |
- Returns
- the preference value or def on error
Definition at line 125 of file prefs.c.
◆ prefs_get_string()
gchar* prefs_get_string |
( |
const gchar * |
key, |
|
|
const gchar * |
def |
|
) |
| |
Gets a string value from preferences. On error, returns def as default value.
- Parameters
-
key | the specific settings key |
def | the default value to return on error |
- Returns
- the preference value or def on error. Must be freed.
Definition at line 171 of file prefs.c.
◆ prefs_load()
Loads the preferences from the config file to the keyFile object (GKeyFile type). Creates the keyFile object if it doesn't exist.
Definition at line 344 of file prefs.c.
◆ prefs_save()
Save the preferences from the keyFile object to the config file.
Definition at line 381 of file prefs.c.
◆ prefs_set_boolean()
void prefs_set_boolean |
( |
const gchar * |
key, |
|
|
gboolean |
value |
|
) |
| |
Sets a boolean value to preferences.
- Parameters
-
key | the specific settings key |
value | the value to set |
Definition at line 273 of file prefs.c.
◆ prefs_set_channel()
void prefs_set_channel |
( |
const gchar * |
card, |
|
|
const gchar * |
channel |
|
) |
| |
Sets the channel for a given card in preferences.
- Parameters
-
card | the Alsa Card associated with the channel |
channel | the channel to save in the preferences. |
Definition at line 334 of file prefs.c.
◆ prefs_set_double()
void prefs_set_double |
( |
const gchar * |
key, |
|
|
gdouble |
value |
|
) |
| |
Sets a double value to preferences.
- Parameters
-
key | the specific settings key |
value | the value to set |
Definition at line 297 of file prefs.c.
◆ prefs_set_double_list()
void prefs_set_double_list |
( |
const gchar * |
key, |
|
|
gdouble * |
list, |
|
|
gsize |
n |
|
) |
| |
Sets a list of doubles to preferences.
- Parameters
-
key | the specific settings key |
list | the array of double values to set |
n | the array length |
Definition at line 322 of file prefs.c.
◆ prefs_set_integer()
void prefs_set_integer |
( |
const gchar * |
key, |
|
|
gint |
value |
|
) |
| |
Sets a integer value to preferences.
- Parameters
-
key | the specific settings key |
value | the value to set |
Definition at line 285 of file prefs.c.
◆ prefs_set_string()
void prefs_set_string |
( |
const gchar * |
key, |
|
|
const gchar * |
value |
|
) |
| |
Sets a string value to preferences.
- Parameters
-
key | the specific settings key |
value | the value to set |
Definition at line 309 of file prefs.c.