|
Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
|
Wrapper over juce::AudioDeviceManager that exposes changes as signals. More...
#include <src/gui/backend/device_manager.h>


Public Types | |
| using | XmlStateGetter = std::function<std::unique_ptr<juce::XmlElement> ()> |
| using | XmlStateSetter = std::function<void (const juce::XmlElement &)> |
| Public Types inherited from zrythm::dsp::IHardwareMidiInterface | |
| using | BufferMap |
| using | DeviceChangeCallback = std::function<void ()> |
Public Member Functions | |
| DeviceManager (XmlStateGetter state_getter, XmlStateSetter state_setter) | |
| void | initialize (int max_input_channels, int max_output_channels, bool fallback_to_default) |
| Opens a set of devices ready for use. | |
| void | save_state () |
| void | createAudioDeviceTypes (juce::OwnedArray< juce::AudioIODeviceType > &types) override |
| Q_INVOKABLE void | showDeviceSelector () |
| QVector< AudioInputInfo > | availableAudioInputs () const |
| Q_SIGNAL void | availableAudioInputsChanged () |
| QVector< MidiInputInfo > | availableMidiInputs () const |
| Q_SIGNAL void | availableMidiInputsChanged () |
| dsp::MidiDeviceBuffer * | midi_buffer_for_device (const utils::Utf8String &identifier) const |
| void | set_device_change_callback (std::optional< DeviceChangeCallback > cb) override |
| Registers a notification-only device change callback. | |
| BufferMap | device_buffers () const override |
| Returns the current map of device identifiers to buffers. | |
Properties | |
| QML_ELEMENT QVector< zrythm::gui::backend::AudioInputInfo > | availableAudioInputs |
| QVector< zrythm::gui::backend::MidiInputInfo > | availableMidiInputs |
Friends | |
| struct | MidiImpl |
Wrapper over juce::AudioDeviceManager that exposes changes as signals.
Definition at line 62 of file device_manager.h.
| using zrythm::gui::backend::DeviceManager::XmlStateGetter = std::function<std::unique_ptr<juce::XmlElement> ()> |
Definition at line 75 of file device_manager.h.
| using zrythm::gui::backend::DeviceManager::XmlStateSetter = std::function<void (const juce::XmlElement &)> |
Definition at line 76 of file device_manager.h.
|
overridevirtual |
Returns the current map of device identifiers to buffers.
The returned shared_ptrs remain valid as long as the caller holds them, even across device changes (buffers are only destroyed when no longer referenced).
Implements zrythm::dsp::IHardwareMidiInterface.
| void zrythm::gui::backend::DeviceManager::initialize | ( | int | max_input_channels, |
| int | max_output_channels, | ||
| bool | fallback_to_default ) |
Opens a set of devices ready for use.
| max_input_channels | Max number of input channels (channels used might be less than this). |
| max_output_channels | Max number of output channels (channels used might be less than this). |
| fallback_to_default | Whether to fallback to the default device if opening the device(s) from the state fails. |
This calls juce::AudioDeviceManager::initialise() internally and passes the state obtained from state_getter_.
| ZrythmException | Error occurred in opening the device(s). |
|
overridevirtual |
Registers a notification-only device change callback.
The implementation must call cb on the main thread whenever the set of active MIDI devices changes. The callback carries no data — the listener should call device_buffers() to pull the current state.
Passing nullopt unregisters the callback. Only one callback is supported. Calling again replaces the previous one.
Implements zrythm::dsp::IHardwareMidiInterface.
|
friend |
Definition at line 126 of file device_manager.h.
|
read |
Definition at line 71 of file device_manager.h.
|
read |
Definition at line 72 of file device_manager.h.