Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
AudioClock
makes it easy for elements to implement a Clock
, they
simply need to provide a function that returns the current clock time.
This object is internally used to implement the clock in AudioBaseSink
.
Synopsis
- newtype AudioClock = AudioClock (ManagedPtr AudioClock)
- class (GObject o, IsDescendantOf AudioClock o) => IsAudioClock o
- toAudioClock :: (MonadIO m, IsAudioClock o) => o -> m AudioClock
- audioClockAdjust :: (HasCallStack, MonadIO m, IsAudioClock a) => a -> Word64 -> m Word64
- audioClockGetTime :: (HasCallStack, MonadIO m, IsAudioClock a) => a -> m Word64
- audioClockInvalidate :: (HasCallStack, MonadIO m, IsAudioClock a) => a -> m ()
- audioClockNew :: (HasCallStack, MonadIO m) => Text -> AudioClockGetTimeFunc -> m AudioClock
- audioClockReset :: (HasCallStack, MonadIO m, IsAudioClock a) => a -> Word64 -> m ()
Exported types
newtype AudioClock Source #
Memory-managed wrapper type.
AudioClock (ManagedPtr AudioClock) |
Instances
Eq AudioClock Source # | |
Defined in GI.GstAudio.Objects.AudioClock (==) :: AudioClock -> AudioClock -> Bool # (/=) :: AudioClock -> AudioClock -> Bool # | |
GObject AudioClock Source # | |
Defined in GI.GstAudio.Objects.AudioClock | |
ManagedPtrNewtype AudioClock Source # | |
Defined in GI.GstAudio.Objects.AudioClock toManagedPtr :: AudioClock -> ManagedPtr AudioClock | |
TypedObject AudioClock Source # | |
Defined in GI.GstAudio.Objects.AudioClock | |
HasParentTypes AudioClock Source # | |
Defined in GI.GstAudio.Objects.AudioClock | |
IsGValue (Maybe AudioClock) Source # | Convert |
Defined in GI.GstAudio.Objects.AudioClock gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe AudioClock -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe AudioClock) | |
type ParentTypes AudioClock Source # | |
Defined in GI.GstAudio.Objects.AudioClock type ParentTypes AudioClock = '[SystemClock, Clock, Object, Object] |
class (GObject o, IsDescendantOf AudioClock o) => IsAudioClock o Source #
Type class for types which can be safely cast to AudioClock
, for instance with toAudioClock
.
Instances
(GObject o, IsDescendantOf AudioClock o) => IsAudioClock o Source # | |
Defined in GI.GstAudio.Objects.AudioClock |
toAudioClock :: (MonadIO m, IsAudioClock o) => o -> m AudioClock Source #
Cast to AudioClock
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
addControlBinding, addObservation, addObservationUnapplied, adjust, adjustUnlocked, adjustWithCalibration, bindProperty, bindPropertyFull, defaultError, forceFloating, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, invalidate, isFloating, isSynced, newPeriodicId, newSingleShotId, notify, notifyByPspec, periodicIdReinit, ref, refSink, removeControlBinding, reset, runDispose, singleShotIdReinit, stealData, stealQdata, suggestNextSync, syncValues, thawNotify, unadjustUnlocked, unadjustWithCalibration, unparent, unref, waitForSync, watchClosure.
Getters
getCalibration, getControlBinding, getControlRate, getData, getGValueArray, getInternalTime, getMaster, getName, getParent, getPathString, getProperty, getQdata, getResolution, getTime, getTimeout, getValue.
Setters
setCalibration, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setMaster, setName, setParent, setProperty, setResolution, setSynced, setTimeout.
adjust
:: (HasCallStack, MonadIO m, IsAudioClock a) | |
=> a |
|
-> Word64 |
|
-> m Word64 | Returns: |
Adjust time
with the internal offset of the audio clock.
getTime
:: (HasCallStack, MonadIO m, IsAudioClock a) | |
=> a |
|
-> m Word64 | Returns: the time as reported by the time function of the audio clock |
Report the time as returned by the AudioClockGetTimeFunc
without applying
any offsets.
invalidate
:: (HasCallStack, MonadIO m, IsAudioClock a) | |
=> a |
|
-> m () |
Invalidate the clock function. Call this function when the provided
AudioClockGetTimeFunc
cannot be called anymore, for example, when the
user_data becomes invalid.
After calling this function, clock
will return the last returned time for
the rest of its lifetime.
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> AudioClockGetTimeFunc |
|
-> m AudioClock | Returns: a new |
Create a new AudioClock
instance. Whenever the clock time should be
calculated it will call func
with userData
. When func
returns
CLOCK_TIME_NONE
, the clock will return the last reported time.
reset
:: (HasCallStack, MonadIO m, IsAudioClock a) | |
=> a |
|
-> Word64 |
|
-> m () |
Inform clock
that future calls to AudioClockGetTimeFunc
will return values
starting from time
. The clock will update an internal offset to make sure that
future calls to internal_time will return an increasing result as required by
the Clock
object.