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

An ExternalPlayheadSynchroniser is used to synchronise the internal Edit's playhead with an AudioProcessor, for use in plugins. More...

Public Member Functions

 ExternalPlayheadSynchroniser (Edit &)
 Constructs an ExternalPlayheadSynchroniser. More...
 
bool synchronise (juce::AudioPlayHead &)
 Synchronises the Edit's playback position with an AudioPlayHead if possible. More...
 
bool synchronise (juce::AudioProcessor &)
 Synchronises the Edit's playback position with the AudioProcessor's playhead if possible. More...
 
juce::AudioPlayHead::CurrentPositionInfo getPositionInfo () const
 Returns the current position info, useful for graphical displays etc. More...
 

Detailed Description

An ExternalPlayheadSynchroniser is used to synchronise the internal Edit's playhead with an AudioProcessor, for use in plugins.

Just create one when you create your Edit and repeatedly call the synchronise method in your process block like this:

void processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midi) override
{
// Update position info first
externalPlayheadSynchroniser.synchronise (*this);
...

Constructor & Destructor Documentation

◆ ExternalPlayheadSynchroniser()

tracktion::engine::ExternalPlayheadSynchroniser::ExternalPlayheadSynchroniser ( Edit )

Member Function Documentation

◆ synchronise() [1/2]

bool tracktion::engine::ExternalPlayheadSynchroniser::synchronise ( juce::AudioPlayHead &  )

Synchronises the Edit's playback position with an AudioPlayHead if possible.

Generally you'd call this at the start of your plugin's processBlock method.

Returns
true if it was able to synchronise, false otherwise.

◆ synchronise() [2/2]

bool tracktion::engine::ExternalPlayheadSynchroniser::synchronise ( juce::AudioProcessor &  )

Synchronises the Edit's playback position with the AudioProcessor's playhead if possible.

Generally you'd call this at the start of your plugin's processBlock method.

Returns
true if it was able to synchronise, false otherwise.

◆ getPositionInfo()

juce::AudioPlayHead::CurrentPositionInfo tracktion::engine::ExternalPlayheadSynchroniser::getPositionInfo ( ) const

Returns the current position info, useful for graphical displays etc.


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