TracktionEngine
|
Inherits juce::ChangeBroadcaster, juce::ChangeListener, and juce::AudioIODeviceCallback.
Classes | |
struct | ContextDeviceListRebuilder |
struct | CPUUsageListener |
Public Member Functions | |
~DeviceManager () override | |
void | initialise (int defaultNumInputChannelsToOpen=512, int defaultNumOutputChannelsToOpen=512) |
void | closeDevices () |
void | saveSettings () |
HostedAudioDeviceInterface & | getHostedAudioDeviceInterface () |
If you are using the engine in a plugin or an application that accesses the audio device directly, use this interface to pass audio and midi to the DeviceManager. More... | |
bool | isHostedAudioDeviceInterfaceInUse () const |
Returns true if the hosted interface is available and in use. More... | |
void | removeHostedAudioDeviceInterface () |
Removes the hosted audio device. More... | |
float | getCpuUsage () const noexcept |
void | setCpuLimitBeforeMuting (double newLimit) |
void | updateNumCPUs () |
void | addCPUUsageListener (CPUUsageListener *listener) |
void | removeCPUUsageListener (CPUUsageListener *listener) |
double | getSampleRate () const |
int | getBitDepth () const |
int | getBlockSize () const |
double | getBlockSizeMs () const |
TimeDuration | getBlockLength () const |
int | getNumWaveOutDevices () const |
WaveOutputDevice * | getWaveOutDevice (int index) const |
WaveOutputDevice * | getDefaultWaveOutDevice () const |
void | setDefaultWaveOutDevice (int index) |
int | getNumWaveInDevices () const |
WaveInputDevice * | getWaveInDevice (int index) const |
WaveInputDevice * | getDefaultWaveInDevice () const |
void | setDefaultWaveInDevice (int index) |
void | setDeviceOutChannelStereo (int channelNum, bool isStereoPair) |
bool | isDeviceOutChannelStereo (int chan) const |
bool | isDeviceOutEnabled (int chanNum) |
void | setDeviceInChannelStereo (int channelNum, bool isStereoPair) |
bool | isDeviceInChannelStereo (int chan) const |
bool | isDeviceInEnabled (int chanNum) |
void | setWaveOutChannelsEnabled (const std::vector< ChannelIndex > &, bool) |
void | setWaveInChannelsEnabled (const std::vector< ChannelIndex > &, bool) |
bool | rebuildWaveDeviceListIfNeeded () |
void | rescanMidiDeviceList (bool forceRescan) |
int | getNumMidiOutDevices () const |
MidiOutputDevice * | getMidiOutDevice (int index) const |
MidiOutputDevice * | getDefaultMidiOutDevice () const |
void | setDefaultMidiOutDevice (int index) |
int | getNumMidiInDevices () const |
MidiInputDevice * | getMidiInDevice (int index) const |
MidiInputDevice * | getDefaultMidiInDevice () const |
void | setDefaultMidiInDevice (int index) |
void | broadcastStreamTimeToMidiDevices (double streamTime) |
bool | shouldSendMidiTimecode () const noexcept |
double | getCurrentStreamTime () const noexcept |
Returns the current block's stream time. More... | |
bool | isMSWavetableSynthPresent () const |
void | resetToDefaults (bool deviceSettings, bool resetInputDevices, bool resetOutputDevices, bool latencySettings, bool mixSettings) |
int | getNumInputDevices () const |
InputDevice * | getInputDevice (int index) const |
int | getNumOutputDevices () const |
OutputDevice * | getOutputDeviceAt (int index) const |
OutputDevice * | findOutputDeviceForID (const juce::String &id) const |
OutputDevice * | findOutputDeviceWithName (const juce::String &name) const |
void | checkDefaultDevicesAreValid () |
juce::Result | createVirtualMidiDevice (const juce::String &name) |
void | deleteVirtualMidiDevice (VirtualMidiInputDevice *) |
double | getRecordAdjustmentMs () |
int | getRecordAdjustmentSamples () |
double | getOutputLatencySeconds () const |
void | addContext (EditPlaybackContext *) |
void | removeContext (EditPlaybackContext *) |
void | clearAllContextDevices () |
void | reloadAllContextDevices () |
void | setGlobalOutputAudioProcessor (juce::AudioProcessor *) |
Sets a global processor to be applied to the output. More... | |
juce::AudioProcessor * | getGlobalOutputAudioProcessor () const |
Returns a previously set globalOutputAudioProcessor. More... | |
Static Public Member Functions | |
static juce::String | getDefaultAudioOutDeviceName (bool translated) |
static juce::String | getDefaultMidiOutDeviceName (bool translated) |
static juce::String | getDefaultAudioInDeviceName (bool translated) |
static juce::String | getDefaultMidiInDeviceName (bool translated) |
Public Attributes | |
Engine & | engine |
std::unique_ptr< HostedAudioDeviceInterface > | hostedAudioDeviceInterface |
TracktionEngineAudioDeviceManager | deviceManager { engine } |
juce::OwnedArray< MidiInputDevice, juce::CriticalSection > | midiInputs |
juce::OwnedArray< MidiOutputDevice > | midiOutputs |
juce::OwnedArray< WaveInputDevice > | waveInputs |
juce::OwnedArray< WaveOutputDevice > | waveOutputs |
std::function< void(InputDevice *)> | warnOfWastedMidiMessagesFunction |
If this is set, it will get called (possibly on the midi thread) when incoming messages seem to be unused. More... | |
|
override |
void tracktion::engine::DeviceManager::initialise | ( | int | defaultNumInputChannelsToOpen = 512 , |
int | defaultNumOutputChannelsToOpen = 512 |
||
) |
void tracktion::engine::DeviceManager::closeDevices | ( | ) |
void tracktion::engine::DeviceManager::saveSettings | ( | ) |
HostedAudioDeviceInterface& tracktion::engine::DeviceManager::getHostedAudioDeviceInterface | ( | ) |
If you are using the engine in a plugin or an application that accesses the audio device directly, use this interface to pass audio and midi to the DeviceManager.
bool tracktion::engine::DeviceManager::isHostedAudioDeviceInterfaceInUse | ( | ) | const |
Returns true if the hosted interface is available and in use.
void tracktion::engine::DeviceManager::removeHostedAudioDeviceInterface | ( | ) |
Removes the hosted audio device.
You shouldn't normally need to call this but can be useful for running tests. Afterwards, you'll need to call initialise again.
|
noexcept |
void tracktion::engine::DeviceManager::setCpuLimitBeforeMuting | ( | double | newLimit | ) |
void tracktion::engine::DeviceManager::updateNumCPUs | ( | ) |
void tracktion::engine::DeviceManager::addCPUUsageListener | ( | CPUUsageListener * | listener | ) |
void tracktion::engine::DeviceManager::removeCPUUsageListener | ( | CPUUsageListener * | listener | ) |
double tracktion::engine::DeviceManager::getSampleRate | ( | ) | const |
int tracktion::engine::DeviceManager::getBitDepth | ( | ) | const |
int tracktion::engine::DeviceManager::getBlockSize | ( | ) | const |
double tracktion::engine::DeviceManager::getBlockSizeMs | ( | ) | const |
TimeDuration tracktion::engine::DeviceManager::getBlockLength | ( | ) | const |
int tracktion::engine::DeviceManager::getNumWaveOutDevices | ( | ) | const |
References waveOutputs.
WaveOutputDevice* tracktion::engine::DeviceManager::getWaveOutDevice | ( | int | index | ) | const |
References waveOutputs.
Referenced by getDefaultWaveOutDevice().
WaveOutputDevice* tracktion::engine::DeviceManager::getDefaultWaveOutDevice | ( | ) | const |
References getWaveOutDevice().
void tracktion::engine::DeviceManager::setDefaultWaveOutDevice | ( | int | index | ) |
int tracktion::engine::DeviceManager::getNumWaveInDevices | ( | ) | const |
References waveInputs.
WaveInputDevice* tracktion::engine::DeviceManager::getWaveInDevice | ( | int | index | ) | const |
References waveInputs.
Referenced by getDefaultWaveInDevice().
WaveInputDevice* tracktion::engine::DeviceManager::getDefaultWaveInDevice | ( | ) | const |
References getWaveInDevice().
void tracktion::engine::DeviceManager::setDefaultWaveInDevice | ( | int | index | ) |
void tracktion::engine::DeviceManager::setDeviceOutChannelStereo | ( | int | channelNum, |
bool | isStereoPair | ||
) |
bool tracktion::engine::DeviceManager::isDeviceOutChannelStereo | ( | int | chan | ) | const |
bool tracktion::engine::DeviceManager::isDeviceOutEnabled | ( | int | chanNum | ) |
void tracktion::engine::DeviceManager::setDeviceInChannelStereo | ( | int | channelNum, |
bool | isStereoPair | ||
) |
bool tracktion::engine::DeviceManager::isDeviceInChannelStereo | ( | int | chan | ) | const |
bool tracktion::engine::DeviceManager::isDeviceInEnabled | ( | int | chanNum | ) |
void tracktion::engine::DeviceManager::setWaveOutChannelsEnabled | ( | const std::vector< ChannelIndex > & | , |
bool | |||
) |
void tracktion::engine::DeviceManager::setWaveInChannelsEnabled | ( | const std::vector< ChannelIndex > & | , |
bool | |||
) |
bool tracktion::engine::DeviceManager::rebuildWaveDeviceListIfNeeded | ( | ) |
void tracktion::engine::DeviceManager::rescanMidiDeviceList | ( | bool | forceRescan | ) |
int tracktion::engine::DeviceManager::getNumMidiOutDevices | ( | ) | const |
References midiOutputs.
MidiOutputDevice* tracktion::engine::DeviceManager::getMidiOutDevice | ( | int | index | ) | const |
References midiOutputs.
Referenced by getDefaultMidiOutDevice().
MidiOutputDevice* tracktion::engine::DeviceManager::getDefaultMidiOutDevice | ( | ) | const |
References getMidiOutDevice().
void tracktion::engine::DeviceManager::setDefaultMidiOutDevice | ( | int | index | ) |
int tracktion::engine::DeviceManager::getNumMidiInDevices | ( | ) | const |
MidiInputDevice* tracktion::engine::DeviceManager::getMidiInDevice | ( | int | index | ) | const |
Referenced by getDefaultMidiInDevice().
MidiInputDevice* tracktion::engine::DeviceManager::getDefaultMidiInDevice | ( | ) | const |
References getMidiInDevice().
void tracktion::engine::DeviceManager::setDefaultMidiInDevice | ( | int | index | ) |
void tracktion::engine::DeviceManager::broadcastStreamTimeToMidiDevices | ( | double | streamTime | ) |
|
noexcept |
|
noexcept |
Returns the current block's stream time.
This shouldn't really be used and may be removed in future.
bool tracktion::engine::DeviceManager::isMSWavetableSynthPresent | ( | ) | const |
void tracktion::engine::DeviceManager::resetToDefaults | ( | bool | deviceSettings, |
bool | resetInputDevices, | ||
bool | resetOutputDevices, | ||
bool | latencySettings, | ||
bool | mixSettings | ||
) |
int tracktion::engine::DeviceManager::getNumInputDevices | ( | ) | const |
InputDevice* tracktion::engine::DeviceManager::getInputDevice | ( | int | index | ) | const |
int tracktion::engine::DeviceManager::getNumOutputDevices | ( | ) | const |
OutputDevice* tracktion::engine::DeviceManager::getOutputDeviceAt | ( | int | index | ) | const |
OutputDevice* tracktion::engine::DeviceManager::findOutputDeviceForID | ( | const juce::String & | id | ) | const |
OutputDevice* tracktion::engine::DeviceManager::findOutputDeviceWithName | ( | const juce::String & | name | ) | const |
void tracktion::engine::DeviceManager::checkDefaultDevicesAreValid | ( | ) |
|
static |
|
static |
|
static |
|
static |
juce::Result tracktion::engine::DeviceManager::createVirtualMidiDevice | ( | const juce::String & | name | ) |
void tracktion::engine::DeviceManager::deleteVirtualMidiDevice | ( | VirtualMidiInputDevice * | ) |
double tracktion::engine::DeviceManager::getRecordAdjustmentMs | ( | ) |
int tracktion::engine::DeviceManager::getRecordAdjustmentSamples | ( | ) |
double tracktion::engine::DeviceManager::getOutputLatencySeconds | ( | ) | const |
void tracktion::engine::DeviceManager::addContext | ( | EditPlaybackContext * | ) |
void tracktion::engine::DeviceManager::removeContext | ( | EditPlaybackContext * | ) |
void tracktion::engine::DeviceManager::clearAllContextDevices | ( | ) |
void tracktion::engine::DeviceManager::reloadAllContextDevices | ( | ) |
void tracktion::engine::DeviceManager::setGlobalOutputAudioProcessor | ( | juce::AudioProcessor * | ) |
Sets a global processor to be applied to the output.
This can be used to set a limiter or similar on the whole ouput. It shouldn't be used for musical effects.
juce::AudioProcessor* tracktion::engine::DeviceManager::getGlobalOutputAudioProcessor | ( | ) | const |
Returns a previously set globalOutputAudioProcessor.
Engine& tracktion::engine::DeviceManager::engine |
std::unique_ptr<HostedAudioDeviceInterface> tracktion::engine::DeviceManager::hostedAudioDeviceInterface |
TracktionEngineAudioDeviceManager tracktion::engine::DeviceManager::deviceManager { engine } |
juce::OwnedArray<MidiInputDevice, juce::CriticalSection> tracktion::engine::DeviceManager::midiInputs |
juce::OwnedArray<MidiOutputDevice> tracktion::engine::DeviceManager::midiOutputs |
Referenced by getMidiOutDevice(), and getNumMidiOutDevices().
juce::OwnedArray<WaveInputDevice> tracktion::engine::DeviceManager::waveInputs |
Referenced by getNumWaveInDevices(), and getWaveInDevice().
juce::OwnedArray<WaveOutputDevice> tracktion::engine::DeviceManager::waveOutputs |
Referenced by getNumWaveOutDevices(), and getWaveOutDevice().
std::function<void (InputDevice*)> tracktion::engine::DeviceManager::warnOfWastedMidiMessagesFunction |
If this is set, it will get called (possibly on the midi thread) when incoming messages seem to be unused.
May want to use it to warn the user.