Remove global Session::playlists variable, use getter method (1/2)
[ardour.git] / libs / ardour / io.cc
index a2a46270c8a80a80b948102002c08243e5a5479e..5d6d343f2ea444116618378d802313ad69921a16 100644 (file)
@@ -105,7 +105,7 @@ IO::~IO ()
 void
 IO::disconnect_check (boost::shared_ptr<Port> a, boost::shared_ptr<Port> b)
 {
-       if (_session.state_of_the_state () & Session::Deletion) {
+       if (_session.deletion_in_progress ()) {
                return;
        }
        /* this could be called from within our own ::disconnect() method(s)
@@ -130,18 +130,6 @@ IO::disconnect_check (boost::shared_ptr<Port> a, boost::shared_ptr<Port> b)
        }
 }
 
-void
-IO::increment_port_buffer_offset (pframes_t offset)
-{
-       /* io_lock, not taken: function must be called from Session::process() calltree */
-
-       if (_direction == Output) {
-               for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
-                       i->increment_port_buffer_offset (offset);
-               }
-       }
-}
-
 void
 IO::silence (samplecnt_t nframes)
 {
@@ -498,11 +486,11 @@ IO::ensure_io (ChanCount count, bool clear, void* src)
 XMLNode&
 IO::get_state ()
 {
-       return state (true);
+       return state ();
 }
 
 XMLNode&
-IO::state (bool /*full_state*/)
+IO::state ()
 {
        XMLNode* node = new XMLNode (state_node_name);
        int n;
@@ -548,7 +536,7 @@ IO::state (bool /*full_state*/)
                node->add_child_nocopy (*pnode);
        }
 
-       node->set_property (X_("user-latency"), _user_latency);
+       Latent::add_state (node);
 
        return *node;
 }
@@ -609,7 +597,7 @@ IO::set_state (const XMLNode& node, int version)
                ConnectingLegal.connect_same_thread (connection_legal_c, boost::bind (&IO::connecting_became_legal, this));
        }
 
-       node.get_property ("user-latency", _user_latency);
+       Latent::set_state (node, version);
 
        return 0;
 }
@@ -1216,6 +1204,26 @@ IO::apply_pretty_name ()
        }
 }
 
+void
+IO::set_private_port_latencies (samplecnt_t value, bool playback)
+{
+       LatencyRange lat;
+       lat.min = lat.max = value;
+       for (PortSet::iterator i = _ports.begin (); i != _ports.end(); ++i) {
+                i->set_private_latency_range (lat, playback);
+       }
+}
+
+void
+IO::set_public_port_latencies (samplecnt_t value, bool playback) const
+{
+       LatencyRange lat;
+       lat.min = lat.max = value;
+       for (PortSet::const_iterator i = _ports.begin (); i != _ports.end(); ++i) {
+                i->set_public_latency_range (lat, playback);
+       }
+}
+
 samplecnt_t
 IO::latency () const
 {