[SCM] calf/master: + Framework: sort out dependencies and namespace pollution for Monosynth and Organ

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:38:15 UTC 2013


The following commit has been merged in the master branch:
commit ed76fd931009a077396819012d7dcb558839e7d4
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Sat Nov 1 18:12:11 2008 +0000

    + Framework: sort out dependencies and namespace pollution for Monosynth and Organ

diff --git a/src/calf/giface.h b/src/calf/giface.h
index 32d8daf..db483ac 100644
--- a/src/calf/giface.h
+++ b/src/calf/giface.h
@@ -701,6 +701,56 @@ public:
 /// Escape a string to be used in XML file
 std::string xml_escape(const std::string &src);
 
+/// Empty implementations for plugin functions. Note, that functions aren't virtual, because they're called via the particular
+/// subclass (flanger_audio_module etc) via template wrappers (ladspa_wrapper<> etc), not via base class pointer/reference
+class null_audio_module: public line_graph_iface
+{
+public:
+    /// Handle MIDI Note On
+    inline void note_on(int note, int velocity) {}
+    /// Handle MIDI Note Off
+    inline void note_off(int note, int velocity) {}
+    /// Handle MIDI Program Change
+    inline void program_change(int program) {}
+    /// Handle MIDI Control Change
+    inline void control_change(int controller, int value) {}
+    /// Handle MIDI Pitch Bend
+    /// @param value pitch bend value (-8192 to 8191, defined as in MIDI ie. 8191 = 200 ct by default)
+    inline void pitch_bend(int value) {}
+    /// Called when params are changed (before processing)
+    inline void params_changed() {}
+    /// 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) { }
+    /// Get "live" graph
+    inline bool get_graph(int index, int subindex, float *data, int points, cairo_t *context) { return false; }
+    inline static const char *get_gui_xml() { return NULL; }
+    /// Get "static" graph (one that is dependent on single parameter value and doesn't use other parameters or plugin internal state).
+    /// Used by waveform graphs.
+    inline static bool get_static_graph(int index, int subindex, float value, float *data, int points, cairo_t *context) { return false; }
+    /// Return the NULL-terminated list of menu commands
+    inline static plugin_command_info *get_commands() { return NULL; }
+    /// does parameter number represent a CV port? (yes by default, except for synths)
+    static bool is_cv(int param_no) { return true; }
+    /// does parameter change cause an audible click?
+    static bool is_noisy(int param_no) { return false; }
+    /// Execute menu command with given number
+    inline void execute(int cmd_no) {}
+    /// DSSI configure call
+    inline char *configure(const char *key, const char *value) { return NULL; }
+    /// Send all understood configure vars
+    inline void send_configures(send_configure_iface *sci) {}
+    /// Get all configure vars that are supposed to be set to initialize a preset
+    static inline const char **get_default_configure_vars() { return NULL; }
+    /// Reset parameter values for epp:trigger type parameters (ones activated by oneshot push button instead of check box)
+    inline void params_reset() {}
+};
+
+extern const char *calf_copyright_info;
+
 };
 
 #endif
diff --git a/src/calf/modules.h b/src/calf/modules.h
index 6a6b297..89afd15 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -40,54 +40,6 @@ using namespace dsp;
 class null_audio_module;
 struct ladspa_plugin_info;
     
-/// Empty implementations for plugin functions. Note, that functions aren't virtual, because they're called via the particular
-/// subclass (flanger_audio_module etc) via template wrappers (ladspa_wrapper<> etc), not via base class pointer/reference
-class null_audio_module: public line_graph_iface
-{
-public:
-    /// Handle MIDI Note On
-    inline void note_on(int note, int velocity) {}
-    /// Handle MIDI Note Off
-    inline void note_off(int note, int velocity) {}
-    /// Handle MIDI Program Change
-    inline void program_change(int program) {}
-    /// Handle MIDI Control Change
-    inline void control_change(int controller, int value) {}
-    /// Handle MIDI Pitch Bend
-    /// @param value pitch bend value (-8192 to 8191, defined as in MIDI ie. 8191 = 200 ct by default)
-    inline void pitch_bend(int value) {}
-    /// Called when params are changed (before processing)
-    inline void params_changed() {}
-    /// 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) { }
-    /// Get "live" graph
-    inline bool get_graph(int index, int subindex, float *data, int points, cairo_t *context) { return false; }
-    inline static const char *get_gui_xml() { return NULL; }
-    /// Get "static" graph (one that is dependent on single parameter value and doesn't use other parameters or plugin internal state).
-    /// Used by waveform graphs.
-    inline static bool get_static_graph(int index, int subindex, float value, float *data, int points, cairo_t *context) { return false; }
-    /// Return the NULL-terminated list of menu commands
-    inline static plugin_command_info *get_commands() { return NULL; }
-    /// does parameter number represent a CV port? (yes by default, except for synths)
-    static bool is_cv(int param_no) { return true; }
-    /// does parameter change cause an audible click?
-    static bool is_noisy(int param_no) { return false; }
-    /// Execute menu command with given number
-    inline void execute(int cmd_no) {}
-    /// DSSI configure call
-    inline char *configure(const char *key, const char *value) { return NULL; }
-    /// Send all understood configure vars
-    inline void send_configures(send_configure_iface *sci) {}
-    /// Get all configure vars that are supposed to be set to initialize a preset
-    static inline const char **get_default_configure_vars() { return NULL; }
-    /// Reset parameter values for epp:trigger type parameters (ones activated by oneshot push button instead of check box)
-    inline void params_reset() {}
-};
-
 class amp_audio_module: public null_audio_module
 {
 public:
@@ -836,7 +788,6 @@ public:
 };
 
 extern std::string get_builtin_modules_rdf();
