@@ -1 +1 @@ | |||||
Subproject commit c6c6900b8743550da7eb4f0f61a28ee85ac80966 | |||||
Subproject commit 83e8afdb77695686a6b61dda2a5013d991232ddb |
@@ -97,7 +97,7 @@ struct CarlaModule : Module { | |||||
std::string patchStorage; | std::string patchStorage; | ||||
CarlaModule() | CarlaModule() | ||||
: pcontext(reinterpret_cast<CardinalPluginContext*>(APP)) | |||||
: pcontext(static_cast<CardinalPluginContext*>(APP)) | |||||
{ | { | ||||
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); | config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); | ||||
configParam<SwitchQuantity>(BIPOLAR_INPUTS, 0.f, 1.f, 1.f, "Bipolar CV Inputs")->randomizeEnabled = false; | configParam<SwitchQuantity>(BIPOLAR_INPUTS, 0.f, 1.f, 1.f, "Bipolar CV Inputs")->randomizeEnabled = false; | ||||
@@ -47,7 +47,7 @@ struct HostCV : Module { | |||||
configParam<SwitchQuantity>(BIPOLAR_OUTPUTS_1_5, 0.f, 1.f, 0.f, "Bipolar Outputs 1-5")->randomizeEnabled = false; | configParam<SwitchQuantity>(BIPOLAR_OUTPUTS_1_5, 0.f, 1.f, 0.f, "Bipolar Outputs 1-5")->randomizeEnabled = false; | ||||
configParam<SwitchQuantity>(BIPOLAR_OUTPUTS_6_10, 0.f, 1.f, 0.f, "Bipolar Outputs 6-10")->randomizeEnabled = false; | configParam<SwitchQuantity>(BIPOLAR_OUTPUTS_6_10, 0.f, 1.f, 0.f, "Bipolar Outputs 6-10")->randomizeEnabled = false; | ||||
CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP); | |||||
CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP); | |||||
if (pcontext == nullptr) | if (pcontext == nullptr) | ||||
throw rack::Exception("Plugin context is null."); | throw rack::Exception("Plugin context is null."); | ||||
@@ -60,7 +60,7 @@ struct HostCV : Module { | |||||
~HostCV() override | ~HostCV() override | ||||
{ | { | ||||
CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP); | |||||
CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP); | |||||
DISTRHO_SAFE_ASSERT_RETURN(pcontext != nullptr,); | DISTRHO_SAFE_ASSERT_RETURN(pcontext != nullptr,); | ||||
pcontext->loadedHostCV = false; | pcontext->loadedHostCV = false; | ||||
@@ -68,7 +68,7 @@ struct HostCV : Module { | |||||
void process(const ProcessArgs&) override | void process(const ProcessArgs&) override | ||||
{ | { | ||||
if (CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP)) | |||||
if (CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP)) | |||||
{ | { | ||||
const float** dataIns = pcontext->dataIns; | const float** dataIns = pcontext->dataIns; | ||||
float** dataOuts = pcontext->dataOuts; | float** dataOuts = pcontext->dataOuts; | ||||
@@ -42,7 +42,7 @@ struct HostParameters : Module { | |||||
{ | { | ||||
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); | config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); | ||||
CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP); | |||||
CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP); | |||||
if (pcontext == nullptr) | if (pcontext == nullptr) | ||||
throw rack::Exception("Plugin context is null."); | throw rack::Exception("Plugin context is null."); | ||||
@@ -57,7 +57,7 @@ struct HostParameters : Module { | |||||
void process(const ProcessArgs&) override | void process(const ProcessArgs&) override | ||||
{ | { | ||||
if (CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP)) | |||||
if (CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP)) | |||||
{ | { | ||||
for (uint32_t i=0; i<kModuleParameters; ++i) | for (uint32_t i=0; i<kModuleParameters; ++i) | ||||
outputs[i].setVoltage(parameters[i].process(sampleTime, pcontext->parameters[i])); | outputs[i].setVoltage(parameters[i].process(sampleTime, pcontext->parameters[i])); | ||||
@@ -66,7 +66,7 @@ struct HostParameters : Module { | |||||
void onSampleRateChange(const SampleRateChangeEvent& e) override | void onSampleRateChange(const SampleRateChangeEvent& e) override | ||||
{ | { | ||||
if (CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP)) | |||||
if (CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP)) | |||||
{ | { | ||||
const double fall = 1.0 / (double(pcontext->bufferSize) / e.sampleRate); | const double fall = 1.0 / (double(pcontext->bufferSize) / e.sampleRate); | ||||
@@ -84,12 +84,12 @@ struct HostParameters : Module { | |||||
#ifndef HEADLESS | #ifndef HEADLESS | ||||
struct CardinalParameterPJ301MPort : PJ301MPort { | struct CardinalParameterPJ301MPort : PJ301MPort { | ||||
void onDragStart(const DragStartEvent& e) override { | void onDragStart(const DragStartEvent& e) override { | ||||
if (CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP)) | |||||
if (CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP)) | |||||
handleHostParameterDrag(pcontext, portId, true); | handleHostParameterDrag(pcontext, portId, true); | ||||
PJ301MPort::onDragStart(e); | PJ301MPort::onDragStart(e); | ||||
} | } | ||||
void onDragEnd(const DragEndEvent& e) override { | void onDragEnd(const DragEndEvent& e) override { | ||||
if (CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP)) | |||||
if (CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP)) | |||||
handleHostParameterDrag(pcontext, portId, false); | handleHostParameterDrag(pcontext, portId, false); | ||||
PJ301MPort::onDragEnd(e); | PJ301MPort::onDragEnd(e); | ||||
} | } | ||||
@@ -42,7 +42,7 @@ struct HostTime : Module { | |||||
{ | { | ||||
config(NUM_PARAMS, NUM_INPUTS, kHostTimeCount, kHostTimeCount); | config(NUM_PARAMS, NUM_INPUTS, kHostTimeCount, kHostTimeCount); | ||||
CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP); | |||||
CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP); | |||||
if (pcontext == nullptr) | if (pcontext == nullptr) | ||||
throw rack::Exception("Plugin context is null."); | throw rack::Exception("Plugin context is null."); | ||||
@@ -50,7 +50,7 @@ struct HostTime : Module { | |||||
void process(const ProcessArgs& args) override | void process(const ProcessArgs& args) override | ||||
{ | { | ||||
if (CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP)) | |||||
if (CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP)) | |||||
{ | { | ||||
const bool playing = pcontext->playing; | const bool playing = pcontext->playing; | ||||
const bool playingWithBBT = playing && pcontext->bbtValid; | const bool playingWithBBT = playing && pcontext->bbtValid; | ||||
@@ -270,7 +270,7 @@ struct IldaeilModule : Module { | |||||
IldaeilMidiGenerator midiGenerator; | IldaeilMidiGenerator midiGenerator; | ||||
IldaeilModule() | IldaeilModule() | ||||
: pcontext(reinterpret_cast<CardinalPluginContext*>(APP)) | |||||
: pcontext(static_cast<CardinalPluginContext*>(APP)) | |||||
{ | { | ||||
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); | config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); | ||||
for (uint i=0; i<2; ++i) | for (uint i=0; i<2; ++i) | ||||
@@ -37,10 +37,38 @@ | |||||
#include "WindowParameters.hpp" | #include "WindowParameters.hpp" | ||||
#include "ResizeHandle.hpp" | #include "ResizeHandle.hpp" | ||||
GLFWAPI const char* glfwGetClipboardString(GLFWwindow*) { return nullptr; } | |||||
GLFWAPI void glfwSetClipboardString(GLFWwindow*, const char*) {} | |||||
GLFWAPI int glfwGetKeyScancode(int) { return 0; } | GLFWAPI int glfwGetKeyScancode(int) { return 0; } | ||||
GLFWAPI const char* glfwGetClipboardString(GLFWwindow*) | |||||
{ | |||||
CardinalPluginContext* const context = static_cast<CardinalPluginContext*>(APP); | |||||
DISTRHO_SAFE_ASSERT_RETURN(context != nullptr, nullptr); | |||||
DISTRHO_SAFE_ASSERT_RETURN(context->ui != nullptr, nullptr); | |||||
const char* mimeType = nullptr; | |||||
size_t dataSize = 0; | |||||
if (const void* const clipboard = context->ui->getClipboard(mimeType, dataSize)) | |||||
{ | |||||
if (mimeType == nullptr || std::strcmp(mimeType, "text/plain") != 0) | |||||
return nullptr; | |||||
return static_cast<const char*>(clipboard); | |||||
} | |||||
return nullptr; | |||||
} | |||||
GLFWAPI void glfwSetClipboardString(GLFWwindow*, const char* const text) | |||||
{ | |||||
DISTRHO_SAFE_ASSERT_RETURN(text != nullptr,); | |||||
CardinalPluginContext* const context = static_cast<CardinalPluginContext*>(APP); | |||||
DISTRHO_SAFE_ASSERT_RETURN(context != nullptr,); | |||||
DISTRHO_SAFE_ASSERT_RETURN(context->ui != nullptr,); | |||||
context->ui->setClipboard(nullptr, text, std::strlen(text)+1); | |||||
} | |||||
GLFWAPI double glfwGetTime(void) | GLFWAPI double glfwGetTime(void) | ||||
{ | { | ||||
CardinalPluginContext* const context = static_cast<CardinalPluginContext*>(APP); | CardinalPluginContext* const context = static_cast<CardinalPluginContext*>(APP); | ||||