// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

#![doc = include_str!("../README.md")]
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![allow(
    clippy::approx_constant,
    clippy::type_complexity,
    clippy::unreadable_literal,
    clippy::upper_case_acronyms
)]
#![cfg_attr(feature = "dox", feature(doc_cfg))]

#[allow(unused_imports)]
use libc::{
    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
    intptr_t, size_t, ssize_t, uintptr_t, FILE,
};

#[allow(unused_imports)]
use glib::{gboolean, gconstpointer, gpointer, GType};

// Enums
pub type ALSAHwdepDeviceCommonError = c_int;
pub const ALSAHWDEP_DEVICE_COMMON_ERROR_FAILED: ALSAHwdepDeviceCommonError = 1;
pub const ALSAHWDEP_DEVICE_COMMON_ERROR_IS_OPENED: ALSAHwdepDeviceCommonError = 2;
pub const ALSAHWDEP_DEVICE_COMMON_ERROR_IS_NOT_OPENED: ALSAHwdepDeviceCommonError = 3;
pub const ALSAHWDEP_DEVICE_COMMON_ERROR_IS_USED: ALSAHwdepDeviceCommonError = 4;
pub const ALSAHWDEP_DEVICE_COMMON_ERROR_IS_NOT_SUPPORTED: ALSAHwdepDeviceCommonError = 5;
pub const ALSAHWDEP_DEVICE_COMMON_ERROR_IS_DISCONNECTED: ALSAHwdepDeviceCommonError = 6;

pub type ALSAHwdepIfaceType = c_int;
pub const ALSAHWDEP_IFACE_TYPE_OPL2: ALSAHwdepIfaceType = 0;
pub const ALSAHWDEP_IFACE_TYPE_OPL3: ALSAHwdepIfaceType = 1;
pub const ALSAHWDEP_IFACE_TYPE_OPL4: ALSAHwdepIfaceType = 2;
pub const ALSAHWDEP_IFACE_TYPE_SB16CSP: ALSAHwdepIfaceType = 3;
pub const ALSAHWDEP_IFACE_TYPE_EMU10K1: ALSAHwdepIfaceType = 4;
pub const ALSAHWDEP_IFACE_TYPE_YSS225: ALSAHwdepIfaceType = 5;
pub const ALSAHWDEP_IFACE_TYPE_ICS2115: ALSAHwdepIfaceType = 6;
pub const ALSAHWDEP_IFACE_TYPE_SSCAPE: ALSAHwdepIfaceType = 7;
pub const ALSAHWDEP_IFACE_TYPE_VX: ALSAHwdepIfaceType = 8;
pub const ALSAHWDEP_IFACE_TYPE_MIXART: ALSAHwdepIfaceType = 9;
pub const ALSAHWDEP_IFACE_TYPE_USX2Y: ALSAHwdepIfaceType = 10;
pub const ALSAHWDEP_IFACE_TYPE_EMUX_WAVETABLE: ALSAHwdepIfaceType = 11;
pub const ALSAHWDEP_IFACE_TYPE_BLUETOOTH: ALSAHwdepIfaceType = 12;
pub const ALSAHWDEP_IFACE_TYPE_USX2Y_PCM: ALSAHwdepIfaceType = 13;
pub const ALSAHWDEP_IFACE_TYPE_PCXHR: ALSAHwdepIfaceType = 14;
pub const ALSAHWDEP_IFACE_TYPE_SB_RC: ALSAHwdepIfaceType = 15;
pub const ALSAHWDEP_IFACE_TYPE_HDA: ALSAHwdepIfaceType = 16;
pub const ALSAHWDEP_IFACE_TYPE_USB_STREAM: ALSAHwdepIfaceType = 17;
pub const ALSAHWDEP_IFACE_TYPE_FW_DICE: ALSAHwdepIfaceType = 18;
pub const ALSAHWDEP_IFACE_TYPE_FW_FIREWORKS: ALSAHwdepIfaceType = 19;
pub const ALSAHWDEP_IFACE_TYPE_FW_BEBOB: ALSAHwdepIfaceType = 20;
pub const ALSAHWDEP_IFACE_TYPE_FW_OXFW: ALSAHwdepIfaceType = 21;
pub const ALSAHWDEP_IFACE_TYPE_FW_DIGI00X: ALSAHwdepIfaceType = 22;
pub const ALSAHWDEP_IFACE_TYPE_FW_TASCAM: ALSAHwdepIfaceType = 23;
pub const ALSAHWDEP_IFACE_TYPE_LINE6: ALSAHwdepIfaceType = 24;
pub const ALSAHWDEP_IFACE_TYPE_FW_MOTU: ALSAHwdepIfaceType = 25;
pub const ALSAHWDEP_IFACE_TYPE_FW_FIREFACE: ALSAHwdepIfaceType = 26;

