* @ALSACTL_CARD_ERROR_FAILED: The system call failed.
* @ALSACTL_CARD_ERROR_DISCONNECTED: The card associated to the instance is in disconnect state.
* @ALSACTL_CARD_ERROR_ELEM_NOT_FOUND: The control element not found in the card.
+ * @ALSACTL_CARD_ERROR_ELEM_NOT_SUPPORTED: The operation is not supported by the control element.
*
* A set of error code for GError with domain which equals to #alsactl_card_error_quark()
*/
ALSACTL_CARD_ERROR_FAILED,
ALSACTL_CARD_ERROR_DISCONNECTED,
ALSACTL_CARD_ERROR_ELEM_NOT_FOUND,
+ ALSACTL_CARD_ERROR_ELEM_NOT_SUPPORTED,
} ALSACtlCardError;
#endif
static const char *const err_msgs[] = {
[ALSACTL_CARD_ERROR_DISCONNECTED] = "The card associated to the instance is in disconnect state",
[ALSACTL_CARD_ERROR_ELEM_NOT_FOUND] = "The control element not found in the card",
+ [ALSACTL_CARD_ERROR_ELEM_NOT_SUPPORTED] = "The operation is not supported by the control element.",
};
#define generate_local_error(exception, code) \
generate_local_error(error, ALSACTL_CARD_ERROR_DISCONNECTED);
else if (errno == ENOENT)
generate_local_error(error, ALSACTL_CARD_ERROR_ELEM_NOT_FOUND);
+ else if (errno == EPERM)
+ generate_local_error(error, ALSACTL_CARD_ERROR_ELEM_NOT_SUPPORTED);
else
generate_syscall_error(error, errno, "ioctl(%s)", "ELEM_WRITE");
}
generate_local_error(error, ALSACTL_CARD_ERROR_DISCONNECTED);
else if (errno == ENOENT)
generate_local_error(error, ALSACTL_CARD_ERROR_ELEM_NOT_FOUND);
+ else if (errno == EPERM)
+ generate_local_error(error, ALSACTL_CARD_ERROR_ELEM_NOT_SUPPORTED);
else
generate_syscall_error(error, errno, "ioctl(%s)", "ELEM_READ");
}