2626#include < unordered_set>
2727
2828
29+ // By default, the test plug-in only analyzes audio sources when explicitly requested by the host,
30+ // or if the user opens its (empty) UI and selects playback regions or region sequences in the host
31+ // for which there is no content data available yet.
32+ // The define below allows to always trigger audio source analysis when a new audio source instance
33+ // is created (and the host does not provide all supported content for it), which is closer to the
34+ // behavior of actual plug-ins like Melodyne, and also allows for testing analysis and related
35+ // notifications in hosts that never request audio source analysis.
36+ #if !defined (ARA_ALWAYS_PERFORM_ANALYSIS)
37+ #define ARA_ALWAYS_PERFORM_ANALYSIS 0
38+ #endif
39+
40+
2941class ARATestAudioSource ;
3042class ARATestPlaybackRenderer ;
3143class ARATestAnalysisTask ;
3244
45+ /* ******************************************************************************/
46+ class ARATestEditorView : public ARA ::PlugIn::EditorView
47+ {
48+ public:
49+ using ARA::PlugIn::EditorView::EditorView;
50+
51+ protected:
52+ virtual void doNotifySelection (const ARA::PlugIn::ViewSelection* selection) noexcept ;
53+ };
54+
3355/* ******************************************************************************/
3456class ARATestDocumentController : public ARA ::PlugIn::DocumentController
3557{
@@ -99,6 +121,7 @@ class ARATestDocumentController : public ARA::PlugIn::DocumentController
99121
100122 // Plug-In Instance Management
101123 ARA::PlugIn::PlaybackRenderer* doCreatePlaybackRenderer () noexcept override ;
124+ ARA::PlugIn::EditorView* doCreateEditorView () noexcept override ;
102125
103126public:
104127 // Render thread synchronization:
@@ -109,13 +132,13 @@ class ARATestDocumentController : public ARA::PlugIn::DocumentController
109132 bool rendererWillAccessModelGraph (ARATestPlaybackRenderer* playbackRenderer) noexcept ;
110133 void rendererDidAccessModelGraph (ARATestPlaybackRenderer* playbackRenderer) noexcept ;
111134
135+ void startOrScheduleAnalysisOfAudioSource (ARATestAudioSource* audioSource); // does nothing if already analyzing
136+ bool cancelAnalysisOfAudioSource (ARATestAudioSource* audioSource);
137+
112138private:
113139 void disableRendererModelGraphAccess () noexcept ;
114140 void enableRendererModelGraphAccess () noexcept ;
115141
116- void startOrScheduleAnalysisOfAudioSource (ARATestAudioSource* audioSource); // does nothing if already analyzing
117- bool cancelAnalysisOfAudioSource (ARATestAudioSource* audioSource);
118-
119142 void startAnalysisTaskForAudioSource (ARATestAudioSource* audioSource);
120143 bool cancelAnalysisTaskForAudioSource (ARATestAudioSource* audioSource);
121144 ARATestAnalysisTask* getActiveAnalysisTaskForAudioSource (const ARATestAudioSource* audioSource) noexcept ; // returns nullptr if no active analysis for given audio source
0 commit comments