Less weak plugin preset system (maybe AU preset stuff can use the 'normal' thing...
[ardour.git] / libs / ardour / ardour / route.h
index d2e40501f1096a4652b1c66006b09d8d8aa6af82..cbf49108991b3ea7be3cb3abf4a48c3cd4a71fb4 100644 (file)
@@ -27,6 +27,7 @@
 #include <string>
 
 #include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
 
 #include <pbd/fastlog.h>
 #include <glibmm/thread.h>
 
 #include <ardour/ardour.h>
 #include <ardour/io.h>
-#include <ardour/session.h>
-#include <ardour/io_processor.h>
 #include <ardour/types.h>
 
 namespace ARDOUR {
 
 class Processor;
+class IOProcessor;
 class Send;
 class RouteGroup;
 
@@ -75,6 +75,8 @@ class Route : public IO
        Route (Session&, const XMLNode&, DataType default_type = DataType::AUDIO);
        virtual ~Route();
 
+       static std::string ensure_track_or_route_name(std::string, Session &);
+
        std::string comment() { return _comment; }
        void set_comment (std::string str, void *src);
 
@@ -105,20 +107,19 @@ class Route : public IO
 
        /* end of vfunc-based API */
 
+       void shift (nframes64_t, nframes64_t);
+
        /* override IO::set_gain() to provide group control */
 
        void set_gain (gain_t val, void *src);
        void inc_gain (gain_t delta, void *src);
        
-       bool active() const { return _active; }
-       void set_active (bool yn);
-
        void set_solo (bool yn, void *src);
        bool soloed() const { return _soloed; }
 
        void set_solo_safe (bool yn, void *src);
        bool solo_safe() const { return _solo_safe; }
-
+       
        void set_mute (bool yn, void *src);
        bool muted() const { return _muted; }
        bool solo_muted() const { return desired_solo_gain == 0.0; }
@@ -141,10 +142,10 @@ class Route : public IO
 
        void flush_processors ();
 
-       template<class T> void foreach_processor (T *obj, void (T::*func)(boost::shared_ptr<Processor>)) {
+       void foreach_processor (sigc::slot<void, boost::weak_ptr<Processor> > method) {
                Glib::RWLock::ReaderLock lm (_processor_lock);
                for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
-                       (obj->*func) (*i);
+                       method (boost::weak_ptr<Processor> (*i));
                }
        }
 
@@ -153,7 +154,7 @@ class Route : public IO
                ProcessorList::iterator i;
                for (i = _processors.begin(); i != _processors.end() && n; ++i, --n);
                if (i == _processors.end()) {
-                       return boost::shared_ptr<IOProcessor> ();
+                       return boost::shared_ptr<Processor> ();
                } else {
                        return *i;
                }
@@ -203,7 +204,6 @@ class Route : public IO
        sigc::signal<void,void*> record_enable_changed;
        sigc::signal<void,void*> edit_group_changed;
        sigc::signal<void,void*> mix_group_changed;
-       sigc::signal<void>       active_changed;
        sigc::signal<void,void*> meter_change;
        sigc::signal<void>       signal_latency_changed;
        sigc::signal<void>       initial_delay_changed;
@@ -227,7 +227,7 @@ class Route : public IO
        IO* control_outs() { return _control_outs; }
 
        bool feeds (boost::shared_ptr<Route>);
-       set<boost::shared_ptr<Route> > fed_by;
+       std::set<boost::shared_ptr<Route> > fed_by;
 
        struct ToggleControllable : public PBD::Controllable {
            enum ToggleType {
@@ -251,19 +251,20 @@ class Route : public IO
                return _mute_control;
        }
        
-       void automation_snapshot (nframes_t now);
+       void automation_snapshot (nframes_t now, bool force=false);
        void protect_automation ();
        
        void set_remote_control_id (uint32_t id);
        uint32_t remote_control_id () const;
        sigc::signal<void> RemoteControlIDChanged;
 
-       void sync_order_keys ();
-       static sigc::signal<void> SyncOrderKeys;
+       void sync_order_keys (const char* base);
+       static sigc::signal<void,const char*> SyncOrderKeys;
 
   protected:
        friend class Session;
 
+       void catch_up_on_solo_mute_override ();
        void set_solo_mute (bool yn);
        void set_block_size (nframes_t nframes);
        bool has_external_redirects() const;
@@ -280,7 +281,6 @@ class Route : public IO
        bool                     _soloed : 1;
        bool                     _solo_safe : 1;
        bool                     _recordable : 1;
-       bool                     _active : 1;
        bool                     _mute_affects_pre_fader : 1;
        bool                     _mute_affects_post_fader : 1;
        bool                     _mute_affects_control_outs : 1;
@@ -362,8 +362,8 @@ class Route : public IO
        void input_change_handler (IOChange, void *src);
        void output_change_handler (IOChange, void *src);
 
-       int reset_plugin_counts (ProcessorStreams*); /* locked */
-       int _reset_plugin_counts (ProcessorStreams*); /* unlocked */
+       int reset_processor_counts (ProcessorStreams*); /* locked */
+       int _reset_processor_counts (ProcessorStreams*); /* unlocked */
 
        /* processor I/O channels and plugin count handling */
 
@@ -375,8 +375,8 @@ class Route : public IO
            ProcessorCount (boost::shared_ptr<ARDOUR::Processor> ins) : processor(ins) {}
        };
        
-       int32_t apply_some_plugin_counts (std::list<ProcessorCount>& iclist);
-       bool    check_some_plugin_counts (std::list<ProcessorCount>& iclist, ChanCount required_inputs, ProcessorStreams* err_streams);
+       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&);