TracktionEngine
Classes | Public Member Functions | List of all members
tracktion::engine::AbletonLink Class Reference

Manages an Ableton Link session connecting an Edit with a number of networked peers, syncronising their tempos, bar phases and start/stop statuses. More...

Classes

struct  Listener
 When Link is on, you shouldn't set the tempo directly. More...
 

Public Member Functions

 AbletonLink (TransportControl &)
 Creates an Ableton Link connection for an Edit. More...
 
 ~AbletonLink ()
 Destructor. More...
 
void setEnabled (bool isEnabled)
 On iOS you need this to instantiate an ABLLinkSettingsViewController. More...
 
bool isEnabled () const
 Is Link enabled? It may not be connected to any peers even if it is. More...
 
bool isConnected () const
 Is Link connected to any other peers? More...
 
size_t getNumPeers () const
 Returns the number of connected peers. More...
 
bool isPlaying () const
 Returns whether the Link transport is currently playing. More...
 
void enableStartStopSync (bool enable)
 Sets whether start/stop is syncronsied. More...
 
bool isStartStopSyncEnabled () const
 Returns whether start/stop is syncronsied. More...
 
double getSessionTempo () const
 Get the current session tempo. More...
 
double getBeatsUntilNextCycle (double quantum) const
 Number of beats until the next bar (quantum) - e.g. More...
 
void setCustomOffset (int offsetMs)
 Use to offset the calculations by some amount (on top of device latency). More...
 
void setTempoConstraint (juce::Range< double > minMaxTempo)
 Once set, tempos chnages from link are transparently divided or multiplied by 2 to stay within this range (if possible). More...
 
double getBarPhase () const
 Returns how far though the current bar the Link clock is. More...
 
double getChaseProportion () const
 Returns how much chasing playback is doing. More...
 
void requestStartStopChange (bool isPlaying)
 Request the Link session to start or stop playing. More...
 
void requestTempoChange (double newBpm)
 Request the Link session to change tempo. More...
 
void addListener (Listener *)
 Adds a listener. More...
 
void removeListener (Listener *)
 Removes a previously added listener. More...
 
void syncronise (TimePosition)
 

Detailed Description

Manages an Ableton Link session connecting an Edit with a number of networked peers, syncronising their tempos, bar phases and start/stop statuses.

Constructor & Destructor Documentation

◆ AbletonLink()

tracktion::engine::AbletonLink::AbletonLink ( TransportControl )

Creates an Ableton Link connection for an Edit.

Don't create one of these manually, get the one contained in the Edit with Edit::getAbletonLink().

◆ ~AbletonLink()

tracktion::engine::AbletonLink::~AbletonLink ( )

Destructor.

Member Function Documentation

◆ setEnabled()

void tracktion::engine::AbletonLink::setEnabled ( bool  isEnabled)

On iOS you need this to instantiate an ABLLinkSettingsViewController.

Enable Link. On platforms other than iOS, Link connects automatically once this is set. On iOS the user must additionally switch Link on using the ABLLinkSettingsViewController. Off by default on desktop, on by default on iOS.

◆ isEnabled()

bool tracktion::engine::AbletonLink::isEnabled ( ) const

Is Link enabled? It may not be connected to any peers even if it is.

◆ isConnected()

bool tracktion::engine::AbletonLink::isConnected ( ) const

Is Link connected to any other peers?

◆ getNumPeers()

size_t tracktion::engine::AbletonLink::getNumPeers ( ) const

Returns the number of connected peers.

◆ isPlaying()

bool tracktion::engine::AbletonLink::isPlaying ( ) const

Returns whether the Link transport is currently playing.

◆ enableStartStopSync()

void tracktion::engine::AbletonLink::enableStartStopSync ( bool  enable)

Sets whether start/stop is syncronsied.

◆ isStartStopSyncEnabled()

bool tracktion::engine::AbletonLink::isStartStopSyncEnabled ( ) const

Returns whether start/stop is syncronsied.

If you're not connected, this may not make sense.

◆ getSessionTempo()

double tracktion::engine::AbletonLink::getSessionTempo ( ) const

Get the current session tempo.

If you're not connected, this may not make sense.

◆ getBeatsUntilNextCycle()

double tracktion::engine::AbletonLink::getBeatsUntilNextCycle ( double  quantum) const

Number of beats until the next bar (quantum) - e.g.

supply 4.0 for 4/4 cycles.

◆ setCustomOffset()

void tracktion::engine::AbletonLink::setCustomOffset ( int  offsetMs)

Use to offset the calculations by some amount (on top of device latency).

◆ setTempoConstraint()

void tracktion::engine::AbletonLink::setTempoConstraint ( juce::Range< double >  minMaxTempo)

Once set, tempos chnages from link are transparently divided or multiplied by 2 to stay within this range (if possible).

◆ getBarPhase()

double tracktion::engine::AbletonLink::getBarPhase ( ) const

Returns how far though the current bar the Link clock is.

◆ getChaseProportion()

double tracktion::engine::AbletonLink::getChaseProportion ( ) const

Returns how much chasing playback is doing.

0 means perfectly in sync 1 means playback is speeding up as much as it can -1 means playback is slowing down as much as it can

◆ requestStartStopChange()

void tracktion::engine::AbletonLink::requestStartStopChange ( bool  isPlaying)

Request the Link session to start or stop playing.

This will in turn trigger a callback to linkRequestedStartStopChange which should be used to actually start the transport. [[ message_thread ]]

◆ requestTempoChange()

void tracktion::engine::AbletonLink::requestTempoChange ( double  newBpm)

Request the Link session to change tempo.

This will in turn trigger a callback to linkRequestedTempoChange which should be used to actually change the tempo. [[ message_thread ]]

◆ addListener()

void tracktion::engine::AbletonLink::addListener ( Listener )

Adds a listener.

◆ removeListener()

void tracktion::engine::AbletonLink::removeListener ( Listener )

Removes a previously added listener.

◆ syncronise()

void tracktion::engine::AbletonLink::syncronise ( TimePosition  )

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