Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
A DeviceProvider
subclass is provided by a plugin that handles devices
if there is a way to programmatically list connected devices. It can also
optionally provide updates to the list of connected devices.
Each DeviceProvider
subclass is a singleton, a plugin should
normally provide a single subclass for all devices.
Applications would normally use a DeviceMonitor
to monitor devices
from all relevant providers.
Since: 1.4
Synopsis
- newtype DeviceProvider = DeviceProvider (ManagedPtr DeviceProvider)
- class (GObject o, IsDescendantOf DeviceProvider o) => IsDeviceProvider o
- toDeviceProvider :: (MonadIO m, IsDeviceProvider o) => o -> m DeviceProvider
- noDeviceProvider :: Maybe DeviceProvider
- deviceProviderCanMonitor :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m Bool
- deviceProviderDeviceAdd :: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b) => a -> b -> m ()
- deviceProviderDeviceChanged :: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b, IsDevice c) => a -> b -> c -> m ()
- deviceProviderDeviceRemove :: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b) => a -> b -> m ()
- deviceProviderGetBus :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m Bus
- deviceProviderGetDevices :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m [Device]
- deviceProviderGetFactory :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m DeviceProviderFactory
- deviceProviderGetHiddenProviders :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m [Text]
- deviceProviderGetMetadata :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> Text -> m Text
- deviceProviderHideProvider :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> Text -> m ()
- deviceProviderRegister :: (HasCallStack, MonadIO m, IsPlugin a) => Maybe a -> Text -> Word32 -> GType -> m Bool
- deviceProviderStart :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m Bool
- deviceProviderStop :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m ()
- deviceProviderUnhideProvider :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> Text -> m ()
- type C_DeviceProviderProviderHiddenCallback = Ptr () -> CString -> Ptr () -> IO ()
- type DeviceProviderProviderHiddenCallback = Text -> IO ()
- afterDeviceProviderProviderHidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderHiddenCallback -> m SignalHandlerId
- genClosure_DeviceProviderProviderHidden :: MonadIO m => DeviceProviderProviderHiddenCallback -> m (GClosure C_DeviceProviderProviderHiddenCallback)
- mk_DeviceProviderProviderHiddenCallback :: C_DeviceProviderProviderHiddenCallback -> IO (FunPtr C_DeviceProviderProviderHiddenCallback)
- noDeviceProviderProviderHiddenCallback :: Maybe DeviceProviderProviderHiddenCallback
- onDeviceProviderProviderHidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderHiddenCallback -> m SignalHandlerId
- wrap_DeviceProviderProviderHiddenCallback :: DeviceProviderProviderHiddenCallback -> C_DeviceProviderProviderHiddenCallback
- type C_DeviceProviderProviderUnhiddenCallback = Ptr () -> CString -> Ptr () -> IO ()
- type DeviceProviderProviderUnhiddenCallback = Text -> IO ()
- afterDeviceProviderProviderUnhidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderUnhiddenCallback -> m SignalHandlerId
- genClosure_DeviceProviderProviderUnhidden :: MonadIO m => DeviceProviderProviderUnhiddenCallback -> m (GClosure C_DeviceProviderProviderUnhiddenCallback)
- mk_DeviceProviderProviderUnhiddenCallback :: C_DeviceProviderProviderUnhiddenCallback -> IO (FunPtr C_DeviceProviderProviderUnhiddenCallback)
- noDeviceProviderProviderUnhiddenCallback :: Maybe DeviceProviderProviderUnhiddenCallback
- onDeviceProviderProviderUnhidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderUnhiddenCallback -> m SignalHandlerId
- wrap_DeviceProviderProviderUnhiddenCallback :: DeviceProviderProviderUnhiddenCallback -> C_DeviceProviderProviderUnhiddenCallback
Exported types
newtype DeviceProvider Source #
Memory-managed wrapper type.
Instances
GObject DeviceProvider Source # | |
Defined in GI.Gst.Objects.DeviceProvider gobjectType :: IO GType # | |
HasParentTypes DeviceProvider Source # | |
Defined in GI.Gst.Objects.DeviceProvider | |
type ParentTypes DeviceProvider Source # | |
Defined in GI.Gst.Objects.DeviceProvider |
class (GObject o, IsDescendantOf DeviceProvider o) => IsDeviceProvider o Source #
Type class for types which can be safely cast to DeviceProvider
, for instance with toDeviceProvider
.
Instances
(GObject o, IsDescendantOf DeviceProvider o) => IsDeviceProvider o Source # | |
Defined in GI.Gst.Objects.DeviceProvider |
toDeviceProvider :: (MonadIO m, IsDeviceProvider o) => o -> m DeviceProvider Source #
Cast to DeviceProvider
, for types for which this is known to be safe. For general casts, use castTo
.
noDeviceProvider :: Maybe DeviceProvider Source #
A convenience alias for Nothing
:: Maybe
DeviceProvider
.
Methods
canMonitor
deviceProviderCanMonitor :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m Bool Source #
No description available in the introspection data.
deviceAdd
deviceProviderDeviceAdd Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b) | |
=> a |
|
-> b |
|
-> m () |
Posts a message on the provider's Bus
to inform applications that
a new device has been added.
This is for use by subclasses.
device
's reference count will be incremented, and any floating reference
will be removed (see gst_object_ref_sink()
).
Since: 1.4
deviceChanged
deviceProviderDeviceChanged Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b, IsDevice c) | |
=> a | |
-> b |
|
-> c |
|
-> m () |
This function is used when changedDevice
was modified into its new form
device
. This will post a DEVICE_CHANGED
message on the bus to let
the application know that the device was modified. Device
is immutable
for MT. safety purposes so this is an "atomic" way of letting the application
know when a device was modified.
Since: 1.16
deviceRemove
deviceProviderDeviceRemove Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b) | |
=> a |
|
-> b |
|
-> m () |
Posts a message on the provider's Bus
to inform applications that
a device has been removed.
This is for use by subclasses.
Since: 1.4
getBus
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> m Bus | Returns: a |
Gets the Bus
of this DeviceProvider
Since: 1.4
getDevices
deviceProviderGetDevices Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> m [Device] |
Gets a list of devices that this provider understands. This may actually probe the hardware if the provider is not currently started.
Since: 1.4
getFactory
deviceProviderGetFactory Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> m DeviceProviderFactory | Returns: the |
Retrieves the factory that was used to create this device provider.
Since: 1.4
getHiddenProviders
deviceProviderGetHiddenProviders Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> m [Text] | Returns:
a list of hidden providers factory names or |
Get the provider factory names of the DeviceProvider
instances that
are hidden by provider
.
Since: 1.6
getMetadata
deviceProviderGetMetadata Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: the metadata for |
Get metadata with key
in provider
.
Since: 1.14
hideProvider
deviceProviderHideProvider Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> Text |
|
-> m () |
Make provider
hide the devices from the factory with name
.
This function is used when provider
will also provide the devices reported
by provider factory name
. A monitor should stop monitoring the
device provider with name
to avoid duplicate devices.
Since: 1.6
register
deviceProviderRegister Source #
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> Maybe a |
|
-> Text |
|
-> Word32 |
|
-> GType |
|
-> m Bool |
Create a new device providerfactory capable of instantiating objects of the
type
and add the factory to plugin
.
Since: 1.4
start
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> m Bool | Returns: |
Starts providering the devices. This will cause GST_MESSAGE_DEVICE_ADDED
and GST_MESSAGE_DEVICE_REMOVED
messages to be posted on the provider's bus
when devices are added or removed from the system.
Since the DeviceProvider
is a singleton,
deviceProviderStart
may already have been called by another
user of the object, deviceProviderStop
needs to be called the same
number of times.
Since: 1.4
stop
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> m () |
Decreases the use-count by one. If the use count reaches zero, this
DeviceProvider
will stop providering the devices. This needs to be
called the same number of times that deviceProviderStart
was called.
Since: 1.4
unhideProvider
deviceProviderUnhideProvider Source #
:: (HasCallStack, MonadIO m, IsDeviceProvider a) | |
=> a |
|
-> Text |
|
-> m () |
Make provider
unhide the devices from factory name
.
This function is used when provider
will no longer provide the devices
reported by provider factory name
. A monitor should start
monitoring the devices from provider factory name
in order to see
all devices again.
Since: 1.6
Signals
providerHidden
type C_DeviceProviderProviderHiddenCallback = Ptr () -> CString -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type DeviceProviderProviderHiddenCallback = Text -> IO () Source #
No description available in the introspection data.
afterDeviceProviderProviderHidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderHiddenCallback -> m SignalHandlerId Source #
Connect a signal handler for the “provider-hidden
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
deviceProvider #providerHidden callback
genClosure_DeviceProviderProviderHidden :: MonadIO m => DeviceProviderProviderHiddenCallback -> m (GClosure C_DeviceProviderProviderHiddenCallback) Source #
Wrap the callback into a GClosure
.
mk_DeviceProviderProviderHiddenCallback :: C_DeviceProviderProviderHiddenCallback -> IO (FunPtr C_DeviceProviderProviderHiddenCallback) Source #
Generate a function pointer callable from C code, from a C_DeviceProviderProviderHiddenCallback
.
noDeviceProviderProviderHiddenCallback :: Maybe DeviceProviderProviderHiddenCallback Source #
A convenience synonym for
.Nothing
:: Maybe
DeviceProviderProviderHiddenCallback
onDeviceProviderProviderHidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderHiddenCallback -> m SignalHandlerId Source #
Connect a signal handler for the “provider-hidden
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
deviceProvider #providerHidden callback
wrap_DeviceProviderProviderHiddenCallback :: DeviceProviderProviderHiddenCallback -> C_DeviceProviderProviderHiddenCallback Source #
providerUnhidden
type = Ptr () -> CString -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderUnhiddenCallback -> m SignalHandlerId Source #
:: (Connect a signal handler for the “provider-unhidden
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
deviceProvider #providerUnhidden callback
MonadIO m => DeviceProviderProviderUnhiddenCallback -> m (GClosure C_DeviceProviderProviderUnhiddenCallback) Source #
::Wrap the callback into a GClosure
.
C_DeviceProviderProviderUnhiddenCallback -> IO (FunPtr C_DeviceProviderProviderUnhiddenCallback) Source #
::Generate a function pointer callable from C code, from a C_DeviceProviderProviderUnhiddenCallback
.
Maybe DeviceProviderProviderUnhiddenCallback Source #
::A convenience synonym for
.Nothing
:: Maybe
DeviceProviderProviderUnhiddenCallback
IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderUnhiddenCallback -> m SignalHandlerId Source #
:: (Connect a signal handler for the “provider-unhidden
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
deviceProvider #providerUnhidden callback