## BtSettings

BtSettings — base class for buzztard settings handling

## Synopsis

    #include <libbtcore/core.h>

    struct              BtSettings;
    gpointer            (*BtSettingsFactory)                (void);
    gchar *             bt_settings_determine_audiosink_name
                                                            (const BtSettings * const self);
    BtSettings *        bt_settings_make                    (void);
    void                bt_settings_set_factory             (BtSettingsFactory factory);

## Object Hierarchy

      GObject
       +----BtSettings
             +----BtGConfSettings

## Properties

      "audiosink"                gchar*                : Read / Write
      "channels"                 guint                 : Read / Write
      "coherence-upnp-active"    gboolean              : Read / Write
      "coherence-upnp-port"      guint                 : Read / Write
      "grid-density"             gchar*                : Read / Write
      "missing-machines"         gchar*                : Read / Write
      "news-seen"                guint                 : Read / Write
      "presented-tips"           gchar*                : Read / Write
      "record-folder"            gchar*                : Read / Write
      "sample-folder"            gchar*                : Read / Write
      "sample-rate"              guint                 : Read / Write
      "show-tips"                gboolean              : Read / Write
      "song-folder"              gchar*                : Read / Write
      "statusbar-hide"           gboolean              : Read / Write
      "system-audiosink"         gchar*                : Read
      "tabs-hide"                gboolean              : Read / Write
      "toolbar-hide"             gboolean              : Read / Write
      "toolbar-style"            gchar*                : Read
      "window-height"            gint                  : Read / Write
      "window-width"             gint                  : Read / Write
      "window-xpos"              gint                  : Read / Write
      "window-ypos"              gint                  : Read / Write

## Description

Under the gnome platform GConf is a locical choice for settings managment. Unfortunately there currently is no port of GConf for other platforms. This class wraps the settings management. Depending on what settings managment capabillities the `configure` script find on the system one of the subclasses (BtGConfSettings,BtPlainfileSettings) will be used.

In any case it is always sufficient to talk to this class instance. Single settings are accessed via normat `g_object_get()` and `g_object_set()` calls. If the backends supports it changes in the settings will be notified to the application by the GObject::notify signal.

## Details

### struct BtSettings

    struct BtSettings;

base object for a buzztard based settings

### BtSettingsFactory ()

    gpointer            (*BtSettingsFactory)                (void);

Factory method that creates a new settings instance.

Returns : | the setting implementation

### bt_settings_determine_audiosink_name ()

    gchar *             bt_settings_determine_audiosink_name
                                                            (const BtSettings * const self);

Check the settings for the configured audio sink. Pick a fallback if none has been chosen. Verify that the sink works.

`self` : | the settings
Returns : | the elemnt name, free when done.

### bt_settings_make ()

    BtSettings *        bt_settings_make                    (void);

Create a new instance. The type of the settings depends on the subsystem found during configuration run.

Settings are implemented as a singleton. Thus the first invocation will create the object and further calls will just give back a reference.

Returns : | the instance or `NULL` in case of an error

### bt_settings_set_factory ()

    void                bt_settings_set_factory             (BtSettingsFactory factory);

Set a factory method that creates a new settings instance. This is currently only used by the unit tests to exercise the applications under various conditions. Normal applications should NOT use it.

`factory` : | factory method

## Property Details

### The `"audiosink"` property

      "audiosink"                gchar*                : Read / Write

audio output gstreamer element.

Default value: "autoaudiosink"

### The `"channels"` property

      "channels"                 guint                 : Read / Write

number of audio output channels.

Allowed values: [1,2]

Default value: 2

### The `"coherence-upnp-active"` property

      "coherence-upnp-active"    gboolean              : Read / Write

activate Coherence UPnP based playback controller.

Default value: FALSE

### The `"coherence-upnp-port"` property

      "coherence-upnp-port"      guint                 : Read / Write

the port number for the communication with the coherence backend.

Default value: 7654

### The `"grid-density"` property

      "grid-density"             gchar*                : Read / Write

machine view grid detail level.

Default value: "low"

### The `"missing-machines"` property

      "missing-machines"         gchar*                : Read / Write

list of tip-numbers that were shown already.

Default value: NULL

### The `"news-seen"` property

      "news-seen"                guint                 : Read / Write

version number for that the user has seen the news.

Default value: 0

### The `"presented-tips"` property

      "presented-tips"           gchar*                : Read / Write

list of missing machines to ignore.

Default value: NULL

### The `"record-folder"` property

      "record-folder"            gchar*                : Read / Write

default directory for recordings.

Default value: "/home/buildd"

### The `"sample-folder"` property

      "sample-folder"            gchar*                : Read / Write

default directory for sample-waveforms.

Default value: "/home/buildd"

### The `"sample-rate"` property

      "sample-rate"              guint                 : Read / Write

audio output sample-rate.

Allowed values: [1,96000]

Default value: 44100

### The `"show-tips"` property

      "show-tips"                gboolean              : Read / Write

show tips on startup.

Default value: TRUE

### The `"song-folder"` property

      "song-folder"              gchar*                : Read / Write

default directory for songs.

Default value: "/home/buildd"

### The `"statusbar-hide"` property

      "statusbar-hide"           gboolean              : Read / Write

hide bottom statusbar.

Default value: FALSE

### The `"system-audiosink"` property

      "system-audiosink"         gchar*                : Read

system audio output gstreamer element.

Default value: "autoaudiosink"

### The `"tabs-hide"` property

      "tabs-hide"                gboolean              : Read / Write

hide main page tabs.

Default value: FALSE

### The `"toolbar-hide"` property

      "toolbar-hide"             gboolean              : Read / Write

hide main toolbar.

Default value: FALSE

### The `"toolbar-style"` property

      "toolbar-style"            gchar*                : Read

system tolbar style.

Default value: "both"

### The `"window-height"` property

      "window-height"            gint                  : Read / Write

last application window height.

Allowed values: >= -1

Default value: -1

### The `"window-width"` property

      "window-width"             gint                  : Read / Write

last application window width.

Allowed values: >= -1

Default value: -1

### The `"window-xpos"` property

      "window-xpos"              gint                  : Read / Write

last application window x-position.

Default value: 0

### The `"window-ypos"` property

      "window-ypos"              gint                  : Read / Write

last application window y-position.

Default value: 0