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/FileBrowserDialog.hpp"
|
||||||
# include "extra/ScopedPointer.hpp"
|
# include "extra/ScopedPointer.hpp"
|
||||||
# include "extra/Thread.hpp"
|
# include "extra/Thread.hpp"
|
||||||
|
# include "../../src/extra/SharedResourcePointer.hpp"
|
||||||
#else
|
#else
|
||||||
# include "extra/Mutex.hpp"
|
# include "extra/Mutex.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -212,6 +213,13 @@ static void projectLoadedFromDSP(void* ui);
|
||||||
|
|
||||||
static Mutex sPluginInfoLoadMutex;
|
static Mutex sPluginInfoLoadMutex;
|
||||||
|
|
||||||
|
#ifndef HEADLESS
|
||||||
|
struct JuceInitializer {
|
||||||
|
JuceInitializer() { carla_juce_init(); }
|
||||||
|
~JuceInitializer() { carla_juce_cleanup(); }
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
struct IldaeilModule : Module {
|
struct IldaeilModule : Module {
|
||||||
enum ParamIds {
|
enum ParamIds {
|
||||||
NUM_PARAMS
|
NUM_PARAMS
|
||||||
|
|
@ -236,6 +244,10 @@ struct IldaeilModule : Module {
|
||||||
NUM_LIGHTS
|
NUM_LIGHTS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef HEADLESS
|
||||||
|
SharedResourcePointer<JuceInitializer> juceInitializer;
|
||||||
|
#endif
|
||||||
|
|
||||||
CardinalPluginContext* const pcontext;
|
CardinalPluginContext* const pcontext;
|
||||||
|
|
||||||
const NativePluginDescriptor* fCarlaPluginDescriptor = nullptr;
|
const NativePluginDescriptor* fCarlaPluginDescriptor = nullptr;
|
||||||
|
|
@ -936,7 +948,6 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
|
|
||||||
if (! idleCallbackActive)
|
if (! idleCallbackActive)
|
||||||
{
|
{
|
||||||
carla_juce_init();
|
|
||||||
idleCallbackActive = pcontext->addIdleCallback(this);
|
idleCallbackActive = pcontext->addIdleCallback(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -955,7 +966,6 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
{
|
{
|
||||||
idleCallbackActive = false;
|
idleCallbackActive = false;
|
||||||
pcontext->removeIdleCallback(this);
|
pcontext->removeIdleCallback(this);
|
||||||
carla_juce_cleanup();
|
|
||||||
|
|
||||||
if (fileBrowserHandle != nullptr)
|
if (fileBrowserHandle != nullptr)
|
||||||
{
|
{
|
||||||
|
|
@ -1097,9 +1107,9 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
|
|
||||||
const MutexLocker cml(sPluginInfoLoadMutex);
|
const MutexLocker cml(sPluginInfoLoadMutex);
|
||||||
|
|
||||||
if (const uint count = carla_get_cached_plugin_count(fPluginType, path))
|
d_stdout("Will scan plugins now...");
|
||||||
{
|
const uint count = carla_get_cached_plugin_count(fPluginType, path);
|
||||||
fPlugins = new PluginInfoCache[count];
|
d_stdout("Scanning found %u plugins", count);
|
||||||
|
|
||||||
if (fDrawingState == kDrawingLoading)
|
if (fDrawingState == kDrawingLoading)
|
||||||
{
|
{
|
||||||
|
|
@ -1107,6 +1117,10 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
fPluginSearchFirstShow = true;
|
fPluginSearchFirstShow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count != 0)
|
||||||
|
{
|
||||||
|
fPlugins = new PluginInfoCache[count];
|
||||||
|
|
||||||
for (uint i=0, j; i < count && ! shouldThreadExit(); ++i)
|
for (uint i=0, j; i < count && ! shouldThreadExit(); ++i)
|
||||||
{
|
{
|
||||||
const CarlaCachedPluginInfo* const info = carla_get_cached_plugin_info(fPluginType, i);
|
const CarlaCachedPluginInfo* const info = carla_get_cached_plugin_info(fPluginType, i);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue