LMMS
Loading...
Searching...
No Matches
CarlaEngineJuce Class Reference
Inheritance diagram for CarlaEngineJuce:
juce::AudioIODeviceCallback juce::MidiInputCallback

Classes

struct  RtMidiEvents

Public Member Functions

 CarlaEngineJuce (juce::AudioIODeviceType *const devType)
 ~CarlaEngineJuce () override
bool init (const char *const clientName) override
bool close () override
bool hasIdleOnMainThread () const noexcept override
bool isRunning () const noexcept override
bool isOffline () const noexcept override
EngineType getType () const noexcept override
const char * getCurrentDriverName () const noexcept override
uint32_t getTotalXruns () const noexcept override
void clearXruns () const noexcept override
bool setBufferSizeAndSampleRate (const uint bufferSize, const double sampleRate) override
bool showDeviceControlPanel () const noexcept override
template<class Graph>
bool refreshExternalGraphPorts (Graph *const graph, const bool sendHost, const bool sendOSC)
bool patchbayRefresh (const bool sendHost, const bool sendOSC, const bool external) override
Public Member Functions inherited from juce::AudioIODeviceCallback
virtual ~AudioIODeviceCallback ()=default
virtual void audioDeviceIOCallbackWithContext (const float **inputChannelData, int numInputChannels, float **outputChannelData, int numOutputChannels, int numSamples, const AudioIODeviceCallbackContext &context)
Public Member Functions inherited from juce::MidiInputCallback
virtual ~MidiInputCallback ()=default
virtual void handlePartialSysexMessage (MidiInput *source, const uint8 *messageData, int numBytesSoFar, double timestamp)

Protected Member Functions

void audioDeviceIOCallback (const float **inputChannelData, int numInputChannels, float **outputChannelData, int numOutputChannels, int numSamples) override
void audioDeviceAboutToStart (juce::AudioIODevice *) override
void audioDeviceStopped () override
void audioDeviceError (const juce::String &errorMessage) override
void handleIncomingMidiMessage (juce::MidiInput *, const juce::MidiMessage &message) override
bool connectExternalGraphPort (const uint connectionType, const uint portId, const char *const portName) override
bool disconnectExternalGraphPort (const uint connectionType, const uint portId, const char *const portName) override

Private Attributes

CarlaScopedPointer< juce::AudioIODevicefDevice
juce::AudioIODeviceType *const fDeviceType
LinkedList< MidiInPortfMidiIns
RtMidiEvents fMidiInEvents
LinkedList< MidiOutPortfMidiOuts
CarlaMutex fMidiOutMutex

Constructor & Destructor Documentation

◆ CarlaEngineJuce()

CarlaEngineJuce::CarlaEngineJuce ( juce::AudioIODeviceType *const devType)
inline

◆ ~CarlaEngineJuce()

CarlaEngineJuce::~CarlaEngineJuce ( )
inlineoverride

Member Function Documentation

◆ audioDeviceAboutToStart()

void CarlaEngineJuce::audioDeviceAboutToStart ( juce::AudioIODevice * device)
inlineoverrideprotectedvirtual

Called to indicate that the device is about to start calling back.

This will be called just before the audio callbacks begin, either when this callback has just been added to an audio device, or after the device has been restarted because of a sample-rate or block-size change.

You can use this opportunity to find out the sample rate and block size that the device is going to use by calling the AudioIODevice::getCurrentSampleRate() and AudioIODevice::getCurrentBufferSizeSamples() on the supplied pointer.

Parameters
devicethe audio IO device that will be used to drive the callback. Note that if you're going to store this this pointer, it is only valid until the next time that audioDeviceStopped is called.

Implements juce::AudioIODeviceCallback.

◆ audioDeviceError()

void CarlaEngineJuce::audioDeviceError ( const juce::String & errorMessage)
inlineoverrideprotectedvirtual

This can be overridden to be told if the device generates an error while operating. Be aware that this could be called by any thread! And not all devices perform this callback.

Reimplemented from juce::AudioIODeviceCallback.

◆ audioDeviceIOCallback()

void CarlaEngineJuce::audioDeviceIOCallback ( const float ** inputChannelData,
int numInputChannels,
float ** outputChannelData,
int numOutputChannels,
int numSamples )
inlineoverrideprotectedvirtual

Processes a block of incoming and outgoing audio data.

The subclass's implementation should use the incoming audio for whatever purposes it needs to, and must fill all the output channels with the next block of output data before returning.

The channel data is arranged with the same array indices as the channel name array returned by AudioIODevice::getOutputChannelNames(), but those channels that aren't specified in AudioIODevice::open() will have a null pointer for their associated channel, so remember to check for this.

