MateMixerDevice: libmatemixer Reference Manual

## MateMixerDevice MateMixerDevice — Hardware or software device in the sound system |

## Functions

const gchar * | mate_mixer_device_get_name ()
const gchar * | mate_mixer_device_get_label ()
const gchar * | mate_mixer_device_get_icon ()
MateMixerStream * | mate_mixer_device_get_stream ()
MateMixerDeviceSwitch * | mate_mixer_device_get_switch ()
const GList * | mate_mixer_device_list_streams ()
const GList * | mate_mixer_device_list_switches ()

## Properties

gchar * | icon | Read / Write / Construct Only
gchar * | label | Read / Write / Construct Only
gchar * | name | Read / Write / Construct Only

## Signals

void | stream-added | Run First
void | stream-removed | Run First
void | switch-added | Run First
void | switch-removed | Run First

## Types and Values

| MateMixerDevice
struct | MateMixerDeviceClass

## Object Hierarchy

        GObject
        ╰── MateMixerDevice

## Includes

    #include <libmatemixer/matemixer.h>

## Description

A MateMixerDevice represents a sound device, most typically a sound card.

Each device may contain an arbitrary number of streams.

## Functions

### mate_mixer_device_get_name ()

    const gchar *
    mate_mixer_device_get_name (MateMixerDevice *device);

Gets the name of the device.

The name serves as a unique identifier and in most cases it is not in a user-readable form.

The returned name is guaranteed to be unique across all the known devices and may be used to get the MateMixerDevice using `mate_mixer_context_get_device()`.

#### Parameters

device | a MateMixerDevice |

#### Returns

the name of the device.

### mate_mixer_device_get_label ()

    const gchar *
    mate_mixer_device_get_label (MateMixerDevice *device);

Gets the label of the device.

This is a potentially translated string that should be presented to users in the user interface.

#### Parameters

device | a MateMixerDevice |

#### Returns

the label of the device.

### mate_mixer_device_get_icon ()

    const gchar *
    mate_mixer_device_get_icon (MateMixerDevice *device);

Gets the XDG icon name of the device.

#### Parameters

device | a MateMixerDevice |

#### Returns

the icon name or `NULL`.

### mate_mixer_device_get_stream ()

    MateMixerStream *
    mate_mixer_device_get_stream (MateMixerDevice *device,
                                  const gchar *name);

Gets the device stream with the given name.

#### Parameters

device | a MateMixerDevice |
name | a stream name |

#### Returns

a MateMixerStream or `NULL` if there is no such stream.

### mate_mixer_device_get_switch ()

    MateMixerDeviceSwitch *
    mate_mixer_device_get_switch (MateMixerDevice *device,
                                  const gchar *name);

Gets the device switch with the given name.

Note that this function will only return a switch that belongs to the device and not to a stream of the device. See `mate_mixer_device_list_switches()` for information about the difference between device and stream switches.

To get a stream switch, rather than a device switch, use `mate_mixer_stream_get_switch()`.

#### Parameters

device | a MateMixerDevice |
name | a switch name |

#### Returns

a MateMixerDeviceSwitch or `NULL` if there is no such device switch.

### mate_mixer_device_list_streams ()

    const GList *
    mate_mixer_device_list_streams (MateMixerDevice *device);

Gets the list of streams that belong to the device.

The returned GList is owned by the MateMixerDevice and may be invalidated at any time.

#### Parameters

device | a MateMixerDevice |

#### Returns

a GList of the device streams or `NULL` if the device does not have any streams.

### mate_mixer_device_list_switches ()

    const GList *
    mate_mixer_device_list_switches (MateMixerDevice *device);

Gets the list of switches the belong to the device.

Note that a switch may belong either to a device, or to a stream. Unlike stream switches, device switches returned by this function are not classified as input or output (as streams are), but they operate on the whole device.

Use `mate_mixer_stream_list_switches()` to get a list of switches that belong to a stream.

The returned GList is owned by the MateMixerDevice and may be invalidated at any time.

#### Parameters

device | a MateMixerDevice |

#### Returns

a GList of the device switches or `NULL` if the device does not have any switches.

## Types and Values

### MateMixerDevice

    typedef struct _MateMixerDevice MateMixerDevice;

The MateMixerDevice structure contains only private data and should only be accessed using the provided API.

### struct MateMixerDeviceClass

    struct MateMixerDeviceClass {
        GObjectClass parent_class;
    };

The class structure for MateMixerDevice.

#### Members

## Property Details

### The `“icon”` property

      “icon”                     gchar *

The XDG icon name of the device.

Owner: MateMixerDevice

Flags: Read / Write / Construct Only

Default value: NULL

### The `“label”` property

      “label”                    gchar *

The label of the device. This is a potentially translated string that should be presented to users in the user interface.

Owner: MateMixerDevice

Flags: Read / Write / Construct Only

Default value: NULL

### The `“name”` property

      “name”                     gchar *

The name of the device. The name serves as a unique identifier and in most cases it is not in a user-readable form.

Owner: MateMixerDevice

Flags: Read / Write / Construct Only

Default value: NULL

## Signal Details

### The `“stream-added”` signal

    void
    user_function (MateMixerDevice *device,
                   gchar           *name,
                   gpointer         user_data)

The signal is emitted each time a device stream is added.

Note that at the time this signal is emitted, the controls and switches of the stream may not yet be known.

#### Parameters

device | a MateMixerDevice |
name | name of the added stream |
user_data | user data set when the signal handler was connected. |

Flags: Run First

### The `“stream-removed”` signal

    void
    user_function (MateMixerDevice *device,
                   gchar           *name,
                   gpointer         user_data)

The signal is emitted each time a device stream is removed.

When this signal is emitted, the stream is no longer known to the library, it will not be included in the stream list provided by the `mate_mixer_device_list_streams()` function and it is not possible to get the stream with `mate_mixer_device_get_stream()`.

#### Parameters

device | a MateMixerDevice |
name | name of the removed stream |
user_data | user data set when the signal handler was connected. |

Flags: Run First

### The `“switch-added”` signal

    void
    user_function (MateMixerDevice *device,
                   gchar           *name,
                   gpointer         user_data)

The signal is emitted each time a device switch is added.

#### Parameters

device | a MateMixerDevice |
name | name of the added switch |
user_data | user data set when the signal handler was connected. |

Flags: Run First

### The `“switch-removed”` signal

    void
    user_function (MateMixerDevice *device,
                   gchar           *name,
                   gpointer         user_data)

The signal is emitted each time a device switch is removed.

When this signal is emitted, the switch is no longer known to the library, it will not be included in the switch list provided by the `mate_mixer_device_list_switches()` function and it is not possible to get the switch with `mate_mixer_device_get_switch()`.

#### Parameters

device | a MateMixerDevice |
name | name of the removed switch |
user_data | user data set when the signal handler was connected. |

Flags: Run First