summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-08-13 03:40:04 +0000
committerDavid Robillard <d@drobilla.net>2006-08-13 03:40:04 +0000
commit0b572cdd84151335594965a3f0ed16f1665dfa56 (patch)
tree25818906a95bd0c47c190793d7924b75b5076fde /libs/ardour/ardour
parenta98a67120eea8ebb817eebea048affc182ea054e (diff)
More signal path cleanup, IO now has one deliver_output function that should do the reasonable thing in all cases.
Including deliver MIDI. You can now create a MIDI Track, run some MIDI through it, and toggle the mute button on and off, hearing either silence or a large amount of stuck notes depending on your luck. Woooo. git-svn-id: svn://localhost/ardour2/branches/midi@818 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/amp.h (renamed from libs/ardour/ardour/declicker.h)10
-rw-r--r--libs/ardour/ardour/buffer.h8
-rw-r--r--libs/ardour/ardour/insert.h6
-rw-r--r--libs/ardour/ardour/io.h10
-rw-r--r--libs/ardour/ardour/midi_port.h1
-rw-r--r--libs/ardour/ardour/panner.h9
-rw-r--r--libs/ardour/ardour/redirect.h2
-rw-r--r--libs/ardour/ardour/route.h4
-rw-r--r--libs/ardour/ardour/send.h2
9 files changed, 28 insertions, 24 deletions
diff --git a/libs/ardour/ardour/declicker.h b/libs/ardour/ardour/amp.h
index 7e4c034f5d..7cdb302a3b 100644
--- a/libs/ardour/ardour/declicker.h
+++ b/libs/ardour/ardour/amp.h
@@ -16,8 +16,8 @@
675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef __ardour_declicker_h__
-#define __ardour_declicker_h__
+#ifndef __ardour_amp_h__
+#define __ardour_amp_h__
#include <ardour/types.h>
@@ -29,12 +29,14 @@ class BufferSet;
/** Applies a declick operation to all audio inputs, passing the same number of
* audio outputs, and passing through any other types unchanged.
*/
-class Declicker {
+class Amp {
public:
static void run (BufferSet& bufs, jack_nframes_t nframes, gain_t initial, gain_t target, bool invert_polarity);
+
+ static void apply_simple_gain(BufferSet& bufs, jack_nframes_t nframes, gain_t target);
};
} // namespace ARDOUR
-#endif // __ardour_declicker_h__
+#endif // __ardour_amp_h__
diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h
index accdd9c181..df7f57455b 100644
--- a/libs/ardour/ardour/buffer.h
+++ b/libs/ardour/ardour/buffer.h
@@ -136,6 +136,14 @@ public:
}
}
+ void apply_gain(gain_t gain, jack_nframes_t len, jack_nframes_t offset=0) {
+ Sample* const buf = _data + offset;
+
+ for (jack_nframes_t n = 0; n < len; ++n) {
+ buf[n] *= gain;
+ }
+ }
+
/** Set the data contained by this buffer manually (for setting directly to jack buffer).
*
* Constructor MUST have been passed capacity=0 or this will die (to prevent mem leaks).
diff --git a/libs/ardour/ardour/insert.h b/libs/ardour/ardour/insert.h
index b958f20b95..a8a651df24 100644
--- a/libs/ardour/ardour/insert.h
+++ b/libs/ardour/ardour/insert.h
@@ -53,7 +53,7 @@ class Insert : public Redirect
virtual ~Insert() { }
- virtual void run (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset) = 0;
+ virtual void run (BufferSet& bufs, jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t nframes, jack_nframes_t offset) = 0;
virtual void activate () {}
virtual void deactivate () {}
@@ -75,7 +75,7 @@ class PortInsert : public Insert
int set_state(const XMLNode&);
void init ();
- void run (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset);
+ void run (BufferSet& bufs, jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t nframes, jack_nframes_t offset);
jack_nframes_t latency();
@@ -113,7 +113,7 @@ class PluginInsert : public Insert
StateManager::State* state_factory (std::string why) const;
Change restore_state (StateManager::State&);
- void run (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset);
+ void run (BufferSet& bufs, jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t nframes, jack_nframes_t offset);
void silence (jack_nframes_t nframes, jack_nframes_t offset);
void activate ();
void deactivate ();
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index 0b8c84a459..7b5e72742d 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -101,11 +101,9 @@ class IO : public Stateful, public ARDOUR::StateManager
virtual void silence (jack_nframes_t, jack_nframes_t offset);
- void pan (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset, gain_t gain_coeff);
- void pan_automated (BufferSet& bufs, jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t nframes, jack_nframes_t offset);
void collect_input (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset);
- void deliver_output (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset);
- void deliver_output_no_pan (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset);
+ void deliver_output (BufferSet& bufs, jack_nframes_t start_frame, jack_nframes_t end_frame,
+ jack_nframes_t nframes, jack_nframes_t offset);
void just_meter_input (jack_nframes_t start_frame, jack_nframes_t end_frame,
jack_nframes_t nframes, jack_nframes_t offset);
@@ -115,6 +113,9 @@ class IO : public Stateful, public ARDOUR::StateManager
void inc_gain (gain_t delta, void *src);
gain_t gain () const { return _desired_gain; }
virtual gain_t effective_gain () const;
+
+ void set_phase_invert (bool yn, void *src);
+ bool phase_invert() const { return _phase_invert; }
Panner& panner() { return *_panner; }
PeakMeter& peak_meter() { return *_meter; }
@@ -295,6 +296,7 @@ public:
Connection* _output_connection;
PBD::ID _id;
bool no_panner_reset;
+ bool _phase_invert;
XMLNode* deferred_state;
DataType _default_type;
diff --git a/libs/ardour/ardour/midi_port.h b/libs/ardour/ardour/midi_port.h
index a2bc259a6e..3c48f0ce9e 100644
--- a/libs/ardour/ardour/midi_port.h
+++ b/libs/ardour/ardour/midi_port.h
@@ -40,7 +40,6 @@ class MidiPort : public Port {
DataType type() const { return DataType(DataType::MIDI); }
MidiBuffer& get_buffer() {
- assert(_nframes_this_cycle > 0);
return *_buffer;
}
diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h
index 5ea9f95f7a..a88180701e 100644
--- a/libs/ardour/ardour/panner.h
+++ b/libs/ardour/ardour/panner.h
@@ -241,13 +241,8 @@ class Panner : public std::vector<StreamPanner*>, public Stateful, public sigc::
Panner (string name, Session&);
virtual ~Panner ();
- // FIXME: unify these two
-
/// The fundamental Panner function
- void distribute (BufferSet& src, BufferSet& dest, jack_nframes_t nframes, jack_nframes_t offset, gain_t gain_coeff);
-
- /// The other fundamental Panner function
- void distribute_automated (BufferSet& src, BufferSet& dest, jack_nframes_t start_frame, jack_nframes_t end_frames, jack_nframes_t nframes, jack_nframes_t offset);
+ void distribute(BufferSet& src, BufferSet& dest, jack_nframes_t start_frame, jack_nframes_t end_frames, jack_nframes_t nframes, jack_nframes_t offset);
void set_name (string);
@@ -311,6 +306,8 @@ class Panner : public std::vector<StreamPanner*>, public Stateful, public sigc::
void set_position (float x, float y, float z, StreamPanner& orig);
private:
+ void distribute_no_automation(BufferSet& src, BufferSet& dest, jack_nframes_t nframes, jack_nframes_t offset, gain_t gain_coeff);
+
string automation_path;
Session& _session;
diff --git a/libs/ardour/ardour/redirect.h b/libs/ardour/ardour/redirect.h
index 62da98aed1..b9e91e1cfd 100644
--- a/libs/ardour/ardour/redirect.h
+++ b/libs/ardour/ardour/redirect.h
@@ -81,7 +81,7 @@ class Redirect : public IO
Placement placement() const { return _placement; }
void set_placement (Placement, void *src);
- virtual void run (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset) = 0;
+ virtual void run (BufferSet& bufs, jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t nframes, jack_nframes_t offset) = 0;
virtual void activate () = 0;
virtual void deactivate () = 0;
virtual jack_nframes_t latency() { return 0; }
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index cf6b2b7c60..db5cddca39 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -124,9 +124,6 @@ class Route : public IO
void set_mute_config (mute_type, bool, void *src);
bool get_mute_config (mute_type);
-
- void set_phase_invert (bool yn, void *src);
- bool phase_invert() const { return _phase_invert; }
void set_edit_group (RouteGroup *, void *);
void drop_edit_group (void *);
@@ -269,7 +266,6 @@ class Route : public IO
bool _soloed : 1;
bool _solo_muted : 1;
bool _solo_safe : 1;
- bool _phase_invert : 1;
bool _recordable : 1;
bool _active : 1;
bool _mute_affects_pre_fader : 1;
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index 426ff5deed..8a7beb8598 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -40,7 +40,7 @@ class Send : public Redirect {
Send (const Send&);
~Send ();
- void run (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset);
+ void run (BufferSet& bufs, jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t nframes, jack_nframes_t offset);
void activate() {}
void deactivate () {}