{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gst.Objects.Device
(
Device(..) ,
IsDevice ,
toDevice ,
noDevice ,
#if defined(ENABLE_OVERLOADING)
ResolveDeviceMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DeviceCreateElementMethodInfo ,
#endif
deviceCreateElement ,
#if defined(ENABLE_OVERLOADING)
DeviceGetCapsMethodInfo ,
#endif
deviceGetCaps ,
#if defined(ENABLE_OVERLOADING)
DeviceGetDeviceClassMethodInfo ,
#endif
deviceGetDeviceClass ,
#if defined(ENABLE_OVERLOADING)
DeviceGetDisplayNameMethodInfo ,
#endif
deviceGetDisplayName ,
#if defined(ENABLE_OVERLOADING)
DeviceGetPropertiesMethodInfo ,
#endif
deviceGetProperties ,
#if defined(ENABLE_OVERLOADING)
DeviceHasClassesMethodInfo ,
#endif
deviceHasClasses ,
#if defined(ENABLE_OVERLOADING)
DeviceHasClassesvMethodInfo ,
#endif
deviceHasClassesv ,
#if defined(ENABLE_OVERLOADING)
DeviceReconfigureElementMethodInfo ,
#endif
deviceReconfigureElement ,
#if defined(ENABLE_OVERLOADING)
DeviceCapsPropertyInfo ,
#endif
constructDeviceCaps ,
#if defined(ENABLE_OVERLOADING)
deviceCaps ,
#endif
getDeviceCaps ,
#if defined(ENABLE_OVERLOADING)
DeviceDeviceClassPropertyInfo ,
#endif
constructDeviceDeviceClass ,
#if defined(ENABLE_OVERLOADING)
deviceDeviceClass ,
#endif
getDeviceDeviceClass ,
#if defined(ENABLE_OVERLOADING)
DeviceDisplayNamePropertyInfo ,
#endif
constructDeviceDisplayName ,
#if defined(ENABLE_OVERLOADING)
deviceDisplayName ,
#endif
getDeviceDisplayName ,
#if defined(ENABLE_OVERLOADING)
DevicePropertiesPropertyInfo ,
#endif
constructDeviceProperties ,
#if defined(ENABLE_OVERLOADING)
deviceProperties ,
#endif
getDeviceProperties ,
C_DeviceRemovedCallback ,
DeviceRemovedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceRemovedSignalInfo ,
#endif
afterDeviceRemoved ,
genClosure_DeviceRemoved ,
mk_DeviceRemovedCallback ,
noDeviceRemovedCallback ,
onDeviceRemoved ,
wrap_DeviceRemovedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gst.Objects.Element as Gst.Element
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Structs.Caps as Gst.Caps
import {-# SOURCE #-} qualified GI.Gst.Structs.Structure as Gst.Structure
newtype Device = Device (ManagedPtr Device)
deriving (Device -> Device -> Bool
(Device -> Device -> Bool)
-> (Device -> Device -> Bool) -> Eq Device
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Device -> Device -> Bool
$c/= :: Device -> Device -> Bool
== :: Device -> Device -> Bool
$c== :: Device -> Device -> Bool
Eq)
foreign import ccall "gst_device_get_type"
c_gst_device_get_type :: IO GType
instance GObject Device where
gobjectType :: IO GType
gobjectType = IO GType
c_gst_device_get_type
instance B.GValue.IsGValue Device where
toGValue :: Device -> IO GValue
toGValue o :: Device
o = do
GType
gtype <- IO GType
c_gst_device_get_type
Device -> (Ptr Device -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Device
o (GType -> (GValue -> Ptr Device -> IO ()) -> Ptr Device -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Device -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Device
fromGValue gv :: GValue
gv = do
Ptr Device
ptr <- GValue -> IO (Ptr Device)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Device)
(ManagedPtr Device -> Device) -> Ptr Device -> IO Device
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Device -> Device
Device Ptr Device
ptr
class (GObject o, O.IsDescendantOf Device o) => IsDevice o
instance (GObject o, O.IsDescendantOf Device o) => IsDevice o
instance O.HasParentTypes Device
type instance O.ParentTypes Device = '[Gst.Object.Object, GObject.Object.Object]
toDevice :: (MonadIO m, IsDevice o) => o -> m Device
toDevice :: o -> m Device
toDevice = IO Device -> m Device
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Device -> m Device) -> (o -> IO Device) -> o -> m Device
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Device -> Device) -> o -> IO Device
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Device -> Device
Device
noDevice :: Maybe Device
noDevice :: Maybe Device
noDevice = Maybe Device
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDeviceMethod (t :: Symbol) (o :: *) :: * where
ResolveDeviceMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveDeviceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDeviceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDeviceMethod "createElement" o = DeviceCreateElementMethodInfo
ResolveDeviceMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveDeviceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDeviceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDeviceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDeviceMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveDeviceMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveDeviceMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveDeviceMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveDeviceMethod "hasClasses" o = DeviceHasClassesMethodInfo
ResolveDeviceMethod "hasClassesv" o = DeviceHasClassesvMethodInfo
ResolveDeviceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDeviceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDeviceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDeviceMethod "reconfigureElement" o = DeviceReconfigureElementMethodInfo
ResolveDeviceMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveDeviceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDeviceMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveDeviceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDeviceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDeviceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDeviceMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveDeviceMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveDeviceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDeviceMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveDeviceMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveDeviceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDeviceMethod "getCaps" o = DeviceGetCapsMethodInfo
ResolveDeviceMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveDeviceMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveDeviceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDeviceMethod "getDeviceClass" o = DeviceGetDeviceClassMethodInfo
ResolveDeviceMethod "getDisplayName" o = DeviceGetDisplayNameMethodInfo
ResolveDeviceMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveDeviceMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveDeviceMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveDeviceMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveDeviceMethod "getProperties" o = DeviceGetPropertiesMethodInfo
ResolveDeviceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDeviceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDeviceMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveDeviceMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveDeviceMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveDeviceMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveDeviceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDeviceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDeviceMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveDeviceMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveDeviceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDeviceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDeviceMethod t Device, O.MethodInfo info Device p) => OL.IsLabel t (Device -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type DeviceRemovedCallback =
IO ()
noDeviceRemovedCallback :: Maybe DeviceRemovedCallback
noDeviceRemovedCallback :: Maybe (IO ())
noDeviceRemovedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_DeviceRemovedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceRemovedCallback :: C_DeviceRemovedCallback -> IO (FunPtr C_DeviceRemovedCallback)
genClosure_DeviceRemoved :: MonadIO m => DeviceRemovedCallback -> m (GClosure C_DeviceRemovedCallback)
genClosure_DeviceRemoved :: IO () -> m (GClosure C_DeviceRemovedCallback)
genClosure_DeviceRemoved cb :: IO ()
cb = IO (GClosure C_DeviceRemovedCallback)
-> m (GClosure C_DeviceRemovedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DeviceRemovedCallback)
-> m (GClosure C_DeviceRemovedCallback))
-> IO (GClosure C_DeviceRemovedCallback)
-> m (GClosure C_DeviceRemovedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceRemovedCallback
cb' = IO () -> C_DeviceRemovedCallback
wrap_DeviceRemovedCallback IO ()
cb
C_DeviceRemovedCallback -> IO (FunPtr C_DeviceRemovedCallback)
mk_DeviceRemovedCallback C_DeviceRemovedCallback
cb' IO (FunPtr C_DeviceRemovedCallback)
-> (FunPtr C_DeviceRemovedCallback
-> IO (GClosure C_DeviceRemovedCallback))
-> IO (GClosure C_DeviceRemovedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DeviceRemovedCallback
-> IO (GClosure C_DeviceRemovedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DeviceRemovedCallback ::
DeviceRemovedCallback ->
C_DeviceRemovedCallback
wrap_DeviceRemovedCallback :: IO () -> C_DeviceRemovedCallback
wrap_DeviceRemovedCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onDeviceRemoved :: (IsDevice a, MonadIO m) => a -> DeviceRemovedCallback -> m SignalHandlerId
onDeviceRemoved :: a -> IO () -> m SignalHandlerId
onDeviceRemoved obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceRemovedCallback
cb' = IO () -> C_DeviceRemovedCallback
wrap_DeviceRemovedCallback IO ()
cb
FunPtr C_DeviceRemovedCallback
cb'' <- C_DeviceRemovedCallback -> IO (FunPtr C_DeviceRemovedCallback)
mk_DeviceRemovedCallback C_DeviceRemovedCallback
cb'
a
-> Text
-> FunPtr C_DeviceRemovedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "removed" FunPtr C_DeviceRemovedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDeviceRemoved :: (IsDevice a, MonadIO m) => a -> DeviceRemovedCallback -> m SignalHandlerId
afterDeviceRemoved :: a -> IO () -> m SignalHandlerId
afterDeviceRemoved obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceRemovedCallback
cb' = IO () -> C_DeviceRemovedCallback
wrap_DeviceRemovedCallback IO ()
cb
FunPtr C_DeviceRemovedCallback
cb'' <- C_DeviceRemovedCallback -> IO (FunPtr C_DeviceRemovedCallback)
mk_DeviceRemovedCallback C_DeviceRemovedCallback
cb'
a
-> Text
-> FunPtr C_DeviceRemovedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "removed" FunPtr C_DeviceRemovedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DeviceRemovedSignalInfo
instance SignalInfo DeviceRemovedSignalInfo where
type HaskellCallbackType DeviceRemovedSignalInfo = DeviceRemovedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DeviceRemovedCallback cb
cb'' <- mk_DeviceRemovedCallback cb'
connectSignalFunPtr obj "removed" cb'' connectMode detail
#endif
getDeviceCaps :: (MonadIO m, IsDevice o) => o -> m (Maybe Gst.Caps.Caps)
getDeviceCaps :: o -> m (Maybe Caps)
getDeviceCaps obj :: o
obj = IO (Maybe Caps) -> m (Maybe Caps)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Caps) -> m (Maybe Caps))
-> IO (Maybe Caps) -> m (Maybe Caps)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Caps -> Caps) -> IO (Maybe Caps)
forall a b.
(GObject a, BoxedObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj "caps" ManagedPtr Caps -> Caps
Gst.Caps.Caps
constructDeviceCaps :: (IsDevice o) => Gst.Caps.Caps -> IO (GValueConstruct o)
constructDeviceCaps :: Caps -> IO (GValueConstruct o)
constructDeviceCaps val :: Caps
val = String -> Maybe Caps -> IO (GValueConstruct o)
forall a o.
BoxedObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed "caps" (Caps -> Maybe Caps
forall a. a -> Maybe a
Just Caps
val)
#if defined(ENABLE_OVERLOADING)
data DeviceCapsPropertyInfo
instance AttrInfo DeviceCapsPropertyInfo where
type AttrAllowedOps DeviceCapsPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceCapsPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceCapsPropertyInfo = (~) Gst.Caps.Caps
type AttrTransferTypeConstraint DeviceCapsPropertyInfo = (~) Gst.Caps.Caps
type AttrTransferType DeviceCapsPropertyInfo = Gst.Caps.Caps
type AttrGetType DeviceCapsPropertyInfo = (Maybe Gst.Caps.Caps)
type AttrLabel DeviceCapsPropertyInfo = "caps"
type AttrOrigin DeviceCapsPropertyInfo = Device
attrGet = getDeviceCaps
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceCaps
attrClear = undefined
#endif
getDeviceDeviceClass :: (MonadIO m, IsDevice o) => o -> m (Maybe T.Text)
getDeviceDeviceClass :: o -> m (Maybe Text)
getDeviceDeviceClass obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "device-class"
constructDeviceDeviceClass :: (IsDevice o) => T.Text -> IO (GValueConstruct o)
constructDeviceDeviceClass :: Text -> IO (GValueConstruct o)
constructDeviceDeviceClass val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "device-class" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DeviceDeviceClassPropertyInfo
instance AttrInfo DeviceDeviceClassPropertyInfo where
type AttrAllowedOps DeviceDeviceClassPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceDeviceClassPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceDeviceClassPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DeviceDeviceClassPropertyInfo = (~) T.Text
type AttrTransferType DeviceDeviceClassPropertyInfo = T.Text
type AttrGetType DeviceDeviceClassPropertyInfo = (Maybe T.Text)
type AttrLabel DeviceDeviceClassPropertyInfo = "device-class"
type AttrOrigin DeviceDeviceClassPropertyInfo = Device
attrGet = getDeviceDeviceClass
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceDeviceClass
attrClear = undefined
#endif
getDeviceDisplayName :: (MonadIO m, IsDevice o) => o -> m (Maybe T.Text)
getDeviceDisplayName :: o -> m (Maybe Text)
getDeviceDisplayName obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "display-name"
constructDeviceDisplayName :: (IsDevice o) => T.Text -> IO (GValueConstruct o)
constructDeviceDisplayName :: Text -> IO (GValueConstruct o)
constructDeviceDisplayName val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "display-name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DeviceDisplayNamePropertyInfo
instance AttrInfo DeviceDisplayNamePropertyInfo where
type AttrAllowedOps DeviceDisplayNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceDisplayNamePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceDisplayNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DeviceDisplayNamePropertyInfo = (~) T.Text
type AttrTransferType DeviceDisplayNamePropertyInfo = T.Text
type AttrGetType DeviceDisplayNamePropertyInfo = (Maybe T.Text)
type AttrLabel DeviceDisplayNamePropertyInfo = "display-name"
type AttrOrigin DeviceDisplayNamePropertyInfo = Device
attrGet = getDeviceDisplayName
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceDisplayName
attrClear = undefined
#endif
getDeviceProperties :: (MonadIO m, IsDevice o) => o -> m (Maybe Gst.Structure.Structure)
getDeviceProperties :: o -> m (Maybe Structure)
getDeviceProperties obj :: o
obj = IO (Maybe Structure) -> m (Maybe Structure)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Structure) -> m (Maybe Structure))
-> IO (Maybe Structure) -> m (Maybe Structure)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr Structure -> Structure)
-> IO (Maybe Structure)
forall a b.
(GObject a, BoxedObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj "properties" ManagedPtr Structure -> Structure
Gst.Structure.Structure
constructDeviceProperties :: (IsDevice o) => Gst.Structure.Structure -> IO (GValueConstruct o)
constructDeviceProperties :: Structure -> IO (GValueConstruct o)
constructDeviceProperties val :: Structure
val = String -> Maybe Structure -> IO (GValueConstruct o)
forall a o.
BoxedObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed "properties" (Structure -> Maybe Structure
forall a. a -> Maybe a
Just Structure
val)
#if defined(ENABLE_OVERLOADING)
data DevicePropertiesPropertyInfo
instance AttrInfo DevicePropertiesPropertyInfo where
type AttrAllowedOps DevicePropertiesPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DevicePropertiesPropertyInfo = IsDevice
type AttrSetTypeConstraint DevicePropertiesPropertyInfo = (~) Gst.Structure.Structure
type AttrTransferTypeConstraint DevicePropertiesPropertyInfo = (~) Gst.Structure.Structure
type AttrTransferType DevicePropertiesPropertyInfo = Gst.Structure.Structure
type AttrGetType DevicePropertiesPropertyInfo = (Maybe Gst.Structure.Structure)
type AttrLabel DevicePropertiesPropertyInfo = "properties"
type AttrOrigin DevicePropertiesPropertyInfo = Device
attrGet = getDeviceProperties
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceProperties
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Device
type instance O.AttributeList Device = DeviceAttributeList
type DeviceAttributeList = ('[ '("caps", DeviceCapsPropertyInfo), '("deviceClass", DeviceDeviceClassPropertyInfo), '("displayName", DeviceDisplayNamePropertyInfo), '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("properties", DevicePropertiesPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
deviceCaps :: AttrLabelProxy "caps"
deviceCaps = AttrLabelProxy
deviceDeviceClass :: AttrLabelProxy "deviceClass"
deviceDeviceClass = AttrLabelProxy
deviceDisplayName :: AttrLabelProxy "displayName"
deviceDisplayName = AttrLabelProxy
deviceProperties :: AttrLabelProxy "properties"
deviceProperties = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Device = DeviceSignalList
type DeviceSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("removed", DeviceRemovedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_device_create_element" gst_device_create_element ::
Ptr Device ->
CString ->
IO (Ptr Gst.Element.Element)
deviceCreateElement ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> Maybe (T.Text)
-> m (Maybe Gst.Element.Element)
deviceCreateElement :: a -> Maybe Text -> m (Maybe Element)
deviceCreateElement device :: a
device name :: Maybe Text
name = IO (Maybe Element) -> m (Maybe Element)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Element) -> m (Maybe Element))
-> IO (Maybe Element) -> m (Maybe Element)
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr CChar
maybeName <- case Maybe Text
name of
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jName :: Text
jName -> do
Ptr CChar
jName' <- Text -> IO (Ptr CChar)
textToCString Text
jName
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jName'
Ptr Element
result <- Ptr Device -> Ptr CChar -> IO (Ptr Element)
gst_device_create_element Ptr Device
device' Ptr CChar
maybeName
Maybe Element
maybeResult <- Ptr Element -> (Ptr Element -> IO Element) -> IO (Maybe Element)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Element
result ((Ptr Element -> IO Element) -> IO (Maybe Element))
-> (Ptr Element -> IO Element) -> IO (Maybe Element)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Element
result' -> do
Element
result'' <- ((ManagedPtr Element -> Element) -> Ptr Element -> IO Element
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Element -> Element
Gst.Element.Element) Ptr Element
result'
Element -> IO Element
forall (m :: * -> *) a. Monad m => a -> m a
return Element
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeName
Maybe Element -> IO (Maybe Element)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Element
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceCreateElementMethodInfo
instance (signature ~ (Maybe (T.Text) -> m (Maybe Gst.Element.Element)), MonadIO m, IsDevice a) => O.MethodInfo DeviceCreateElementMethodInfo a signature where
overloadedMethod = deviceCreateElement
#endif
foreign import ccall "gst_device_get_caps" gst_device_get_caps ::
Ptr Device ->
IO (Ptr Gst.Caps.Caps)
deviceGetCaps ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m (Maybe Gst.Caps.Caps)
deviceGetCaps :: a -> m (Maybe Caps)
deviceGetCaps device :: a
device = IO (Maybe Caps) -> m (Maybe Caps)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Caps) -> m (Maybe Caps))
-> IO (Maybe Caps) -> m (Maybe Caps)
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr Caps
result <- Ptr Device -> IO (Ptr Caps)
gst_device_get_caps Ptr Device
device'
Maybe Caps
maybeResult <- Ptr Caps -> (Ptr Caps -> IO Caps) -> IO (Maybe Caps)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Caps
result ((Ptr Caps -> IO Caps) -> IO (Maybe Caps))
-> (Ptr Caps -> IO Caps) -> IO (Maybe Caps)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Caps
result' -> do
Caps
result'' <- ((ManagedPtr Caps -> Caps) -> Ptr Caps -> IO Caps
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Caps -> Caps
Gst.Caps.Caps) Ptr Caps
result'
Caps -> IO Caps
forall (m :: * -> *) a. Monad m => a -> m a
return Caps
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Maybe Caps -> IO (Maybe Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Caps
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceGetCapsMethodInfo
instance (signature ~ (m (Maybe Gst.Caps.Caps)), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetCapsMethodInfo a signature where
overloadedMethod = deviceGetCaps
#endif
foreign import ccall "gst_device_get_device_class" gst_device_get_device_class ::
Ptr Device ->
IO CString
deviceGetDeviceClass ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m T.Text
deviceGetDeviceClass :: a -> m Text
deviceGetDeviceClass device :: a
device = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr CChar
result <- Ptr Device -> IO (Ptr CChar)
gst_device_get_device_class Ptr Device
device'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "deviceGetDeviceClass" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetDeviceClassMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetDeviceClassMethodInfo a signature where
overloadedMethod = deviceGetDeviceClass
#endif
foreign import ccall "gst_device_get_display_name" gst_device_get_display_name ::
Ptr Device ->
IO CString
deviceGetDisplayName ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m T.Text
deviceGetDisplayName :: a -> m Text
deviceGetDisplayName device :: a
device = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr CChar
result <- Ptr Device -> IO (Ptr CChar)
gst_device_get_display_name Ptr Device
device'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "deviceGetDisplayName" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetDisplayNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetDisplayNameMethodInfo a signature where
overloadedMethod = deviceGetDisplayName
#endif
foreign import ccall "gst_device_get_properties" gst_device_get_properties ::
Ptr Device ->
IO (Ptr Gst.Structure.Structure)
deviceGetProperties ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m (Maybe Gst.Structure.Structure)
deviceGetProperties :: a -> m (Maybe Structure)
deviceGetProperties device :: a
device = IO (Maybe Structure) -> m (Maybe Structure)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Structure) -> m (Maybe Structure))
-> IO (Maybe Structure) -> m (Maybe Structure)
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr Structure
result <- Ptr Device -> IO (Ptr Structure)
gst_device_get_properties Ptr Device
device'
Maybe Structure
maybeResult <- Ptr Structure
-> (Ptr Structure -> IO Structure) -> IO (Maybe Structure)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Structure
result ((Ptr Structure -> IO Structure) -> IO (Maybe Structure))
-> (Ptr Structure -> IO Structure) -> IO (Maybe Structure)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Structure
result' -> do
Structure
result'' <- ((ManagedPtr Structure -> Structure)
-> Ptr Structure -> IO Structure
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Structure -> Structure
Gst.Structure.Structure) Ptr Structure
result'
Structure -> IO Structure
forall (m :: * -> *) a. Monad m => a -> m a
return Structure
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Maybe Structure -> IO (Maybe Structure)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Structure
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceGetPropertiesMethodInfo
instance (signature ~ (m (Maybe Gst.Structure.Structure)), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetPropertiesMethodInfo a signature where
overloadedMethod = deviceGetProperties
#endif
foreign import ccall "gst_device_has_classes" gst_device_has_classes ::
Ptr Device ->
CString ->
IO CInt
deviceHasClasses ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> T.Text
-> m Bool
deviceHasClasses :: a -> Text -> m Bool
deviceHasClasses device :: a
device classes :: Text
classes = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr CChar
classes' <- Text -> IO (Ptr CChar)
textToCString Text
classes
CInt
result <- Ptr Device -> Ptr CChar -> IO CInt
gst_device_has_classes Ptr Device
device' Ptr CChar
classes'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
classes'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceHasClassesMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDevice a) => O.MethodInfo DeviceHasClassesMethodInfo a signature where
overloadedMethod = deviceHasClasses
#endif
foreign import ccall "gst_device_has_classesv" gst_device_has_classesv ::
Ptr Device ->
Ptr CString ->
IO CInt
deviceHasClassesv ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> [T.Text]
-> m Bool
deviceHasClassesv :: a -> [Text] -> m Bool
deviceHasClassesv device :: a
device classes :: [Text]
classes = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr (Ptr CChar)
classes' <- [Text] -> IO (Ptr (Ptr CChar))
packZeroTerminatedUTF8CArray [Text]
classes
CInt
result <- Ptr Device -> Ptr (Ptr CChar) -> IO CInt
gst_device_has_classesv Ptr Device
device' Ptr (Ptr CChar)
classes'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
(Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
classes'
Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
classes'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceHasClassesvMethodInfo
instance (signature ~ ([T.Text] -> m Bool), MonadIO m, IsDevice a) => O.MethodInfo DeviceHasClassesvMethodInfo a signature where
overloadedMethod = deviceHasClassesv
#endif
foreign import ccall "gst_device_reconfigure_element" gst_device_reconfigure_element ::
Ptr Device ->
Ptr Gst.Element.Element ->
IO CInt
deviceReconfigureElement ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a, Gst.Element.IsElement b) =>
a
-> b
-> m Bool
deviceReconfigureElement :: a -> b -> m Bool
deviceReconfigureElement device :: a
device element :: b
element = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr Element
element' <- b -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
element
CInt
result <- Ptr Device -> Ptr Element -> IO CInt
gst_device_reconfigure_element Ptr Device
device' Ptr Element
element'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
element
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceReconfigureElementMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsDevice a, Gst.Element.IsElement b) => O.MethodInfo DeviceReconfigureElementMethodInfo a signature where
overloadedMethod = deviceReconfigureElement
#endif