{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gst.Objects.Clock
(
Clock(..) ,
IsClock ,
toClock ,
#if defined(ENABLE_OVERLOADING)
ResolveClockMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ClockAddObservationMethodInfo ,
#endif
clockAddObservation ,
#if defined(ENABLE_OVERLOADING)
ClockAddObservationUnappliedMethodInfo ,
#endif
clockAddObservationUnapplied ,
#if defined(ENABLE_OVERLOADING)
ClockAdjustUnlockedMethodInfo ,
#endif
clockAdjustUnlocked ,
#if defined(ENABLE_OVERLOADING)
ClockAdjustWithCalibrationMethodInfo ,
#endif
clockAdjustWithCalibration ,
#if defined(ENABLE_OVERLOADING)
ClockGetCalibrationMethodInfo ,
#endif
clockGetCalibration ,
#if defined(ENABLE_OVERLOADING)
ClockGetInternalTimeMethodInfo ,
#endif
clockGetInternalTime ,
#if defined(ENABLE_OVERLOADING)
ClockGetMasterMethodInfo ,
#endif
clockGetMaster ,
#if defined(ENABLE_OVERLOADING)
ClockGetResolutionMethodInfo ,
#endif
clockGetResolution ,
#if defined(ENABLE_OVERLOADING)
ClockGetTimeMethodInfo ,
#endif
clockGetTime ,
#if defined(ENABLE_OVERLOADING)
ClockGetTimeoutMethodInfo ,
#endif
clockGetTimeout ,
clockIdCompareFunc ,
clockIdGetClock ,
clockIdGetTime ,
clockIdRef ,
clockIdUnref ,
clockIdUnschedule ,
clockIdUsesClock ,
clockIdWait ,
clockIdWaitAsync ,
#if defined(ENABLE_OVERLOADING)
ClockIsSyncedMethodInfo ,
#endif
clockIsSynced ,
#if defined(ENABLE_OVERLOADING)
ClockNewPeriodicIdMethodInfo ,
#endif
clockNewPeriodicId ,
#if defined(ENABLE_OVERLOADING)
ClockNewSingleShotIdMethodInfo ,
#endif
clockNewSingleShotId ,
#if defined(ENABLE_OVERLOADING)
ClockPeriodicIdReinitMethodInfo ,
#endif
clockPeriodicIdReinit ,
#if defined(ENABLE_OVERLOADING)
ClockSetCalibrationMethodInfo ,
#endif
clockSetCalibration ,
#if defined(ENABLE_OVERLOADING)
ClockSetMasterMethodInfo ,
#endif
clockSetMaster ,
#if defined(ENABLE_OVERLOADING)
ClockSetResolutionMethodInfo ,
#endif
clockSetResolution ,
#if defined(ENABLE_OVERLOADING)
ClockSetSyncedMethodInfo ,
#endif
clockSetSynced ,
#if defined(ENABLE_OVERLOADING)
ClockSetTimeoutMethodInfo ,
#endif
clockSetTimeout ,
#if defined(ENABLE_OVERLOADING)
ClockSingleShotIdReinitMethodInfo ,
#endif
clockSingleShotIdReinit ,
#if defined(ENABLE_OVERLOADING)
ClockUnadjustUnlockedMethodInfo ,
#endif
clockUnadjustUnlocked ,
#if defined(ENABLE_OVERLOADING)
ClockUnadjustWithCalibrationMethodInfo ,
#endif
clockUnadjustWithCalibration ,
#if defined(ENABLE_OVERLOADING)
ClockWaitForSyncMethodInfo ,
#endif
clockWaitForSync ,
#if defined(ENABLE_OVERLOADING)
ClockTimeoutPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
clockTimeout ,
#endif
constructClockTimeout ,
getClockTimeout ,
setClockTimeout ,
#if defined(ENABLE_OVERLOADING)
ClockWindowSizePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
clockWindowSize ,
#endif
constructClockWindowSize ,
getClockWindowSize ,
setClockWindowSize ,
#if defined(ENABLE_OVERLOADING)
ClockWindowThresholdPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
clockWindowThreshold ,
#endif
constructClockWindowThreshold ,
getClockWindowThreshold ,
setClockWindowThreshold ,
ClockSyncedCallback ,
#if defined(ENABLE_OVERLOADING)
ClockSyncedSignalInfo ,
#endif
afterClockSynced ,
onClockSynced ,
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
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 Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
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 GHC.Records as R
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Callbacks as Gst.Callbacks
import {-# SOURCE #-} qualified GI.Gst.Enums as Gst.Enums
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
newtype Clock = Clock (SP.ManagedPtr Clock)
deriving (Clock -> Clock -> Bool
(Clock -> Clock -> Bool) -> (Clock -> Clock -> Bool) -> Eq Clock
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Clock -> Clock -> Bool
$c/= :: Clock -> Clock -> Bool
== :: Clock -> Clock -> Bool
$c== :: Clock -> Clock -> Bool
Eq)
instance SP.ManagedPtrNewtype Clock where
toManagedPtr :: Clock -> ManagedPtr Clock
toManagedPtr (Clock ManagedPtr Clock
p) = ManagedPtr Clock
p
foreign import ccall "gst_clock_get_type"
c_gst_clock_get_type :: IO B.Types.GType
instance B.Types.TypedObject Clock where
glibType :: IO GType
glibType = IO GType
c_gst_clock_get_type
instance B.Types.GObject Clock
class (SP.GObject o, O.IsDescendantOf Clock o) => IsClock o
instance (SP.GObject o, O.IsDescendantOf Clock o) => IsClock o
instance O.HasParentTypes Clock
type instance O.ParentTypes Clock = '[Gst.Object.Object, GObject.Object.Object]
toClock :: (MIO.MonadIO m, IsClock o) => o -> m Clock
toClock :: forall (m :: * -> *) o. (MonadIO m, IsClock o) => o -> m Clock
toClock = IO Clock -> m Clock
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Clock -> m Clock) -> (o -> IO Clock) -> o -> m Clock
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Clock -> Clock) -> o -> IO Clock
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Clock -> Clock
Clock
instance B.GValue.IsGValue (Maybe Clock) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gst_clock_get_type
gvalueSet_ :: Ptr GValue -> Maybe Clock -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Clock
P.Nothing = Ptr GValue -> Ptr Clock -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Clock
forall a. Ptr a
FP.nullPtr :: FP.Ptr Clock)
gvalueSet_ Ptr GValue
gv (P.Just Clock
obj) = Clock -> (Ptr Clock -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Clock
obj (Ptr GValue -> Ptr Clock -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Clock)
gvalueGet_ Ptr GValue
gv = do
Ptr Clock
ptr <- Ptr GValue -> IO (Ptr Clock)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Clock)
if Ptr Clock
ptr Ptr Clock -> Ptr Clock -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Clock
forall a. Ptr a
FP.nullPtr
then Clock -> Maybe Clock
forall a. a -> Maybe a
P.Just (Clock -> Maybe Clock) -> IO Clock -> IO (Maybe Clock)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Clock -> Clock) -> Ptr Clock -> IO Clock
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Clock -> Clock
Clock Ptr Clock
ptr
else Maybe Clock -> IO (Maybe Clock)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Clock
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveClockMethod (t :: Symbol) (o :: *) :: * where
ResolveClockMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveClockMethod "addObservation" o = ClockAddObservationMethodInfo
ResolveClockMethod "addObservationUnapplied" o = ClockAddObservationUnappliedMethodInfo
ResolveClockMethod "adjustUnlocked" o = ClockAdjustUnlockedMethodInfo
ResolveClockMethod "adjustWithCalibration" o = ClockAdjustWithCalibrationMethodInfo
ResolveClockMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveClockMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveClockMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveClockMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveClockMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveClockMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveClockMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveClockMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveClockMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveClockMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveClockMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveClockMethod "isSynced" o = ClockIsSyncedMethodInfo
ResolveClockMethod "newPeriodicId" o = ClockNewPeriodicIdMethodInfo
ResolveClockMethod "newSingleShotId" o = ClockNewSingleShotIdMethodInfo
ResolveClockMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveClockMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveClockMethod "periodicIdReinit" o = ClockPeriodicIdReinitMethodInfo
ResolveClockMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveClockMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveClockMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveClockMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveClockMethod "singleShotIdReinit" o = ClockSingleShotIdReinitMethodInfo
ResolveClockMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveClockMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveClockMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveClockMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveClockMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveClockMethod "unadjustUnlocked" o = ClockUnadjustUnlockedMethodInfo
ResolveClockMethod "unadjustWithCalibration" o = ClockUnadjustWithCalibrationMethodInfo
ResolveClockMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveClockMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveClockMethod "waitForSync" o = ClockWaitForSyncMethodInfo
ResolveClockMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveClockMethod "getCalibration" o = ClockGetCalibrationMethodInfo
ResolveClockMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveClockMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveClockMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveClockMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveClockMethod "getInternalTime" o = ClockGetInternalTimeMethodInfo
ResolveClockMethod "getMaster" o = ClockGetMasterMethodInfo
ResolveClockMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveClockMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveClockMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveClockMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveClockMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveClockMethod "getResolution" o = ClockGetResolutionMethodInfo
ResolveClockMethod "getTime" o = ClockGetTimeMethodInfo
ResolveClockMethod "getTimeout" o = ClockGetTimeoutMethodInfo
ResolveClockMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveClockMethod "setCalibration" o = ClockSetCalibrationMethodInfo
ResolveClockMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveClockMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveClockMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveClockMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveClockMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveClockMethod "setMaster" o = ClockSetMasterMethodInfo
ResolveClockMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveClockMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveClockMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveClockMethod "setResolution" o = ClockSetResolutionMethodInfo
ResolveClockMethod "setSynced" o = ClockSetSyncedMethodInfo
ResolveClockMethod "setTimeout" o = ClockSetTimeoutMethodInfo
ResolveClockMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveClockMethod t Clock, O.OverloadedMethod info Clock p) => OL.IsLabel t (Clock -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveClockMethod t Clock, O.OverloadedMethod info Clock p, R.HasField t Clock p) => R.HasField t Clock p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveClockMethod t Clock, O.OverloadedMethodInfo info Clock) => OL.IsLabel t (O.MethodProxy info Clock) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type ClockSyncedCallback =
Bool
-> IO ()
type C_ClockSyncedCallback =
Ptr Clock ->
CInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ClockSyncedCallback :: C_ClockSyncedCallback -> IO (FunPtr C_ClockSyncedCallback)
wrap_ClockSyncedCallback ::
GObject a => (a -> ClockSyncedCallback) ->
C_ClockSyncedCallback
wrap_ClockSyncedCallback :: forall a.
GObject a =>
(a -> ClockSyncedCallback) -> C_ClockSyncedCallback
wrap_ClockSyncedCallback a -> ClockSyncedCallback
gi'cb Ptr Clock
gi'selfPtr CInt
synced Ptr ()
_ = do
let synced' :: Bool
synced' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
synced
Ptr Clock -> (Clock -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Clock
gi'selfPtr ((Clock -> IO ()) -> IO ()) -> (Clock -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Clock
gi'self -> a -> ClockSyncedCallback
gi'cb (Clock -> a
Coerce.coerce Clock
gi'self) Bool
synced'
onClockSynced :: (IsClock a, MonadIO m) => a -> ((?self :: a) => ClockSyncedCallback) -> m SignalHandlerId
onClockSynced :: forall a (m :: * -> *).
(IsClock a, MonadIO m) =>
a -> ((?self::a) => ClockSyncedCallback) -> m SignalHandlerId
onClockSynced a
obj (?self::a) => ClockSyncedCallback
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 wrapped :: a -> ClockSyncedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => ClockSyncedCallback
ClockSyncedCallback
cb
let wrapped' :: C_ClockSyncedCallback
wrapped' = (a -> ClockSyncedCallback) -> C_ClockSyncedCallback
forall a.
GObject a =>
(a -> ClockSyncedCallback) -> C_ClockSyncedCallback
wrap_ClockSyncedCallback a -> ClockSyncedCallback
wrapped
FunPtr C_ClockSyncedCallback
wrapped'' <- C_ClockSyncedCallback -> IO (FunPtr C_ClockSyncedCallback)
mk_ClockSyncedCallback C_ClockSyncedCallback
wrapped'
a
-> Text
-> FunPtr C_ClockSyncedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"synced" FunPtr C_ClockSyncedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterClockSynced :: (IsClock a, MonadIO m) => a -> ((?self :: a) => ClockSyncedCallback) -> m SignalHandlerId
afterClockSynced :: forall a (m :: * -> *).
(IsClock a, MonadIO m) =>
a -> ((?self::a) => ClockSyncedCallback) -> m SignalHandlerId
afterClockSynced a
obj (?self::a) => ClockSyncedCallback
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 wrapped :: a -> ClockSyncedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => ClockSyncedCallback
ClockSyncedCallback
cb
let wrapped' :: C_ClockSyncedCallback
wrapped' = (a -> ClockSyncedCallback) -> C_ClockSyncedCallback
forall a.
GObject a =>
(a -> ClockSyncedCallback) -> C_ClockSyncedCallback
wrap_ClockSyncedCallback a -> ClockSyncedCallback
wrapped
FunPtr C_ClockSyncedCallback
wrapped'' <- C_ClockSyncedCallback -> IO (FunPtr C_ClockSyncedCallback)
mk_ClockSyncedCallback C_ClockSyncedCallback
wrapped'
a
-> Text
-> FunPtr C_ClockSyncedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"synced" FunPtr C_ClockSyncedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data ClockSyncedSignalInfo
instance SignalInfo ClockSyncedSignalInfo where
type HaskellCallbackType ClockSyncedSignalInfo = ClockSyncedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_ClockSyncedCallback cb
cb'' <- mk_ClockSyncedCallback cb'
connectSignalFunPtr obj "synced" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock::synced"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#g:signal:synced"})
#endif
getClockTimeout :: (MonadIO m, IsClock o) => o -> m Word64
getClockTimeout :: forall (m :: * -> *) o. (MonadIO m, IsClock o) => o -> m Word64
getClockTimeout o
obj = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word64
forall a. GObject a => a -> String -> IO Word64
B.Properties.getObjectPropertyUInt64 o
obj String
"timeout"
setClockTimeout :: (MonadIO m, IsClock o) => o -> Word64 -> m ()
setClockTimeout :: forall (m :: * -> *) o.
(MonadIO m, IsClock o) =>
o -> Word64 -> m ()
setClockTimeout o
obj Word64
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Word64 -> IO ()
forall a. GObject a => a -> String -> Word64 -> IO ()
B.Properties.setObjectPropertyUInt64 o
obj String
"timeout" Word64
val
constructClockTimeout :: (IsClock o, MIO.MonadIO m) => Word64 -> m (GValueConstruct o)
constructClockTimeout :: forall o (m :: * -> *).
(IsClock o, MonadIO m) =>
Word64 -> m (GValueConstruct o)
constructClockTimeout Word64
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word64 -> IO (GValueConstruct o)
forall o. String -> Word64 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt64 String
"timeout" Word64
val
#if defined(ENABLE_OVERLOADING)
data ClockTimeoutPropertyInfo
instance AttrInfo ClockTimeoutPropertyInfo where
type AttrAllowedOps ClockTimeoutPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint ClockTimeoutPropertyInfo = IsClock
type AttrSetTypeConstraint ClockTimeoutPropertyInfo = (~) Word64
type AttrTransferTypeConstraint ClockTimeoutPropertyInfo = (~) Word64
type AttrTransferType ClockTimeoutPropertyInfo = Word64
type AttrGetType ClockTimeoutPropertyInfo = Word64
type AttrLabel ClockTimeoutPropertyInfo = "timeout"
type AttrOrigin ClockTimeoutPropertyInfo = Clock
attrGet = getClockTimeout
attrSet = setClockTimeout
attrTransfer _ v = do
return v
attrConstruct = constructClockTimeout
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.timeout"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#g:attr:timeout"
})
#endif
getClockWindowSize :: (MonadIO m, IsClock o) => o -> m Int32
getClockWindowSize :: forall (m :: * -> *) o. (MonadIO m, IsClock o) => o -> m Int32
getClockWindowSize o
obj = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"window-size"
setClockWindowSize :: (MonadIO m, IsClock o) => o -> Int32 -> m ()
setClockWindowSize :: forall (m :: * -> *) o.
(MonadIO m, IsClock o) =>
o -> Int32 -> m ()
setClockWindowSize o
obj Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Int32 -> IO ()
forall a. GObject a => a -> String -> Int32 -> IO ()
B.Properties.setObjectPropertyInt32 o
obj String
"window-size" Int32
val
constructClockWindowSize :: (IsClock o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructClockWindowSize :: forall o (m :: * -> *).
(IsClock o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructClockWindowSize Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"window-size" Int32
val
#if defined(ENABLE_OVERLOADING)
data ClockWindowSizePropertyInfo
instance AttrInfo ClockWindowSizePropertyInfo where
type AttrAllowedOps ClockWindowSizePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint ClockWindowSizePropertyInfo = IsClock
type AttrSetTypeConstraint ClockWindowSizePropertyInfo = (~) Int32
type AttrTransferTypeConstraint ClockWindowSizePropertyInfo = (~) Int32
type AttrTransferType ClockWindowSizePropertyInfo = Int32
type AttrGetType ClockWindowSizePropertyInfo = Int32
type AttrLabel ClockWindowSizePropertyInfo = "window-size"
type AttrOrigin ClockWindowSizePropertyInfo = Clock
attrGet = getClockWindowSize
attrSet = setClockWindowSize
attrTransfer _ v = do
return v
attrConstruct = constructClockWindowSize
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.windowSize"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#g:attr:windowSize"
})
#endif
getClockWindowThreshold :: (MonadIO m, IsClock o) => o -> m Int32
getClockWindowThreshold :: forall (m :: * -> *) o. (MonadIO m, IsClock o) => o -> m Int32
getClockWindowThreshold o
obj = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"window-threshold"
setClockWindowThreshold :: (MonadIO m, IsClock o) => o -> Int32 -> m ()
setClockWindowThreshold :: forall (m :: * -> *) o.
(MonadIO m, IsClock o) =>
o -> Int32 -> m ()
setClockWindowThreshold o
obj Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Int32 -> IO ()
forall a. GObject a => a -> String -> Int32 -> IO ()
B.Properties.setObjectPropertyInt32 o
obj String
"window-threshold" Int32
val
constructClockWindowThreshold :: (IsClock o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructClockWindowThreshold :: forall o (m :: * -> *).
(IsClock o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructClockWindowThreshold Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"window-threshold" Int32
val
#if defined(ENABLE_OVERLOADING)
data ClockWindowThresholdPropertyInfo
instance AttrInfo ClockWindowThresholdPropertyInfo where
type AttrAllowedOps ClockWindowThresholdPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint ClockWindowThresholdPropertyInfo = IsClock
type AttrSetTypeConstraint ClockWindowThresholdPropertyInfo = (~) Int32
type AttrTransferTypeConstraint ClockWindowThresholdPropertyInfo = (~) Int32
type AttrTransferType ClockWindowThresholdPropertyInfo = Int32
type AttrGetType ClockWindowThresholdPropertyInfo = Int32
type AttrLabel ClockWindowThresholdPropertyInfo = "window-threshold"
type AttrOrigin ClockWindowThresholdPropertyInfo = Clock
attrGet = getClockWindowThreshold
attrSet = setClockWindowThreshold
attrTransfer _ v = do
return v
attrConstruct = constructClockWindowThreshold
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.windowThreshold"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#g:attr:windowThreshold"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Clock
type instance O.AttributeList Clock = ClockAttributeList
type ClockAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("timeout", ClockTimeoutPropertyInfo), '("windowSize", ClockWindowSizePropertyInfo), '("windowThreshold", ClockWindowThresholdPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
clockTimeout :: AttrLabelProxy "timeout"
clockTimeout = AttrLabelProxy
clockWindowSize :: AttrLabelProxy "windowSize"
clockWindowSize = AttrLabelProxy
clockWindowThreshold :: AttrLabelProxy "windowThreshold"
clockWindowThreshold = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Clock = ClockSignalList
type ClockSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("synced", ClockSyncedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_clock_add_observation" gst_clock_add_observation ::
Ptr Clock ->
Word64 ->
Word64 ->
Ptr CDouble ->
IO CInt
clockAddObservation ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> Word64
-> m ((Bool, Double))
clockAddObservation :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> Word64 -> m (Bool, Double)
clockAddObservation a
clock Word64
slave Word64
master = IO (Bool, Double) -> m (Bool, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double) -> m (Bool, Double))
-> IO (Bool, Double) -> m (Bool, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr CDouble
rSquared <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Clock -> Word64 -> Word64 -> Ptr CDouble -> IO CInt
gst_clock_add_observation Ptr Clock
clock' Word64
slave Word64
master Ptr CDouble
rSquared
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CDouble
rSquared' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
rSquared
let rSquared'' :: Double
rSquared'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
rSquared'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
rSquared
(Bool, Double) -> IO (Bool, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
rSquared'')
#if defined(ENABLE_OVERLOADING)
data ClockAddObservationMethodInfo
instance (signature ~ (Word64 -> Word64 -> m ((Bool, Double))), MonadIO m, IsClock a) => O.OverloadedMethod ClockAddObservationMethodInfo a signature where
overloadedMethod = clockAddObservation
instance O.OverloadedMethodInfo ClockAddObservationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockAddObservation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockAddObservation"
})
#endif
foreign import ccall "gst_clock_add_observation_unapplied" gst_clock_add_observation_unapplied ::
Ptr Clock ->
Word64 ->
Word64 ->
Ptr CDouble ->
Ptr Word64 ->
Ptr Word64 ->
Ptr Word64 ->
Ptr Word64 ->
IO CInt
clockAddObservationUnapplied ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> Word64
-> m ((Bool, Double, Word64, Word64, Word64, Word64))
clockAddObservationUnapplied :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> Word64
-> m (Bool, Double, Word64, Word64, Word64, Word64)
clockAddObservationUnapplied a
clock Word64
slave Word64
master = IO (Bool, Double, Word64, Word64, Word64, Word64)
-> m (Bool, Double, Word64, Word64, Word64, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double, Word64, Word64, Word64, Word64)
-> m (Bool, Double, Word64, Word64, Word64, Word64))
-> IO (Bool, Double, Word64, Word64, Word64, Word64)
-> m (Bool, Double, Word64, Word64, Word64, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr CDouble
rSquared <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr Word64
internal <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Word64
external <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Word64
rateNum <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Word64
rateDenom <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
CInt
result <- Ptr Clock
-> Word64
-> Word64
-> Ptr CDouble
-> Ptr Word64
-> Ptr Word64
-> Ptr Word64
-> Ptr Word64
-> IO CInt
gst_clock_add_observation_unapplied Ptr Clock
clock' Word64
slave Word64
master Ptr CDouble
rSquared Ptr Word64
internal Ptr Word64
external Ptr Word64
rateNum Ptr Word64
rateDenom
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CDouble
rSquared' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
rSquared
let rSquared'' :: Double
rSquared'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
rSquared'
Word64
internal' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
internal
Word64
external' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
external
Word64
rateNum' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
rateNum
Word64
rateDenom' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
rateDenom
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
rSquared
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
internal
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
external
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
rateNum
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
rateDenom
(Bool, Double, Word64, Word64, Word64, Word64)
-> IO (Bool, Double, Word64, Word64, Word64, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
rSquared'', Word64
internal', Word64
external', Word64
rateNum', Word64
rateDenom')
#if defined(ENABLE_OVERLOADING)
data ClockAddObservationUnappliedMethodInfo
instance (signature ~ (Word64 -> Word64 -> m ((Bool, Double, Word64, Word64, Word64, Word64))), MonadIO m, IsClock a) => O.OverloadedMethod ClockAddObservationUnappliedMethodInfo a signature where
overloadedMethod = clockAddObservationUnapplied
instance O.OverloadedMethodInfo ClockAddObservationUnappliedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockAddObservationUnapplied",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockAddObservationUnapplied"
})
#endif
foreign import ccall "gst_clock_adjust_unlocked" gst_clock_adjust_unlocked ::
Ptr Clock ->
Word64 ->
IO Word64
clockAdjustUnlocked ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> m Word64
clockAdjustUnlocked :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> m Word64
clockAdjustUnlocked a
clock Word64
internal = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock -> Word64 -> IO Word64
gst_clock_adjust_unlocked Ptr Clock
clock' Word64
internal
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockAdjustUnlockedMethodInfo
instance (signature ~ (Word64 -> m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockAdjustUnlockedMethodInfo a signature where
overloadedMethod = clockAdjustUnlocked
instance O.OverloadedMethodInfo ClockAdjustUnlockedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockAdjustUnlocked",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockAdjustUnlocked"
})
#endif
foreign import ccall "gst_clock_adjust_with_calibration" gst_clock_adjust_with_calibration ::
Ptr Clock ->
Word64 ->
Word64 ->
Word64 ->
Word64 ->
Word64 ->
IO Word64
clockAdjustWithCalibration ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> m Word64
clockAdjustWithCalibration :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> m Word64
clockAdjustWithCalibration a
clock Word64
internalTarget Word64
cinternal Word64
cexternal Word64
cnum Word64
cdenom = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock
-> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> IO Word64
gst_clock_adjust_with_calibration Ptr Clock
clock' Word64
internalTarget Word64
cinternal Word64
cexternal Word64
cnum Word64
cdenom
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockAdjustWithCalibrationMethodInfo
instance (signature ~ (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockAdjustWithCalibrationMethodInfo a signature where
overloadedMethod = clockAdjustWithCalibration
instance O.OverloadedMethodInfo ClockAdjustWithCalibrationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockAdjustWithCalibration",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockAdjustWithCalibration"
})
#endif
foreign import ccall "gst_clock_get_calibration" gst_clock_get_calibration ::
Ptr Clock ->
Ptr Word64 ->
Ptr Word64 ->
Ptr Word64 ->
Ptr Word64 ->
IO ()
clockGetCalibration ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> m ((Word64, Word64, Word64, Word64))
clockGetCalibration :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> m (Word64, Word64, Word64, Word64)
clockGetCalibration a
clock = IO (Word64, Word64, Word64, Word64)
-> m (Word64, Word64, Word64, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word64, Word64, Word64, Word64)
-> m (Word64, Word64, Word64, Word64))
-> IO (Word64, Word64, Word64, Word64)
-> m (Word64, Word64, Word64, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr Word64
internal <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Word64
external <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Word64
rateNum <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Word64
rateDenom <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Clock
-> Ptr Word64 -> Ptr Word64 -> Ptr Word64 -> Ptr Word64 -> IO ()
gst_clock_get_calibration Ptr Clock
clock' Ptr Word64
internal Ptr Word64
external Ptr Word64
rateNum Ptr Word64
rateDenom
Word64
internal' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
internal
Word64
external' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
external
Word64
rateNum' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
rateNum
Word64
rateDenom' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
rateDenom
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
internal
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
external
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
rateNum
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
rateDenom
(Word64, Word64, Word64, Word64)
-> IO (Word64, Word64, Word64, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word64
internal', Word64
external', Word64
rateNum', Word64
rateDenom')
#if defined(ENABLE_OVERLOADING)
data ClockGetCalibrationMethodInfo
instance (signature ~ (m ((Word64, Word64, Word64, Word64))), MonadIO m, IsClock a) => O.OverloadedMethod ClockGetCalibrationMethodInfo a signature where
overloadedMethod = clockGetCalibration
instance O.OverloadedMethodInfo ClockGetCalibrationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockGetCalibration",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockGetCalibration"
})
#endif
foreign import ccall "gst_clock_get_internal_time" gst_clock_get_internal_time ::
Ptr Clock ->
IO Word64
clockGetInternalTime ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> m Word64
clockGetInternalTime :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> m Word64
clockGetInternalTime a
clock = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock -> IO Word64
gst_clock_get_internal_time Ptr Clock
clock'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockGetInternalTimeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockGetInternalTimeMethodInfo a signature where
overloadedMethod = clockGetInternalTime
instance O.OverloadedMethodInfo ClockGetInternalTimeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockGetInternalTime",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockGetInternalTime"
})
#endif
foreign import ccall "gst_clock_get_master" gst_clock_get_master ::
Ptr Clock ->
IO (Ptr Clock)
clockGetMaster ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> m (Maybe Clock)
clockGetMaster :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> m (Maybe Clock)
clockGetMaster a
clock = IO (Maybe Clock) -> m (Maybe Clock)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Clock) -> m (Maybe Clock))
-> IO (Maybe Clock) -> m (Maybe Clock)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr Clock
result <- Ptr Clock -> IO (Ptr Clock)
gst_clock_get_master Ptr Clock
clock'
Maybe Clock
maybeResult <- Ptr Clock -> (Ptr Clock -> IO Clock) -> IO (Maybe Clock)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Clock
result ((Ptr Clock -> IO Clock) -> IO (Maybe Clock))
-> (Ptr Clock -> IO Clock) -> IO (Maybe Clock)
forall a b. (a -> b) -> a -> b
$ \Ptr Clock
result' -> do
Clock
result'' <- ((ManagedPtr Clock -> Clock) -> Ptr Clock -> IO Clock
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Clock -> Clock
Clock) Ptr Clock
result'
Clock -> IO Clock
forall (m :: * -> *) a. Monad m => a -> m a
return Clock
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Maybe Clock -> IO (Maybe Clock)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Clock
maybeResult
#if defined(ENABLE_OVERLOADING)
data ClockGetMasterMethodInfo
instance (signature ~ (m (Maybe Clock)), MonadIO m, IsClock a) => O.OverloadedMethod ClockGetMasterMethodInfo a signature where
overloadedMethod = clockGetMaster
instance O.OverloadedMethodInfo ClockGetMasterMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockGetMaster",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockGetMaster"
})
#endif
foreign import ccall "gst_clock_get_resolution" gst_clock_get_resolution ::
Ptr Clock ->
IO Word64
clockGetResolution ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> m Word64
clockGetResolution :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> m Word64
clockGetResolution a
clock = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock -> IO Word64
gst_clock_get_resolution Ptr Clock
clock'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockGetResolutionMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockGetResolutionMethodInfo a signature where
overloadedMethod = clockGetResolution
instance O.OverloadedMethodInfo ClockGetResolutionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockGetResolution",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockGetResolution"
})
#endif
foreign import ccall "gst_clock_get_time" gst_clock_get_time ::
Ptr Clock ->
IO Word64
clockGetTime ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> m Word64
clockGetTime :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> m Word64
clockGetTime a
clock = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock -> IO Word64
gst_clock_get_time Ptr Clock
clock'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockGetTimeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockGetTimeMethodInfo a signature where
overloadedMethod = clockGetTime
instance O.OverloadedMethodInfo ClockGetTimeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockGetTime",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockGetTime"
})
#endif
foreign import ccall "gst_clock_get_timeout" gst_clock_get_timeout ::
Ptr Clock ->
IO Word64
clockGetTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> m Word64
clockGetTimeout :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> m Word64
clockGetTimeout a
clock = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock -> IO Word64
gst_clock_get_timeout Ptr Clock
clock'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockGetTimeoutMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockGetTimeoutMethodInfo a signature where
overloadedMethod = clockGetTimeout
instance O.OverloadedMethodInfo ClockGetTimeoutMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockGetTimeout",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockGetTimeout"
})
#endif
foreign import ccall "gst_clock_is_synced" gst_clock_is_synced ::
Ptr Clock ->
IO CInt
clockIsSynced ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> m Bool
clockIsSynced :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> m Bool
clockIsSynced a
clock = 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 Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
CInt
result <- Ptr Clock -> IO CInt
gst_clock_is_synced Ptr Clock
clock'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClockIsSyncedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsClock a) => O.OverloadedMethod ClockIsSyncedMethodInfo a signature where
overloadedMethod = clockIsSynced
instance O.OverloadedMethodInfo ClockIsSyncedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockIsSynced",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockIsSynced"
})
#endif
foreign import ccall "gst_clock_new_periodic_id" gst_clock_new_periodic_id ::
Ptr Clock ->
Word64 ->
Word64 ->
IO (Ptr ())
clockNewPeriodicId ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> Word64
-> m (Ptr ())
clockNewPeriodicId :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> Word64 -> m (Ptr ())
clockNewPeriodicId a
clock Word64
startTime Word64
interval = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr ()
result <- Ptr Clock -> Word64 -> Word64 -> IO (Ptr ())
gst_clock_new_periodic_id Ptr Clock
clock' Word64
startTime Word64
interval
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data ClockNewPeriodicIdMethodInfo
instance (signature ~ (Word64 -> Word64 -> m (Ptr ())), MonadIO m, IsClock a) => O.OverloadedMethod ClockNewPeriodicIdMethodInfo a signature where
overloadedMethod = clockNewPeriodicId
instance O.OverloadedMethodInfo ClockNewPeriodicIdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockNewPeriodicId",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockNewPeriodicId"
})
#endif
foreign import ccall "gst_clock_new_single_shot_id" gst_clock_new_single_shot_id ::
Ptr Clock ->
Word64 ->
IO (Ptr ())
clockNewSingleShotId ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> m (Ptr ())
clockNewSingleShotId :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> m (Ptr ())
clockNewSingleShotId a
clock Word64
time = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr ()
result <- Ptr Clock -> Word64 -> IO (Ptr ())
gst_clock_new_single_shot_id Ptr Clock
clock' Word64
time
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data ClockNewSingleShotIdMethodInfo
instance (signature ~ (Word64 -> m (Ptr ())), MonadIO m, IsClock a) => O.OverloadedMethod ClockNewSingleShotIdMethodInfo a signature where
overloadedMethod = clockNewSingleShotId
instance O.OverloadedMethodInfo ClockNewSingleShotIdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockNewSingleShotId",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockNewSingleShotId"
})
#endif
foreign import ccall "gst_clock_periodic_id_reinit" gst_clock_periodic_id_reinit ::
Ptr Clock ->
Ptr () ->
Word64 ->
Word64 ->
IO CInt
clockPeriodicIdReinit ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Ptr ()
-> Word64
-> Word64
-> m Bool
clockPeriodicIdReinit :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Ptr () -> Word64 -> Word64 -> m Bool
clockPeriodicIdReinit a
clock Ptr ()
id Word64
startTime Word64
interval = 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 Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
CInt
result <- Ptr Clock -> Ptr () -> Word64 -> Word64 -> IO CInt
gst_clock_periodic_id_reinit Ptr Clock
clock' Ptr ()
id Word64
startTime Word64
interval
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClockPeriodicIdReinitMethodInfo
instance (signature ~ (Ptr () -> Word64 -> Word64 -> m Bool), MonadIO m, IsClock a) => O.OverloadedMethod ClockPeriodicIdReinitMethodInfo a signature where
overloadedMethod = clockPeriodicIdReinit
instance O.OverloadedMethodInfo ClockPeriodicIdReinitMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockPeriodicIdReinit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockPeriodicIdReinit"
})
#endif
foreign import ccall "gst_clock_set_calibration" gst_clock_set_calibration ::
Ptr Clock ->
Word64 ->
Word64 ->
Word64 ->
Word64 ->
IO ()
clockSetCalibration ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> Word64
-> Word64
-> Word64
-> m ()
clockSetCalibration :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> Word64 -> Word64 -> Word64 -> m ()
clockSetCalibration a
clock Word64
internal Word64
external Word64
rateNum Word64
rateDenom = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr Clock -> Word64 -> Word64 -> Word64 -> Word64 -> IO ()
gst_clock_set_calibration Ptr Clock
clock' Word64
internal Word64
external Word64
rateNum Word64
rateDenom
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClockSetCalibrationMethodInfo
instance (signature ~ (Word64 -> Word64 -> Word64 -> Word64 -> m ()), MonadIO m, IsClock a) => O.OverloadedMethod ClockSetCalibrationMethodInfo a signature where
overloadedMethod = clockSetCalibration
instance O.OverloadedMethodInfo ClockSetCalibrationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockSetCalibration",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockSetCalibration"
})
#endif
foreign import ccall "gst_clock_set_master" gst_clock_set_master ::
Ptr Clock ->
Ptr Clock ->
IO CInt
clockSetMaster ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a, IsClock b) =>
a
-> Maybe (b)
-> m Bool
clockSetMaster :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClock a, IsClock b) =>
a -> Maybe b -> m Bool
clockSetMaster a
clock Maybe b
master = 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 Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr Clock
maybeMaster <- case Maybe b
master of
Maybe b
Nothing -> Ptr Clock -> IO (Ptr Clock)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Clock
forall a. Ptr a
nullPtr
Just b
jMaster -> do
Ptr Clock
jMaster' <- b -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMaster
Ptr Clock -> IO (Ptr Clock)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Clock
jMaster'
CInt
result <- Ptr Clock -> Ptr Clock -> IO CInt
gst_clock_set_master Ptr Clock
clock' Ptr Clock
maybeMaster
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
master b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClockSetMasterMethodInfo
instance (signature ~ (Maybe (b) -> m Bool), MonadIO m, IsClock a, IsClock b) => O.OverloadedMethod ClockSetMasterMethodInfo a signature where
overloadedMethod = clockSetMaster
instance O.OverloadedMethodInfo ClockSetMasterMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockSetMaster",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockSetMaster"
})
#endif
foreign import ccall "gst_clock_set_resolution" gst_clock_set_resolution ::
Ptr Clock ->
Word64 ->
IO Word64
clockSetResolution ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> m Word64
clockSetResolution :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> m Word64
clockSetResolution a
clock Word64
resolution = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock -> Word64 -> IO Word64
gst_clock_set_resolution Ptr Clock
clock' Word64
resolution
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockSetResolutionMethodInfo
instance (signature ~ (Word64 -> m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockSetResolutionMethodInfo a signature where
overloadedMethod = clockSetResolution
instance O.OverloadedMethodInfo ClockSetResolutionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockSetResolution",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockSetResolution"
})
#endif
foreign import ccall "gst_clock_set_synced" gst_clock_set_synced ::
Ptr Clock ->
CInt ->
IO ()
clockSetSynced ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Bool
-> m ()
clockSetSynced :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Bool -> m ()
clockSetSynced a
clock Bool
synced = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
let synced' :: CInt
synced' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
synced
Ptr Clock -> CInt -> IO ()
gst_clock_set_synced Ptr Clock
clock' CInt
synced'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClockSetSyncedMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsClock a) => O.OverloadedMethod ClockSetSyncedMethodInfo a signature where
overloadedMethod = clockSetSynced
instance O.OverloadedMethodInfo ClockSetSyncedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockSetSynced",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockSetSynced"
})
#endif
foreign import ccall "gst_clock_set_timeout" gst_clock_set_timeout ::
Ptr Clock ->
Word64 ->
IO ()
clockSetTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> m ()
clockSetTimeout :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> m ()
clockSetTimeout a
clock Word64
timeout = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Ptr Clock -> Word64 -> IO ()
gst_clock_set_timeout Ptr Clock
clock' Word64
timeout
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClockSetTimeoutMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsClock a) => O.OverloadedMethod ClockSetTimeoutMethodInfo a signature where
overloadedMethod = clockSetTimeout
instance O.OverloadedMethodInfo ClockSetTimeoutMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockSetTimeout",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockSetTimeout"
})
#endif
foreign import ccall "gst_clock_single_shot_id_reinit" gst_clock_single_shot_id_reinit ::
Ptr Clock ->
Ptr () ->
Word64 ->
IO CInt
clockSingleShotIdReinit ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Ptr ()
-> Word64
-> m Bool
clockSingleShotIdReinit :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Ptr () -> Word64 -> m Bool
clockSingleShotIdReinit a
clock Ptr ()
id Word64
time = 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 Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
CInt
result <- Ptr Clock -> Ptr () -> Word64 -> IO CInt
gst_clock_single_shot_id_reinit Ptr Clock
clock' Ptr ()
id Word64
time
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClockSingleShotIdReinitMethodInfo
instance (signature ~ (Ptr () -> Word64 -> m Bool), MonadIO m, IsClock a) => O.OverloadedMethod ClockSingleShotIdReinitMethodInfo a signature where
overloadedMethod = clockSingleShotIdReinit
instance O.OverloadedMethodInfo ClockSingleShotIdReinitMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockSingleShotIdReinit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockSingleShotIdReinit"
})
#endif
foreign import ccall "gst_clock_unadjust_unlocked" gst_clock_unadjust_unlocked ::
Ptr Clock ->
Word64 ->
IO Word64
clockUnadjustUnlocked ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> m Word64
clockUnadjustUnlocked :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> m Word64
clockUnadjustUnlocked a
clock Word64
external = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock -> Word64 -> IO Word64
gst_clock_unadjust_unlocked Ptr Clock
clock' Word64
external
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockUnadjustUnlockedMethodInfo
instance (signature ~ (Word64 -> m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockUnadjustUnlockedMethodInfo a signature where
overloadedMethod = clockUnadjustUnlocked
instance O.OverloadedMethodInfo ClockUnadjustUnlockedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockUnadjustUnlocked",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockUnadjustUnlocked"
})
#endif
foreign import ccall "gst_clock_unadjust_with_calibration" gst_clock_unadjust_with_calibration ::
Ptr Clock ->
Word64 ->
Word64 ->
Word64 ->
Word64 ->
Word64 ->
IO Word64
clockUnadjustWithCalibration ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> m Word64
clockUnadjustWithCalibration :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> m Word64
clockUnadjustWithCalibration a
clock Word64
externalTarget Word64
cinternal Word64
cexternal Word64
cnum Word64
cdenom = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
Word64
result <- Ptr Clock
-> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> IO Word64
gst_clock_unadjust_with_calibration Ptr Clock
clock' Word64
externalTarget Word64
cinternal Word64
cexternal Word64
cnum Word64
cdenom
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data ClockUnadjustWithCalibrationMethodInfo
instance (signature ~ (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> m Word64), MonadIO m, IsClock a) => O.OverloadedMethod ClockUnadjustWithCalibrationMethodInfo a signature where
overloadedMethod = clockUnadjustWithCalibration
instance O.OverloadedMethodInfo ClockUnadjustWithCalibrationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockUnadjustWithCalibration",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockUnadjustWithCalibration"
})
#endif
foreign import ccall "gst_clock_wait_for_sync" gst_clock_wait_for_sync ::
Ptr Clock ->
Word64 ->
IO CInt
clockWaitForSync ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
a
-> Word64
-> m Bool
clockWaitForSync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
a -> Word64 -> m Bool
clockWaitForSync a
clock Word64
timeout = 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 Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
CInt
result <- Ptr Clock -> Word64 -> IO CInt
gst_clock_wait_for_sync Ptr Clock
clock' Word64
timeout
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClockWaitForSyncMethodInfo
instance (signature ~ (Word64 -> m Bool), MonadIO m, IsClock a) => O.OverloadedMethod ClockWaitForSyncMethodInfo a signature where
overloadedMethod = clockWaitForSync
instance O.OverloadedMethodInfo ClockWaitForSyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Clock.clockWaitForSync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Clock.html#v:clockWaitForSync"
})
#endif
foreign import ccall "gst_clock_id_compare_func" gst_clock_id_compare_func ::
Ptr () ->
Ptr () ->
IO Int32
clockIdCompareFunc ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> Ptr ()
-> m Int32
clockIdCompareFunc :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> Ptr () -> m Int32
clockIdCompareFunc Ptr ()
id1 Ptr ()
id2 = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Int32
result <- Ptr () -> Ptr () -> IO Int32
gst_clock_id_compare_func Ptr ()
id1 Ptr ()
id2
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_clock_id_get_clock" gst_clock_id_get_clock ::
Ptr () ->
IO (Ptr Clock)
clockIdGetClock ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m (Maybe Clock)
clockIdGetClock :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> m (Maybe Clock)
clockIdGetClock Ptr ()
id = IO (Maybe Clock) -> m (Maybe Clock)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Clock) -> m (Maybe Clock))
-> IO (Maybe Clock) -> m (Maybe Clock)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clock
result <- Ptr () -> IO (Ptr Clock)
gst_clock_id_get_clock Ptr ()
id
Maybe Clock
maybeResult <- Ptr Clock -> (Ptr Clock -> IO Clock) -> IO (Maybe Clock)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Clock
result ((Ptr Clock -> IO Clock) -> IO (Maybe Clock))
-> (Ptr Clock -> IO Clock) -> IO (Maybe Clock)
forall a b. (a -> b) -> a -> b
$ \Ptr Clock
result' -> do
Clock
result'' <- ((ManagedPtr Clock -> Clock) -> Ptr Clock -> IO Clock
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Clock -> Clock
Clock) Ptr Clock
result'
Clock -> IO Clock
forall (m :: * -> *) a. Monad m => a -> m a
return Clock
result''
Maybe Clock -> IO (Maybe Clock)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Clock
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_clock_id_get_time" gst_clock_id_get_time ::
Ptr () ->
IO Word64
clockIdGetTime ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m Word64
clockIdGetTime :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> m Word64
clockIdGetTime Ptr ()
id = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Word64
result <- Ptr () -> IO Word64
gst_clock_id_get_time Ptr ()
id
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_clock_id_ref" gst_clock_id_ref ::
Ptr () ->
IO (Ptr ())
clockIdRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m (Ptr ())
clockIdRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> m (Ptr ())
clockIdRef Ptr ()
id = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr ()
result <- Ptr () -> IO (Ptr ())
gst_clock_id_ref Ptr ()
id
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_clock_id_unref" gst_clock_id_unref ::
Ptr () ->
IO ()
clockIdUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m ()
clockIdUnref :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Ptr () -> m ()
clockIdUnref Ptr ()
id = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr () -> IO ()
gst_clock_id_unref Ptr ()
id
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_clock_id_unschedule" gst_clock_id_unschedule ::
Ptr () ->
IO ()
clockIdUnschedule ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m ()
clockIdUnschedule :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Ptr () -> m ()
clockIdUnschedule Ptr ()
id = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr () -> IO ()
gst_clock_id_unschedule Ptr ()
id
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_clock_id_uses_clock" gst_clock_id_uses_clock ::
Ptr () ->
Ptr Clock ->
IO CInt
clockIdUsesClock ::
(B.CallStack.HasCallStack, MonadIO m, IsClock a) =>
Ptr ()
-> a
-> m Bool
clockIdUsesClock :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClock a) =>
Ptr () -> a -> m Bool
clockIdUsesClock Ptr ()
id a
clock = 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 Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
CInt
result <- Ptr () -> Ptr Clock -> IO CInt
gst_clock_id_uses_clock Ptr ()
id Ptr Clock
clock'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_clock_id_wait" gst_clock_id_wait ::
Ptr () ->
Ptr Int64 ->
IO CUInt
clockIdWait ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m ((Gst.Enums.ClockReturn, Int64))
clockIdWait :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> m (ClockReturn, Int64)
clockIdWait Ptr ()
id = IO (ClockReturn, Int64) -> m (ClockReturn, Int64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (ClockReturn, Int64) -> m (ClockReturn, Int64))
-> IO (ClockReturn, Int64) -> m (ClockReturn, Int64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Int64
jitter <- IO (Ptr Int64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int64)
CUInt
result <- Ptr () -> Ptr Int64 -> IO CUInt
gst_clock_id_wait Ptr ()
id Ptr Int64
jitter
let result' :: ClockReturn
result' = (Int -> ClockReturn
forall a. Enum a => Int -> a
toEnum (Int -> ClockReturn) -> (CUInt -> Int) -> CUInt -> ClockReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
Int64
jitter' <- Ptr Int64 -> IO Int64
forall a. Storable a => Ptr a -> IO a
peek Ptr Int64
jitter
Ptr Int64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int64
jitter
(ClockReturn, Int64) -> IO (ClockReturn, Int64)
forall (m :: * -> *) a. Monad m => a -> m a
return (ClockReturn
result', Int64
jitter')
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_clock_id_wait_async" gst_clock_id_wait_async ::
Ptr () ->
FunPtr Gst.Callbacks.C_ClockCallback ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO CUInt
clockIdWaitAsync ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> Gst.Callbacks.ClockCallback
-> m Gst.Enums.ClockReturn
clockIdWaitAsync :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> ClockCallback -> m ClockReturn
clockIdWaitAsync Ptr ()
id ClockCallback
func = IO ClockReturn -> m ClockReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ClockReturn -> m ClockReturn)
-> IO ClockReturn -> m ClockReturn
forall a b. (a -> b) -> a -> b
$ do
FunPtr C_ClockCallback
func' <- C_ClockCallback -> IO (FunPtr C_ClockCallback)
Gst.Callbacks.mk_ClockCallback (Maybe (Ptr (FunPtr C_ClockCallback))
-> ClockCallback_WithClosures -> C_ClockCallback
Gst.Callbacks.wrap_ClockCallback Maybe (Ptr (FunPtr C_ClockCallback))
forall a. Maybe a
Nothing (ClockCallback -> ClockCallback_WithClosures
Gst.Callbacks.drop_closures_ClockCallback ClockCallback
func))
let userData :: Ptr ()
userData = FunPtr C_ClockCallback -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_ClockCallback
func'
let destroyData :: FunPtr (Ptr a -> IO ())
destroyData = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
CUInt
result <- Ptr ()
-> FunPtr C_ClockCallback
-> Ptr ()
-> FunPtr (Ptr () -> IO ())
-> IO CUInt
gst_clock_id_wait_async Ptr ()
id FunPtr C_ClockCallback
func' Ptr ()
userData FunPtr (Ptr () -> IO ())
forall a. FunPtr (Ptr a -> IO ())
destroyData
let result' :: ClockReturn
result' = (Int -> ClockReturn
forall a. Enum a => Int -> a
toEnum (Int -> ClockReturn) -> (CUInt -> Int) -> CUInt -> ClockReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
ClockReturn -> IO ClockReturn
forall (m :: * -> *) a. Monad m => a -> m a
return ClockReturn
result'
#if defined(ENABLE_OVERLOADING)
#endif