Parameters
inputChannelDataa set of arrays containing the audio data for each incoming channel - this data is valid until the function returns. There will be one channel of data for each input channel that was enabled when the audio device was opened (see AudioIODevice::open())
numInputChannelsthe number of pointers to channel data in the inputChannelData array.
outputChannelDataa set of arrays which need to be filled with the data that should be sent to each outgoing channel of the device. There will be one channel of data for each output channel that was enabled when the audio device was opened (see AudioIODevice::open()) The initial contents of the array is undefined, so the callback function must fill all the channels with zeros if its output is silence. Failing to do this could cause quite an unpleasant noise!
numOutputChannelsthe number of pointers to channel data in the outputChannelData array.
numSamplesthe number of samples in each channel of the input and output arrays. The number of samples will depend on the audio device's buffer size and will usually remain constant, although this isn't guaranteed. For example, on Android, on devices which support it, Android will chop up your audio processing into several smaller callbacks to ensure higher audio performance. So make sure your code can cope with reasonable changes in the buffer size from one callback to the next.

Reimplemented from juce::AudioIODeviceCallback.

◆ audioDeviceStopped()

void CarlaEngineJuce::audioDeviceStopped ( )
inlineoverrideprotectedvirtual

Called to indicate that the device has stopped.

Implements juce::AudioIODeviceCallback.

◆ clearXruns()

void CarlaEngineJuce::clearXruns ( ) const
inlineoverridenoexcept

◆ close()

bool CarlaEngineJuce::close ( )
inlineoverride

◆ connectExternalGraphPort()

bool CarlaEngineJuce::connectExternalGraphPort ( const uint connectionType,
const uint portId,
const char *const portName )
inlineoverrideprotected

◆ disconnectExternalGraphPort()

bool CarlaEngineJuce::disconnectExternalGraphPort ( const uint connectionType,
const uint portId,
const char *const portName )
inlineoverrideprotected

◆ getCurrentDriverName()

const char * CarlaEngineJuce::getCurrentDriverName ( ) const
inlineoverridenoexcept

◆ getTotalXruns()

uint32_t CarlaEngineJuce::getTotalXruns ( ) const
inlineoverridenoexcept

◆ getType()

EngineType CarlaEngineJuce::getType ( ) const
inlineoverridenoexcept

◆ handleIncomingMidiMessage()

void CarlaEngineJuce::handleIncomingMidiMessage ( juce::MidiInput * source,
const juce::MidiMessage & message )
inlineoverrideprotectedvirtual

Receives an incoming message.

A MidiInput object will call this method when a midi event arrives. It'll be called on a high-priority system thread, so avoid doing anything time-consuming in here, and avoid making any UI calls. You might find the MidiBuffer class helpful for queueing incoming messages for use later.

Parameters
sourcethe MidiInput object that generated the message
messagethe incoming message. The message's timestamp is set to a value equivalent to (Time::getMillisecondCounter() / 1000.0) to specify the time when the message arrived

Implements juce::MidiInputCallback.

◆ hasIdleOnMainThread()

bool CarlaEngineJuce::hasIdleOnMainThread ( ) const
inlineoverridenoexcept

◆ init()

bool CarlaEngineJuce::init ( const char *const clientName)
inlineoverride

◆ isOffline()

bool CarlaEngineJuce::isOffline ( ) const
inlineoverridenoexcept

◆ isRunning()

bool CarlaEngineJuce::isRunning ( ) const
inlineoverridenoexcept

◆ patchbayRefresh()

bool CarlaEngineJuce::patchbayRefresh ( const bool sendHost,
const bool sendOSC,
const bool external )
inlineoverride

◆ refreshExternalGraphPorts()

template<class Graph>
bool CarlaEngineJuce::refreshExternalGraphPorts ( Graph *const graph,
const bool sendHost,
const bool sendOSC )
inline

◆ setBufferSizeAndSampleRate()

bool CarlaEngineJuce::setBufferSizeAndSampleRate ( const uint bufferSize,
const double sampleRate )
inlineoverride

◆ showDeviceControlPanel()

bool CarlaEngineJuce::showDeviceControlPanel ( ) const
inlineoverridenoexcept

Member Data Documentation

◆ fDevice

CarlaScopedPointer<juce::AudioIODevice> CarlaEngineJuce::fDevice
private

◆ fDeviceType

juce::AudioIODeviceType* const CarlaEngineJuce::fDeviceType
private

◆ fMidiInEvents

RtMidiEvents CarlaEngineJuce::fMidiInEvents
private

◆ fMidiIns

LinkedList<MidiInPort> CarlaEngineJuce::fMidiIns
private

◆ fMidiOutMutex

CarlaMutex CarlaEngineJuce::fMidiOutMutex
private

◆ fMidiOuts

LinkedList<MidiOutPort> CarlaEngineJuce::fMidiOuts
private

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