Remove small plugins together with all the supporting infrastructure.
The small plugins don't really fit into the project and should be moved somewhere else instead. Unfortunately, I don't have enough time to do it myself, so if anyone needs them, feel free to make a separate project out of them, or merge them (if possible, it may be very hard) into some other small plugin library. (cherry picked from commit e03505a778ac3b8edb7a389a11eae03cbacc79fe)
This commit is contained in:
committed by
Tobias Doerffel
parent
6c59404c32
commit
0ab27d30c3
@@ -23,80 +23,3 @@
|
||||
#endif
|
||||
#undef PER_MODULE_ITEM
|
||||
#endif
|
||||
#ifdef PER_SMALL_MODULE_ITEM
|
||||
#ifdef ENABLE_EXPERIMENTAL
|
||||
PER_SMALL_MODULE_ITEM(lp_filter, "lowpass12")
|
||||
PER_SMALL_MODULE_ITEM(hp_filter, "highpass12")
|
||||
PER_SMALL_MODULE_ITEM(bp_filter, "bandpass6")
|
||||
PER_SMALL_MODULE_ITEM(br_filter, "notch6")
|
||||
PER_SMALL_MODULE_ITEM(onepole_lp_filter, "lowpass6")
|
||||
PER_SMALL_MODULE_ITEM(onepole_hp_filter, "highpass6")
|
||||
PER_SMALL_MODULE_ITEM(onepole_ap_filter, "allpass")
|
||||
PER_SMALL_MODULE_ITEM(min, "min")
|
||||
PER_SMALL_MODULE_ITEM(max, "max")
|
||||
PER_SMALL_MODULE_ITEM(minus, "minus")
|
||||
PER_SMALL_MODULE_ITEM(mul, "mul")
|
||||
PER_SMALL_MODULE_ITEM(neg, "neg")
|
||||
PER_SMALL_MODULE_ITEM(min_c, "min_c")
|
||||
PER_SMALL_MODULE_ITEM(max_c, "max_c")
|
||||
PER_SMALL_MODULE_ITEM(minus_c, "minus_c")
|
||||
PER_SMALL_MODULE_ITEM(mul_c, "mul_c")
|
||||
PER_SMALL_MODULE_ITEM(neg_c, "neg_c")
|
||||
PER_SMALL_MODULE_ITEM(level2edge_c, "level2edge_c")
|
||||
PER_SMALL_MODULE_ITEM(map_lin2exp, "lin2exp")
|
||||
PER_SMALL_MODULE_ITEM(square_osc, "square_osc")
|
||||
PER_SMALL_MODULE_ITEM(saw_osc, "saw_osc")
|
||||
PER_SMALL_MODULE_ITEM(square_lfo, "square_lfo")
|
||||
PER_SMALL_MODULE_ITEM(saw_lfo, "saw_lfo")
|
||||
PER_SMALL_MODULE_ITEM(pulse_lfo, "pulse_lfo")
|
||||
PER_SMALL_MODULE_ITEM(print_a, "print_a")
|
||||
PER_SMALL_MODULE_ITEM(print_c, "print_c")
|
||||
PER_SMALL_MODULE_ITEM(print_e, "print_e")
|
||||
PER_SMALL_MODULE_ITEM(print_em, "print_em")
|
||||
PER_SMALL_MODULE_ITEM(copy_em, "copy_em")
|
||||
PER_SMALL_MODULE_ITEM(notefilter_m, "notefilter_m")
|
||||
PER_SMALL_MODULE_ITEM(ccfilter_m, "ccfilter_m")
|
||||
PER_SMALL_MODULE_ITEM(pcfilter_m, "pcfilter_m")
|
||||
PER_SMALL_MODULE_ITEM(pressurefilter_m, "pressurefilter_m")
|
||||
PER_SMALL_MODULE_ITEM(pitchbendfilter_m, "pitchbendfilter_m")
|
||||
PER_SMALL_MODULE_ITEM(systemfilter_m, "systemfilter_m")
|
||||
PER_SMALL_MODULE_ITEM(channelfilter_m, "channelfilter_m")
|
||||
PER_SMALL_MODULE_ITEM(keyfilter_m, "keyfilter_m")
|
||||
PER_SMALL_MODULE_ITEM(setchannel_m, "setchannel_m")
|
||||
PER_SMALL_MODULE_ITEM(key_less_than_m, "key_less_than_m")
|
||||
PER_SMALL_MODULE_ITEM(channel_less_than_m, "channel_less_than_m")
|
||||
PER_SMALL_MODULE_ITEM(transpose_m, "transpose_m")
|
||||
PER_SMALL_MODULE_ITEM(eventmerge_e, "eventmerge_e")
|
||||
PER_SMALL_MODULE_ITEM(quadpower_a, "quadpower_a")
|
||||
PER_SMALL_MODULE_ITEM(quadpower_c, "quadpower_c")
|
||||
PER_SMALL_MODULE_ITEM(crossfader2_a, "crossfader2_a")
|
||||
PER_SMALL_MODULE_ITEM(crossfader2_c, "crossfader2_c")
|
||||
PER_SMALL_MODULE_ITEM(linear_inertia_c, "linear_inertia_c")
|
||||
PER_SMALL_MODULE_ITEM(exp_inertia_c, "exp_inertia_c")
|
||||
PER_SMALL_MODULE_ITEM(sample_hold_edge_c, "sample_hold_edge_c")
|
||||
PER_SMALL_MODULE_ITEM(sample_hold_level_c, "sample_hold_level_c")
|
||||
PER_SMALL_MODULE_ITEM(bit_and_c, "bit_and_c")
|
||||
PER_SMALL_MODULE_ITEM(bit_or_c, "bit_or_c")
|
||||
PER_SMALL_MODULE_ITEM(bit_xor_c, "bit_xor_c")
|
||||
PER_SMALL_MODULE_ITEM(logical_and_c, "logical_and_c")
|
||||
PER_SMALL_MODULE_ITEM(logical_or_c, "logical_or_c")
|
||||
PER_SMALL_MODULE_ITEM(logical_xor_c, "logical_xor_c")
|
||||
PER_SMALL_MODULE_ITEM(logical_not_c, "logical_not_c")
|
||||
PER_SMALL_MODULE_ITEM(flipflop_c, "flipflop_c")
|
||||
PER_SMALL_MODULE_ITEM(schmitt_c, "schmitt_c")
|
||||
PER_SMALL_MODULE_ITEM(between_c, "between_c")
|
||||
PER_SMALL_MODULE_ITEM(less_c, "less_c")
|
||||
PER_SMALL_MODULE_ITEM(clip_c, "clip_c")
|
||||
PER_SMALL_MODULE_ITEM(trigger_a2c, "trigger_a2c")
|
||||
PER_SMALL_MODULE_ITEM(timer_c, "timer_c")
|
||||
PER_SMALL_MODULE_ITEM(prio_mux_c, "prio_mux_c")
|
||||
PER_SMALL_MODULE_ITEM(prio_enc8_c, "prio_enc8_c")
|
||||
PER_SMALL_MODULE_ITEM(ifthenelse_c, "ifthenelse_c")
|
||||
PER_SMALL_MODULE_ITEM(counter_c, "counter_c")
|
||||
PER_SMALL_MODULE_ITEM(mux4_c, "mux4_c")
|
||||
PER_SMALL_MODULE_ITEM(mux8_c, "mux8_c")
|
||||
PER_SMALL_MODULE_ITEM(mux16_c, "mux16_c")
|
||||
PER_SMALL_MODULE_ITEM(msgread_e, "msgread_e")
|
||||
#endif
|
||||
#undef PER_SMALL_MODULE_ITEM
|
||||
#endif
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
/* Calf DSP Library
|
||||
* "Small" audio modules for modular synthesis
|
||||
*
|
||||
* Copyright (C) 2001-2007 Krzysztof Foltman
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __CALF_MODULES_SMALL_H
|
||||
#define __CALF_MODULES_SMALL_H
|
||||
|
||||
#if USE_LV2
|
||||
|
||||
#include <lv2.h>
|
||||
#include "plugininfo.h"
|
||||
#include "lv2_polymorphic_port.h"
|
||||
#include "lv2helpers.h"
|
||||
|
||||
namespace calf_plugins {
|
||||
|
||||
/// Empty implementations for plugin functions. Note, that some functions aren't virtual, because they're called via the particular
|
||||
/// subclass via template wrappers (ladspa_small_wrapper<> etc), not via base class pointer/reference. On the other hand,
|
||||
/// other functions are virtual when overhead is acceptable (instantiation time functions etc.)
|
||||
class null_small_audio_module: public uri_map_access
|
||||
{
|
||||
public:
|
||||
uint32_t srate;
|
||||
double odsr;
|
||||
uint32_t poly_type_control, poly_type_audio;
|
||||
/// for polymorphic ports: "is audio" flags for first 32 ports (should be sufficient for most plugins)
|
||||
uint32_t poly_port_types;
|
||||
|
||||
null_small_audio_module()
|
||||
: srate((uint32_t)-1)
|
||||
, odsr(0.)
|
||||
, poly_type_control(0)
|
||||
, poly_type_audio(0)
|
||||
, poly_port_types(0)
|
||||
{
|
||||
}
|
||||
|
||||
/// Called when host changes type of the polymorphic port
|
||||
inline void set_port_type(uint32_t port, uint32_t type, void *type_data) {
|
||||
if (port >= 32)
|
||||
return;
|
||||
uint32_t port_mask = 1 << port;
|
||||
if (type == poly_type_control)
|
||||
poly_port_types &= ~port_mask;
|
||||
else if (type == poly_type_audio)
|
||||
poly_port_types |= port_mask;
|
||||
on_port_types_changed();
|
||||
}
|
||||
|
||||
/// Returns 1 for audio ports and 0 for control ports
|
||||
inline unsigned int port_is_audio(unsigned int port) {
|
||||
return (poly_port_types >> port) & 1;
|
||||
}
|
||||
|
||||
/// Returns (unsigned)-1 for audio ports and 0 for control ports
|
||||
inline unsigned int port_audio_mask(unsigned int port) {
|
||||
return 0 - ((poly_port_types >> port) & 1);
|
||||
}
|
||||
|
||||
/// Returns (unsigned)-1 for audio ports and 0 for control ports
|
||||
static inline unsigned int port_audio_mask(unsigned int port, uint32_t poly_port_types) {
|
||||
return 0 - ((poly_port_types >> port) & 1);
|
||||
}
|
||||
|
||||
virtual void on_port_types_changed() {}
|
||||
inline void set_bundle_path(const char *path) {}
|
||||
/// Called to map all the necessary URIs
|
||||
virtual void map_uris()
|
||||
{
|
||||
poly_type_control = map_uri(LV2_POLYMORPHIC_PORT_URI, "http://lv2plug.in/ns/lv2core#ControlPort");
|
||||
poly_type_audio = map_uri(LV2_POLYMORPHIC_PORT_URI, "http://lv2plug.in/ns/lv2core#AudioPort");
|
||||
}
|
||||
/// Called on instantiation with the list of LV2 features called
|
||||
virtual void use_features(const LV2_Feature *const *features) {
|
||||
while(*features)
|
||||
{
|
||||
use_feature((*features)->URI, (*features)->data);
|
||||
features++;
|
||||
}
|
||||
}
|
||||
/// LADSPA-esque activate function, except it is called after ports are connected, not before
|
||||
inline void activate() {}
|
||||
/// LADSPA-esque deactivate function
|
||||
inline void deactivate() {}
|
||||
/// Set sample rate for the plugin
|
||||
inline void set_sample_rate(uint32_t sr) { srate = sr; odsr = 1.0 / sr; }
|
||||
static inline const void *ext_data(const char *URI) { return NULL; }
|
||||
};
|
||||
|
||||
/// Templatized version useful when the number of inputs and outputs is small
|
||||
template<unsigned int Inputs, unsigned int Outputs>
|
||||
class small_audio_module_base: public null_small_audio_module
|
||||
{
|
||||
public:
|
||||
enum { in_count = Inputs, out_count = Outputs };
|
||||
/// Input pointers
|
||||
float *ins[in_count];
|
||||
/// Output pointers
|
||||
float *outs[out_count];
|
||||
};
|
||||
|
||||
template<class Module>
|
||||
struct lv2_small_wrapper
|
||||
{
|
||||
typedef Module instance;
|
||||
static LV2_Descriptor descriptor;
|
||||
std::string uri;
|
||||
static uint32_t poly_port_types;
|
||||
|
||||
lv2_small_wrapper(const char *id)
|
||||
{
|
||||
uri = "http://calf.sourceforge.net/small_plugins/" + std::string(id);
|
||||
descriptor.URI = uri.c_str();
|
||||
descriptor.instantiate = cb_instantiate;
|
||||
descriptor.connect_port = cb_connect;
|
||||
descriptor.activate = cb_activate;
|
||||
descriptor.run = cb_run;
|
||||
descriptor.deactivate = cb_deactivate;
|
||||
descriptor.cleanup = cb_cleanup;
|
||||
descriptor.extension_data = cb_ext_data;
|
||||
|
||||
plugin_port_type_grabber ptg(poly_port_types);
|
||||
Module::plugin_info(&ptg);
|
||||
}
|
||||
|
||||
static void cb_connect(LV2_Handle Instance, uint32_t port, void *DataLocation) {
|
||||
unsigned long ins = Module::in_count;
|
||||
unsigned long outs = Module::out_count;
|
||||
instance *const mod = (instance *)Instance;
|
||||
if (port < ins)
|
||||
mod->ins[port] = (float *)DataLocation;
|
||||
else if (port < ins + outs)
|
||||
mod->outs[port - ins] = (float *)DataLocation;
|
||||
}
|
||||
|
||||
static void cb_activate(LV2_Handle Instance) {
|
||||
// Note the changed semantics (now more LV2-like)
|
||||
instance *const mod = (instance *)Instance;
|
||||
mod->activate();
|
||||
}
|
||||
|
||||
static void cb_deactivate(LV2_Handle Instance) {
|
||||
instance *const mod = (instance *)Instance;
|
||||
mod->deactivate();
|
||||
}
|
||||
|
||||
static uint32_t cb_set_type(LV2_Handle Instance, uint32_t port, uint32_t type, void *type_data)
|
||||
{
|
||||
instance *const mod = (instance *)Instance;
|
||||
mod->set_port_type(port, type, type_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LV2_Handle cb_instantiate(const LV2_Descriptor * Descriptor, double sample_rate, const char *bundle_path, const LV2_Feature *const *features)
|
||||
{
|
||||
instance *mod = new instance();
|
||||
mod->poly_port_types = poly_port_types;
|
||||
// XXXKF some people use fractional sample rates; we respect them ;-)
|
||||
mod->set_bundle_path(bundle_path);
|
||||
mod->use_features(features);
|
||||
mod->set_sample_rate((uint32_t)sample_rate);
|
||||
return mod;
|
||||
}
|
||||
|
||||
static void cb_run(LV2_Handle Instance, uint32_t SampleCount) {
|
||||
instance *const mod = (instance *)Instance;
|
||||
mod->process(SampleCount);
|
||||
}
|
||||
|
||||
static void cb_cleanup(LV2_Handle Instance) {
|
||||
instance *const mod = (instance *)Instance;
|
||||
delete mod;
|
||||
}
|
||||
|
||||
static const void *cb_ext_data(const char *URI) {
|
||||
return Module::ext_data(URI);
|
||||
}
|
||||
};
|
||||
|
||||
extern const LV2_Descriptor *lv2_small_descriptor(uint32_t index);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,105 +0,0 @@
|
||||
/* Calf DSP Library
|
||||
* Plugin introspection interface
|
||||
*
|
||||
* Copyright (C) 2008 Krzysztof Foltman
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __CALF_PLUGININFO_H
|
||||
#define __CALF_PLUGININFO_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace calf_plugins {
|
||||
|
||||
/// A sink to send information about an audio port
|
||||
struct plain_port_info_iface
|
||||
{
|
||||
/// Called if it's an input port
|
||||
virtual plain_port_info_iface& input() { return *this; }
|
||||
/// Called if it's an output port
|
||||
virtual plain_port_info_iface& output() { return *this; }
|
||||
virtual plain_port_info_iface& lv2_ttl(const std::string &text) { return *this; }
|
||||
virtual ~plain_port_info_iface() {}
|
||||
};
|
||||
|
||||
/// A sink to send information about a control port (very incomplete, missing stuff: units, integer, boolean, toggled, notAutomatic, notGUI...)
|
||||
struct control_port_info_iface
|
||||
{
|
||||
/// Called if it's an input port
|
||||
virtual control_port_info_iface& input() { return *this; }
|
||||
/// Called if it's an output port
|
||||
virtual control_port_info_iface& output() { return *this; }
|
||||
/// Called to mark the port as using linear range [from, to]
|
||||
virtual control_port_info_iface& lin_range(double from, double to) { return *this; }
|
||||
/// Called to mark the port as using log range [from, to]
|
||||
virtual control_port_info_iface& log_range(double from, double to) { return *this; }
|
||||
virtual control_port_info_iface& toggle() { return *this; }
|
||||
virtual control_port_info_iface& trigger() { return *this; }
|
||||
virtual control_port_info_iface& integer() { return *this; }
|
||||
virtual control_port_info_iface& lv2_ttl(const std::string &text) { return *this; }
|
||||
virtual control_port_info_iface& polymorphic() { return lv2_ttl("a poly:PolymorphicPort ;"); }
|
||||
virtual control_port_info_iface& poly_audio() { return lv2_ttl("poly:supportsType lv2:AudioPort ;"); }
|
||||
virtual ~control_port_info_iface() {}
|
||||
};
|
||||
|
||||
/// A sink to send information about a plugin
|
||||
struct plugin_info_iface
|
||||
{
|
||||
/// Set plugin names (ID, name and label)
|
||||
virtual void names(const std::string &name, const std::string &label, const std::string &category, const std::string µname = std::string()) {}
|
||||
/// Add an audio port (returns a sink which accepts further description)
|
||||
virtual plain_port_info_iface &audio_port(const std::string &id, const std::string &name, const std::string µname = std::string("N/A"))=0;
|
||||
/// Add an event port (returns a sink which accepts further description)
|
||||
virtual plain_port_info_iface &event_port(const std::string &id, const std::string &name, const std::string µname = std::string("N/A"))=0;
|
||||
/// Add a control port (returns a sink which accepts further description)
|
||||
virtual control_port_info_iface &control_port(const std::string &id, const std::string &name, double def_value, const std::string µname = "N/A")=0;
|
||||
/// Add arbitrary TTL clauses
|
||||
virtual void lv2_ttl(const std::string &text) {}
|
||||
/// Add small plugin GUI
|
||||
virtual void has_gui() { lv2_ttl("uiext:ui <http://calf.sourceforge.net/small_plugins/gui/gtk2-gui> ;"); }
|
||||
/// Called after plugin has reported all the information
|
||||
virtual void finalize() {}
|
||||
virtual ~plugin_info_iface() {}
|
||||
};
|
||||
|
||||
struct plugin_port_type_grabber: public plugin_info_iface, public control_port_info_iface
|
||||
{
|
||||
uint32_t ⌖
|
||||
uint32_t index;
|
||||
|
||||
plain_port_info_iface pp;
|
||||
control_port_info_iface cp;
|
||||
|
||||
plugin_port_type_grabber(uint32_t &_target) : target(_target), index(0) { target = 0; }
|
||||
|
||||
virtual plain_port_info_iface &audio_port(const std::string &id, const std::string &name, const std::string µname = std::string("N/A")) { target |= (1 << index); index++; return pp; }
|
||||
virtual plain_port_info_iface &event_port(const std::string &id, const std::string &name, const std::string µname = std::string("N/A")) { index++; return pp; }
|
||||
virtual control_port_info_iface &control_port(const std::string &id, const std::string &name, double def_value, const std::string µname = "N/A") { index++; return cp; }
|
||||
};
|
||||
|
||||
/// A sink to send information about plugins
|
||||
struct plugin_list_info_iface
|
||||
{
|
||||
/// Add an empty plugin object and return the sink to be filled with information
|
||||
virtual plugin_info_iface &plugin(const std::string &id) = 0;
|
||||
virtual ~plugin_list_info_iface() {}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,6 @@
|
||||
#include <calf/lv2wrap.h>
|
||||
#include <calf/modules.h>
|
||||
#include <calf/modules_dev.h>
|
||||
#include <calf/modules_small.h>
|
||||
|
||||
using namespace calf_plugins;
|
||||
|
||||
@@ -61,11 +60,7 @@ const LV2_Descriptor *lv2_descriptor(uint32_t index)
|
||||
{
|
||||
#define PER_MODULE_ITEM(name, isSynth, jackname) if (!(index--)) return &lv2_wrapper<name##_audio_module>::get().descriptor;
|
||||
#include <calf/modulelist.h>
|
||||
#ifdef ENABLE_EXPERIMENTAL
|
||||
return lv2_small_descriptor(index);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user