Interface
ALSAHwdepDeviceCommon
Description [src]
interface ALSAHwdep.DeviceCommon : GObject.Object
An interface to express common features of ALSA HwDep device.
A ALSAHwdepDeviceCommon should be implemented by any type of ALSA HwDep device.
| Available since: | 0.3. |
Prerequisite
In order to implement DeviceCommon, your type must inherit from
GObject.
Instance methods
alsahwdep_device_common_create_source
Allocate GSource structure to handle events from ALSA hwdep character device. In
each iteration of GMainContext, the read(2) system call is executed to dispatch
hwdep event, according to the result of poll(2) system call.
alsahwdep_device_common_get_device_info
Get the information according to given numeric IDs for card and device. The call of function is
expected to executes ioctl(2) system call with SNDRV_CTL_IOCTL_HWDEP_INFO command to the
character device.
alsahwdep_device_common_get_protocol_version
Get the version of hwdep protocol used currently. The version is expressed as the array with three elements; major, minor, and micro version in the order. The length of major version is 16 bit, the length of minor and micro version is 8 bit each.
alsahwdep_device_common_open
Open one of ALSA hwdep character devices for the sound card.
Signals
ALSAHwdep.DeviceCommon::handle-disconnection
Emitted when the sound card is not available anymore due to unbinding driver or hot
unplugging. The owner of the object should prepare to call g_object_unref()
so that ALSA HwDep character device is going to be closed and sound card is released.
Interface structure
struct ALSAHwdepDeviceCommonInterface {
GTypeInterface parent_iface;
gboolean (* open) (
ALSAHwdepDeviceCommon* self,
const gchar* path,
gint open_flag,
GError** error
);
gboolean (* get_protocol_version) (
ALSAHwdepDeviceCommon* self,
guint16* const* proto_ver_triplet,
GError** error
);
gboolean (* get_device_info) (
ALSAHwdepDeviceCommon* self,
ALSAHwdepDeviceInfo** device_info,
GError** error
);
gboolean (* create_source) (
ALSAHwdepDeviceCommon* self,
GSource** source,
GError** error
);
void (* handle_disconnection) (
ALSAHwdepDeviceCommon* self
);
}
Interface members
parent_iface |
|
| No description available. | |
open |
|
| No description available. | |
get_protocol_version |
|
| No description available. | |
get_device_info |
|
| No description available. | |
create_source |
|
| No description available. | |
handle_disconnection |
|
| No description available. |
Virtual methods
ALSAHwdep.DeviceCommon.create_source
Allocate GSource structure to handle events from ALSA hwdep character device. In
each iteration of GMainContext, the read(2) system call is executed to dispatch
hwdep event, according to the result of poll(2) system call.
ALSAHwdep.DeviceCommon.get_device_info
Get the information according to given numeric IDs for card and device. The call of function is
expected to executes ioctl(2) system call with SNDRV_CTL_IOCTL_HWDEP_INFO command to the
character device.
ALSAHwdep.DeviceCommon.get_protocol_version
Get the version of hwdep protocol used currently. The version is expressed as the array with three elements; major, minor, and micro version in the order. The length of major version is 16 bit, the length of minor and micro version is 8 bit each.
ALSAHwdep.DeviceCommon.handle_disconnection
Closure for the ALSAHwdepDeviceCommon::handle-disconnection signal.
ALSAHwdep.DeviceCommon.open
Open one of ALSA hwdep character devices for the sound card.