module GI.Gst.Objects.DeviceMonitor
(
DeviceMonitor(..) ,
IsDeviceMonitor ,
toDeviceMonitor ,
noDeviceMonitor ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorAddFilterMethodInfo ,
#endif
deviceMonitorAddFilter ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorGetBusMethodInfo ,
#endif
deviceMonitorGetBus ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorGetDevicesMethodInfo ,
#endif
deviceMonitorGetDevices ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorGetProvidersMethodInfo ,
#endif
deviceMonitorGetProviders ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorGetShowAllDevicesMethodInfo,
#endif
deviceMonitorGetShowAllDevices ,
deviceMonitorNew ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorRemoveFilterMethodInfo ,
#endif
deviceMonitorRemoveFilter ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorSetShowAllDevicesMethodInfo,
#endif
deviceMonitorSetShowAllDevices ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorStartMethodInfo ,
#endif
deviceMonitorStart ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorStopMethodInfo ,
#endif
deviceMonitorStop ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DeviceMonitorShowAllPropertyInfo ,
#endif
constructDeviceMonitorShowAll ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
deviceMonitorShowAll ,
#endif
getDeviceMonitorShowAll ,
setDeviceMonitorShowAll ,
) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Objects.Bus as Gst.Bus
import qualified GI.Gst.Objects.Device as Gst.Device
import qualified GI.Gst.Objects.Object as Gst.Object
import qualified GI.Gst.Structs.Caps as Gst.Caps
newtype DeviceMonitor = DeviceMonitor (ManagedPtr DeviceMonitor)
foreign import ccall "gst_device_monitor_get_type"
c_gst_device_monitor_get_type :: IO GType
instance GObject DeviceMonitor where
gobjectType _ = c_gst_device_monitor_get_type
class GObject o => IsDeviceMonitor o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError DeviceMonitor a) =>
IsDeviceMonitor a
#endif
instance IsDeviceMonitor DeviceMonitor
instance Gst.Object.IsObject DeviceMonitor
instance GObject.Object.IsObject DeviceMonitor
toDeviceMonitor :: (MonadIO m, IsDeviceMonitor o) => o -> m DeviceMonitor
toDeviceMonitor = liftIO . unsafeCastTo DeviceMonitor
noDeviceMonitor :: Maybe DeviceMonitor
noDeviceMonitor = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveDeviceMonitorMethod (t :: Symbol) (o :: *) :: * where
ResolveDeviceMonitorMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveDeviceMonitorMethod "addFilter" o = DeviceMonitorAddFilterMethodInfo
ResolveDeviceMonitorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDeviceMonitorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDeviceMonitorMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveDeviceMonitorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDeviceMonitorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDeviceMonitorMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveDeviceMonitorMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveDeviceMonitorMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveDeviceMonitorMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveDeviceMonitorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDeviceMonitorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDeviceMonitorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDeviceMonitorMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveDeviceMonitorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDeviceMonitorMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveDeviceMonitorMethod "removeFilter" o = DeviceMonitorRemoveFilterMethodInfo
ResolveDeviceMonitorMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveDeviceMonitorMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveDeviceMonitorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDeviceMonitorMethod "start" o = DeviceMonitorStartMethodInfo
ResolveDeviceMonitorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDeviceMonitorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDeviceMonitorMethod "stop" o = DeviceMonitorStopMethodInfo
ResolveDeviceMonitorMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveDeviceMonitorMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveDeviceMonitorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDeviceMonitorMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveDeviceMonitorMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveDeviceMonitorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDeviceMonitorMethod "getBus" o = DeviceMonitorGetBusMethodInfo
ResolveDeviceMonitorMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveDeviceMonitorMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveDeviceMonitorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDeviceMonitorMethod "getDevices" o = DeviceMonitorGetDevicesMethodInfo
ResolveDeviceMonitorMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveDeviceMonitorMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveDeviceMonitorMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveDeviceMonitorMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveDeviceMonitorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDeviceMonitorMethod "getProviders" o = DeviceMonitorGetProvidersMethodInfo
ResolveDeviceMonitorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDeviceMonitorMethod "getShowAllDevices" o = DeviceMonitorGetShowAllDevicesMethodInfo
ResolveDeviceMonitorMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveDeviceMonitorMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveDeviceMonitorMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveDeviceMonitorMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveDeviceMonitorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDeviceMonitorMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveDeviceMonitorMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveDeviceMonitorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDeviceMonitorMethod "setShowAllDevices" o = DeviceMonitorSetShowAllDevicesMethodInfo
ResolveDeviceMonitorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDeviceMonitorMethod t DeviceMonitor, O.MethodInfo info DeviceMonitor p) => O.IsLabelProxy t (DeviceMonitor -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDeviceMonitorMethod t DeviceMonitor, O.MethodInfo info DeviceMonitor p) => O.IsLabel t (DeviceMonitor -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
getDeviceMonitorShowAll :: (MonadIO m, IsDeviceMonitor o) => o -> m Bool
getDeviceMonitorShowAll obj = liftIO $ getObjectPropertyBool obj "show-all"
setDeviceMonitorShowAll :: (MonadIO m, IsDeviceMonitor o) => o -> Bool -> m ()
setDeviceMonitorShowAll obj val = liftIO $ setObjectPropertyBool obj "show-all" val
constructDeviceMonitorShowAll :: (IsDeviceMonitor o) => Bool -> IO (GValueConstruct o)
constructDeviceMonitorShowAll val = constructObjectPropertyBool "show-all" val
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorShowAllPropertyInfo
instance AttrInfo DeviceMonitorShowAllPropertyInfo where
type AttrAllowedOps DeviceMonitorShowAllPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DeviceMonitorShowAllPropertyInfo = (~) Bool
type AttrBaseTypeConstraint DeviceMonitorShowAllPropertyInfo = IsDeviceMonitor
type AttrGetType DeviceMonitorShowAllPropertyInfo = Bool
type AttrLabel DeviceMonitorShowAllPropertyInfo = "show-all"
type AttrOrigin DeviceMonitorShowAllPropertyInfo = DeviceMonitor
attrGet _ = getDeviceMonitorShowAll
attrSet _ = setDeviceMonitorShowAll
attrConstruct _ = constructDeviceMonitorShowAll
attrClear _ = undefined
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList DeviceMonitor
type instance O.AttributeList DeviceMonitor = DeviceMonitorAttributeList
type DeviceMonitorAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("showAll", DeviceMonitorShowAllPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
deviceMonitorShowAll :: AttrLabelProxy "showAll"
deviceMonitorShowAll = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList DeviceMonitor = DeviceMonitorSignalList
type DeviceMonitorSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_device_monitor_new" gst_device_monitor_new ::
IO (Ptr DeviceMonitor)
deviceMonitorNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m DeviceMonitor
deviceMonitorNew = liftIO $ do
result <- gst_device_monitor_new
checkUnexpectedReturnNULL "deviceMonitorNew" result
result' <- (wrapObject DeviceMonitor) result
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
foreign import ccall "gst_device_monitor_add_filter" gst_device_monitor_add_filter ::
Ptr DeviceMonitor ->
CString ->
Ptr Gst.Caps.Caps ->
IO Word32
deviceMonitorAddFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> Maybe (T.Text)
-> Maybe (Gst.Caps.Caps)
-> m Word32
deviceMonitorAddFilter monitor classes caps = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
maybeClasses <- case classes of
Nothing -> return nullPtr
Just jClasses -> do
jClasses' <- textToCString jClasses
return jClasses'
maybeCaps <- case caps of
Nothing -> return nullPtr
Just jCaps -> do
jCaps' <- unsafeManagedPtrGetPtr jCaps
return jCaps'
result <- gst_device_monitor_add_filter monitor' maybeClasses maybeCaps
touchManagedPtr monitor
whenJust caps touchManagedPtr
freeMem maybeClasses
return result
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorAddFilterMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (Gst.Caps.Caps) -> m Word32), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorAddFilterMethodInfo a signature where
overloadedMethod _ = deviceMonitorAddFilter
#endif
foreign import ccall "gst_device_monitor_get_bus" gst_device_monitor_get_bus ::
Ptr DeviceMonitor ->
IO (Ptr Gst.Bus.Bus)
deviceMonitorGetBus ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> m Gst.Bus.Bus
deviceMonitorGetBus monitor = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
result <- gst_device_monitor_get_bus monitor'
checkUnexpectedReturnNULL "deviceMonitorGetBus" result
result' <- (wrapObject Gst.Bus.Bus) result
touchManagedPtr monitor
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorGetBusMethodInfo
instance (signature ~ (m Gst.Bus.Bus), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorGetBusMethodInfo a signature where
overloadedMethod _ = deviceMonitorGetBus
#endif
foreign import ccall "gst_device_monitor_get_devices" gst_device_monitor_get_devices ::
Ptr DeviceMonitor ->
IO (Ptr (GList (Ptr Gst.Device.Device)))
deviceMonitorGetDevices ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> m [Gst.Device.Device]
deviceMonitorGetDevices monitor = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
result <- gst_device_monitor_get_devices monitor'
result' <- unpackGList result
result'' <- mapM (wrapObject Gst.Device.Device) result'
g_list_free result
touchManagedPtr monitor
return result''
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorGetDevicesMethodInfo
instance (signature ~ (m [Gst.Device.Device]), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorGetDevicesMethodInfo a signature where
overloadedMethod _ = deviceMonitorGetDevices
#endif
foreign import ccall "gst_device_monitor_get_providers" gst_device_monitor_get_providers ::
Ptr DeviceMonitor ->
IO (Ptr CString)
deviceMonitorGetProviders ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> m [T.Text]
deviceMonitorGetProviders monitor = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
result <- gst_device_monitor_get_providers monitor'
checkUnexpectedReturnNULL "deviceMonitorGetProviders" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr monitor
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorGetProvidersMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorGetProvidersMethodInfo a signature where
overloadedMethod _ = deviceMonitorGetProviders
#endif
foreign import ccall "gst_device_monitor_get_show_all_devices" gst_device_monitor_get_show_all_devices ::
Ptr DeviceMonitor ->
IO CInt
deviceMonitorGetShowAllDevices ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> m Bool
deviceMonitorGetShowAllDevices monitor = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
result <- gst_device_monitor_get_show_all_devices monitor'
let result' = (/= 0) result
touchManagedPtr monitor
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorGetShowAllDevicesMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorGetShowAllDevicesMethodInfo a signature where
overloadedMethod _ = deviceMonitorGetShowAllDevices
#endif
foreign import ccall "gst_device_monitor_remove_filter" gst_device_monitor_remove_filter ::
Ptr DeviceMonitor ->
Word32 ->
IO CInt
deviceMonitorRemoveFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> Word32
-> m Bool
deviceMonitorRemoveFilter monitor filterId = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
result <- gst_device_monitor_remove_filter monitor' filterId
let result' = (/= 0) result
touchManagedPtr monitor
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorRemoveFilterMethodInfo
instance (signature ~ (Word32 -> m Bool), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorRemoveFilterMethodInfo a signature where
overloadedMethod _ = deviceMonitorRemoveFilter
#endif
foreign import ccall "gst_device_monitor_set_show_all_devices" gst_device_monitor_set_show_all_devices ::
Ptr DeviceMonitor ->
CInt ->
IO ()
deviceMonitorSetShowAllDevices ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> Bool
-> m ()
deviceMonitorSetShowAllDevices monitor showAll = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
let showAll' = (fromIntegral . fromEnum) showAll
gst_device_monitor_set_show_all_devices monitor' showAll'
touchManagedPtr monitor
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorSetShowAllDevicesMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorSetShowAllDevicesMethodInfo a signature where
overloadedMethod _ = deviceMonitorSetShowAllDevices
#endif
foreign import ccall "gst_device_monitor_start" gst_device_monitor_start ::
Ptr DeviceMonitor ->
IO CInt
deviceMonitorStart ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> m Bool
deviceMonitorStart monitor = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
result <- gst_device_monitor_start monitor'
let result' = (/= 0) result
touchManagedPtr monitor
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorStartMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorStartMethodInfo a signature where
overloadedMethod _ = deviceMonitorStart
#endif
foreign import ccall "gst_device_monitor_stop" gst_device_monitor_stop ::
Ptr DeviceMonitor ->
IO ()
deviceMonitorStop ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceMonitor a) =>
a
-> m ()
deviceMonitorStop monitor = liftIO $ do
monitor' <- unsafeManagedPtrCastPtr monitor
gst_device_monitor_stop monitor'
touchManagedPtr monitor
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DeviceMonitorStopMethodInfo
instance (signature ~ (m ()), MonadIO m, IsDeviceMonitor a) => O.MethodInfo DeviceMonitorStopMethodInfo a signature where
overloadedMethod _ = deviceMonitorStop
#endif