summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-07 06:30:50 +0000
committerDavid Robillard <d@drobilla.net>2009-05-07 06:30:50 +0000
commit7183242b8c8d9296f94a035fb66b1eae06fd3496 (patch)
treeee48e2019f2330baee7c280090a48e43336682b3 /libs/ardour/ardour
parent97b5eb1580d53197dc93a805d1995b82660cdfe3 (diff)
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of processors. There are definitely regressions here, but there's also a lot of things fixed. It's far too much work to let diverge anymore regardless, so here it is. The basic model is: A route has a fixed set of input channels (matching its JACK input ports and diskstream). The first processor takes this as input. The next processor is configured using the first processor's output as input, and is allowed to choose whatever output it wants given that input... and so on, and so on. Finally, the last processor's requested output is used to set up the panner and create whatever Jack ports are needed to output the data. All 'special' internal processors (meter, fader, amp, insert, send) are currently transparent: they read any input, and return the same set of channels back (unmodified, except for amp). User visible changes: * LV2 Instrument support (tracks with both MIDI and audio channels) * MIDI in/out plugin support * Generic plugin replication (for MIDI plugins, MIDI/audio plugins) * Movable meter point Known Bugs: * Things seem to get weird on loaded sessions * Output delivery is sketchy * 2.0 session loading was probably already broken... but it's definitely broken now :) Please test this and file bugs if you have any time... git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/amp.h49
-rw-r--r--libs/ardour/ardour/audio_track.h6
-rw-r--r--libs/ardour/ardour/buffer_set.h8
-rw-r--r--libs/ardour/ardour/chan_count.h12
-rw-r--r--libs/ardour/ardour/chan_mapping.h46
-rw-r--r--libs/ardour/ardour/click.h12
-rw-r--r--libs/ardour/ardour/control_outputs.h55
-rw-r--r--libs/ardour/ardour/io.h49
-rw-r--r--libs/ardour/ardour/io_processor.h5
-rw-r--r--libs/ardour/ardour/meter.h10
-rw-r--r--libs/ardour/ardour/midi_track.h11
-rw-r--r--libs/ardour/ardour/panner.h2
-rw-r--r--libs/ardour/ardour/plugin_insert.h2
-rw-r--r--libs/ardour/ardour/port_insert.h2
-rw-r--r--libs/ardour/ardour/processor.h16
-rw-r--r--libs/ardour/ardour/route.h64
-rw-r--r--libs/ardour/ardour/send.h2
-rw-r--r--libs/ardour/ardour/session.h1
-rw-r--r--libs/ardour/ardour/track.h12
19 files changed, 225 insertions, 139 deletions
diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h
index 402a29542d..fa9de724ad 100644
--- a/libs/ardour/ardour/amp.h
+++ b/libs/ardour/ardour/amp.h
@@ -20,22 +20,63 @@
#define __ardour_amp_h__
#include "ardour/types.h"
+#include "ardour/chan_count.h"
+#include "ardour/processor.h"
namespace ARDOUR {
class BufferSet;
+class IO;
/** Applies a declick operation to all audio inputs, passing the same number of
* audio outputs, and passing through any other types unchanged.
- *
- * FIXME: make this a Processor.
*/
-class Amp {
+class Amp : public Processor {
public:
- static void run_in_place (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target, bool invert_polarity);
+ Amp(Session& s, IO& io);
+
+ bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
+ bool configure_io (ChanCount in, ChanCount out);
+
+ void run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes);
+
+ bool apply_gain() const { return _apply_gain; }
+ void apply_gain(bool yn) { _apply_gain = yn; }
+
+ bool apply_gain_automation() const { return _apply_gain_automation; }
+ void apply_gain_automation(bool yn) { _apply_gain_automation = yn; }
+
+ void muute(bool yn) { _mute = yn; }
+
+ void set_gain(float current, float desired) {
+ _current_gain = current;
+ _desired_gain = desired;
+ }
+
+ void apply_mute(bool yn, float current=1.0, float desired=0.0) {
+ _mute = yn;
+ _current_mute_gain = current;
+ _desired_mute_gain = desired;
+ }
+
+ XMLNode& state (bool full);
+ XMLNode& get_state();
+
+ static void apply_gain (BufferSet& bufs, nframes_t nframes,
+ gain_t initial, gain_t target, bool invert_polarity);
static void apply_simple_gain(BufferSet& bufs, nframes_t nframes, gain_t target);
+
+private:
+ IO& _io;
+ bool _mute;
+ bool _apply_gain;
+ bool _apply_gain_automation;
+ float _current_gain;
+ float _desired_gain;
+ float _current_mute_gain;
+ float _desired_mute_gain;
};
diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h
index 22092b5e1b..484887e0b7 100644
--- a/libs/ardour/ardour/audio_track.h
+++ b/libs/ardour/ardour/audio_track.h
@@ -41,12 +41,6 @@ class AudioTrack : public Track
int roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
int declick, bool can_record, bool rec_monitors_input);
-
- int no_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
- bool state_changing, bool can_record, bool rec_monitors_input);
-
- int silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
- bool can_record, bool rec_monitors_input);
boost::shared_ptr<AudioDiskstream> audio_diskstream() const;
diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h
index 9d7ba6d6ae..3f10929fe8 100644
--- a/libs/ardour/ardour/buffer_set.h
+++ b/libs/ardour/ardour/buffer_set.h
@@ -66,7 +66,10 @@ public:
const ChanCount& count() const { return _count; }
ChanCount& count() { return _count; }
- void set_count(const ChanCount& count) { _count = count; }
+ void is_silent(bool yn) { _is_silent = yn; }
+ bool is_silent() const { return _is_silent; }
+
+ void set_count(const ChanCount& count) { assert(count <= _available); _count = count; }
size_t buffer_capacity(DataType type) const;
@@ -161,6 +164,9 @@ private:
/// Whether we (don't) 'own' the contained buffers (otherwise we mirror a PortSet)
bool _is_mirror;
+
+ /// Whether the buffer set should be considered silent
+ bool _is_silent;
};
diff --git a/libs/ardour/ardour/chan_count.h b/libs/ardour/ardour/chan_count.h
index fb4b1999ca..c9b543c4ba 100644
--- a/libs/ardour/ardour/chan_count.h
+++ b/libs/ardour/ardour/chan_count.h
@@ -23,6 +23,7 @@
#include <cassert>
#include <ostream>
+#include "pbd/xml++.h"
#include "ardour/data_type.h"
namespace ARDOUR {
@@ -35,6 +36,7 @@ namespace ARDOUR {
*/
class ChanCount {
public:
+ ChanCount(const XMLNode& node);
ChanCount() { reset(); }
// Convenience constructor for making single-typed streams (stereo, mono, etc)
@@ -104,6 +106,14 @@ public:
return ( (*this > other) || (*this == other) );
}
+ static ChanCount min(const ChanCount& a, const ChanCount& b) {
+ ChanCount ret;
+ for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
+ ret.set(*t, std::min(a.get(*t), b.get(*t)));
+ }
+ return ret;
+ }
+
static ChanCount max(const ChanCount& a, const ChanCount& b) {
ChanCount ret;
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
@@ -111,6 +121,8 @@ public:
}
return ret;
}
+
+ XMLNode* state(const std::string& name) const;
static const ChanCount INFINITE;
static const ChanCount ZERO;
diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h
index 1dae20e34a..5f948a77b0 100644
--- a/libs/ardour/ardour/chan_mapping.h
+++ b/libs/ardour/ardour/chan_mapping.h
@@ -26,6 +26,7 @@
#include <utility>
#include "ardour/data_type.h"
+#include "ardour/chan_count.h"
namespace ARDOUR {
@@ -36,47 +37,26 @@ namespace ARDOUR {
class ChanMapping {
public:
ChanMapping() {}
- ChanMapping(ChanCount identity) {
- for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
- for (size_t i = 0; i <= identity.get(*t); ++i)
- set(*t, i, i);
- }
- }
-
- uint32_t get(DataType t, uint32_t from) {
- Mappings::iterator tm = _mappings.find(t);
- assert(tm != _mappings.end());
- TypeMapping::iterator m = tm->second.find(from);
- assert(m != tm->second.end());
- return m->second;
- }
+ ChanMapping(ARDOUR::ChanCount identity);
+
+ uint32_t get(DataType t, uint32_t from);
+ void set(DataType t, uint32_t from, uint32_t to);
+ void offset_from(DataType t, int32_t delta);
+ void offset_to(DataType t, int32_t delta);
- void set(DataType t, uint32_t from, uint32_t to) {
- Mappings::iterator tm = _mappings.find(t);
- if (tm == _mappings.end()) {
- tm = _mappings.insert(std::make_pair(t, TypeMapping())).first;
- }
- tm->second.insert(std::make_pair(from, to));
- }
-
- /** Increase the 'to' field of every mapping for type @a t by @a delta */
- void offset(DataType t, uint32_t delta) {
- Mappings::iterator tm = _mappings.find(t);
- if (tm != _mappings.end()) {
- for (TypeMapping::iterator m = tm->second.begin(); m != tm->second.end(); ++m) {
- m->second += delta;
- }
- }
- }
-
-private:
typedef std::map<uint32_t, uint32_t> TypeMapping;
typedef std::map<DataType, TypeMapping> Mappings;
+ Mappings mappings() { return _mappings; }
+ const Mappings mappings() const { return _mappings; }
+
+private:
Mappings _mappings;
};
} // namespace ARDOUR
+std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& m);
+
#endif // __ardour_chan_mapping_h__
diff --git a/libs/ardour/ardour/click.h b/libs/ardour/ardour/click.h
index e50e0a29cb..ae744478f1 100644
--- a/libs/ardour/ardour/click.h
+++ b/libs/ardour/ardour/click.h
@@ -26,17 +26,11 @@ namespace ARDOUR {
class ClickIO : public IO
{
- public:
- ClickIO (Session& s, const string& name,
-
- int input_min = -1, int input_max = -1,
-
- int output_min = -1, int output_max = -1)
- : IO (s, name, input_min, input_max, output_min, output_max) {}
-
+public:
+ ClickIO (Session& s, const string& name) : IO (s, name) {}
~ClickIO() {}
- protected:
+protected:
uint32_t pans_required () const { return 1; }
};
diff --git a/libs/ardour/ardour/control_outputs.h b/libs/ardour/ardour/control_outputs.h
new file mode 100644
index 0000000000..72d9534ddf
--- /dev/null
+++ b/libs/ardour/ardour/control_outputs.h
@@ -0,0 +1,55 @@
+/*
+ Copyright (C) 2006 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU 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 General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __ardour_control_outputs_h__
+#define __ardour_control_outputs_h__
+
+#include <string>
+#include "ardour/types.h"
+#include "ardour/chan_count.h"
+#include "ardour/io_processor.h"
+
+namespace ARDOUR {
+
+class BufferSet;
+class IO;
+
+class ControlOutputs : public IOProcessor {
+public:
+ ControlOutputs(Session& s, IO* io);
+
+ bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
+ bool configure_io (ChanCount in, ChanCount out);
+
+ void run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes);
+
+ bool deliver() const { return _deliver; }
+ void deliver(bool yn) { _deliver = yn; }
+
+ XMLNode& state (bool full);
+ XMLNode& get_state();
+
+private:
+ bool _deliver;
+};
+
+
+} // namespace ARDOUR
+
+#endif // __ardour_control_outputs_h__
+
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index 8457668756..3e36d10be3 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -52,32 +52,31 @@ class XMLNode;
namespace ARDOUR {
-class Session;
+class Amp;
class AudioEngine;
-class UserBundle;
+class AudioPort;
+class BufferSet;
class Bundle;
+class MidiPort;
class Panner;
class PeakMeter;
class Port;
-class AudioPort;
-class MidiPort;
-class BufferSet;
+class Session;
+class UserBundle;
/** A collection of input and output ports with connections.
*
* An IO can contain ports of varying types, making routes/inserts/etc with
* varied combinations of types (eg MIDI and audio) possible.
*/
-
class IO : public SessionObject, public AutomatableControls, public Latent
{
public:
static const string state_node_name;
- IO (Session&, const string& name,
- int input_min = -1, int input_max = -1,
- int output_min = -1, int output_max = -1,
- DataType default_type = DataType::AUDIO);
+ IO (Session&, const string& name, DataType default_type = DataType::AUDIO,
+ ChanCount in_min=ChanCount::ZERO, ChanCount in_max=ChanCount::INFINITE,
+ ChanCount out_min=ChanCount::ZERO, ChanCount out_max=ChanCount::INFINITE);
IO (Session&, const XMLNode&, DataType default_type = DataType::AUDIO);
@@ -109,7 +108,7 @@ class IO : public SessionObject, public AutomatableControls, public Latent
BufferSet& output_buffers() { return *_output_buffers; }
- gain_t gain () const { return _desired_gain; }
+ gain_t gain () const { return _gain_control->user_float(); }
virtual gain_t effective_gain () const;
void set_denormal_protection (bool yn, void *src);
@@ -118,11 +117,16 @@ class IO : public SessionObject, public AutomatableControls, public Latent
void set_phase_invert (bool yn, void *src);
bool phase_invert() const { return _phase_invert; }
- Panner& panner() { return *_panner; }
- PeakMeter& peak_meter() { return *_meter; }
- const Panner& panner() const { return *_panner; }
void reset_panner ();
+ boost::shared_ptr<Amp> amp() const { return _amp; }
+
+ PeakMeter& peak_meter() { return *_meter.get(); }
+ const PeakMeter& peak_meter() const { return *_meter.get(); }
+ boost::shared_ptr<PeakMeter> shared_peak_meter() const { return _meter; }
+
+ boost::shared_ptr<Panner> panner() const { return _panner; }
+
int ensure_io (ChanCount in, ChanCount out, bool clear, void *src);
int connect_input_ports_to_bundle (boost::shared_ptr<Bundle>, void *);
@@ -133,8 +137,8 @@ class IO : public SessionObject, public AutomatableControls, public Latent
BundleList bundles_connected_to_inputs ();
BundleList bundles_connected_to_outputs ();
- boost::shared_ptr<Bundle> bundle_for_inputs () { return _bundle_for_inputs; }
- boost::shared_ptr<Bundle> bundle_for_outputs () { return _bundle_for_outputs; }
+ boost::shared_ptr<Bundle> bundle_for_inputs () { return _bundle_for_inputs; }
+ boost::shared_ptr<Bundle> bundle_for_outputs () { return _bundle_for_outputs; }
int add_input_port (string source, void *src, DataType type = DataType::NIL);
int add_output_port (string destination, void *src, DataType type = DataType::NIL);
@@ -271,22 +275,24 @@ class IO : public SessionObject, public AutomatableControls, public Latent
mutable Glib::Mutex io_lock;
protected:
- Panner* _panner;
BufferSet* _output_buffers; //< Set directly to output port buffers
bool _active;
gain_t _gain;
- gain_t _effective_gain;
- gain_t _desired_gain;
Glib::Mutex declick_lock;
PortSet _outputs;
PortSet _inputs;
- PeakMeter* _meter;
bool no_panner_reset;
bool _phase_invert;
bool _denormal_protection;
XMLNode* deferred_state;
DataType _default_type;
nframes_t _output_offset;
+ ChanCount _configured_inputs;
+ ChanCount _configured_outputs;
+
+ boost::shared_ptr<Amp> _amp;
+ boost::shared_ptr<PeakMeter> _meter;
+ boost::shared_ptr<Panner> _panner;
virtual void prepare_inputs (nframes_t nframes);
virtual void flush_outputs (nframes_t nframes);
@@ -301,8 +307,6 @@ class IO : public SessionObject, public AutomatableControls, public Latent
virtual void set_gain (gain_t g, void *src);
void inc_gain (gain_t delta, void *src);
- bool apply_gain_automation;
-
virtual int load_automation (std::string path);
/* AudioTrack::deprecated_use_diskstream_connections() needs these */
@@ -361,6 +365,7 @@ class IO : public SessionObject, public AutomatableControls, public Latent
void bundle_changed (Bundle::Change);
+ int get_port_counts (const XMLNode& node);
int create_ports (const XMLNode&);
int make_connections (const XMLNode&);
boost::shared_ptr<Bundle> find_possible_bundle (const string &desired_name, const string &default_name, const string &connection_type_name);
diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h
index 1a12a3271e..e7dffb3138 100644
--- a/libs/ardour/ardour/io_processor.h
+++ b/libs/ardour/ardour/io_processor.h
@@ -45,8 +45,9 @@ class IO;
class IOProcessor : public Processor
{
public:
- IOProcessor (Session&, const string& name, Placement,
- int input_min = -1, int input_max = -1, int output_min = -1, int output_max = -1,
+ IOProcessor (Session&, const string& proc_name, const string io_name="",
+ ARDOUR::DataType default_type = DataType::AUDIO);
+ IOProcessor (Session&, IO* io, const string& proc_name,
ARDOUR::DataType default_type = DataType::AUDIO);
virtual ~IOProcessor ();
diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h
index 972e1b6760..0a49ddf99f 100644
--- a/libs/ardour/ardour/meter.h
+++ b/libs/ardour/ardour/meter.h
@@ -35,12 +35,12 @@ class Session;
*/
class PeakMeter : public Processor {
public:
- PeakMeter(Session& s) : Processor(s, "meter", PreFader) {}
+ PeakMeter(Session& s) : Processor(s, "Meter") {}
void reset ();
void reset_max ();
- bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const { return true; }
+ bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
/** Compute peaks */
@@ -61,11 +61,11 @@ public:
return minus_infinity();
}
}
+
+ XMLNode& state (bool full);
+ XMLNode& get_state();
private:
- /* disallow copy construction */
- PeakMeter (PeakMeter const &);
-
friend class IO;
void meter();
diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h
index 424b9d2c92..fe8290d5d9 100644
--- a/libs/ardour/ardour/midi_track.h
+++ b/libs/ardour/ardour/midi_track.h
@@ -41,17 +41,6 @@ public:
int roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
int declick, bool can_record, bool rec_monitors_input);
- int no_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
- bool state_changing, bool can_record, bool rec_monitors_input);
-
- int silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
- bool can_record, bool rec_monitors_input);
-
- void process_output_buffers (BufferSet& bufs,
- nframes_t start_frame, nframes_t end_frame,
- nframes_t nframes, bool with_redirects, int declick,
- bool meter);
-
boost::shared_ptr<MidiDiskstream> midi_diskstream() const;
int use_diskstream (string name);
diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h
index 9e54696048..dcb34c8a04 100644
--- a/libs/ardour/ardour/panner.h
+++ b/libs/ardour/ardour/panner.h
@@ -205,7 +205,7 @@ class Panner : public Processor
virtual ~Panner ();
void clear_panners ();
-
+ bool empty() const { return _streampanners.empty(); }
/// The fundamental Panner function
void set_automation_state (AutoState);
diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h
index 99bd492ab5..89512df40c 100644
--- a/libs/ardour/ardour/plugin_insert.h
+++ b/libs/ardour/ardour/plugin_insert.h
@@ -44,7 +44,7 @@ class Plugin;
class PluginInsert : public Processor
{
public:
- PluginInsert (Session&, boost::shared_ptr<Plugin>, Placement);
+ PluginInsert (Session&, boost::shared_ptr<Plugin>);
PluginInsert (Session&, const XMLNode&);
~PluginInsert ();
diff --git a/libs/ardour/ardour/port_insert.h b/libs/ardour/ardour/port_insert.h
index 27d251cc45..076e4af9d1 100644
--- a/libs/ardour/ardour/port_insert.h
+++ b/libs/ardour/ardour/port_insert.h
@@ -40,7 +40,7 @@ class Session;
class PortInsert : public IOProcessor
{
public:
- PortInsert (Session&, Placement);
+ PortInsert (Session&);
PortInsert (Session&, const XMLNode&);
~PortInsert ();
diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h
index 1167930d61..547cc87f88 100644
--- a/libs/ardour/ardour/processor.h
+++ b/libs/ardour/ardour/processor.h
@@ -49,16 +49,21 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
public:
static const string state_node_name;
- Processor(Session&, const string& name, Placement p); // TODO: remove placement (use sort key)
+ Processor(Session&, const string& name);
virtual ~Processor() { }
+ /** Configuration of a processor on a bus
+ * (i.e. how to apply to a BufferSet)
+ */
+ struct Mapping {
+ ChanCount in;
+ ChanCount out;
+ };
+
uint32_t sort_key() const { return _sort_key; }
void set_sort_key (uint32_t key);
- Placement placement() const { return _placement; }
- void set_placement (Placement);
-
bool active () const { return _active; }
bool get_next_ab_is_active () const { return _next_ab_is_active; }
@@ -108,7 +113,6 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
static sigc::signal<void,Processor*> ProcessorCreated;
sigc::signal<void> ActiveChanged;
- sigc::signal<void> PlacementChanged;
sigc::signal<void,ChanCount,ChanCount> ConfigurationChanged;
protected:
@@ -118,9 +122,9 @@ protected:
bool _configured;
ChanCount _configured_input;
ChanCount _configured_output;
- Placement _placement;
uint32_t _sort_key;
void* _gui; /* generic, we don't know or care what this is */
+ Mapping _mapping;
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 6926dbd036..2b54810577 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -44,10 +44,12 @@
namespace ARDOUR {
-class Processor;
+class Amp;
+class ControlOutputs;
class IOProcessor;
-class Send;
+class Processor;
class RouteGroup;
+class Send;
enum mute_type {
PRE_FADER = 0x1,
@@ -70,8 +72,10 @@ class Route : public IO
ControlOut = 0x4
};
- Route (Session&, std::string name, int input_min, int input_max, int output_min, int output_max,
- Flag flags = Flag(0), DataType default_type = DataType::AUDIO);
+ Route (Session&, std::string name, Flag flags = Flag(0),
+ DataType default_type = DataType::AUDIO,
+ ChanCount in=ChanCount::ZERO, ChanCount out=ChanCount::ZERO);
+
Route (Session&, const XMLNode&, DataType default_type = DataType::AUDIO);
virtual ~Route();
@@ -149,6 +153,15 @@ class Route : public IO
method (boost::weak_ptr<Processor> (*i));
}
}
+
+ void foreach_processor (Placement p, sigc::slot<void, boost::weak_ptr<Processor> > method) {
+ Glib::RWLock::ReaderLock lm (_processor_lock);
+ ProcessorList::iterator start, end;
+ placement_range(p, start, end);
+ for (ProcessorList::iterator i = start; i != end; ++i) {
+ method (boost::weak_ptr<Processor> (*i));
+ }
+ }
boost::shared_ptr<Processor> nth_processor (uint32_t n) {
Glib::RWLock::ReaderLock lm (_processor_lock);
@@ -170,12 +183,12 @@ class Route : public IO
struct ProcessorStreams {
ProcessorStreams(size_t i=0, ChanCount c=ChanCount()) : index(i), count(c) {}
- size_t index; ///< Index of processor where configuration failed
+ uint32_t index; ///< Index of processor where configuration failed
ChanCount count; ///< Input requested of processor
};
- int add_processor (boost::shared_ptr<Processor>, ProcessorStreams* err = 0);
- int add_processors (const ProcessorList&, ProcessorStreams* err = 0);
+ int add_processor (boost::shared_ptr<Processor>, ProcessorStreams* err = 0, ProcessorList::iterator* iter=0, Placement=PreFader);
+ int add_processors (const ProcessorList&, ProcessorStreams* err = 0, Placement placement=PreFader);
int remove_processor (boost::shared_ptr<Processor>, ProcessorStreams* err = 0);
int sort_processors (ProcessorStreams* err = 0);
void disable_processors (Placement);
@@ -226,7 +239,7 @@ class Route : public IO
sigc::signal<void,void*> SelectedChanged;
int set_control_outs (const vector<std::string>& ports);
- IO* control_outs() { return _control_outs; }
+ boost::shared_ptr<ControlOutputs> control_outs() { return _control_outs; }
bool feeds (boost::shared_ptr<Route>);
std::set<boost::shared_ptr<Route> > fed_by;
@@ -276,12 +289,11 @@ class Route : public IO
nframes_t check_initial_delay (nframes_t, nframes_t&);
void passthru (nframes_t start_frame, nframes_t end_frame,
- nframes_t nframes, int declick, bool meter_inputs);
+ nframes_t nframes, int declick);
virtual void process_output_buffers (BufferSet& bufs,
nframes_t start_frame, nframes_t end_frame,
- nframes_t nframes, bool with_processors, int declick,
- bool meter);
+ nframes_t nframes, bool with_processors, int declick);
Flag _flags;
int _pending_declick;
@@ -296,8 +308,7 @@ class Route : public IO
nframes_t _roll_delay;
ProcessorList _processors;
Glib::RWLock _processor_lock;
- IO *_control_outs;
- Glib::Mutex _control_outs_lock;
+ boost::shared_ptr<ControlOutputs> _control_outs;
RouteGroup *_edit_group;
RouteGroup *_mix_group;
std::string _comment;
@@ -326,8 +337,7 @@ class Route : public IO
virtual XMLNode& state(bool);
void passthru_silence (nframes_t start_frame, nframes_t end_frame,
- nframes_t nframes, int declick,
- bool meter);
+ nframes_t nframes, int declick);
void silence (nframes_t nframes);
@@ -361,24 +371,18 @@ class Route : public IO
void input_change_handler (IOChange, void *src);
void output_change_handler (IOChange, void *src);
- int reset_processor_counts (ProcessorStreams*); /* locked */
- int _reset_processor_counts (ProcessorStreams*); /* unlocked */
-
- /** processor I/O channels and plugin count handling */
- struct ProcessorCount {
- boost::shared_ptr<ARDOUR::Processor> processor;
- ChanCount in;
- ChanCount out;
+ bool _in_configure_processors;
- ProcessorCount (boost::shared_ptr<ARDOUR::Processor> ins) : processor(ins) {}
- };
+ int configure_processors (ProcessorStreams*);
+ int configure_processors_unlocked (ProcessorStreams*);
- int32_t apply_some_processor_counts (std::list<ProcessorCount>& iclist);
- bool check_some_processor_counts (std::list<ProcessorCount>& iclist,
- ChanCount required_inputs, ProcessorStreams* err_streams);
-
void set_deferred_state ();
- void add_processor_from_xml (const XMLNode&);
+ bool add_processor_from_xml (const XMLNode&, ProcessorList::iterator* iter=0);
+
+ void placement_range(
+ Placement p,
+ ProcessorList::iterator& start,
+ ProcessorList::iterator& end);
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index 2e7d2c239c..77bb6d9017 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -34,7 +34,7 @@ namespace ARDOUR {
class Send : public IOProcessor
{
public:
- Send (Session&, Placement);
+ Send (Session&);
Send (Session&, const XMLNode&);
virtual ~Send ();
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 8bef24a7e2..1e3855c308 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -255,6 +255,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
void set_clean ();
bool dirty() const { return _state_of_the_state & Dirty; }
void set_deletion_in_progress ();
+ void clear_deletion_in_progress ();
bool deletion_in_progress() const { return _state_of_the_state & Deletion; }
sigc::signal<void> DirtyChanged;
diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h
index 29a4aa8e25..96826e3eaa 100644
--- a/libs/ardour/ardour/track.h
+++ b/libs/ardour/ardour/track.h
@@ -44,16 +44,16 @@ class Track : public Route
virtual int set_mode (TrackMode m) { return false; }
virtual bool can_use_mode (TrackMode m, bool& bounce_required) { return false; }
sigc::signal<void> TrackModeChanged;
+
+ int no_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
+ bool state_changing, bool can_record, bool rec_monitors_input);
+
+ int silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
+ bool can_record, bool rec_monitors_input);
virtual int roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
int declick, bool can_record, bool rec_monitors_input) = 0;
- virtual int no_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
- bool state_changing, bool can_record, bool rec_monitors_input) = 0;
-
- virtual int silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
- bool can_record, bool rec_monitors_input) = 0;
-
void toggle_monitor_input ();
bool can_record();