Ildaeil: Setup juce in a shared class, debug discovery plugin count
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
c4d3529105
commit
bf83f160cb
1 changed files with 23 additions and 9 deletions
|
|
@ -32,6 +32,7 @@
|
|||
# include "extra/FileBrowserDialog.hpp"
|
||||
# include "extra/ScopedPointer.hpp"
|
||||
# include "extra/Thread.hpp"
|
||||
# include "../../src/extra/SharedResourcePointer.hpp"
|
||||
#else
|
||||
# include "extra/Mutex.hpp"
|
||||
#endif
|
||||
|
|
@ -212,6 +213,13 @@ static void projectLoadedFromDSP(void* ui);
|
|||
|
||||
static Mutex sPluginInfoLoadMutex;
|
||||
|
||||
#ifndef HEADLESS
|
||||
struct JuceInitializer {
|
||||
JuceInitializer() { carla_juce_init(); }
|
||||
~JuceInitializer() { carla_juce_cleanup(); }
|
||||
};
|
||||
#endif
|
||||
|
||||
struct IldaeilModule : Module {
|
||||
enum ParamIds {
|
||||
NUM_PARAMS
|
||||
|
|
@ -236,6 +244,10 @@ struct IldaeilModule : Module {
|
|||
NUM_LIGHTS
|
||||
};
|
||||
|
||||
#ifndef HEADLESS
|
||||
SharedResourcePointer<JuceInitializer> juceInitializer;
|
||||
#endif
|
||||
|
||||
CardinalPluginContext* const pcontext;
|
||||
|
||||
const NativePluginDescriptor* fCarlaPluginDescriptor = nullptr;
|
||||
|
|
@ -936,7 +948,6 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
|||
|
||||
if (! idleCallbackActive)
|
||||
{
|
||||
carla_juce_init();
|
||||
idleCallbackActive = pcontext->addIdleCallback(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -955,7 +966,6 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
|||
{
|
||||
idleCallbackActive = false;
|
||||
pcontext->removeIdleCallback(this);
|
||||
carla_juce_cleanup();
|
||||
|
||||
if (fileBrowserHandle != nullptr)
|
||||
{
|
||||
|
|
@ -1097,9 +1107,9 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
|||
|
||||
const MutexLocker cml(sPluginInfoLoadMutex);
|
||||
|
||||
if (const uint count = carla_get_cached_plugin_count(fPluginType, path))
|
||||
{
|
||||
fPlugins = new PluginInfoCache[count];
|
||||
d_stdout("Will scan plugins now...");
|
||||
const uint count = carla_get_cached_plugin_count(fPluginType, path);
|
||||
d_stdout("Scanning found %u plugins", count);
|
||||
|
||||
if (fDrawingState == kDrawingLoading)
|
||||
{
|
||||
|
|
@ -1107,6 +1117,10 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
|||
fPluginSearchFirstShow = true;
|
||||
}
|
||||
|
||||
if (count != 0)
|
||||
{
|
||||
fPlugins = new PluginInfoCache[count];
|
||||
|
||||
for (uint i=0, j; i < count && ! shouldThreadExit(); ++i)
|
||||
{
|
||||
const CarlaCachedPluginInfo* const info = carla_get_cached_plugin_info(fPluginType, i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue