|
TracktionEngine
|
#include <tracktion_DeviceManager.h>
Inherits juce::ChangeBroadcaster, juce::ChangeListener, juce::AudioIODeviceCallback, juce::AsyncUpdater, and juce::Timer.
Classes | |
| struct | TracktionEngineAudioDeviceManager |
| Subclass of an AudioDeviceManager which can be used to avoid adding the system audio devices in plugin builds. More... | |
Public Member Functions | |
| ~DeviceManager () override | |
| void | initialise (int defaultNumInputChannelsToOpen=defaultNumChannelsToOpen, int defaultNumOutputChannelsToOpen=defaultNumChannelsToOpen) |
| void | closeDevices () |
| void | saveSettings () |
| void | resetToDefaults (bool deviceSettings, bool resetInputDevices, bool resetOutputDevices, bool latencySettings, bool mixSettings) |
| void | rescanMidiDeviceList () |
| void | rescanWaveDeviceList () |
| int | getMidiDeviceScanIntervalSeconds () const |
| void | setMidiDeviceScanIntervalSeconds (int intervalSeconds) |
| double | getSampleRate () const |
| int | getBitDepth () const |
| int | getBlockSize () const |
| TimeDuration | getBlockLength () const |
| double | getBlockSizeMs () const |
| double | getOutputLatencySeconds () const |
| double | getRecordAdjustmentMs () |
| int | getRecordAdjustmentSamples () |
| float | getCpuUsage () const noexcept |
| void | setCpuLimitBeforeMuting (double newLimit) |
| PerformanceMeasurement::Statistics | getCPUStatistics () const |
| void | restCPUStatistics () |
| void | updateNumCPUs () |
| void | enableOutputClipping (bool clipOutput) |
| If set to true, clips the output at 0.0. | |
| bool | hasOutputClipped (bool reset) |
| Checks if the output has clipped. | |
| 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. | |
| bool | isHostedAudioDeviceInterfaceInUse () const |
| Returns true if the hosted interface is available and in use. | |
| void | removeHostedAudioDeviceInterface () |
| Removes the hosted audio device. | |
| int | getNumInputDevices () const |
| InputDevice * | getInputDevice (int index) const |
| int | getNumOutputDevices () const |
| OutputDevice * | getOutputDeviceAt (int index) const |
| InputDevice * | findInputDeviceForID (const juce::String &id) const |
| InputDevice * | findInputDeviceWithName (const juce::String &name) const |
| std::shared_ptr< MidiInputDevice > | findMidiInputDeviceForID (const juce::String &id) const |
| OutputDevice * | findOutputDeviceForID (const juce::String &id) const |
| OutputDevice * | findOutputDeviceWithName (const juce::String &name) const |
| int | getNumWaveOutDevices () const |
| WaveOutputDevice * | getWaveOutDevice (int index) const |
| void | setDefaultWaveOutDevice (juce::String deviceID) |
| WaveOutputDevice * | getDefaultWaveOutDevice () const |
| juce::String | getDefaultWaveOutDeviceID () const |
| int | getNumWaveInDevices () const |
| WaveInputDevice * | getWaveInDevice (int index) const |
| void | setDefaultWaveInDevice (juce::String deviceID) |
| WaveInputDevice * | getDefaultWaveInDevice () const |
| juce::String | getDefaultWaveInDeviceID () const |
| std::vector< WaveOutputDevice * > | getWaveOutputDevices () |
| std::vector< WaveInputDevice * > | getWaveInputDevices () |
| void | setDeviceEnabled (WaveOutputDevice &, bool) |
| void | setDeviceEnabled (WaveInputDevice &, bool) |
| void | setDeviceNumChannels (WaveOutputDevice &, uint32_t numChannels) |
| void | setDeviceNumChannels (WaveInputDevice &, uint32_t numChannels) |
| void | setAllWaveInputsToNumChannels (uint32_t numChannels) |
| void | setAllWaveOutputsToNumChannels (uint32_t numChannels) |
| juce::StringArray | getPossibleChannelGroupsForDevice (WaveOutputDevice &, uint32_t maxNumChannels) const |
| juce::StringArray | getPossibleChannelGroupsForDevice (WaveInputDevice &, uint32_t maxNumChannels) const |
| juce::XmlElement | getCurrentWaveDeviceLayout () const |
| Wave device channel-grouping layout presets. | |
| void | applyWaveDeviceLayout (const juce::XmlElement &) |
| Applies a previously captured layout to the current device, rebuilding the wave devices. | |
| juce::StringArray | getWaveDeviceLayoutPresetNames () |
| Returns the names of all stored channel-layout presets. | |
| void | saveWaveDeviceLayoutPreset (const juce::String &name) |
| Stores the current channel grouping as a named preset (overwriting any preset with the same name). | |
| void | loadWaveDeviceLayoutPreset (const juce::String &name) |
| Recalls a named preset and applies it to the current device. | |
| void | deleteWaveDeviceLayoutPreset (const juce::String &name) |
| Deletes a named preset. | |
| int | getNumMidiOutDevices () const |
| MidiOutputDevice * | getMidiOutDevice (int index) const |
| void | setDefaultMidiOutDevice (juce::String deviceID) |
| MidiOutputDevice * | getDefaultMidiOutDevice () const |
| juce::String | getDefaultMidiOutDeviceID () const |
| int | getNumMidiInDevices () const |
| std::shared_ptr< MidiInputDevice > | getMidiInDevice (int index) const |
| std::vector< std::shared_ptr< MidiInputDevice > > | getMidiInDevices () const |
| void | setDefaultMidiInDevice (juce::String deviceID) |
| MidiInputDevice * | getDefaultMidiInDevice () const |
| juce::String | getDefaultMidiInDeviceID () const |
| void | injectMIDIMessageToDefaultDevice (const juce::MidiMessage &) |
| void | broadcastMessageToAllVirtualDevices (PhysicalMidiInputDevice &, const juce::MidiMessage &) |
| void | broadcastStreamTimeToMidiDevices (double streamTime) |
| bool | shouldSendMidiTimecode () const noexcept |
| double | getCurrentStreamTime () const noexcept |
| Returns the current block's stream time. | |
| bool | isMSWavetableSynthPresent () const |
| void | dispatchPendingUpdates () |
| Changes to the devices get applied asyncronously so this function can be called to trigger any pending updates to be flushed. | |
| void | checkDefaultDevicesAreValid () |
| juce::Result | createVirtualMidiDevice (const juce::String &name) |
| void | deleteVirtualMidiDevice (VirtualMidiInputDevice &) |
| void | addContext (EditPlaybackContext *) |
| void | removeContext (EditPlaybackContext *) |
| void | setGlobalOutputAudioProcessor (std::unique_ptr< juce::AudioProcessor >) |
| Sets a global processor to be applied to the output. | |
| juce::AudioProcessor * | getGlobalOutputAudioProcessor () const |
| Returns a previously set globalOutputAudioProcessor. | |
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 |
| TracktionEngineAudioDeviceManager | deviceManager { engine } |
| std::unique_ptr< HostedAudioDeviceInterface > | hostedAudioDeviceInterface |
| std::vector< std::shared_ptr< MidiInputDevice > > | midiInputs |
| std::vector< std::shared_ptr< 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. | |
Static Public Attributes | |
| static constexpr int | defaultNumChannelsToOpen = 512 |
| static constexpr uint32_t | maxNumChannelsPerDevice = 128 |
|
override |
| void engine::DeviceManager::initialise | ( | int | defaultNumInputChannelsToOpen = defaultNumChannelsToOpen, |
| int | defaultNumOutputChannelsToOpen = defaultNumChannelsToOpen |
||
| ) |
| void engine::DeviceManager::closeDevices | ( | ) |
| void engine::DeviceManager::saveSettings | ( | ) |
| void engine::DeviceManager::resetToDefaults | ( | bool | deviceSettings, |
| bool | resetInputDevices, | ||
| bool | resetOutputDevices, | ||
| bool | latencySettings, | ||
| bool | mixSettings | ||
| ) |
| void engine::DeviceManager::rescanMidiDeviceList | ( | ) |
| void engine::DeviceManager::rescanWaveDeviceList | ( | ) |
| int engine::DeviceManager::getMidiDeviceScanIntervalSeconds | ( | ) | const |
| void engine::DeviceManager::setMidiDeviceScanIntervalSeconds | ( | int | intervalSeconds | ) |
| double engine::DeviceManager::getSampleRate | ( | ) | const |
| int engine::DeviceManager::getBitDepth | ( | ) | const |
| int engine::DeviceManager::getBlockSize | ( | ) | const |
| TimeDuration engine::DeviceManager::getBlockLength | ( | ) | const |
| double engine::DeviceManager::getBlockSizeMs | ( | ) | const |
| double engine::DeviceManager::getOutputLatencySeconds | ( | ) | const |
| double engine::DeviceManager::getRecordAdjustmentMs | ( | ) |
| int engine::DeviceManager::getRecordAdjustmentSamples | ( | ) |
|
noexcept |
| void engine::DeviceManager::setCpuLimitBeforeMuting | ( | double | newLimit | ) |
| PerformanceMeasurement::Statistics engine::DeviceManager::getCPUStatistics | ( | ) | const |
| void engine::DeviceManager::restCPUStatistics | ( | ) |
| void engine::DeviceManager::updateNumCPUs | ( | ) |
| void engine::DeviceManager::enableOutputClipping | ( | bool | clipOutput | ) |
If set to true, clips the output at 0.0.
| bool engine::DeviceManager::hasOutputClipped | ( | bool | reset | ) |
Checks if the output has clipped.
| reset | Resets the clipped flag |
| HostedAudioDeviceInterface & 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 engine::DeviceManager::isHostedAudioDeviceInterfaceInUse | ( | ) | const |
Returns true if the hosted interface is available and in use.
| void 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.
| int engine::DeviceManager::getNumInputDevices | ( | ) | const |
| InputDevice * engine::DeviceManager::getInputDevice | ( | int | index | ) | const |
| int engine::DeviceManager::getNumOutputDevices | ( | ) | const |
| OutputDevice * engine::DeviceManager::getOutputDeviceAt | ( | int | index | ) | const |
| InputDevice * engine::DeviceManager::findInputDeviceForID | ( | const juce::String & | id | ) | const |
| InputDevice * engine::DeviceManager::findInputDeviceWithName | ( | const juce::String & | name | ) | const |
| std::shared_ptr< MidiInputDevice > engine::DeviceManager::findMidiInputDeviceForID | ( | const juce::String & | id | ) | const |
| OutputDevice * engine::DeviceManager::findOutputDeviceForID | ( | const juce::String & | id | ) | const |
| OutputDevice * engine::DeviceManager::findOutputDeviceWithName | ( | const juce::String & | name | ) | const |
| int engine::DeviceManager::getNumWaveOutDevices | ( | ) | const |
| WaveOutputDevice * engine::DeviceManager::getWaveOutDevice | ( | int | index | ) | const |
| void engine::DeviceManager::setDefaultWaveOutDevice | ( | juce::String | deviceID | ) |
| WaveOutputDevice * engine::DeviceManager::getDefaultWaveOutDevice | ( | ) | const |
| juce::String engine::DeviceManager::getDefaultWaveOutDeviceID | ( | ) | const |
| int engine::DeviceManager::getNumWaveInDevices | ( | ) | const |
| WaveInputDevice * engine::DeviceManager::getWaveInDevice | ( | int | index | ) | const |
| void engine::DeviceManager::setDefaultWaveInDevice | ( | juce::String | deviceID | ) |
| WaveInputDevice * engine::DeviceManager::getDefaultWaveInDevice | ( | ) | const |
| juce::String engine::DeviceManager::getDefaultWaveInDeviceID | ( | ) | const |
| std::vector< WaveOutputDevice * > engine::DeviceManager::getWaveOutputDevices | ( | ) |
| std::vector< WaveInputDevice * > engine::DeviceManager::getWaveInputDevices | ( | ) |
| void engine::DeviceManager::setDeviceEnabled | ( | WaveOutputDevice & | , |
| bool | |||
| ) |
| void engine::DeviceManager::setDeviceEnabled | ( | WaveInputDevice & | , |
| bool | |||
| ) |
| void engine::DeviceManager::setDeviceNumChannels | ( | WaveOutputDevice & | , |
| uint32_t | numChannels | ||
| ) |
| void engine::DeviceManager::setDeviceNumChannels | ( | WaveInputDevice & | , |
| uint32_t | numChannels | ||
| ) |
| void engine::DeviceManager::setAllWaveInputsToNumChannels | ( | uint32_t | numChannels | ) |
| void engine::DeviceManager::setAllWaveOutputsToNumChannels | ( | uint32_t | numChannels | ) |
| juce::StringArray engine::DeviceManager::getPossibleChannelGroupsForDevice | ( | WaveOutputDevice & | , |
| uint32_t | maxNumChannels | ||
| ) | const |
| juce::StringArray engine::DeviceManager::getPossibleChannelGroupsForDevice | ( | WaveInputDevice & | , |
| uint32_t | maxNumChannels | ||
| ) | const |
| juce::XmlElement engine::DeviceManager::getCurrentWaveDeviceLayout | ( | ) | const |
Wave device channel-grouping layout presets.
The way a physical device's channels are grouped into WaveInputDevice and WaveOutputDevice instances is normally stored per-device-type and lost when the device changes. These methods let that grouping be captured as a named preset (stored in the global PropertyStorage) and recalled at any time, even onto a different device - the recalled layout is fitted to whatever device is currently active. Returns the current channel grouping as an XML layout (an AUDIODEVICE_LAYOUT element).
| void engine::DeviceManager::applyWaveDeviceLayout | ( | const juce::XmlElement & | ) |
Applies a previously captured layout to the current device, rebuilding the wave devices.
| juce::StringArray engine::DeviceManager::getWaveDeviceLayoutPresetNames | ( | ) |
Returns the names of all stored channel-layout presets.
| void engine::DeviceManager::saveWaveDeviceLayoutPreset | ( | const juce::String & | name | ) |
Stores the current channel grouping as a named preset (overwriting any preset with the same name).
| void engine::DeviceManager::loadWaveDeviceLayoutPreset | ( | const juce::String & | name | ) |
Recalls a named preset and applies it to the current device.
| void engine::DeviceManager::deleteWaveDeviceLayoutPreset | ( | const juce::String & | name | ) |
Deletes a named preset.
| int engine::DeviceManager::getNumMidiOutDevices | ( | ) | const |
| MidiOutputDevice * engine::DeviceManager::getMidiOutDevice | ( | int | index | ) | const |
| void engine::DeviceManager::setDefaultMidiOutDevice | ( | juce::String | deviceID | ) |
| MidiOutputDevice * engine::DeviceManager::getDefaultMidiOutDevice | ( | ) | const |
| juce::String engine::DeviceManager::getDefaultMidiOutDeviceID | ( | ) | const |
| int engine::DeviceManager::getNumMidiInDevices | ( | ) | const |
| std::shared_ptr< MidiInputDevice > engine::DeviceManager::getMidiInDevice | ( | int | index | ) | const |
| std::vector< std::shared_ptr< MidiInputDevice > > engine::DeviceManager::getMidiInDevices | ( | ) | const |
| void engine::DeviceManager::setDefaultMidiInDevice | ( | juce::String | deviceID | ) |
| MidiInputDevice * engine::DeviceManager::getDefaultMidiInDevice | ( | ) | const |
| juce::String engine::DeviceManager::getDefaultMidiInDeviceID | ( | ) | const |
| void engine::DeviceManager::injectMIDIMessageToDefaultDevice | ( | const juce::MidiMessage & | ) |
| void engine::DeviceManager::broadcastMessageToAllVirtualDevices | ( | PhysicalMidiInputDevice & | , |
| const juce::MidiMessage & | |||
| ) |
| void 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 engine::DeviceManager::isMSWavetableSynthPresent | ( | ) | const |
| void engine::DeviceManager::dispatchPendingUpdates | ( | ) |
Changes to the devices get applied asyncronously so this function can be called to trigger any pending updates to be flushed.
| void engine::DeviceManager::checkDefaultDevicesAreValid | ( | ) |
|
static |
|
static |
|
static |
|
static |
| juce::Result engine::DeviceManager::createVirtualMidiDevice | ( | const juce::String & | name | ) |
| void engine::DeviceManager::deleteVirtualMidiDevice | ( | VirtualMidiInputDevice & | ) |
| void engine::DeviceManager::addContext | ( | EditPlaybackContext * | ) |
| void engine::DeviceManager::removeContext | ( | EditPlaybackContext * | ) |
| void engine::DeviceManager::setGlobalOutputAudioProcessor | ( | std::unique_ptr< 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 * engine::DeviceManager::getGlobalOutputAudioProcessor | ( | ) | const |
Returns a previously set globalOutputAudioProcessor.
|
staticconstexpr |
| Engine& engine::DeviceManager::engine |
| TracktionEngineAudioDeviceManager engine::DeviceManager::deviceManager { engine } |
| std::unique_ptr<HostedAudioDeviceInterface> engine::DeviceManager::hostedAudioDeviceInterface |
| std::vector<std::shared_ptr<MidiInputDevice> > engine::DeviceManager::midiInputs |
| std::vector<std::shared_ptr<MidiOutputDevice> > engine::DeviceManager::midiOutputs |
| juce::OwnedArray<WaveInputDevice> engine::DeviceManager::waveInputs |
| juce::OwnedArray<WaveOutputDevice> engine::DeviceManager::waveOutputs |
| std::function<void(InputDevice*)> 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.
|
staticconstexpr |