alsahwdep 0.8.0

API binding for alsahwdep library
Documentation
// 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

use crate::{ffi, IfaceType};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    /// A GObject-derived object to express information of ALSA hwdep device.
    ///
    /// A [`DeviceInfo`][crate::DeviceInfo] is a GObject-derived object to express information of ALSA hwdep device.
    /// The call of [`DeviceCommonExt::device_info()`][crate::prelude::DeviceCommonExt::device_info()] returns an instance of the object.
    ///
    /// The object wraps `struct snd_hwdep_info` in UAPI of Linux sound subsystem.
    ///
    /// ## Properties
    ///
    ///
    /// #### `card-id`
    ///  The numeric ID of sound card.
    ///
    /// Readable | Writeable | Construct Only
    ///
    ///
    /// #### `device-id`
    ///  The numeric ID of device.
    ///
    /// Readable | Writeable | Construct Only
    ///
    ///
    /// #### `id`
    ///  The string ID of the hwdep device.
    ///
    /// Readable | Writeable | Construct Only
    ///
    ///
    /// #### `iface`
    ///  The type of interface for the hwdep device, one of ALSAHwdepIfaceType.
    ///
    /// Readable | Writeable | Construct Only
    ///
    ///
    /// #### `name`
    ///  The name of the hwdep device.
    ///
    /// Readable | Writeable | Construct Only
    ///
    /// # Implements
    ///
    /// [`DeviceInfoExt`][trait@crate::prelude::DeviceInfoExt]
    #[doc(alias = "ALSAHwdepDeviceInfo")]
    pub struct DeviceInfo(Object<ffi::ALSAHwdepDeviceInfo, ffi::ALSAHwdepDeviceInfoClass>);

    match fn {
        type_ => || ffi::alsahwdep_device_info_get_type(),
    }
}

impl DeviceInfo {
    pub const NONE: Option<&'static DeviceInfo> = None;
}

/// Trait containing all [`struct@DeviceInfo`] methods.
///
/// # Implementors
///
/// [`DeviceInfo`][struct@crate::DeviceInfo]
pub trait DeviceInfoExt: IsA<DeviceInfo> + 'static {
    /// The numeric ID of sound card.
    #[doc(alias = "card-id")]
    fn card_id(&self) -> i32 {
        ObjectExt::property(self.as_ref(), "card-id")
    }

    /// The numeric ID of device.
    #[doc(alias = "device-id")]
    fn device_id(&self) -> u32 {
        ObjectExt::property(self.as_ref(), "device-id")
    }

    /// The string ID of the hwdep device.
    fn id(&self) -> Option<glib::GString> {
        ObjectExt::property(self.as_ref(), "id")
    }

    /// The type of interface for the hwdep device, one of ALSAHwdepIfaceType.
    fn iface(&self) -> IfaceType {
        ObjectExt::property(self.as_ref(), "iface")
    }

    /// The name of the hwdep device.
    fn name(&self) -> Option<glib::GString> {
        ObjectExt::property(self.as_ref(), "name")
    }
}

impl<O: IsA<DeviceInfo>> DeviceInfoExt for O {}