[SCM] calf/master: + Small modules: renamed prio_enc_c to prio_enc8_c before anyone has chance to use it, updated its doxygen documentation, added new 8-input multiplexer plugin (it's possible to make a simple step sequencer now with only a little effort!)
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:37:42 UTC 2013
The following commit has been merged in the master branch:
commit 26c2b500d0347bae19943227911dbc224b58b221
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date: Mon Oct 6 21:49:56 2008 +0000
+ Small modules: renamed prio_enc_c to prio_enc8_c before anyone has chance to use it, updated its doxygen documentation, added new 8-input multiplexer plugin (it's possible to make a simple step sequencer now with only a little effort!)
git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@321 78b06b96-2940-0410-b7fc-879d825d01d8
diff --git a/src/calf/modulelist.h b/src/calf/modulelist.h
index 45b0bb7..f02aa86 100644
--- a/src/calf/modulelist.h
+++ b/src/calf/modulelist.h
@@ -58,9 +58,10 @@
PER_SMALL_MODULE_ITEM(clip_c, "clip_c")
PER_SMALL_MODULE_ITEM(timer_c, "timer_c")
PER_SMALL_MODULE_ITEM(prio_mux_c, "prio_mux_c")
- PER_SMALL_MODULE_ITEM(prio_enc_c, "prio_enc_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(mux8_c, "mux8_c")
#endif
#undef PER_MODULE_ITEM
#undef PER_SMALL_MODULE_ITEM
diff --git a/src/modules_small.cpp b/src/modules_small.cpp
index adda06a..2019c82 100644
--- a/src/modules_small.cpp
+++ b/src/modules_small.cpp
@@ -672,8 +672,9 @@ public:
}
};
-/// 8-input priority multiplexer - without inertia. Outputs the first input if gate_1 is TRUE, else second input if gate_2 is TRUE, else... else "Else" input
-class prio_enc_c_audio_module: public null_small_audio_module
+/// 8-input priority encoder - outputs the index of the first port whose value is >0. 'Any' output is set whenever any of gates is set (which tells
+/// apart no inputs set and 0th input set).
+class prio_enc8_c_audio_module: public null_small_audio_module
{
public:
enum { in_gate1, in_count = in_gate1 + 8};
@@ -683,7 +684,7 @@ public:
static void plugin_info(plugin_info_iface *pii)
{
- pii->names("prio_enc_c", "Priority Encoder (C)", "kf:IntegerPlugin");
+ pii->names("prio_enc8_c", "Priority Encoder (C)", "kf:IntegerPlugin");
for (int i = 0; i < 8; i++)
{
string num = string("01234567" + i, 1);
@@ -708,6 +709,32 @@ public:
}
};
+/// 8-input integer multiplexer, outputs the input selected by ((int)select input & 7)
+class mux8_c_audio_module: public null_small_audio_module
+{
+public:
+ enum { in_select, in_in1, in_count = in_in1 + 8};
+ enum { out_value, out_count };
+ float *ins[in_count];
+ float *outs[out_count];
+
+ static void plugin_info(plugin_info_iface *pii)
+ {
+ pii->names("mux8_c", "Multiplexer (C)", "kf:IntegerPlugin");
+ pii->control_port("select", "Select", 0.f).input().integer();
+ for (int i = 0; i < 8; i++)
+ {
+ string num = string("01234567" + i, 1);
+ pii->control_port("in_"+num, "In "+num, 0.f).input();
+ }
+ pii->control_port("out", "Out", -1).output();
+ }
+ void process(uint32_t count)
+ {
+ *outs[out_value] = *ins[in_in1 + (7 & (int)*ins[in_select])];
+ }
+};
+
/// Linear-to-exponential mapper
class map_lin2exp_audio_module: public null_small_audio_module
{
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list