Audaspace  1.4.0
A high level audio library.
Public Types | Public Member Functions | List of all members
ISynchronizer Interface Referenceabstract

This class enables global synchronization of several audio applications if supported. More...

#include <ISynchronizer.h>

Inheritance diagram for ISynchronizer:
Inheritance graph
[legend]

Public Types

typedef void(* syncFunction) (void *, int, float)
 The syncFunction is called when a synchronization event happens. More...
 

Public Member Functions

virtual ~ISynchronizer ()
 Destroys the synchronizer.
 
virtual void seek (std::shared_ptr< IHandle > handle, double time)=0
 Sets the playback position of a handle and the synchronizer to a specific time. More...
 
virtual double getPosition (std::shared_ptr< IHandle > handle)=0
 Retrieves the position of the synchronizer. More...
 
virtual void play ()=0
 Starts the synchronizer playback.
 
virtual void stop ()=0
 Stops the synchronizer playback.
 
virtual void setSyncCallback (syncFunction function, void *data)=0
 Sets the callback function that is called when a synchronization event happens. More...
 
virtual int isPlaying ()=0
 Retrieves whether the synchronizer is playing back. More...
 

Detailed Description

This class enables global synchronization of several audio applications if supported.

JACK for example supports synchronization through JACK Transport.

Member Typedef Documentation

◆ syncFunction

typedef void(* ISynchronizer::syncFunction) (void *, int, float)

The syncFunction is called when a synchronization event happens.

The function awaits three parameters. The first one is a user defined pointer, the second informs about whether playback is on and the third is the current playback time in seconds.

Member Function Documentation

◆ getPosition()

virtual double ISynchronizer::getPosition ( std::shared_ptr< IHandle handle)
pure virtual

Retrieves the position of the synchronizer.

Parameters
handleThe handle which is synchronized.
Returns
The position in seconds.

Implemented in CoreAudioSynchronizer, JackSynchronizer, and DefaultSynchronizer.

◆ isPlaying()

virtual int ISynchronizer::isPlaying ( )
pure virtual

Retrieves whether the synchronizer is playing back.

Returns
Whether the synchronizer plays back.

Implemented in CoreAudioSynchronizer, JackSynchronizer, and DefaultSynchronizer.

◆ seek()

virtual void ISynchronizer::seek ( std::shared_ptr< IHandle handle,
double  time 
)
pure virtual

Sets the playback position of a handle and the synchronizer to a specific time.

Parameters
handleThe handle that should be synchronized/seeked.
timeThe absolute time to synchronize to.

Implemented in CoreAudioSynchronizer, JackSynchronizer, and DefaultSynchronizer.

◆ setSyncCallback()

virtual void ISynchronizer::setSyncCallback ( syncFunction  function,
void *  data 
)
pure virtual

Sets the callback function that is called when a synchronization event happens.

Parameters
functionThe function to be called.
dataUser data to be passed to the callback.

Implemented in CoreAudioSynchronizer, JackSynchronizer, and DefaultSynchronizer.


The documentation for this interface was generated from the following file: