Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::gui::backend::DeviceManager Class Reference

Wrapper over juce::AudioDeviceManager that exposes changes as signals. More...

#include <src/gui/backend/device_manager.h>

Inheritance diagram for zrythm::gui::backend::DeviceManager:
Collaboration diagram for zrythm::gui::backend::DeviceManager:

Public Types

using XmlStateGetter = std::function<std::unique_ptr<juce::XmlElement> ()>
using XmlStateSetter = std::function<void (const juce::XmlElement &)>

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 ()

Detailed Description

Wrapper over juce::AudioDeviceManager that exposes changes as signals.

Definition at line 17 of file device_manager.h.

Member Typedef Documentation

◆ XmlStateGetter

using zrythm::gui::backend::DeviceManager::XmlStateGetter = std::function<std::unique_ptr<juce::XmlElement> ()>

Definition at line 24 of file device_manager.h.

◆ XmlStateSetter

using zrythm::gui::backend::DeviceManager::XmlStateSetter = std::function<void (const juce::XmlElement &)>

Definition at line 25 of file device_manager.h.

Member Function Documentation

◆ initialize()

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.

Parameters
max_input_channelsMax number of input channels (channels used might be less than this).
max_output_channelsMax number of output channels (channels used might be less than this).
fallback_to_defaultWhether 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_.

Exceptions
ZrythmExceptionError occurred in opening the device(s).

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