tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_WaveOutputDevice.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
20{
21public:
23 ~WaveOutputDevice() override;
24
25 void resetToDefault();
26 void setEnabled (bool) override;
27 const std::vector<ChannelIndex>& getChannels() const noexcept { return deviceChannels; }
28 const juce::AudioChannelSet& getChannelSet() const noexcept { return channelSet; }
29
30 void reverseChannels (bool);
31 bool isReversed() const { return leftRightReversed; }
32
33 void setDithered (bool);
34 bool isDithered() const { return ditheringEnabled; }
35
40 int getLeftChannel() const;
41
46 int getRightChannel() const;
47
49 bool isStereoPair() const;
50
51 void setStereoPair (bool);
52
54
55protected:
56 juce::String openDevice() override;
57 void closeDevice() override;
58
59private:
60 friend class DeviceManager;
61 friend class WaveOutputDeviceInstance;
62
63 const std::vector<ChannelIndex> deviceChannels;
64 const juce::AudioChannelSet channelSet;
65 bool ditheringEnabled, leftRightReversed;
66
67 void loadProps();
68 void saveProps();
69
71};
72
73//==============================================================================
75{
76public:
78
79 void prepareToPlay (double sampleRate, int blockSizeSamples);
80
81protected:
82 Ditherer ditherers[2];
83 MidiMessageArray midiBuffer;
84 juce::AudioBuffer<float> outputBuffer;
85
86 WaveOutputDevice& getWaveOutput() const { return static_cast<WaveOutputDevice&> (owner); }
87
89};
90
91}} // namespace tracktion { inline namespace engine
The Engine is the central class for all tracktion sessions.
Base class for audio or midi output devices, to which a track's output can be sent.
int getLeftChannel() const
Returns the left channel index.
int getRightChannel() const
Returns the right channel index.
bool isStereoPair() const
Returns true if the output is a stereo pair.
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
An extremely naive ditherer.
Describes a WaveDevice from which the WaveOutputDevice and WaveInputDevice lists will be built.