// Records
#[derive(Copy, Clone)]
#[repr(C)]
pub struct ALSAHwdepDeviceCommonInterface {
    pub parent_iface: gobject::GTypeInterface,
    pub open: Option<
        unsafe extern "C" fn(
            *mut ALSAHwdepDeviceCommon,
            *const c_char,
            c_int,
            *mut *mut glib::GError,
        ) -> gboolean,
    >,
    pub get_protocol_version: Option<
        unsafe extern "C" fn(
            *mut ALSAHwdepDeviceCommon,
            *const *mut [u16; 3],
            *mut *mut glib::GError,
        ) -> gboolean,
    >,
    pub get_device_info: Option<
        unsafe extern "C" fn(
            *mut ALSAHwdepDeviceCommon,
            *mut *mut ALSAHwdepDeviceInfo,
            *mut *mut glib::GError,
        ) -> gboolean,
    >,
    pub create_source: Option<
        unsafe extern "C" fn(
            *mut ALSAHwdepDeviceCommon,
            *mut *mut glib::GSource,
            *mut *mut glib::GError,
        ) -> gboolean,
    >,
    pub handle_disconnection: Option<unsafe extern "C" fn(*mut ALSAHwdepDeviceCommon)>,
}

impl ::std::fmt::Debug for ALSAHwdepDeviceCommonInterface {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("ALSAHwdepDeviceCommonInterface @ {:p}", self))
            .field("parent_iface", &self.parent_iface)
            .field("open", &self.open)
            .field("get_protocol_version", &self.get_protocol_version)
            .field("get_device_info", &self.get_device_info)
            .field("create_source", &self.create_source)
            .field("handle_disconnection", &self.handle_disconnection)
            .finish()
    }
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct ALSAHwdepDeviceInfoClass {
    pub parent_class: gobject::GObjectClass,
}

impl ::std::fmt::Debug for ALSAHwdepDeviceInfoClass {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("ALSAHwdepDeviceInfoClass @ {:p}", self))
            .field("parent_class", &self.parent_class)
            .finish()
    }
}

// Classes
#[derive(Copy, Clone)]
#[repr(C)]
pub struct ALSAHwdepDeviceInfo {
    pub parent_instance: gobject::GObject,
}

impl ::std::fmt::Debug for ALSAHwdepDeviceInfo {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("ALSAHwdepDeviceInfo @ {:p}", self))
            .field("parent_instance", &self.parent_instance)
            .finish()
    }
}

// Interfaces
#[repr(C)]
pub struct ALSAHwdepDeviceCommon {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for ALSAHwdepDeviceCommon {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        write!(f, "ALSAHwdepDeviceCommon @ {:p}", self)
    }
}

#[link(name = "alsahwdep")]
extern "C" {

    //=========================================================================
    // ALSAHwdepDeviceCommonError
    //=========================================================================
    pub fn alsahwdep_device_common_error_get_type() -> GType;
    pub fn alsahwdep_device_common_error_quark() -> glib::GQuark;
    pub fn alsahwdep_device_common_error_to_label(
        code: ALSAHwdepDeviceCommonError,
        label: *mut *const c_char,
    );

    //=========================================================================
    // ALSAHwdepIfaceType
    //=========================================================================
    pub fn alsahwdep_iface_type_get_type() -> GType;

    //=========================================================================
    // ALSAHwdepDeviceInfo
    //=========================================================================
    pub fn alsahwdep_device_info_get_type() -> GType;

    //=========================================================================
    // ALSAHwdepDeviceCommon
    //=========================================================================
    pub fn alsahwdep_device_common_get_type() -> GType;
    pub fn alsahwdep_device_common_create_source(
        self_: *mut ALSAHwdepDeviceCommon,
        source: *mut *mut glib::GSource,
        error: *mut *mut glib::GError,
    ) -> gboolean;
    pub fn alsahwdep_device_common_get_device_info(
        self_: *mut ALSAHwdepDeviceCommon,
        device_info: *mut *mut ALSAHwdepDeviceInfo,
        error: *mut *mut glib::GError,
    ) -> gboolean;
    pub fn alsahwdep_device_common_get_protocol_version(
        self_: *mut ALSAHwdepDeviceCommon,
        proto_ver_triplet: *const *mut [u16; 3],
        error: *mut *mut glib::GError,
    ) -> gboolean;
    pub fn alsahwdep_device_common_open(
        self_: *mut ALSAHwdepDeviceCommon,
        card_id: c_uint,
        device_id: c_uint,
        open_flag: c_int,
        error: *mut *mut glib::GError,
    ) -> gboolean;

    //=========================================================================
    // Other functions
    //=========================================================================
    pub fn alsahwdep_get_device_id_list(
        card_id: c_uint,
        entries: *mut *mut c_uint,
        entry_count: *mut size_t,
        error: *mut *mut glib::GError,
    ) -> gboolean;
    pub fn alsahwdep_get_device_info(
        card_id: c_uint,
        device_id: c_uint,
        device_info: *mut *mut ALSAHwdepDeviceInfo,
        error: *mut *mut glib::GError,
    ) -> gboolean;
    pub fn alsahwdep_get_hwdep_devnode(
        card_id: c_uint,
        device_id: c_uint,
        devnode: *mut *mut c_char,
        error: *mut *mut glib::GError,
    ) -> gboolean;
    pub fn alsahwdep_get_hwdep_sysname(
        card_id: c_uint,
        device_id: c_uint,
        sysname: *mut *mut c_char,
        error: *mut *mut glib::GError,
    ) -> gboolean;

}
