diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/amp.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/audiofilesource.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/automatable.h | 78 | ||||
-rw-r--r-- | libs/ardour/ardour/automation_event.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/curve.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/diskstream.h | 9 | ||||
-rw-r--r-- | libs/ardour/ardour/insert.h | 70 | ||||
-rw-r--r-- | libs/ardour/ardour/io.h | 33 | ||||
-rw-r--r-- | libs/ardour/ardour/meter.h | 13 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_track.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/playlist.h | 10 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin_insert.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/port_insert.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/redirect.h | 93 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 75 | ||||
-rw-r--r-- | libs/ardour/ardour/send.h | 8 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/smf_source.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/source.h | 12 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 2 |
20 files changed, 246 insertions, 189 deletions
diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h index c3049c1e8b..e5a4c189e9 100644 --- a/libs/ardour/ardour/amp.h +++ b/libs/ardour/ardour/amp.h @@ -28,6 +28,8 @@ class BufferSet; /** 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 an insert. */ class Amp { public: diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h index 149ceb7dc3..78d10f9d64 100644 --- a/libs/ardour/ardour/audiofilesource.h +++ b/libs/ardour/ardour/audiofilesource.h @@ -56,7 +56,8 @@ class AudioFileSource : public AudioSource { virtual ~AudioFileSource (); - int set_name (Glib::ustring newname, bool destructive); + bool set_name (const std::string& newname) { return (set_source_name(newname, destructive()) == 0); } + int set_source_name (Glib::ustring newname, bool destructive); Glib::ustring path() const { return _path; } Glib::ustring peak_path (Glib::ustring audio_path); diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h new file mode 100644 index 0000000000..c6621b9780 --- /dev/null +++ b/libs/ardour/ardour/automatable.h @@ -0,0 +1,78 @@ +/* + Copyright (C) 2000,2007 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_automatable_h__ +#define __ardour_automatable_h__ + +#include <set> +#include <map> +#include <ardour/session_object.h> +#include <ardour/automation_event.h> + +namespace ARDOUR { + +class Session; + +class Automatable : public SessionObject +{ +public: + Automatable(Session&, const std::string& name); + + virtual ~Automatable() {} + + virtual AutomationList& automation_list(uint32_t n); + + virtual void automation_snapshot (nframes_t now) {}; + + virtual bool find_next_event(nframes_t start, nframes_t end, ControlEvent& ev) const; + + virtual string describe_parameter(uint32_t which); + virtual float default_parameter_value(uint32_t which) { return 1.0f; } + + void what_has_automation(std::set<uint32_t>&) const; + void what_has_visible_automation(std::set<uint32_t>&) const; + const std::set<uint32_t>& what_can_be_automated() const { return _can_automate_list; } + + void mark_automation_visible(uint32_t, bool); + +protected: + + void can_automate(uint32_t); + + virtual void automation_list_creation_callback(uint32_t, AutomationList&) {} + + int set_automation_state(const XMLNode&); + XMLNode& get_automation_state(); + + int load_automation (const std::string& path); + int old_set_automation_state(const XMLNode&); + + mutable Glib::Mutex _automation_lock; + + // FIXME: map with int keys is a bit silly. this could be O(1) + std::map<uint32_t,AutomationList*> _parameter_automation; + std::set<uint32_t> _visible_parameter_automation; + std::set<uint32_t> _can_automate_list; + + nframes_t _last_automation_snapshot; +}; + +} // namespace ARDOUR + +#endif /* __ardour_automatable_h__ */ diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h index 5a9792c11d..f04dcdc112 100644 --- a/libs/ardour/ardour/automation_event.h +++ b/libs/ardour/ardour/automation_event.h @@ -114,10 +114,10 @@ class AutomationList : public PBD::StatefulDestructible AutoStyle automation_style() const { return _style; } sigc::signal<void> automation_state_changed; - bool automation_playback() { + bool automation_playback() const { return (_state & Play) || ((_state & Touch) && !_touching); } - bool automation_write () { + bool automation_write () const { return (_state & Write) || ((_state & Touch) && _touching); } diff --git a/libs/ardour/ardour/curve.h b/libs/ardour/ardour/curve.h index dd63439f08..605eda2e4b 100644 --- a/libs/ardour/ardour/curve.h +++ b/libs/ardour/ardour/curve.h @@ -60,7 +60,7 @@ class Curve : public AutomationList void solve (); - static sigc::signal<void, Curve*> CurveCreated; + static sigc::signal<void, Curve*> CurveCreated; protected: ControlEvent* point_factory (double,double) const; diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index 4809e17868..3dd6555011 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -53,7 +53,7 @@ class Session; class Playlist; class IO; -class Diskstream : public PBD::StatefulDestructible +class Diskstream : public SessionObject { public: enum Flag { @@ -65,9 +65,8 @@ class Diskstream : public PBD::StatefulDestructible Diskstream (Session &, const string& name, Flag f = Recordable); Diskstream (Session &, const XMLNode&); virtual ~Diskstream(); - - string name () const { return _name; } - virtual int set_name (string str); + + bool set_name (const string& str); ARDOUR::IO* io() const { return _io; } void set_io (ARDOUR::IO& io); @@ -238,8 +237,6 @@ class Diskstream : public PBD::StatefulDestructible uint32_t i_am_the_modifier; - string _name; - ARDOUR::Session& _session; ARDOUR::IO* _io; ChanCount _n_channels; diff --git a/libs/ardour/ardour/insert.h b/libs/ardour/ardour/insert.h index 618b7c6446..3fc9fbd1e4 100644 --- a/libs/ardour/ardour/insert.h +++ b/libs/ardour/ardour/insert.h @@ -24,11 +24,16 @@ #include <string> #include <exception> +#include <pbd/statefuldestructible.h> + #include <sigc++/signal.h> + +#include <ardour/types.h> #include <ardour/ardour.h> -#include <ardour/redirect.h> #include <ardour/plugin_state.h> -#include <ardour/types.h> +#include <ardour/buffer_set.h> +#include <ardour/automatable.h> + class XMLNode; @@ -36,26 +41,71 @@ namespace ARDOUR { class Session; -class Insert : public Redirect +/* A mixer strip element - plugin, send, meter, etc. + */ +class Insert : public Automatable { public: - Insert(Session& s, std::string name, Placement p); - Insert(Session& s, std::string name, Placement p, int imin, int imax, int omin, int omax); + static const string state_node_name; + + Insert(Session&, const string& name, Placement p); // TODO: remove placement in favour of sort key virtual ~Insert() { } + + static boost::shared_ptr<Insert> clone (boost::shared_ptr<const Insert>); + + 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; } + void set_active (bool yn); + + bool get_next_ab_is_active () const { return _next_ab_is_active; } + void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; } + + virtual nframes_t latency() { return 0; } + + virtual void transport_stopped (nframes_t frame) {} + + virtual void set_block_size (nframes_t nframes) {} virtual void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0; + virtual void silence (nframes_t nframes, nframes_t offset) {} + + virtual void activate () { _active = true; ActiveChanged.emit(); } + virtual void deactivate () { _active = false; ActiveChanged.emit(); } - virtual void activate () {} - virtual void deactivate () {} + virtual bool configure_io (ChanCount in, ChanCount out) { _configured_input = in; return (_configured = true); } + + /* Act as a pass through, if not overridden */ + virtual bool can_support_input_configuration (ChanCount in) const { return true; } + virtual ChanCount output_for_input_configuration (ChanCount in) const { return in; } + virtual ChanCount output_streams() const { return _configured_input; } + virtual ChanCount input_streams () const { return _configured_input; } + + virtual XMLNode& state (bool full); + virtual XMLNode& get_state (void); + virtual int set_state (const XMLNode&); + + void *get_gui () const { return _gui; } + void set_gui (void *p) { _gui = p; } + + static sigc::signal<void,Insert*> InsertCreated; - virtual bool can_support_input_configuration (ChanCount in) const = 0; - virtual ChanCount output_for_input_configuration (ChanCount in) const = 0; - virtual bool configure_io (ChanCount in, ChanCount out) = 0; + sigc::signal<void> ActiveChanged; + sigc::signal<void> PlacementChanged; protected: + bool _active; + bool _next_ab_is_active; bool _configured; ChanCount _configured_input; + Placement _placement; + uint32_t _sort_key; + void* _gui; /* generic, we don't know or care what this is */ }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 0b86eb4088..3952d14c0e 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -34,6 +34,7 @@ #include <pbd/controllable.h> #include <ardour/ardour.h> +#include <ardour/session_object.h> #include <ardour/utils.h> #include <ardour/curve.h> #include <ardour/types.h> @@ -63,13 +64,13 @@ class BufferSet; * 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 PBD::StatefulDestructible +class IO : public SessionObject { public: static const string state_node_name; - IO (Session&, string 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); @@ -90,10 +91,9 @@ class IO : public PBD::StatefulDestructible DataType default_type() const { return _default_type; } void set_default_type(DataType t) { _default_type = t; } - - const string& name() const { return _name; } - virtual int set_name (string str, void *src); + bool set_name (const string& str); + virtual void silence (nframes_t, nframes_t offset); void collect_input (BufferSet& bufs, nframes_t nframes, nframes_t offset); @@ -179,7 +179,6 @@ class IO : public PBD::StatefulDestructible sigc::signal<void,IOChange,void*> output_changed; sigc::signal<void,void*> gain_changed; - sigc::signal<void,void*> name_changed; virtual XMLNode& state (bool full); XMLNode& get_state (void); @@ -229,26 +228,16 @@ class IO : public PBD::StatefulDestructible void clear_automation (); - bool gain_automation_recording() const { - return (_gain_automation_curve.automation_state() & (Write|Touch)); - } - - bool gain_automation_playback() const { - return (_gain_automation_curve.automation_state() & Play) || - ((_gain_automation_curve.automation_state() & Touch) && - !_gain_automation_curve.touching()); - } - virtual void set_gain_automation_state (AutoState); AutoState gain_automation_state() const { return _gain_automation_curve.automation_state(); } - sigc::signal<void> gain_automation_state_changed; + //sigc::signal<void> gain_automation_state_changed; virtual void set_gain_automation_style (AutoStyle); AutoStyle gain_automation_style () const { return _gain_automation_curve.automation_style(); } - sigc::signal<void> gain_automation_style_changed; + //sigc::signal<void> gain_automation_style_changed; - virtual void transport_stopped (nframes_t now); - void automation_snapshot (nframes_t now); + virtual void transport_stopped (nframes_t now); // interface: matches Insert + void automation_snapshot (nframes_t now); // interface: matches Automatable ARDOUR::Curve& gain_automation_curve () { return _gain_automation_curve; } @@ -272,7 +261,6 @@ class IO : public PBD::StatefulDestructible mutable Glib::Mutex io_lock; protected: - Session& _session; Panner* _panner; BufferSet* _output_buffers; //< Set directly to output port buffers gain_t _gain; @@ -282,7 +270,6 @@ class IO : public PBD::StatefulDestructible PortSet _outputs; PortSet _inputs; PeakMeter* _meter; - string _name; Bundle* _input_bundle; Bundle* _output_bundle; bool no_panner_reset; @@ -336,6 +323,8 @@ class IO : public PBD::StatefulDestructible private: + friend class Send; + /* are these the best variable names ever, or what? */ sigc::connection input_bundle_configuration_connection; diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h index ed38fc4f0a..7e0bf8ac53 100644 --- a/libs/ardour/ardour/meter.h +++ b/libs/ardour/ardour/meter.h @@ -21,6 +21,7 @@ #include <vector> #include <ardour/types.h> +#include <ardour/insert.h> #include <pbd/fastlog.h> namespace ARDOUR { @@ -32,16 +33,17 @@ class Session; /** Meters peaks on the input and stores them for access. */ -class PeakMeter { +class PeakMeter : public Insert { public: - PeakMeter(Session& s) : _session(s) {} + PeakMeter(Session& s) : Insert(s, "meter", PreFader) {} - void setup (const ChanCount& in); void reset (); void reset_max (); - + + bool configure_io (ChanCount in, ChanCount out); + /** Compute peaks */ - void run (BufferSet& bufs, nframes_t nframes, nframes_t offset=0); + void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset); float peak_power (uint32_t n) { if (n < _visible_peak_power.size()) { @@ -64,7 +66,6 @@ private: friend class IO; void meter(); - Session& _session; std::vector<float> _peak_power; std::vector<float> _visible_peak_power; std::vector<float> _max_peak_power; diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index c88878c167..fb350b8838 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -37,8 +37,6 @@ public: MidiTrack (Session&, const XMLNode&); ~MidiTrack (); - int set_name (string str, void *src); - int roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset, int declick, bool can_record, bool rec_monitors_input); diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 9eb66f66b6..55947a84a5 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -38,6 +38,7 @@ #include <pbd/statefuldestructible.h> #include <ardour/ardour.h> +#include <ardour/session_object.h> #include <ardour/crossfade_compare.h> #include <ardour/location.h> #include <ardour/data_type.h> @@ -47,7 +48,7 @@ namespace ARDOUR { class Session; class Region; -class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_from_this<Playlist> { +class Playlist : public SessionObject, public boost::enable_shared_from_this<Playlist> { public: typedef list<boost::shared_ptr<Region> > RegionList; @@ -67,8 +68,7 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f void release(); bool used () const { return _refcnt != 0; } - std::string name() const { return _name; } - void set_name (std::string str); + bool set_name (const string& str); const DataType& data_type() const { return _type; } @@ -130,8 +130,6 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f uint32_t read_data_count() const { return _read_data_count; } - Session& session() { return _session; } - const PBD::ID& get_orig_diskstream_id () const { return _orig_diskstream_id; } void set_orig_diskstream_id (const PBD::ID& did) { _orig_diskstream_id = did; } @@ -170,8 +168,6 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f RegionList regions; /* the current list of regions in the playlist */ std::set<boost::shared_ptr<Region> > all_regions; /* all regions ever added to this playlist */ - string _name; - Session& _session; DataType _type; mutable gint block_notifications; mutable gint ignore_state_changes; diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 37cf0d49b2..4acacae7f5 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -22,13 +22,13 @@ #include <vector> #include <string> -#include <exception> #include <sigc++/signal.h> #include <ardour/ardour.h> #include <ardour/plugin_state.h> #include <ardour/types.h> #include <ardour/insert.h> +#include <ardour/automation_event.h> class XMLNode; @@ -105,7 +105,7 @@ class PluginInsert : public Insert void parameter_changed (uint32_t, float); - vector<boost::shared_ptr<Plugin> > _plugins; + std::vector<boost::shared_ptr<Plugin> > _plugins; void automation_run (BufferSet& bufs, nframes_t nframes, nframes_t offset); void connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now = 0); diff --git a/libs/ardour/ardour/port_insert.h b/libs/ardour/ardour/port_insert.h index 4898efc789..5d9cd583cb 100644 --- a/libs/ardour/ardour/port_insert.h +++ b/libs/ardour/ardour/port_insert.h @@ -26,7 +26,7 @@ #include <sigc++/signal.h> #include <ardour/ardour.h> -#include <ardour/insert.h> +#include <ardour/redirect.h> #include <ardour/plugin_state.h> #include <ardour/types.h> @@ -37,8 +37,10 @@ namespace ARDOUR { class Session; /** Port inserts: send output to a Jack port, pick up input at a Jack port + * + * PortInsert IS-A Redirect IS-A Insert, IO */ -class PortInsert : public Insert +class PortInsert : public Redirect { public: PortInsert (Session&, Placement); diff --git a/libs/ardour/ardour/redirect.h b/libs/ardour/ardour/redirect.h index fbbb295a24..bc12bb6a8a 100644 --- a/libs/ardour/ardour/redirect.h +++ b/libs/ardour/ardour/redirect.h @@ -32,6 +32,7 @@ #include <pbd/undo.h> #include <ardour/ardour.h> +#include <ardour/insert.h> #include <ardour/io.h> #include <ardour/automation_event.h> @@ -46,97 +47,37 @@ namespace ARDOUR { class Session; -class Redirect : public IO +/** A mixer strip element (Insert) with Jack ports (IO). + */ +class Redirect : public Insert { public: - static const string state_node_name; - Redirect (Session&, const string& name, Placement, int input_min = -1, int input_max = -1, int output_min = -1, int output_max = -1); Redirect (const Redirect&); virtual ~Redirect (); + + virtual ChanCount output_streams() const { return _io->n_outputs(); } + virtual ChanCount input_streams () const { return _io->n_inputs(); } + virtual ChanCount natural_output_streams() const { return _io->n_outputs(); } + virtual ChanCount natural_input_streams () const { return _io->n_inputs(); } - static boost::shared_ptr<Redirect> clone (boost::shared_ptr<const Redirect>); - - bool active () const { return _active; } - void set_active (bool yn, void *src); - - virtual ChanCount output_streams() const { return n_outputs(); } - virtual ChanCount input_streams () const { return n_inputs(); } - virtual ChanCount natural_output_streams() const { return n_outputs(); } - virtual ChanCount natural_input_streams () const { return n_inputs(); } - - uint32_t sort_key() const { return _sort_key; } - void set_sort_key (uint32_t key); - - Placement placement() const { return _placement; } - void set_placement (Placement, void *src); + boost::shared_ptr<IO> io() { return _io; } + boost::shared_ptr<const IO> io() const { return _io; } + + virtual void automation_snapshot (nframes_t now) { _io->automation_snapshot(now); } virtual void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0; - virtual void activate () = 0; - virtual void deactivate () = 0; - virtual nframes_t latency() { return 0; } - - virtual void set_block_size (nframes_t nframes) {} + void silence (nframes_t nframes, nframes_t offset); - sigc::signal<void,Redirect*,void*> active_changed; - sigc::signal<void,Redirect*,void*> placement_changed; - sigc::signal<void,Redirect*,bool> AutomationPlaybackChanged; + sigc::signal<void,Redirect*,bool> AutomationPlaybackChanged; sigc::signal<void,Redirect*,uint32_t> AutomationChanged; - - static sigc::signal<void,Redirect*> RedirectCreated; - XMLNode& state (bool full); - XMLNode& get_state (void); + XMLNode& state (bool full_state); int set_state (const XMLNode&); - - void *get_gui () const { return _gui; } - void set_gui (void *p) { _gui = p; } - - virtual string describe_parameter (uint32_t which); - virtual float default_parameter_value (uint32_t which) { - return 1.0f; - } - - void what_has_automation (set<uint32_t>&) const; - void what_has_visible_automation (set<uint32_t>&) const; - const set<uint32_t>& what_can_be_automated () const { return can_automate_list; } - - void mark_automation_visible (uint32_t, bool); - - AutomationList& automation_list (uint32_t); - bool find_next_event (nframes_t, nframes_t, ControlEvent&) const; - - virtual void transport_stopped (nframes_t frame) {}; - - bool get_next_ab_is_active () const { return _next_ab_is_active; } - void set_next_ab_is_active (bool yn); protected: - /* children may use this stuff as they see fit */ - - map<uint32_t,AutomationList*> parameter_automation; - set<uint32_t> visible_parameter_automation; - - mutable Glib::Mutex _automation_lock; - - void can_automate (uint32_t); - set<uint32_t> can_automate_list; - - virtual void automation_list_creation_callback (uint32_t, AutomationList&) {} - - int set_automation_state (const XMLNode&); - XMLNode& get_automation_state (); - - private: - bool _active; - bool _next_ab_is_active; - Placement _placement; - uint32_t _sort_key; - void* _gui; /* generic, we don't know or care what this is */ - - int old_set_automation_state (const XMLNode&); - int load_automation (std::string path); + boost::shared_ptr<IO> _io; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index b5d1fa03d6..4f5f863fee 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -59,7 +59,8 @@ class Route : public IO { protected: - typedef list<boost::shared_ptr<Redirect> > RedirectList; + typedef list<boost::shared_ptr<Insert> > InsertList; + public: enum Flag { @@ -99,7 +100,7 @@ class Route : public IO virtual bool can_record() { return false; } virtual void set_record_enable (bool yn, void *src) {} virtual bool record_enabled() const { return false; } - virtual void handle_transport_stopped (bool abort, bool did_locate, bool flush_redirects); + virtual void handle_transport_stopped (bool abort, bool did_locate, bool flush_inserts); virtual void set_pending_declick (int); /* end of vfunc-based API */ @@ -136,54 +137,54 @@ class Route : public IO virtual void set_meter_point (MeterPoint, void *src); MeterPoint meter_point() const { return _meter_point; } - /* Redirects */ + /* Inserts */ - void flush_redirects (); + void flush_inserts (); - template<class T> void foreach_redirect (T *obj, void (T::*func)(boost::shared_ptr<Redirect>)) { - Glib::RWLock::ReaderLock lm (redirect_lock); - for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) { + template<class T> void foreach_insert (T *obj, void (T::*func)(boost::shared_ptr<Insert>)) { + Glib::RWLock::ReaderLock lm (insert_lock); + for (InsertList::iterator i = _inserts.begin(); i != _inserts.end(); ++i) { (obj->*func) (*i); } } - boost::shared_ptr<Redirect> nth_redirect (uint32_t n) { - Glib::RWLock::ReaderLock lm (redirect_lock); - RedirectList::iterator i; - for (i = _redirects.begin(); i != _redirects.end() && n; ++i, --n); - if (i == _redirects.end()) { + boost::shared_ptr<Insert> nth_insert (uint32_t n) { + Glib::RWLock::ReaderLock lm (insert_lock); + InsertList::iterator i; + for (i = _inserts.begin(); i != _inserts.end() && n; ++i, --n); + if (i == _inserts.end()) { return boost::shared_ptr<Redirect> (); } else { return *i; } } - ChanCount max_redirect_outs () const { return redirect_max_outs; } + ChanCount max_insert_outs () const { return insert_max_outs; } ChanCount pre_fader_streams() const; - /** A record of the stream configuration at some point in the redirect list. - * Used to return where and why a redirect list configuration request failed. + /** A record of the stream configuration at some point in the insert list. + * Used to return where and why an insert list configuration request failed. */ struct InsertStreams { InsertStreams(size_t i=0, ChanCount c=ChanCount()) : index(i), count(c) {} - size_t index; ///< Index of redirect where configuration failed - ChanCount count; ///< Input requested of redirect + size_t index; ///< Index of insert where configuration failed + ChanCount count; ///< Input requested of insert }; - int add_redirect (boost::shared_ptr<Redirect>, void *src, InsertStreams* err = 0); - int add_redirects (const RedirectList&, void *src, InsertStreams* err = 0); - int remove_redirect (boost::shared_ptr<Redirect>, void *src, InsertStreams* err = 0); - int copy_redirects (const Route&, Placement, InsertStreams* err = 0); - int sort_redirects (InsertStreams* err = 0); - void disable_redirects (Placement); - void disable_redirects (); + int add_insert (boost::shared_ptr<Insert>, InsertStreams* err = 0); + int add_inserts (const InsertList&, InsertStreams* err = 0); + int remove_insert (boost::shared_ptr<Insert>, InsertStreams* err = 0); + int copy_inserts (const Route&, Placement, InsertStreams* err = 0); + int sort_inserts (InsertStreams* err = 0); + void disable_inserts (Placement); + void disable_inserts (); void disable_plugins (Placement); void disable_plugins (); void ab_plugins (bool forward); - void clear_redirects (Placement, void *src); - void all_redirects_flip(); - void all_redirects_active (Placement, bool state); + void clear_inserts (Placement); + void all_inserts_flip(); + void all_inserts_active (Placement, bool state); virtual nframes_t update_total_latency(); nframes_t signal_latency() const { return _own_latency; } @@ -197,7 +198,7 @@ class Route : public IO sigc::signal<void,void*> post_fader_changed; sigc::signal<void,void*> control_outs_changed; sigc::signal<void,void*> main_outs_changed; - sigc::signal<void,void*> redirects_changed; + sigc::signal<void> inserts_changed; sigc::signal<void,void*> record_enable_changed; sigc::signal<void,void*> edit_group_changed; sigc::signal<void,void*> mix_group_changed; @@ -214,8 +215,8 @@ class Route : public IO int set_state(const XMLNode& node); virtual XMLNode& get_template(); - XMLNode& get_redirect_state (); - int set_redirect_state (const XMLNode&); + XMLNode& get_insert_state (); + int set_insert_state (const XMLNode&); sigc::signal<void,void*> SelectedChanged; @@ -294,8 +295,8 @@ class Route : public IO nframes_t _initial_delay; nframes_t _roll_delay; nframes_t _own_latency; - RedirectList _redirects; - Glib::RWLock redirect_lock; + InsertList _inserts; + Glib::RWLock insert_lock; IO *_control_outs; Glib::Mutex control_outs_lock; RouteGroup *_edit_group; @@ -311,7 +312,7 @@ class Route : public IO virtual void process_output_buffers (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, - nframes_t nframes, nframes_t offset, bool with_redirects, int declick, + nframes_t nframes, nframes_t offset, bool with_inserts, int declick, bool meter); protected: @@ -326,14 +327,14 @@ class Route : public IO sigc::connection input_signal_connection; - ChanCount redirect_max_outs; + ChanCount insert_max_outs; uint32_t _remote_control_id; uint32_t pans_required() const; ChanCount n_process_buffers (); virtual int _set_state (const XMLNode&, bool call_base); - virtual void _set_redirect_states (const XMLNodeList&); + virtual void _set_insert_states (const XMLNodeList&); private: void init (); @@ -354,7 +355,6 @@ class Route : public IO void input_change_handler (IOChange, void *src); void output_change_handler (IOChange, void *src); - bool legal_redirect (Redirect&); int reset_plugin_counts (InsertStreams*); /* locked */ int _reset_plugin_counts (InsertStreams*); /* unlocked */ @@ -372,8 +372,7 @@ class Route : public IO bool check_some_plugin_counts (std::list<InsertCount>& iclist, ChanCount required_inputs, InsertStreams* err_streams); void set_deferred_state (); - void add_redirect_from_xml (const XMLNode&); - void redirect_active_proxy (Redirect*, void*); + void add_insert_from_xml (const XMLNode&); }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index d3ce6ddee8..dc509514e2 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -42,6 +42,9 @@ class Send : public Redirect uint32_t bit_slot() const { return bitslot; } + ChanCount output_streams() const; + ChanCount input_streams () const; + void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset); void activate() {} @@ -54,7 +57,10 @@ class Send : public Redirect int set_state(const XMLNode& node); uint32_t pans_required() const { return _expected_inputs.n_audio(); } - void expect_inputs (const ChanCount&); + + virtual bool can_support_input_configuration (ChanCount in) const; + virtual ChanCount output_for_input_configuration (ChanCount in) const; + virtual bool configure_io (ChanCount in, ChanCount out); static uint32_t how_many_sends(); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 685e7f2284..1fea324406 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1374,7 +1374,7 @@ class Session : public PBD::StatefulDestructible void set_play_loop (bool yn); void overwrite_some_buffers (Diskstream*); - void flush_all_redirects (); + void flush_all_inserts (); void locate (nframes_t, bool with_roll, bool with_flush, bool with_loop=false); void start_locate (nframes_t, bool with_roll, bool with_flush, bool with_loop=false); void force_locate (nframes_t frame, bool with_roll = false); @@ -1521,8 +1521,8 @@ class Session : public PBD::StatefulDestructible uint32_t insert_cnt; - void add_redirect (Redirect *); - void remove_redirect (Redirect *); + void add_insert (Insert *); + void remove_insert (Insert *); /* S/W RAID */ diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h index 086c77537d..e4d2611271 100644 --- a/libs/ardour/ardour/smf_source.h +++ b/libs/ardour/ardour/smf_source.h @@ -61,7 +61,8 @@ class SMFSource : public MidiSource { virtual void mark_capture_end () {} virtual void clear_capture_marks() {} - int set_name (string newname, bool destructive); + bool set_name (const std::string& newname) { return (set_source_name(newname, false) == 0); } + int set_source_name (string newname, bool destructive); string path() const { return _path; } diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h index 2a6e0c8638..029469f491 100644 --- a/libs/ardour/ardour/source.h +++ b/libs/ardour/ardour/source.h @@ -28,6 +28,7 @@ #include <pbd/statefuldestructible.h> #include <ardour/ardour.h> +#include <ardour/session_object.h> #include <ardour/data_type.h> namespace ARDOUR { @@ -35,17 +36,14 @@ namespace ARDOUR { class Session; class Playlist; -class Source : public PBD::StatefulDestructible +class Source : public SessionObject { public: - Source (Session&, std::string name, DataType type); + Source (Session&, const std::string& name, DataType type); Source (Session&, const XMLNode&); virtual ~Source (); - - std::string name() const { return _name; } - int set_name (std::string str, bool destructive); - + DataType type() { return _type; } time_t timestamp() const { return _timestamp; } @@ -76,8 +74,6 @@ class Source : public PBD::StatefulDestructible protected: void update_length (nframes_t pos, nframes_t cnt); - Session& _session; - string _name; DataType _type; time_t _timestamp; nframes_t _length; diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index eee04d9bfa..5d87a13886 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -37,7 +37,7 @@ class Track : public Route virtual ~Track (); - int set_name (string str, void *src); + bool set_name (const std::string& str); TrackMode mode () const { return _mode; } virtual int set_mode (TrackMode m) { return false; } |