Move file suffixes out of the Session class and into filename_extensions.h/cc
[ardour.git] / libs / ardour / ardour / redirect.h
index 4e6ef5124c8f6451180888f1d2a1e524720b169f..fbbb295a24500e6769dba208ef406ec331890aa9 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #ifndef __ardour_redirect_h__
@@ -47,14 +46,6 @@ namespace ARDOUR {
 
 class Session;
 
-struct RedirectState : public StateManager::State {
-    RedirectState (string why) 
-           : StateManager::State (why) {}
-    ~RedirectState () {}
-
-    bool active;
-};
-
 class Redirect : public IO
 {
   public:
@@ -70,10 +61,10 @@ class Redirect : public IO
        bool active () const { return _active; }
        void set_active (bool yn, void *src);
 
-       virtual uint32_t output_streams() const { return n_outputs().get(_default_type); }
-       virtual uint32_t input_streams () const { return n_inputs().get(_default_type); }
-       virtual uint32_t natural_output_streams() const { return n_outputs().get(_default_type); }
-       virtual uint32_t natural_input_streams () const { return n_inputs().get(_default_type); }
+       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);
@@ -81,18 +72,17 @@ class Redirect : public IO
        Placement placement() const { return _placement; }
        void set_placement (Placement, void *src);
 
-       virtual void run (vector<Sample *>& ibufs, uint32_t nbufs, jack_nframes_t nframes, jack_nframes_t offset) = 0;
+       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 jack_nframes_t latency() { return 0; }
+       virtual nframes_t latency() { return 0; }
 
-       virtual void set_block_size (jack_nframes_t nframes) {}
+       virtual void set_block_size (nframes_t nframes) {}
 
        sigc::signal<void,Redirect*,void*> active_changed;
        sigc::signal<void,Redirect*,void*> placement_changed;
        sigc::signal<void,Redirect*,bool>  AutomationPlaybackChanged;
        sigc::signal<void,Redirect*,uint32_t> AutomationChanged;
-       sigc::signal<void,Redirect*> GoingAway;
 
        static sigc::signal<void,Redirect*> RedirectCreated;
        
@@ -100,9 +90,6 @@ class Redirect : public IO
        XMLNode& get_state (void);
        int set_state (const XMLNode&);
 
-       StateManager::State* state_factory (string why) const;
-       Change restore_state (StateManager::State&);
-
        void *get_gui () const { return _gui; }
        void  set_gui (void *p) { _gui = p; }
 
@@ -111,9 +98,6 @@ class Redirect : public IO
                return 1.0f;
        }
 
-       int load_automation (string path);
-       int save_automation (string path);
-
        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; }
@@ -121,13 +105,14 @@ class Redirect : public IO
        void mark_automation_visible (uint32_t, bool);
        
        AutomationList& automation_list (uint32_t);
-       bool find_next_event (jack_nframes_t, jack_nframes_t, ControlEvent&) const;
+       bool find_next_event (nframes_t, nframes_t, ControlEvent&) const;
 
-       virtual void transport_stopped (jack_nframes_t frame) {};
+       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:
-       void set_placement (const string&, void *src);
-
        /* children may use this stuff as they see fit */
 
        map<uint32_t,AutomationList*> parameter_automation;
@@ -138,15 +123,20 @@ class Redirect : public IO
        void can_automate (uint32_t);
        set<uint32_t> can_automate_list;
 
-       void store_state (RedirectState&) const;
-
        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);
 };
 
 } // namespace ARDOUR