Skip to content

Commit

Permalink
Continue biset changes, plugin-accessible cardinal context
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Apr 15, 2024
1 parent 8e17cf4 commit 7948f66
Show file tree
Hide file tree
Showing 26 changed files with 228 additions and 264 deletions.
14 changes: 13 additions & 1 deletion include/midi.hpp
@@ -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
Expand Down Expand Up @@ -111,6 +111,18 @@ struct Message {
};


struct InputQueue {
struct Internal;
Internal* internal;

InputQueue();
~InputQueue();
bool tryPop(Message* const messageOut, int64_t maxFrame);
json_t* toJson() const;
void fromJson(json_t* rootJ);
};


/* NOTE all the other MIDI stuff (drivers, ports etc) is purposefully missing here, unwanted in Cardinal
*/
struct Port;
Expand Down
10 changes: 2 additions & 8 deletions plugins/Cardinal/src/AIDA-X.cpp
@@ -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
Expand Down Expand Up @@ -250,7 +250,6 @@ struct AidaPluginModule : Module {
NUM_LIGHTS
};

CardinalPluginContext* const pcontext;
bool fileChanged = false;
std::string currentFile;

Expand All @@ -272,7 +271,6 @@ struct AidaPluginModule : Module {
#endif

AidaPluginModule()
: pcontext(static_cast<CardinalPluginContext*>(APP))
{
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);

Expand Down Expand Up @@ -656,8 +654,6 @@ struct AidaPluginModule : Module {
cachedParams[kParameterPRESENCE]);
}
#endif

DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AidaPluginModule)
};

// --------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 3 additions & 5 deletions plugins/Cardinal/src/AudioFile.cpp
@@ -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
Expand All @@ -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"
Expand All @@ -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);
Expand Down Expand Up @@ -335,8 +337,6 @@ struct CarlaInternalPluginModule : Module, Runner {
0, 0, nullptr, e.sampleRate);
fCarlaPluginDescriptor->activate(fCarlaPluginHandle);
}

DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaInternalPluginModule)
};

// -----------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 2 additions & 4 deletions plugins/Cardinal/src/AudioToCVPitch.cpp
@@ -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
Expand All @@ -16,16 +16,14 @@
* 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"

extern "C" {
#include "aubio.h"
}

USE_NAMESPACE_DISTRHO;

// --------------------------------------------------------------------------------------------------------------------

// aubio setup values (tested under 48 kHz sample rate)
Expand Down
7 changes: 2 additions & 5 deletions plugins/Cardinal/src/Carla.cpp
@@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostAudio.cpp
@@ -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
Expand All @@ -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"

// -----------------------------------------------------------------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostCV.cpp
@@ -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
Expand All @@ -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"

// -----------------------------------------------------------------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostMIDI-CC.cpp
@@ -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
Expand All @@ -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>

Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostMIDI-Gate.cpp
@@ -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
Expand All @@ -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>

Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostMIDI-Map.cpp
@@ -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
Expand All @@ -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>

Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostMIDI.cpp
@@ -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
Expand All @@ -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>
Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostParameters-Map.cpp
@@ -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
Expand All @@ -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"

// -----------------------------------------------------------------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostParameters.cpp
@@ -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
Expand All @@ -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"

// -----------------------------------------------------------------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion plugins/Cardinal/src/HostTime.cpp
@@ -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
Expand All @@ -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"

// --------------------------------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 7948f66

Please sign in to comment.