-extern const char *calf_copyright_info;
 
 };
 
diff --git a/src/calf/modules_synths.h b/src/calf/modules_synths.h
index 77e7d57..24c594b 100644
--- a/src/calf/modules_synths.h
+++ b/src/calf/modules_synths.h
@@ -23,6 +23,7 @@
 
 #include <assert.h>
 #include "biquad.h"
+#include "onepole.h"
 #include "audio_fx.h"
 #include "inertia.h"
 #include "osc.h"
@@ -57,9 +58,9 @@ public:
     
     float buffer[step_size], buffer2[step_size];
     uint32_t output_pos;
-    onepole<float> phaseshifter;
-    biquad<float> filter;
-    biquad<float> filter2;
+    dsp::onepole<float> phaseshifter;
+    dsp::biquad<float> filter;
+    dsp::biquad<float> filter2;
     int wave1, wave2, filter_type, last_filter_type;
     float freq, start_freq, target_freq, cutoff, decay_factor, fgain, fgain_delta, separation;
     float detune, xpose, xfade, pitchbend, ampctl, fltctl, queue_vel;
@@ -68,7 +69,7 @@ public:
     int legato;
     synth::adsr envelope;
     synth::keystack stack;
-    gain_smoothing master;
+    dsp::gain_smoothing master;
     
     static parameter_properties param_props[];
     static const char *get_gui_xml();
@@ -94,7 +95,7 @@ public:
             {
                 last_key = note = stack.nth(stack.count() - 1);
                 start_freq = freq;
-                target_freq = freq = note_to_hz(note);
+                target_freq = freq = dsp::note_to_hz(note);
                 set_frequency();
                 if (!(legato & 1)) {
                     envelope.note_on();
@@ -124,7 +125,7 @@ public:
     void params_changed() {
         float sf = 0.001f;
         envelope.set(*params[par_attack] * sf, *params[par_decay] * sf, std::min(0.999f, *params[par_sustain]), *params[par_release] * sf, srate / step_size);
-        filter_type = fastf2i_drm(*params[par_filtertype]);
+        filter_type = dsp::fastf2i_drm(*params[par_filtertype]);
         decay_factor = odcr * 1000.0 / *params[par_decay];
         separation = pow(2.0, *params[par_cutoffsep] / 1200.0);
         wave1 = dsp::clip(dsp::fastf2i_drm(*params[par_wave1]), 0, (int)wave_count - 1);
diff --git a/src/calf/organ.h b/src/calf/organ.h
index ac8bf71..767086f 100644
--- a/src/calf/organ.h
+++ b/src/calf/organ.h
@@ -218,7 +218,7 @@ protected:
     enum { VibratoSize = 6 };
     float vibrato_x1[VibratoSize][2], vibrato_y1[VibratoSize][2];
     float lfo_phase;
-    onepole<float> vibrato[2];
+    dsp::onepole<float> vibrato[2];
 public:
     void reset();
     void process(organ_parameters *parameters, float (*data)[2], unsigned int len, float sample_rate);
@@ -232,9 +232,9 @@ protected:
         float aux_buffers[3][BlockSize][Channels];
     };
     dsp::fixed_point<int64_t, 52> phase, dphase;
-    biquad<float> filterL[2], filterR[2];
+    dsp::biquad<float> filterL[2], filterR[2];
     adsr envs[EnvCount];
-    inertia<linear_ramp> expression;
+    dsp::inertia<dsp::linear_ramp> expression;
     organ_vibrato vibrato;
     float velocity;
     bool perc_released;
@@ -244,7 +244,7 @@ protected:
 public:
     organ_voice()
     : organ_voice_base(NULL, sample_rate, perc_released),
-    expression(linear_ramp(16)) {
+    expression(dsp::linear_ramp(16)) {
     }
 
     void reset() {
@@ -365,7 +365,7 @@ struct drawbar_organ: public synth::basic_synth {
         float buf[4096][2];
         dsp::zero(&buf[0][0], 2 * nsamples);
         basic_synth::render_to(buf, nsamples);
-        if (fastf2i_drm(parameters->lfo_mode) == organ_voice_base::lfomode_global)
+        if (dsp::fastf2i_drm(parameters->lfo_mode) == organ_voice_base::lfomode_global)
         {
             for (int i = 0; i < nsamples; i += 64)
                 global_vibrato.process(parameters, buf + i, std::min(64, nsamples - i), sample_rate);
diff --git a/src/monosynth.cpp b/src/monosynth.cpp
index b6b923a..73ca1c0 100644
--- a/src/monosynth.cpp
+++ b/src/monosynth.cpp
@@ -26,7 +26,6 @@
 #include <jack/jack.h>
 #endif
 #include <calf/giface.h>
-#include <calf/modules.h>
 #include <calf/modules_synths.h>
 
 using namespace synth;
diff --git a/src/organ.cpp b/src/organ.cpp
index 3c1648c..c5fb9f6 100644
--- a/src/organ.cpp
+++ b/src/organ.cpp
@@ -27,8 +27,7 @@
 #include <jack/jack.h>
 #endif
 #include <calf/giface.h>
-#include <calf/modules.h>
-#include <calf/modules_dev.h>
+#include <calf/modules_synths.h>
 #include <iostream>
 
 using namespace synth;

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list