Continue biset changes, plugin-accessible cardinal context

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2024-04-11 10:34:10 +02:00 committed by Filipe Coelho
parent 8e17cf4ece
commit 7948f66eb4
26 changed files with 223 additions and 259 deletions

@ -1 +1 @@
Subproject commit 43dc87d98e0da2e99b1f03f7f0c4b7e5bccab01d
Subproject commit a3acddc30732700b91f27075488b914c38b9dcdf

View file

@ -1,11 +1,11 @@
/*
* AIDA-X Cardinal plugin
* Copyright (C) 2022-2023 Massimo Pennazio <maxipenna@libero.it>
* Copyright (C) 2023 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2023-2024 Filipe Coelho <falktx@falktx.com>
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "plugincontext.hpp"
#include "plugin.hpp"
#include "ModuleWidgets.hpp"
#ifndef HEADLESS
@ -250,7 +250,6 @@ struct AidaPluginModule : Module {
NUM_LIGHTS
};
CardinalPluginContext* const pcontext;
bool fileChanged = false;
std::string currentFile;
@ -272,7 +271,6 @@ struct AidaPluginModule : Module {
#endif
AidaPluginModule()
: pcontext(static_cast<CardinalPluginContext*>(APP))
{
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
@ -656,8 +654,6 @@ struct AidaPluginModule : Module {
cachedParams[kParameterPRESENCE]);
}
#endif
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AidaPluginModule)
};
// --------------------------------------------------------------------------------------------------------------------
@ -1093,8 +1089,6 @@ struct AidaWidget : ModuleWidgetWithSideScrews<23> {
menu->addChild(new LoadModelFileItem(module));
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AidaWidget)
};
#else
struct AidaWidget : ModuleWidget {

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,6 +15,7 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "extra/Runner.hpp"
@ -39,6 +40,7 @@ const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t
// --------------------------------------------------------------------------------------------------------------------
using namespace CARLA_BACKEND_NAMESPACE;
using namespace DISTRHO_NAMESPACE;
static uint32_t host_get_buffer_size(NativeHostHandle);
static double host_get_sample_rate(NativeHostHandle);
@ -335,8 +337,6 @@ struct CarlaInternalPluginModule : Module, Runner {
0, 0, nullptr, e.sampleRate);
fCarlaPluginDescriptor->activate(fCarlaPluginHandle);
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaInternalPluginModule)
};
// -----------------------------------------------------------------------------------------------------------
@ -679,8 +679,6 @@ struct AudioFileWidget : ModuleWidgetWithSideScrews<23> {
menu->addChild(new LoadAudioFileItem(module));
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AudioFileWidget)
};
#else
struct AudioFileWidget : ModuleWidget {

View file

@ -1,7 +1,7 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Bram Giesen
* Copyright (C) 2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2022-2024 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
@ -16,7 +16,7 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugincontext.hpp"
#include "plugin.hpp"
#include "ModuleWidgets.hpp"
#include "Widgets.hpp"
@ -24,8 +24,6 @@ extern "C" {
#include "aubio.h"
}
USE_NAMESPACE_DISTRHO;
// --------------------------------------------------------------------------------------------------------------------
// aubio setup values (tested under 48 kHz sample rate)

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,6 +15,7 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "Expander.hpp"
#include "ModuleWidgets.hpp"
@ -427,8 +428,6 @@ struct CarlaModule : Module {
0, 0, nullptr, e.sampleRate);
fCarlaPluginDescriptor->activate(fCarlaPluginHandle);
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaModule)
};
static_assert((int)CarlaModule::NUM_INPUTS == (int)CarlaModule::NUM_OUTPUTS, "inputs must match outputs");
@ -715,8 +714,6 @@ struct CarlaModuleWidget : ModuleWidgetWith9HP, IdleCallback {
e.consume(this);
showUI();
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaModuleWidget)
};
static void host_ui_closed(NativeHostHandle handle)

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,9 +15,11 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "Widgets.hpp"
#include "engine/TerminalModule.hpp"
// -----------------------------------------------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,8 +15,10 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "engine/TerminalModule.hpp"
// -----------------------------------------------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -25,9 +25,11 @@
* the License, or (at your option) any later version.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "Widgets.hpp"
#include "engine/TerminalModule.hpp"
#include <algorithm>

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -25,9 +25,11 @@
* the License, or (at your option) any later version.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "Widgets.hpp"
#include "engine/TerminalModule.hpp"
#include <algorithm>

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -25,9 +25,11 @@
* the License, or (at your option) any later version.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "Widgets.hpp"
#include "engine/TerminalModule.hpp"
#include <algorithm>

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -25,7 +25,9 @@
* the License, or (at your option) any later version.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "engine/TerminalModule.hpp"
#include "ModuleWidgets.hpp"
#include <algorithm>

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -25,9 +25,11 @@
* the License, or (at your option) any later version.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "Widgets.hpp"
#include "engine/TerminalModule.hpp"
// -----------------------------------------------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,8 +15,10 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "engine/TerminalModule.hpp"
// -----------------------------------------------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,8 +15,10 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "ModuleWidgets.hpp"
#include "engine/TerminalModule.hpp"
// --------------------------------------------------------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -25,6 +25,7 @@
* the License, or (at your option) any later version.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#include "Expander.hpp"
@ -98,6 +99,7 @@ namespace ildaeil {
// --------------------------------------------------------------------------------------------------------------------
using namespace CARLA_BACKEND_NAMESPACE;
using namespace DISTRHO_NAMESPACE;
static uint32_t host_get_buffer_size(NativeHostHandle);
static double host_get_sample_rate(NativeHostHandle);
@ -768,8 +770,6 @@ struct IldaeilModule : Module {
0, 0, nullptr, e.sampleRate);
fCarlaPluginDescriptor->activate(fCarlaPluginHandle);
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(IldaeilModule)
};
// -----------------------------------------------------------------------------------------------------------
@ -2252,8 +2252,6 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
ImGui::End();
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(IldaeilWidget)
};
// --------------------------------------------------------------------------------------------------------------------
@ -2435,8 +2433,6 @@ struct IldaeilModuleWidget : ModuleWidgetWithSideScrews<26> {
ModuleWidgetWithSideScrews<26>::step();
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(IldaeilModuleWidget)
};
#else
static void host_ui_parameter_changed(NativeHostHandle, uint32_t, float) {}

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,12 +15,15 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugin.hpp"
#include "plugincontext.hpp"
#ifndef HEADLESS
# include "EmbedWidget.hpp"
# include "extra/ExternalWindow.hpp"
#endif
USE_NAMESPACE_DISTRHO;
// --------------------------------------------------------------------------------------------------------------------
struct CardinalEmbedModule : Module {

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugincontext.hpp"
#include "plugin.hpp"
#include "ImGuiWidget.hpp"
#include "sassy/sassy.hpp"
#include "sassy/sassy_scope.cpp"

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugincontext.hpp"
#include "plugin.hpp"
#ifndef HEADLESS
# include "ImGuiTextEditor.hpp"
@ -412,8 +412,6 @@ struct TextEditorModuleWidget : ModuleWidget {
menu->addChild(new ui::MenuSeparator);
menu->addChild(createMenuItem("Select all", RACK_MOD_CTRL_NAME "+A", [=]{ textEditorWidget->selectAll(); }));
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(TextEditorModuleWidget)
};
#else
struct TextEditorModuleWidget : ModuleWidget {

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 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
@ -18,11 +18,8 @@
#pragma once
#include "rack.hpp"
#include "engine/TerminalModule.hpp"
#ifdef NDEBUG
# undef DEBUG
#endif
// #include "engine/TerminalModule.hpp"
// #include "plugincontext.hpp"
using namespace rack;

View file

@ -1,89 +0,0 @@
/*
* DISTRHO Cardinal 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 3 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 "plugin.hpp"
#include "DistrhoUtils.hpp"
#include "../dgl/Base.hpp"
// -----------------------------------------------------------------------------------------------------------
// from PluginContext.hpp
START_NAMESPACE_DGL
class TopLevelWidget;
template <class BaseWidget> class NanoBaseWidget;
typedef NanoBaseWidget<TopLevelWidget> NanoTopLevelWidget;
END_NAMESPACE_DGL
START_NAMESPACE_DISTRHO
static constexpr const uint32_t kModuleParameterCount = 24;
enum CardinalVariant {
kCardinalVariantMain,
kCardinalVariantMini,
kCardinalVariantFX,
kCardinalVariantNative,
kCardinalVariantSynth,
};
class Plugin;
class UI;
struct MidiEvent {
static const uint32_t kDataSize = 4;
uint32_t frame;
uint32_t size;
uint8_t data[kDataSize];
const uint8_t* dataExt;
};
struct CardinalPluginContext : rack::Context {
uint32_t bufferSize, processCounter;
double sampleRate;
float parameters[kModuleParameterCount];
CardinalVariant variant;
bool bypassed, playing, reset, bbtValid;
int32_t bar, beat, beatsPerBar, beatType;
uint64_t frame;
double barStartTick, beatsPerMinute;
double tick, tickClock, ticksPerBeat, ticksPerClock, ticksPerFrame;
uintptr_t nativeWindowId;
const float* const* dataIns;
float** dataOuts;
const MidiEvent* midiEvents;
uint32_t midiEventCount;
Plugin* const plugin;
DGL_NAMESPACE::NanoTopLevelWidget* tlw;
UI* ui;
CardinalPluginContext(Plugin* const p);
void writeMidiMessage(const rack::midi::Message& message, uint8_t channel);
#ifndef HEADLESS
bool addIdleCallback(IdleCallback* cb) const;
void removeIdleCallback(IdleCallback* cb) const;
#endif
};
#ifndef HEADLESS
void handleHostParameterDrag(const CardinalPluginContext* pcontext, uint index, bool started);
#endif
END_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------------------------------------------

View file

@ -578,8 +578,8 @@ BIDOO_CUSTOM_PER_FILE = channel channel filterType
PLUGIN_FILES += $(filter-out Biset/src/plugin.cpp,$(wildcard Biset/src/*.cpp))
PLUGIN_FILES += $(wildcard Biset/src/*/*.cpp)
# # modules/types which are present in other plugins
BISET_CUSTOM = Blank
# modules/types which are present in other plugins
BISET_CUSTOM = Blank ButtonTrigger Clock Tree
# --------------------------------------------------------------
# BogaudioModules
@ -1318,6 +1318,7 @@ BUILD_DIR = ../build/plugins
endif
BASE_FLAGS += -DBUILDING_PLUGIN_MODULES
BASE_FLAGS += -DDONT_SET_USING_DISTRHO_NAMESPACE
BASE_FLAGS += -I$(abspath $(ROOT)/include/osdialog-stub)
ifeq ($(BSD)$(WASM),true)

