[SCM] calf/master: + Small plugins: add print (Control) and print (Audio) plugins, fix onepole filters, add reset to onepole constructor (just in case)
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:37:35 UTC 2013
The following commit has been merged in the master branch:
commit af78817a251b51a7c115692fd6ecf058e8a1e81d
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date: Thu Sep 18 21:24:59 2008 +0000
+ Small plugins: add print (Control) and print (Audio) plugins, fix onepole filters, add reset to onepole constructor (just in case)
git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@290 78b06b96-2940-0410-b7fc-879d825d01d8
diff --git a/src/calf/modulelist.h b/src/calf/modulelist.h
index df98076..77d196e 100644
--- a/src/calf/modulelist.h
+++ b/src/calf/modulelist.h
@@ -22,6 +22,8 @@
PER_SMALL_MODULE_ITEM(small_map_lin2exp)
PER_SMALL_MODULE_ITEM(small_square_osc)
PER_SMALL_MODULE_ITEM(small_saw_osc)
+ PER_SMALL_MODULE_ITEM(small_print)
+ PER_SMALL_MODULE_ITEM(small_print2)
#endif
#undef PER_MODULE_ITEM
#undef PER_SMALL_MODULE_ITEM
diff --git a/src/calf/modules_small.h b/src/calf/modules_small.h
index 9d6ef38..0ad7e93 100644
--- a/src/calf/modules_small.h
+++ b/src/calf/modules_small.h
@@ -130,6 +130,9 @@ public:
uint32_t srate;
static parameter_properties param_props[];
+ void set_sample_rate(uint32_t sr) {
+ srate = sr;
+ }
static void port_info(plugin_info_iface *pii)
{
pii->audio_port("In", "in").input();
@@ -388,7 +391,7 @@ public:
}
static void plugin_info(plugin_info_iface *pii)
{
- pii->names("square_osc", "squareosc", "Square Oscillator", "lv2:Oscillator");
+ pii->names("square_osc", "squareosc", "Square Oscillator", "lv2:OscillatorPlugin");
port_info(pii);
}
};
@@ -404,11 +407,55 @@ public:
}
static void plugin_info(plugin_info_iface *pii)
{
- pii->names("saw_osc", "sawosc", "Saw Oscillator", "lv2:Oscillator");
+ pii->names("saw_osc", "sawosc", "Saw Oscillator", "lv2:OscillatorPlugin");
port_info(pii);
}
};
+class small_print_audio_module: public null_audio_module
+{
+public:
+ enum { in_count = 1, out_count = 0 };
+ float *ins[in_count];
+ float *outs[out_count];
+ uint32_t srate;
+
+ static void plugin_info(plugin_info_iface *pii)
+ {
+ pii->names("print", "print", "Print To Console (C)", "lv2:UtilityPlugin");
+ pii->control_port("in", "In", 0).input();
+ }
+ void set_sample_rate(uint32_t sr) {
+ srate = sr;
+ }
+ void process(uint32_t)
+ {
+ printf("%f\n", *ins[0]);
+ }
+};
+
+class small_print2_audio_module: public null_audio_module
+{
+public:
+ enum { in_count = 1, out_count = 0 };
+ float *ins[in_count];
+ float *outs[out_count];
+ uint32_t srate;
+
+ static void plugin_info(plugin_info_iface *pii)
+ {
+ pii->names("print2", "print2", "Print To Console (A)", "lv2:UtilityPlugin");
+ pii->audio_port("in", "In").input();
+ }
+ void set_sample_rate(uint32_t sr) {
+ srate = sr;
+ }
+ void process(uint32_t)
+ {
+ printf("%f\n", *ins[0]);
+ }
+};
+
};
#endif
diff --git a/src/calf/onepole.h b/src/calf/onepole.h
index bb866bd..97603f0 100644
--- a/src/calf/onepole.h
+++ b/src/calf/onepole.h
@@ -36,6 +36,11 @@ class onepole
public:
T x1, y1;
Coeff a0, a1, b1;
+
+ onepole()
+ {
+ reset();
+ }
/// Set coefficients for a lowpass filter
void set_lp(float fc, float sr)
diff --git a/src/modules.cpp b/src/modules.cpp
index 7a7c118..7ea7fab 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -200,6 +200,8 @@ SMALL_WRAPPERS(small_map_lin2exp, "lin2exp")
SMALL_WRAPPERS(small_square_osc, "square_osc")
SMALL_WRAPPERS(small_saw_osc, "saw_osc")
+SMALL_WRAPPERS(small_print, "print")
+SMALL_WRAPPERS(small_print2, "print2")
#endif
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list