@@ -45,7 +45,7 @@ This is our class for E-Z plugin-making and E-Z multiple-API support.
45
45
46
46
#if defined(TARGET_API_VST) && TARGET_PLUGIN_HAS_GUI
47
47
#include " dfxguieditor.h"
48
- extern AEffEditor* DFXGUI_NewEditorInstance (DfxPlugin* inEffectInstance);
48
+ [[nodiscard]] extern std::unique_ptr<DfxGuiEditor> DFXGUI_NewEditorInstance (DGEditorListenerInstance inEffectInstance);
49
49
#endif
50
50
51
51
#ifdef TARGET_API_RTAS
@@ -204,13 +204,13 @@ DfxPlugin::DfxPlugin(
204
204
mNumInputs = VST_NUM_INPUTS;
205
205
mNumOutputs = VST_NUM_OUTPUTS;
206
206
207
- setUniqueID (PLUGIN_ID);
208
- setNumInputs (VST_NUM_INPUTS);
209
- setNumOutputs (VST_NUM_OUTPUTS);
207
+ TARGET_API_BASE_CLASS:: setUniqueID (PLUGIN_ID);
208
+ TARGET_API_BASE_CLASS:: setNumInputs (VST_NUM_INPUTS);
209
+ TARGET_API_BASE_CLASS:: setNumOutputs (VST_NUM_OUTPUTS);
210
210
211
211
TARGET_API_BASE_CLASS::setProgram (0 ); // set the current preset number to 0
212
212
213
- noTail (true ); // until the plugin declares otherwise
213
+ TARGET_API_BASE_CLASS:: noTail (true ); // until the plugin declares otherwise
214
214
215
215
// check to see if the host supports sending tempo and time information to VST plugins
216
216
// Note that the VST2 SDK (probably erroneously) wants a non-const string here,
@@ -220,18 +220,15 @@ DfxPlugin::DfxPlugin(
220
220
221
221
#if TARGET_PLUGIN_USES_MIDI
222
222
// tell host that we want to use special data chunks for settings storage
223
- programsAreChunks ();
223
+ TARGET_API_BASE_CLASS:: programsAreChunks ();
224
224
#endif
225
225
226
226
#if TARGET_PLUGIN_IS_INSTRUMENT
227
- isSynth ();
227
+ TARGET_API_BASE_CLASS:: isSynth ();
228
228
#endif
229
229
230
230
#if TARGET_PLUGIN_HAS_GUI
231
- // XXX AEffGUIEditor registers itself, so we probably don't need to assign this
232
- // to the member variable here (and probably should be using AEffect::setEditor?).
233
- // Instead we can probably just call getEditor() if we need it.
234
- editor = DFXGUI_NewEditorInstance (this );
231
+ setEditor (DFXGUI_NewEditorInstance (this ).release ());
235
232
#endif
236
233
#endif
237
234
// end VST stuff
@@ -1126,14 +1123,17 @@ void DfxPlugin::setsamplerate(double inSampleRate)
1126
1123
if ((mSampleRateChanged = (inSampleRate != DfxPlugin::mSampleRate )))
1127
1124
{
1128
1125
#ifdef TARGET_API_AUDIOUNIT
1129
- // assume that sample-specified properties change in absolute duration when sample rate changes
1130
- if (auto const latencySamples = std::get_if<long >(&mLatency ); latencySamples && (*latencySamples != 0 ))
1126
+ if (mAUElementsHaveBeenCreated )
1131
1127
{
1132
- postupdate_latency ();
1133
- }
1134
- if (auto const tailSizeSamples = std::get_if<long >(&mTailSize ); tailSizeSamples && (*tailSizeSamples != 0 ))
1135
- {
1136
- postupdate_tailsize ();
1128
+ // assume that sample-specified properties change in absolute duration when sample rate changes
1129
+ if (auto const latencySamples = std::get_if<long >(&mLatency ); latencySamples && (*latencySamples != 0 ))
1130
+ {
1131
+ postupdate_latency ();
1132
+ }
1133
+ if (auto const tailSizeSamples = std::get_if<long >(&mTailSize ); tailSizeSamples && (*tailSizeSamples != 0 ))
1134
+ {
1135
+ postupdate_tailsize ();
1136
+ }
1137
1137
}
1138
1138
#endif
1139
1139
}
0 commit comments