g_return_if_fail(ALSACTL_IS_CARD(self));
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
alsactl_get_control_devnode(card_id, &devnode, error);
if (*error != NULL)
return;
g_return_if_fail(ALSACTL_IS_CARD(self));
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (priv->fd < 0) {
generate_error(error, ENXIO);
return;
g_return_if_fail(ALSACTL_IS_CARD(self));
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
*card_info = g_object_new(ALSACTL_TYPE_CARD_INFO, NULL);
ctl_card_info_refer_private(*card_info, &info);
g_return_if_fail(ALSACTL_IS_CARD(self));
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
allocate_elem_ids(priv->fd, &list, error);
if (*error != NULL)
return;
g_return_if_fail(ALSACTL_IS_CARD(self));
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (lock)
ret = ioctl(priv->fd, SNDRV_CTL_IOCTL_ELEM_LOCK, elem_id);
else
g_return_if_fail(elem_id != NULL);
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
*elem_info = g_object_new(ALSACTL_TYPE_ELEM_INFO, NULL);
ctl_elem_info_refer_private(*elem_info, &info);
g_return_if_fail(elem_id != NULL);
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
// At least two quadlets should be included for type and length.
if (container == NULL || container_count < 2) {
generate_error(error, EINVAL);
g_return_if_fail(elem_id != NULL);
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
// At least two quadlets should be included for type and length.
if (*container == NULL || *container_count < 2) {
generate_error(error, EINVAL);
g_return_if_fail(elem_id != NULL);
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
// At least two quadlets should be included for type and length.
if (*container == NULL || *container_count < 2) {
generate_error(error, EINVAL);
break;
}
default:
- generate_error(error, ENXIO);
- return;
+ g_return_if_reached();
}
info->id = *elem_id;
g_return_if_fail(ALSACTL_IS_ELEM_INFO(elem_info));
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
add_or_replace_elems(priv->fd, elem_id, elem_count, elem_info, FALSE,
entries, error);
}
g_return_if_fail(ALSACTL_IS_ELEM_INFO(elem_info));
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
add_or_replace_elems(priv->fd, elem_id, elem_count, elem_info, TRUE,
entries, error);
}
g_return_if_fail(elem_id != NULL);
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (ioctl(priv->fd, SNDRV_CTL_IOCTL_ELEM_REMOVE, elem_id) < 0)
generate_error(error, errno);
}
g_return_if_fail(elem_id != NULL);
g_return_if_fail(ALSACTL_IS_ELEM_VALUE(elem_value));
+ g_return_if_fail(error == NULL || *error == NULL);
+
ctl_elem_value_refer_private((ALSACtlElemValue *)elem_value, &value);
value->id = *elem_id;
g_return_if_fail(elem_id != NULL);
g_return_if_fail(ALSACTL_IS_ELEM_VALUE(*elem_value));
+ g_return_if_fail(error == NULL || *error == NULL);
+
ctl_elem_value_refer_private(*elem_value, &value);
value->id = *elem_id;
g_return_if_fail(ALSACTL_IS_CARD(self));
priv = alsactl_card_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (priv->fd < 0) {
generate_error(error, ENXIO);
return;
*/
ALSACtlElemInfo *alsactl_elem_info_new(ALSACtlElemType elem_type, GError **error)
{
+ g_return_val_if_fail(error == NULL || *error == NULL, NULL);
+
switch (elem_type) {
case ALSACTL_ELEM_TYPE_BOOLEAN:
case ALSACTL_ELEM_TYPE_INTEGER:
g_return_if_fail(ALSACTL_IS_ELEM_INFO(self));
priv = alsactl_elem_info_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (priv->info.type != SNDRV_CTL_ELEM_TYPE_INTEGER) {
generate_error(error, ENXIO);
return;
g_return_if_fail(ALSACTL_IS_ELEM_INFO(self));
priv = alsactl_elem_info_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (priv->info.type != SNDRV_CTL_ELEM_TYPE_INTEGER) {
generate_error(error, ENXIO);
return;
g_return_if_fail(ALSACTL_IS_ELEM_INFO(self));
priv = alsactl_elem_info_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (priv->info.type != SNDRV_CTL_ELEM_TYPE_INTEGER64) {
generate_error(error, ENXIO);
return;
g_return_if_fail(ALSACTL_IS_ELEM_INFO(self));
priv = alsactl_elem_info_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (priv->info.type != SNDRV_CTL_ELEM_TYPE_INTEGER64) {
generate_error(error, ENXIO);
return;
g_return_if_fail(ALSACTL_IS_ELEM_INFO(self));
priv = alsactl_elem_info_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (priv->info.type != SNDRV_CTL_ELEM_TYPE_ENUMERATED) {
generate_error(error, ENXIO);
return;
g_return_if_fail(ALSACTL_IS_ELEM_INFO(self));
priv = alsactl_elem_info_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
+
if (priv->info.type != SNDRV_CTL_ELEM_TYPE_ENUMERATED) {
generate_error(error, ENXIO);
return;
generate_error(error, EINVAL);
return;
}
+ g_return_if_fail(error == NULL || *error == NULL);
prepare_udev_enum(&enumerator, error);
if (enumerator == NULL)
char *name;
g_return_if_fail(sysname != NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
allocate_sysname(&name, CARD_SYSNAME_TEMPLATE, card_id, error);
if (*error != NULL)
char *name;
g_return_if_fail(sysname != NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
allocate_sysname(&name, CONTROL_SYSNAME_TEMPLATE, card_id, error);
if (*error != NULL)
const char *node;
g_return_if_fail(devnode != NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
allocate_sysname(&sysname, CONTROL_SYSNAME_TEMPLATE, card_id, error);
if (*error != NULL)