gi-gstaudio-1.0.22: GStreamerAudio bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.GstAudio.Objects.AudioClock

Description

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

Exported types

newtype AudioClock Source #

Memory-managed wrapper type.

Constructors

AudioClock (ManagedPtr AudioClock) 

Instances

Instances details
Eq AudioClock Source # 
Instance details

Defined in GI.GstAudio.Objects.AudioClock

Methods

(==) :: AudioClock -> AudioClock -> Bool

(/=) :: AudioClock -> AudioClock -> Bool

GObject AudioClock Source # 
Instance details

Defined in GI.GstAudio.Objects.AudioClock

ManagedPtrNewtype AudioClock Source # 
Instance details

Defined in GI.GstAudio.Objects.AudioClock

Methods

toManagedPtr :: AudioClock -> ManagedPtr AudioClock

TypedObject AudioClock Source # 
Instance details

Defined in GI.GstAudio.Objects.AudioClock

Methods

glibType :: IO GType

IsGValue AudioClock Source #

Convert AudioClock to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.GstAudio.Objects.AudioClock

Methods

toGValue :: AudioClock -> IO GValue

fromGValue :: GValue -> IO AudioClock

HasParentTypes AudioClock Source # 
Instance details

Defined in GI.GstAudio.Objects.AudioClock

type ParentTypes AudioClock Source # 
Instance details

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

Instances details
(GObject o, IsDescendantOf AudioClock o) => IsAudioClock o Source # 
Instance details

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

Overloaded methods

adjust

audioClockAdjust Source #

Arguments

:: (HasCallStack, MonadIO m, IsAudioClock a) 
=> a

clock: a AudioClock

-> Word64

time: a GstClockTime

-> m Word64

Returns: time adjusted with the internal offset.

Adjust time with the internal offset of the audio clock.

getTime

audioClockGetTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsAudioClock a) 
=> a

clock: a AudioClock

-> 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

audioClockInvalidate Source #

Arguments

:: (HasCallStack, MonadIO m, IsAudioClock a) 
=> a

clock: a AudioClock

-> 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

audioClockNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the name of the clock

-> AudioClockGetTimeFunc

func: a function

-> m AudioClock

Returns: a new AudioClock casted to a Clock.

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

audioClockReset Source #

Arguments

:: (HasCallStack, MonadIO m, IsAudioClock a) 
=> a

clock: a AudioClock

-> Word64

time: a GstClockTime

-> 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.