Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Device
are objects representing a device, they contain
relevant metadata about the device, such as its class and the Caps
representing the media types it can produce or handle.
Device
are created by DeviceProvider
objects which can be
aggregated by DeviceMonitor
objects.
- newtype Device = Device (ManagedPtr Device)
- class GObject o => IsDevice o
- toDevice :: (MonadIO m, IsDevice o) => o -> m Device
- noDevice :: Maybe Device
- deviceCreateElement :: (HasCallStack, MonadIO m, IsDevice a) => a -> Maybe Text -> m Element
- deviceGetCaps :: (HasCallStack, MonadIO m, IsDevice a) => a -> m Caps
- deviceGetDeviceClass :: (HasCallStack, MonadIO m, IsDevice a) => a -> m Text
- deviceGetDisplayName :: (HasCallStack, MonadIO m, IsDevice a) => a -> m Text
- deviceGetProperties :: (HasCallStack, MonadIO m, IsDevice a) => a -> m Structure
- deviceHasClasses :: (HasCallStack, MonadIO m, IsDevice a) => a -> Text -> m Bool
- deviceHasClassesv :: (HasCallStack, MonadIO m, IsDevice a) => a -> [Text] -> m Bool
- deviceReconfigureElement :: (HasCallStack, MonadIO m, IsDevice a, IsElement b) => a -> b -> m Bool
- constructDeviceCaps :: IsDevice o => Caps -> IO (GValueConstruct o)
- getDeviceCaps :: (MonadIO m, IsDevice o) => o -> m (Maybe Caps)
- constructDeviceDeviceClass :: IsDevice o => Text -> IO (GValueConstruct o)
- getDeviceDeviceClass :: (MonadIO m, IsDevice o) => o -> m (Maybe Text)
- constructDeviceDisplayName :: IsDevice o => Text -> IO (GValueConstruct o)
- getDeviceDisplayName :: (MonadIO m, IsDevice o) => o -> m (Maybe Text)
- constructDeviceProperties :: IsDevice o => Structure -> IO (GValueConstruct o)
- getDeviceProperties :: (MonadIO m, IsDevice o) => o -> m (Maybe Structure)
- type C_DeviceRemovedCallback = Ptr () -> Ptr () -> IO ()
- type DeviceRemovedCallback = IO ()
- afterDeviceRemoved :: (IsDevice a, MonadIO m) => a -> DeviceRemovedCallback -> m SignalHandlerId
- genClosure_DeviceRemoved :: DeviceRemovedCallback -> IO Closure
- mk_DeviceRemovedCallback :: C_DeviceRemovedCallback -> IO (FunPtr C_DeviceRemovedCallback)
- noDeviceRemovedCallback :: Maybe DeviceRemovedCallback
- onDeviceRemoved :: (IsDevice a, MonadIO m) => a -> DeviceRemovedCallback -> m SignalHandlerId
- wrap_DeviceRemovedCallback :: DeviceRemovedCallback -> Ptr () -> Ptr () -> IO ()
Exported types
Methods
createElement
:: (HasCallStack, MonadIO m, IsDevice a) | |
=> a |
|
-> Maybe Text |
|
-> m Element | Returns: a new |
Creates the element with all of the required parameters set to use this device.
Since: 1.4
getCaps
:: (HasCallStack, MonadIO m, IsDevice a) | |
=> a |
|
-> m Caps | Returns: The |
Getter for the Caps
that this device supports.
Since: 1.4
getDeviceClass
:: (HasCallStack, MonadIO m, IsDevice a) | |
=> a |
|
-> m Text | Returns: The device class. Free with |
Gets the "class" of a device. This is a "/" separated list of
classes that represent this device. They are a subset of the
classes of the DeviceProvider
that produced this device.
Since: 1.4
getDisplayName
:: (HasCallStack, MonadIO m, IsDevice a) | |
=> a |
|
-> m Text | Returns: The device name. Free with |
Gets the user-friendly name of the device.
Since: 1.4
getProperties
:: (HasCallStack, MonadIO m, IsDevice a) | |
=> a |
|
-> m Structure | Returns: The extra properties or |
Gets the extra properties of a device.
Since: 1.6
hasClasses
:: (HasCallStack, MonadIO m, IsDevice a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
Check if device
matches all of the given classes
Since: 1.4
hasClassesv
:: (HasCallStack, MonadIO m, IsDevice a) | |
=> a |
|
-> [Text] |
|
-> m Bool | Returns: |
Check if factory
matches all of the given classes
Since: 1.4
reconfigureElement
deviceReconfigureElement Source #
:: (HasCallStack, MonadIO m, IsDevice a, IsElement b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Tries to reconfigure an existing element to use the device. If this
function fails, then one must destroy the element and create a new one
using deviceCreateElement
.
Note: This should only be implemented for elements can change their device in the PLAYING state.
Since: 1.4
Properties
caps
constructDeviceCaps :: IsDevice o => Caps -> IO (GValueConstruct o) Source #
deviceClass
constructDeviceDeviceClass :: IsDevice o => Text -> IO (GValueConstruct o) Source #
displayName
constructDeviceDisplayName :: IsDevice o => Text -> IO (GValueConstruct o) Source #
properties
constructDeviceProperties :: IsDevice o => Structure -> IO (GValueConstruct o) Source #
Signals
removed
type DeviceRemovedCallback = IO () Source #
afterDeviceRemoved :: (IsDevice a, MonadIO m) => a -> DeviceRemovedCallback -> m SignalHandlerId Source #
onDeviceRemoved :: (IsDevice a, MonadIO m) => a -> DeviceRemovedCallback -> m SignalHandlerId Source #
wrap_DeviceRemovedCallback :: DeviceRemovedCallback -> Ptr () -> Ptr () -> IO () Source #