Skip to content

Commit

Permalink
Oops, checked in some of this already with the previous commit. Some …
Browse files Browse the repository at this point in the history
…plugins are calling GetChannelNum which is AU-specific, but it's easy to support with the mDSPcores thing. Add that. The macro-based initialization is not working today because mDSPCores is private (makes sense) but the macro is evaluated in the context of the derived class, which doesn't have access to private members. So instead, just define a protected initCores method, which does nothing in AU but otherwise this initialization (and now also setting the channel like AU kernel does). Instead of the macro, plugins run initCores<CoreDSPClass>() at the bottom of their ctor (does nothing in AU).
  • Loading branch information
tom7 authored and sophiapoirier committed Jun 27, 2020
1 parent 2a6b611 commit a88087b
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 29 deletions.
17 changes: 9 additions & 8 deletions exemplar/exemplar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ PLUGIN::PLUGIN(TARGET_API_BASE_INSTANCE_TYPE inInstance)
addchannelconfig(1, 1); /* mono */
#endif

#ifdef TARGET_API_VST
#if TARGET_PLUGIN_USES_DSPCORE
DFX_INIT_CORE(ExemplarDSP); /* we need to manage DSP cores manually in VST */
#endif
/* if you have a GUI, need an Editor class... */
#if TARGET_PLUGIN_HAS_GUI
editor = new ExemplarEditor(this);
#endif
#if TARGET_PLUGIN_USES_DSPCORE
initCores<ExemplarDSP>();
#endif

#ifdef TARGET_API_VST
/* if you have a GUI, need an Editor class... */
#if TARGET_PLUGIN_HAS_GUI
editor = new ExemplarEditor(this);
#endif
#endif
}

PLUGIN::~PLUGIN() {
Expand Down
8 changes: 4 additions & 4 deletions geometer/geometer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ PLUGIN::PLUGIN(TARGET_API_BASE_INSTANCE_TYPE inInstance)
addchannelconfig(1, 1); /* mono */
#endif

tmpx.fill(0);
tmpy.fill(0.0f);

#if TARGET_PLUGIN_USES_DSPCORE
DFX_INIT_CORE(PLUGINCORE);
initCores<PLUGINCORE>();
#endif

tmpx.fill(0);
tmpy.fill(0.0f);
}

void PLUGIN::dfx_PostConstructor()
Expand Down
17 changes: 9 additions & 8 deletions guitest/guitest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ PLUGIN::PLUGIN(TARGET_API_BASE_INSTANCE_TYPE inInstance)
addchannelconfig(1, 1); /* mono */
#endif

#ifdef TARGET_API_VST
#if TARGET_PLUGIN_USES_DSPCORE
DFX_INIT_CORE(GuitestDSP); /* we need to manage DSP cores manually in VST */
#endif
/* if you have a GUI, need an Editor class... */
#if TARGET_PLUGIN_HAS_GUI
editor = new GuitestEditor(this);
#endif
#if TARGET_PLUGIN_USES_DSPCORE
initCores<GuitestDSP>();
#endif

#ifdef TARGET_API_VST
/* if you have a GUI, need an Editor class... */
#if TARGET_PLUGIN_HAS_GUI
editor = new GuitestEditor(this);
#endif
#endif
}

PLUGIN::~PLUGIN() {
Expand Down
2 changes: 1 addition & 1 deletion polarizer/polarizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Polarizer::Polarizer(TARGET_API_BASE_INSTANCE_TYPE inInstance)

setpresetname(0, "twicky"); // default preset name

DFX_INIT_CORE(PolarizerDSP);
initCores<PolarizerDSP>();
}

//-----------------------------------------------------------------------------------------
Expand Down
7 changes: 4 additions & 3 deletions slowft/slowft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ PLUGIN::PLUGIN(TARGET_API_BASE_INSTANCE_TYPE inInstance)
addchannelconfig(1, 1); /* mono */
#endif

#if TARGET_PLUGIN_USES_DSPCORE
initCores<SlowftDSP>(); /* we need to manage DSP cores manually in VST */
#endif

#ifdef TARGET_API_VST
#if TARGET_PLUGIN_USES_DSPCORE
DFX_INIT_CORE(SlowftDSP); /* we need to manage DSP cores manually in VST */
#endif
/* if you have a GUI, need an Editor class... */
#if TARGET_PLUGIN_HAS_GUI
editor = new SlowftEditor(this);
Expand Down
2 changes: 1 addition & 1 deletion stub-dfxplugin/dfxplugin-stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ DfxStub::DfxStub(TARGET_API_BASE_INSTANCE_TYPE inInstance)

// API-specific stuff below
#if TARGET_PLUGIN_USES_DSPCORE
DFX_INIT_CORE(DfxStubDSP);
initCores<DfxStubDSP>();
#endif
#ifdef TARGET_API_VST
#if TARGET_PLUGIN_HAS_GUI
Expand Down
2 changes: 1 addition & 1 deletion transverb/transverbformalities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Transverb::Transverb(TARGET_API_BASE_INSTANCE_TYPE inInstance)


#if TARGET_PLUGIN_USES_DSPCORE
DFX_INIT_CORE(TransverbDSP);
initCores<TransverbDSP>();
#endif
}

Expand Down
7 changes: 4 additions & 3 deletions windowingstub/windowingstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ PLUGIN::PLUGIN(TARGET_API_BASE_INSTANCE_TYPE inInstance)
addchannelconfig(1, 1); /* mono */
#endif

#if TARGET_PLUGIN_USES_DSPCORE
initCores<WindowingstubDSP>();
#endif

#ifdef TARGET_API_VST
#if TARGET_PLUGIN_USES_DSPCORE
DFX_INIT_CORE(WindowingstubDSP); /* we need to manage DSP cores manually in VST */
#endif
/* if you have a GUI, need an Editor class... */
#if TARGET_PLUGIN_HAS_GUI
editor = new WindowingstubEditor(this);
Expand Down

0 comments on commit a88087b

Please sign in to comment.