@@ -0,0 +1,60 @@ | |||||
/* | |||||
* DISTRHO Ildaeil Plugin | |||||
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com> | |||||
* | |||||
* This program is free software; you can redistribute it and/or | |||||
* modify it under the terms of the GNU General Public License as | |||||
* published by the Free Software Foundation; either version 2 of | |||||
* the License, or any later version. | |||||
* | |||||
* This program is distributed in the hope that it will be useful, | |||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
* GNU General Public License for more details. | |||||
* | |||||
* For a full copy of the GNU General Public License see the LICENSE file. | |||||
*/ | |||||
#pragma once | |||||
#include "CarlaNativePlugin.h" | |||||
#include "DistrhoPlugin.hpp" | |||||
// generates a warning if this is defined as anything else | |||||
#define CARLA_API | |||||
START_NAMESPACE_DISTRHO | |||||
// -------------------------------------------------------------------------------------------------------------------- | |||||
// static Mutex sPluginInfoLoadMutex; | |||||
// -------------------------------------------------------------------------------------------------------------------- | |||||
class IldaeilBasePlugin : public Plugin | |||||
{ | |||||
// SharedResourcePointer<JuceInitializer> juceInitializer; | |||||
public: | |||||
const NativePluginDescriptor* fCarlaPluginDescriptor; | |||||
NativePluginHandle fCarlaPluginHandle; | |||||
NativeHostDescriptor fCarlaHostDescriptor; | |||||
CarlaHostHandle fCarlaHostHandle; | |||||
void* fUI; | |||||
IldaeilBasePlugin() | |||||
: Plugin(0, 0, 1), | |||||
fCarlaPluginDescriptor(nullptr), | |||||
fCarlaPluginHandle(nullptr), | |||||
fCarlaHostHandle(nullptr), | |||||
fUI(nullptr) | |||||
{ | |||||
memset(&fCarlaHostDescriptor, 0, sizeof(fCarlaHostDescriptor)); | |||||
} | |||||
}; | |||||
// -------------------------------------------------------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO |
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Ildaeil Plugin | * DISTRHO Ildaeil Plugin | ||||
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
@@ -15,16 +15,12 @@ | |||||
* For a full copy of the GNU General Public License see the LICENSE file. | * For a full copy of the GNU General Public License see the LICENSE file. | ||||
*/ | */ | ||||
#include "CarlaNativePlugin.h" | |||||
#include "IldaeilBasePlugin.hpp" | |||||
#include "CarlaEngine.hpp" | #include "CarlaEngine.hpp" | ||||
#include "water/streams/MemoryOutputStream.h" | #include "water/streams/MemoryOutputStream.h" | ||||
#include "water/xml/XmlDocument.h" | #include "water/xml/XmlDocument.h" | ||||
#include "DistrhoPlugin.hpp" | |||||
// generates a warning if this is defined as anything else | |||||
#define CARLA_API | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
@@ -51,30 +47,8 @@ const char* ildaeilOpenFileForUI(void* ui, bool isDir, const char* title, const | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
// static Mutex sPluginInfoLoadMutex; | |||||
/* | |||||
struct JuceInitializer { | |||||
JuceInitializer() { carla_juce_init(); } | |||||
~JuceInitializer() { carla_juce_cleanup(); } | |||||
}; | |||||
*/ | |||||
// -------------------------------------------------------------------------------------------------------------------- | |||||
class IldaeilPlugin : public Plugin | |||||
class IldaeilPlugin : public IldaeilBasePlugin | |||||
{ | { | ||||
// SharedResourcePointer<JuceInitializer> juceInitializer; | |||||
public: | |||||
const NativePluginDescriptor* fCarlaPluginDescriptor; | |||||
NativePluginHandle fCarlaPluginHandle; | |||||
NativeHostDescriptor fCarlaHostDescriptor; | |||||
CarlaHostHandle fCarlaHostHandle; | |||||
void* fUI; | |||||
#if DISTRHO_PLUGIN_WANT_MIDI_INPUT | #if DISTRHO_PLUGIN_WANT_MIDI_INPUT | ||||
static constexpr const uint kMaxMidiEventCount = 512; | static constexpr const uint kMaxMidiEventCount = 512; | ||||
NativeMidiEvent* fMidiEvents; | NativeMidiEvent* fMidiEvents; | ||||
@@ -87,12 +61,9 @@ public: | |||||
mutable water::MemoryOutputStream fLastProjectState; | mutable water::MemoryOutputStream fLastProjectState; | ||||
uint32_t fLastLatencyValue; | uint32_t fLastLatencyValue; | ||||
public: | |||||
IldaeilPlugin() | IldaeilPlugin() | ||||
: Plugin(0, 0, 1), | |||||
fCarlaPluginDescriptor(nullptr), | |||||
fCarlaPluginHandle(nullptr), | |||||
fCarlaHostHandle(nullptr), | |||||
fUI(nullptr), | |||||
: IldaeilBasePlugin(), | |||||
#if DISTRHO_PLUGIN_WANT_MIDI_INPUT | #if DISTRHO_PLUGIN_WANT_MIDI_INPUT | ||||
fMidiEvents(nullptr), | fMidiEvents(nullptr), | ||||
fMidiEventCount(0), | fMidiEventCount(0), | ||||
@@ -103,7 +74,6 @@ public: | |||||
fCarlaPluginDescriptor = carla_get_native_rack_plugin(); | fCarlaPluginDescriptor = carla_get_native_rack_plugin(); | ||||
DISTRHO_SAFE_ASSERT_RETURN(fCarlaPluginDescriptor != nullptr,); | DISTRHO_SAFE_ASSERT_RETURN(fCarlaPluginDescriptor != nullptr,); | ||||
memset(&fCarlaHostDescriptor, 0, sizeof(fCarlaHostDescriptor)); | |||||
memset(&fCarlaTimeInfo, 0, sizeof(fCarlaTimeInfo)); | memset(&fCarlaTimeInfo, 0, sizeof(fCarlaTimeInfo)); | ||||
fCarlaHostDescriptor.handle = this; | fCarlaHostDescriptor.handle = this; | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Ildaeil Plugin | * DISTRHO Ildaeil Plugin | ||||
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
@@ -15,11 +15,10 @@ | |||||
* For a full copy of the GNU General Public License see the LICENSE file. | * For a full copy of the GNU General Public License see the LICENSE file. | ||||
*/ | */ | ||||
#include "CarlaNativePlugin.h" | |||||
#include "CarlaBackendUtils.hpp" | |||||
#include "IldaeilBasePlugin.hpp" | |||||
#include "DistrhoUI.hpp" | #include "DistrhoUI.hpp" | ||||
#include "DistrhoPlugin.hpp" | |||||
#include "CarlaBackendUtils.hpp" | |||||
#include "PluginHostWindow.hpp" | #include "PluginHostWindow.hpp" | ||||
#include "extra/Thread.hpp" | #include "extra/Thread.hpp" | ||||
@@ -44,26 +43,8 @@ namespace ildaeil { | |||||
} | } | ||||
#endif | #endif | ||||
// generates a warning if this is defined as anything else | |||||
#define CARLA_API | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// -------------------------------------------------------------------------------------------------------------------- | |||||
class IldaeilPlugin : public Plugin | |||||
{ | |||||
public: | |||||
const NativePluginDescriptor* fCarlaPluginDescriptor; | |||||
NativePluginHandle fCarlaPluginHandle; | |||||
NativeHostDescriptor fCarlaHostDescriptor; | |||||
CarlaHostHandle fCarlaHostHandle; | |||||
void* fUI; | |||||
// ... | |||||
}; | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
void ildaeilParameterChangeForUI(void* ui, uint32_t index, float value); | void ildaeilParameterChangeForUI(void* ui, uint32_t index, float value); | ||||
@@ -72,9 +53,6 @@ const char* ildaeilOpenFileForUI(void* ui, bool isDir, const char* title, const | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
using namespace CarlaBackend; | using namespace CarlaBackend; | ||||
// shared resource pointer | |||||
// carla_juce_init(); | |||||
class IldaeilUI : public UI, | class IldaeilUI : public UI, | ||||
public Thread, | public Thread, | ||||
public PluginHostWindow::Callbacks | public PluginHostWindow::Callbacks | ||||
@@ -164,7 +142,7 @@ class IldaeilUI : public UI, | |||||
kIdleNothing | kIdleNothing | ||||
} fIdleState = kIdleInit; | } fIdleState = kIdleInit; | ||||
IldaeilPlugin* const fPlugin; | |||||
IldaeilBasePlugin* const fPlugin; | |||||
PluginHostWindow fPluginHostWindow; | PluginHostWindow fPluginHostWindow; | ||||
PluginType fPluginType; | PluginType fPluginType; | ||||
@@ -194,7 +172,7 @@ public: | |||||
Thread("IldaeilScanner"), | Thread("IldaeilScanner"), | ||||
fDrawingState(kDrawingLoading), | fDrawingState(kDrawingLoading), | ||||
fIdleState(kIdleInit), | fIdleState(kIdleInit), | ||||
fPlugin((IldaeilPlugin*)getPluginInstancePointer()), | |||||
fPlugin((IldaeilBasePlugin*)getPluginInstancePointer()), | |||||
fPluginHostWindow(getWindow(), this), | fPluginHostWindow(getWindow(), this), | ||||
fPluginType(PLUGIN_LV2), | fPluginType(PLUGIN_LV2), | ||||
fNextPluginType(fPluginType), | fNextPluginType(fPluginType), | ||||