View file

@ -147,9 +147,13 @@ extern Model* modelChord;
#include "Bidoo/src/plugin.hpp"
// Biset
#define modelBlank modelBisetBlank
#define modelTree modelBisetTree
#define Clock BisetClock
#define ButtonTrigger BisetButtonTrigger
#include "Biset/src/plugin.hpp"
#undef modelBlank
#undef modelTree
#undef ButtonTrigger
#undef Clock
@ -1629,31 +1633,35 @@ static void initStatic__Biset()
const StaticPluginLoader spl(p, "Biset");
if (spl.ok())
{
#define modelBlank modelBisetBlank
#define modelTree modelBisetTree
p->addModel(modelTracker);
p->addModel(modelTrackerSynth);
p->addModel(modelTrackerDrum);
p->addModel(modelTrackerClock);
p->addModel(modelTrackerPhase);
p->addModel(modelTrackerQuant);
p->addModel(modelTrackerState);
p->addModel(modelTrackerControl);
p->addModel(modelTrackerSynth);
p->addModel(modelTrackerDrum);
p->addModel(modelTrackerClock);
p->addModel(modelTrackerPhase);
p->addModel(modelTrackerQuant);
p->addModel(modelTrackerState);
p->addModel(modelTrackerControl);
p->addModel(modelRegex);
p->addModel(modelRegexCondensed);
p->addModel(modelRegexExp);
p->addModel(modelRegex);
p->addModel(modelRegexCondensed);
p->addModel(modelRegexExp);
p->addModel(modelBisetTree);
p->addModel(modelBisetTreeSeed);
p->addModel(modelTree);
p->addModel(modelTreeSeed);
p->addModel(modelGbu);
p->addModel(modelPkm);
p->addModel(modelGbu);
p->addModel(modelPkm);
p->addModel(modelIgc);
p->addModel(modelOmega3);
p->addModel(modelOmega6);
p->addModel(modelIgc);
p->addModel(modelOmega3);
p->addModel(modelOmega6);
p->addModel(modelSegfault);
p->addModel(modelBlank);
p->addModel(modelSegfault);
p->addModel(modelBlank);
#undef modelBlank
#undef modelTree
}
}