Commit read-only stack security fix for 64bit processors.
[ardour.git] / libs / ardour / ardour / io.h
index 1248f60e0fed0760dd608c10281a269ed69a13b6..e1ed7aef9501c9aff6a0310d60550f51f64b4e5d 100644 (file)
@@ -36,7 +36,6 @@
 
 #include <ardour/ardour.h>
 #include <ardour/utils.h>
-#include <ardour/state_manager.h>
 #include <ardour/curve.h>
 #include <ardour/types.h>
 #include <ardour/data_type.h>
@@ -59,7 +58,7 @@ class Panner;
  * 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, public ARDOUR::StateManager
+class IO : public PBD::StatefulDestructible
 {
 
   public:
@@ -87,18 +86,18 @@ virtual ~IO();
        const string& name() const { return _name; }
        virtual int set_name (string str, void *src);
        
-       virtual void silence  (jack_nframes_t, jack_nframes_t offset);
+       virtual void silence  (nframes_t, nframes_t offset);
 
        // These should be moved in to a separate object that manipulates an IO
        
-       void pan (vector<Sample*>& bufs, uint32_t nbufs, jack_nframes_t nframes, jack_nframes_t offset, gain_t gain_coeff);
-       void pan_automated (vector<Sample*>& bufs, uint32_t nbufs, jack_nframes_t start_frame, jack_nframes_t end_frame, 
-                           jack_nframes_t nframes, jack_nframes_t offset);
-       void collect_input  (vector<Sample*>&, uint32_t nbufs, jack_nframes_t nframes, jack_nframes_t offset);
-       void deliver_output (vector<Sample*>&, uint32_t nbufs, jack_nframes_t nframes, jack_nframes_t offset);
-       void deliver_output_no_pan (vector<Sample*>&, uint32_t nbufs, 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);
+       void pan (vector<Sample*>& bufs, uint32_t nbufs, nframes_t nframes, nframes_t offset, gain_t gain_coeff);
+       void pan_automated (vector<Sample*>& bufs, uint32_t nbufs, nframes_t start_frame, nframes_t end_frame, 
+                           nframes_t nframes, nframes_t offset);
+       void collect_input  (vector<Sample*>&, uint32_t nbufs, nframes_t nframes, nframes_t offset);
+       void deliver_output (vector<Sample*>&, uint32_t nbufs, nframes_t nframes, nframes_t offset);
+       void deliver_output_no_pan (vector<Sample*>&, uint32_t nbufs, nframes_t nframes, nframes_t offset);
+       void just_meter_input (nframes_t start_frame, nframes_t end_frame, 
+                              nframes_t nframes, nframes_t offset);
 
        virtual uint32_t n_process_buffers () { return 0; }
 
@@ -134,9 +133,9 @@ virtual ~IO();
        int disconnect_inputs (void *src);
        int disconnect_outputs (void *src);
 
-       jack_nframes_t output_latency() const;
-       jack_nframes_t input_latency() const;
-       void           set_port_latency (jack_nframes_t);
+       nframes_t output_latency() const;
+       nframes_t input_latency() const;
+       void           set_port_latency (nframes_t);
 
        Port *output (uint32_t n) const {
                if (n < _noutputs) {
@@ -167,19 +166,11 @@ virtual ~IO();
        XMLNode& get_state (void);
        int set_state (const XMLNode&);
 
-       virtual UndoAction get_memento() const;
-
-
        static int  disable_connecting (void);
-
        static int  enable_connecting (void);
-
        static int  disable_ports (void);
-
        static int  enable_ports (void);
-
        static int  disable_panners (void);
-
        static int  reset_panners (void);
        
        static sigc::signal<int> PortsLegal;
@@ -234,16 +225,7 @@ public:
        AutoStyle gain_automation_style () const { return _gain_automation_curve.automation_style(); }
        sigc::signal<void> gain_automation_style_changed;
 
-       static void set_automation_interval (jack_nframes_t frames) {
-               _automation_interval = frames;
-       }
-
-       static jack_nframes_t automation_interval() { 
-               return _automation_interval;
-       }
-
-       virtual void transport_stopped (jack_nframes_t now);
-       virtual void automation_snapshot (jack_nframes_t now);
+       virtual void transport_stopped (nframes_t now);
 
        ARDOUR::Curve& gain_automation_curve () { return _gain_automation_curve; }
 
@@ -253,8 +235,6 @@ public:
        void start_pan_touch (uint32_t which);
        void end_pan_touch (uint32_t which);
 
-       const PBD::ID& id() const { return _id; }
-
        void defer_pan_reset ();
        void allow_pan_reset ();
 
@@ -282,10 +262,11 @@ public:
        string              _name;
        Connection*         _input_connection;
        Connection*         _output_connection;
-       PBD::ID             _id;
        bool                 no_panner_reset;
        XMLNode*             deferred_state;
-       DataType        _default_type;
+       DataType            _default_type;
+       bool                _ignore_gain_on_deliver;
+       
 
        virtual void set_deferred_state() {}
 
@@ -294,11 +275,11 @@ public:
 
        virtual uint32_t pans_required() const { return _ninputs; }
 
-       static void apply_declick (vector<Sample*>&, uint32_t nbufs, jack_nframes_t nframes, 
+       static void apply_declick (vector<Sample*>&, uint32_t nbufs, nframes_t nframes, 
                                   gain_t initial, gain_t target, bool invert_polarity);
 
        struct GainControllable : public PBD::Controllable {
-           GainControllable (IO& i) : io (i) {}
+           GainControllable (std::string name, IO& i) : Controllable (name), io (i) {}
         
            void set_value (float val);
            float get_value (void) const;
@@ -308,17 +289,7 @@ public:
 
        GainControllable _gain_control;
 
-       /* state management */
-
-       Change               restore_state (State&);
-       StateManager::State* state_factory (std::string why) const;
-
-       /* automation */
-
-       jack_nframes_t last_automation_snapshot;
-       static jack_nframes_t _automation_interval;
-
-    AutoState      _gain_automation_state;
+       AutoState      _gain_automation_state;
        AutoStyle      _gain_automation_style;
 
        bool     apply_gain_automation;