LMMS
Loading...
Searching...
No Matches
juce_AudioProcessor_ARAExtensions.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26#pragma once
27
28namespace juce
29{
30
31class AudioProcessor;
32class ARAPlaybackRenderer;
33class ARAEditorRenderer;
34class ARAEditorView;
35
36//==============================================================================
44class JUCE_API AudioProcessorARAExtension : public ARA::PlugIn::PlugInExtension
45{
46public:
48
49 //==============================================================================
57 template <typename PlaybackRenderer_t = ARAPlaybackRenderer>
58 PlaybackRenderer_t* getPlaybackRenderer() const noexcept
59 {
60 return ARA::PlugIn::PlugInExtension::getPlaybackRenderer<PlaybackRenderer_t>();
61 }
62
70 template <typename EditorRenderer_t = ARAEditorRenderer>
71 EditorRenderer_t* getEditorRenderer() const noexcept
72 {
73 return ARA::PlugIn::PlugInExtension::getEditorRenderer<EditorRenderer_t>();
74 }
75
83 template <typename EditorView_t = ARAEditorView>
85 {
86 return ARA::PlugIn::PlugInExtension::getEditorView<EditorView_t>();
87 }
88
89 //==============================================================================
92 {
93 return ARA::PlugIn::PlugInExtension::getPlaybackRenderer() != nullptr;
94 }
95
98 {
99 return ARA::PlugIn::PlugInExtension::getEditorRenderer() != nullptr;
100 }
101
104 {
105 return ARA::PlugIn::PlugInExtension::getEditorView() != nullptr;
106 }
107
108 //==============================================================================
109#if ARA_VALIDATE_API_CALLS
110 bool isPrepared { false };
111#endif
112
113protected:
119 bool getTailLengthSecondsForARA (double& tailLength) const;
120
126 bool prepareToPlayForARA (double sampleRate,
127 int samplesPerBlock,
128 int numChannels,
129 AudioProcessor::ProcessingPrecision precision);
130
136 bool releaseResourcesForARA();
137
145 bool processBlockForARA (AudioBuffer<float>& buffer,
146 AudioProcessor::Realtime realtime,
147 const AudioPlayHead::PositionInfo& positionInfo);
148
156 bool processBlockForARA (AudioBuffer<float>& buffer, AudioProcessor::Realtime isNonRealtime, AudioPlayHead* playhead);
157
158 //==============================================================================
163 void didBindToARA() noexcept override;
164
165private:
166 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessorARAExtension)
167};
168
169//==============================================================================
178{
179public:
181 explicit AudioProcessorEditorARAExtension (AudioProcessor* audioProcessor);
182
184 template <typename EditorView_t = ARAEditorView>
186 {
187 return (this->araProcessorExtension != nullptr) ? this->araProcessorExtension->getEditorView<EditorView_t>()
188 : nullptr;
189 }
190
192 bool isARAEditorView() const noexcept { return getARAEditorView() != nullptr; }
193
194protected:
197
198private:
200
202};
203
204} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
#define override
Definition DistrhoDefines.h:73
Definition juce_AudioProcessor_ARAExtensions.h:45
PlaybackRenderer_t * getPlaybackRenderer() const noexcept
Definition juce_AudioProcessor_ARAExtensions.h:58
EditorRenderer_t * getEditorRenderer() const noexcept
Definition juce_AudioProcessor_ARAExtensions.h:71
bool isPlaybackRenderer() const noexcept
Definition juce_AudioProcessor_ARAExtensions.h:91
bool isEditorView() const noexcept
Definition juce_AudioProcessor_ARAExtensions.h:103
bool isEditorRenderer() const noexcept
Definition juce_AudioProcessor_ARAExtensions.h:97
EditorView_t * getEditorView() const noexcept
Definition juce_AudioProcessor_ARAExtensions.h:84
Definition juce_AudioProcessor_ARAExtensions.h:178
AudioProcessorEditorARAExtension(AudioProcessor *audioProcessor)
Definition juce_AudioProcessor_ARAExtensions.cpp:141
AudioProcessorARAExtension * araProcessorExtension
Definition juce_AudioProcessor_ARAExtensions.h:199
EditorView_t * getARAEditorView() const noexcept
Definition juce_AudioProcessor_ARAExtensions.h:185
bool isARAEditorView() const noexcept
Definition juce_AudioProcessor_ARAExtensions.h:192
Definition juce_AudioProcessor.h:46
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
#define const
Definition zconf.h:137