MateMixerDevice

MateMixerDevice — Hardware or software device in the sound system

Synopsis

#include <libmatemixer/matemixer.h>

                    MateMixerDevice;
struct              MateMixerDeviceClass;
const gchar *       mate_mixer_device_get_name          (MateMixerDevice *device);
const gchar *       mate_mixer_device_get_label         (MateMixerDevice *device);
const gchar *       mate_mixer_device_get_icon          (MateMixerDevice *device);
MateMixerStream *   mate_mixer_device_get_stream        (MateMixerDevice *device,
                                                         const gchar *name);
MateMixerDeviceSwitch * mate_mixer_device_get_switch    (MateMixerDevice *device,
                                                         const gchar *name);
const GList *       mate_mixer_device_list_streams      (MateMixerDevice *device);
const GList *       mate_mixer_device_list_switches     (MateMixerDevice *device);

Object Hierarchy

  GObject
   +----MateMixerDevice

Properties

  "icon"                     gchar*                : Read / Write / Construct Only
  "label"                    gchar*                : Read / Write / Construct Only
  "name"                     gchar*                : Read / Write / Construct Only

Signals

  "stream-added"                                   : Run First
  "stream-removed"                                 : Run First
  "switch-added"                                   : Run First
  "switch-removed"                                 : Run First

Description

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

Each device may contain an arbitrary number of streams.

Details

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.

GObjectClass parent_class;

The parent class.

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().

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.

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.

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.

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().

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.

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.

device :

a MateMixerDevice

Returns :

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

Property Details

The "icon" property

  "icon"                     gchar*                : Read / Write / Construct Only

The XDG icon name of the device.

Default value: NULL


The "label" property

  "label"                    gchar*                : Read / Write / Construct Only

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

Default value: NULL


The "name" property

  "name"                     gchar*                : Read / Write / Construct Only

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

Default value: NULL

Signal Details

The "stream-added" signal

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

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.

device :

a MateMixerDevice

name :

name of the added stream

user_data :

user data set when the signal handler was connected.

The "stream-removed" signal

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

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().

device :

a MateMixerDevice

name :

name of the removed stream

user_data :

user data set when the signal handler was connected.

The "switch-added" signal

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

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

device :

a MateMixerDevice

name :

name of the added switch

user_data :

user data set when the signal handler was connected.

The "switch-removed" signal

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

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().

device :

a MateMixerDevice

name :

name of the removed switch

user_data :

user data set when the signal handler was connected.