Skip to content

Commit

Permalink
Merge pull request #391 from StoneyDSP/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
nathanjhood authored Jan 7, 2025
2 parents 8e1f5c2 + ceaa1d3 commit 75f3b5d
Show file tree
Hide file tree
Showing 33 changed files with 1,873 additions and 979 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"C_Cpp.default.defines": [
"_DEBUG=1",
"STONEYVCV_EXPERIMENTAL",
"STONEYVCV_BUILD_COMPONENTLIBRARY=1",
"STONEYVCV_BUILD_PLUGIN=1",
"STONEYVCV_BUILD_MODULES=1",
"STONEYVCV_BUILD_HP4=1",
Expand Down
321 changes: 148 additions & 173 deletions CMakeLists.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions CMakeOptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
"value": "ON",
"type": "BOOL"
},
"STONEYVCV_BUILD_COMPONENTLIBRARY": {
"value": "ON",
"type": "BOOL"
},
"STONEYVCV_BUILD_PLUGIN": {
"value": "ON",
"type": "BOOL"
Expand Down
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ FLAGS += -DSTONEYVCV_VERSION_TWEAK=$(STONEYVCV_VERSION_TWEAK)
# Experimental?
STONEYVCV_EXPERIMENTAL ?= 0

# Component Library?
STONEYVCV_BUILD_COMPONENTLIBRARY ?= 1

# Build plugin?
STONEYVCV_BUILD_PLUGIN ?= 1

Expand All @@ -123,10 +126,23 @@ STONEYVCV_BUILD_HP1 ?= $(STONEYVCV_BUILD_MODULES)
STONEYVCV_BUILD_VCA ?= $(STONEYVCV_BUILD_MODULES)
STONEYVCV_BUILD_LFO ?= $(STONEYVCV_EXPERIMENTAL)

# ifneq ($(STONEYVCV_BUILD_COMPONENTLIBRARY),$(STONEYVCV_BUILD_PLUGIN))
# $(error STONEYVCV_BUILD_PLUGIN requires that STONEYVCV_BUILD_COMPONENTLIBRARY=1)
# endif

SOURCES += src/StoneyVCV.cpp

ifeq ($(STONEYVCV_BUILD_COMPONENTLIBRARY),1)
FLAGS += -DSTONEYVCV_BUILD_COMPONENTLIBRARY=$(STONEYVCV_BUILD_COMPONENTLIBRARY)
SOURCES += src/StoneyVCV/ComponentLibrary.cpp
SOURCES += src/StoneyVCV/ComponentLibrary/Widget.cpp
SOURCES += src/StoneyVCV/ComponentLibrary/PortWidget.cpp
SOURCES += src/StoneyVCV/ComponentLibrary/PanelWidget.cpp
endif

ifeq ($(STONEYVCV_BUILD_PLUGIN),1)
FLAGS += -DSTONEYVCV_BUILD_PLUGIN=$(STONEYVCV_BUILD_PLUGIN)
SOURCES += src/StoneyVCV/plugin.cpp
SOURCES += src/StoneyVCV/ComponentLibrary.cpp

ifeq ($(STONEYVCV_BUILD_MODULES),1)
FLAGS += -DSTONEYVCV_BUILD_MODULES=$(STONEYVCV_BUILD_MODULES)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1233.37366161623664
2.0.1265.37346335353431
102 changes: 102 additions & 0 deletions include/StoneyVCV.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@

//==============================================================================

#ifdef STONEYDSP_DEBUG
#include <iostream>
#define DBG(msg, ...) do { ::std::cerr << std::string(msg, ##__VA_ARGS__) << std::endl; } while (0)
#else
#define DBG(msg, ...) ::StoneyDSP::ignoreUnused(msg, ##__VA_ARGS__)
#endif

//==============================================================================

/**
* @brief The `StoneyDSP` namespace.
* @author Nathan J. Hood ([email protected])
Expand Down Expand Up @@ -66,6 +75,89 @@ namespace StoneyVCV
* @{
*/

//==============================================================================

namespace Tools {
/** @addtogroup Tools
* @{
*/

//==============================================================================

const extern ::StoneyDSP::float_t vMin;
const extern ::StoneyDSP::float_t vMax;
const extern ::StoneyDSP::float_t vNominal;
const extern ::StoneyDSP::float_t vBias;
const extern ::StoneyDSP::float_t vGround;
const extern ::StoneyDSP::float_t vFloor;

//==============================================================================

/// @} group Tools
} // namespace Tools

//==============================================================================

// Declare an abstract base class with a pure virtual destructor.
// It's the simplest possible abstract class.
template <typename T>
struct Engine
{

//==========================================================================

public:

//==========================================================================

Engine()
{
DBG("Creating StoneyDSP::StoneyVCV::Engine");
};

virtual ~Engine() noexcept = 0; // pure virtual

//==========================================================================

virtual void processSample(T* sample) = 0; // pure virtual

//==========================================================================

private:

//==========================================================================

STONEYDSP_DECLARE_NON_COPYABLE(Engine)
STONEYDSP_DECLARE_NON_MOVEABLE(Engine)
};

template<class T>
::StoneyDSP::StoneyVCV::Engine<T>::~Engine() noexcept
{
DBG("Destroying StoneyDSP::StoneyVCV::Engine");
}

template struct ::StoneyDSP::StoneyVCV::Engine<::StoneyDSP::float_t>;
template struct ::StoneyDSP::StoneyVCV::Engine<::StoneyDSP::double_t>;

//==============================================================================

template <class TWidget = ::rack::widget::Widget>
TWidget *createWidgetSized(::rack::math::Vec pos, ::rack::math::Vec size)
{
TWidget* o = ::rack::createWidget<TWidget>(pos);
o->box.size = size;
return o;
}

template <class TWidget = ::rack::widget::Widget>
TWidget* createWidgetCenteredSized(::rack::math::Vec pos, ::rack::math::Vec size)
{
TWidget* o = ::rack::createWidgetCentered<TWidget>(pos);
o->box.size = size;
return o;
}

//==============================================================================

/// @} group StoneyVCV
Expand All @@ -77,3 +169,13 @@ namespace StoneyVCV
} // namespace StoneyDSP

//==============================================================================

// #include <StoneyVCV/version.hpp>
// #include <StoneyVCV/ComponentLibrary.hpp>
// #include <StoneyVCV/plugin.hpp>
// #include <StoneyVCV/HP1.hpp>
// #include <StoneyVCV/HP2.hpp>
// #include <StoneyVCV/HP4.hpp>
// #include <StoneyVCV/VCA.hpp>

//==============================================================================
Loading

0 comments on commit 75f3b5d

Please sign in to comment.