Re-enable creation of stereo bundles for system IO, so that the mixer strip
[ardour.git] / libs / ardour / session.cc
index 862a8fb7e6fe709424bac4700e556a18dfd419c3..ed5ff668aad41d122f9584ac59f258d38b38e13f 100644 (file)
@@ -119,6 +119,7 @@ Session::Session (AudioEngine &eng,
                  string mix_template)
 
        : _engine (eng),
+         _requested_return_frame (-1),
          _scratch_buffers(new BufferSet()),
          _silent_buffers(new BufferSet()),
          _mix_buffers(new BufferSet()),
@@ -201,6 +202,7 @@ Session::Session (AudioEngine &eng,
                  nframes_t initial_length)
 
        : _engine (eng),
+         _requested_return_frame (-1),
          _scratch_buffers(new BufferSet()),
          _silent_buffers(new BufferSet()),
          _mix_buffers(new BufferSet()),
@@ -593,7 +595,11 @@ Session::when_engine_running ()
        BootMessage (_("Set up standard connections"));
 
        /* Create a set of Bundle objects that map
-          to the physical I/O currently available */
+          to the physical I/O currently available.  We create both
+          mono and stereo bundles, so that the common cases of mono
+          and stereo tracks get bundles to put in their mixer strip
+          in / out menus.  There may be a nicer way of achieving that;
+          it doesn't really scale that well to higher channel counts */
 
        for (uint32_t np = 0; np < n_physical_outputs; ++np) {
                char buf[32];
@@ -606,6 +612,20 @@ Session::when_engine_running ()
                add_bundle (c);
        }
 
+       for (uint32_t np = 0; np < n_physical_outputs; np += 2) {
+               if (np + 1 < n_physical_outputs) {
+                       char buf[32];
+                       snprintf (buf, sizeof(buf), _("out %" PRIu32 "+%" PRIu32), np + 1, np + 2);
+                       shared_ptr<Bundle> c (new Bundle (buf, true));
+                       c->add_channel (_("L"));
+                       c->set_port (0, _engine.get_nth_physical_output (DataType::AUDIO, np));
+                       c->add_channel (_("R"));
+                       c->set_port (1, _engine.get_nth_physical_output (DataType::AUDIO, np + 1));
+
+                       add_bundle (c);
+               }
+       }
+
        for (uint32_t np = 0; np < n_physical_inputs; ++np) {
                char buf[32];
                snprintf (buf, sizeof (buf), _("in %" PRIu32), np+1);
@@ -617,6 +637,21 @@ Session::when_engine_running ()
                add_bundle (c);
        }
 
+       for (uint32_t np = 0; np < n_physical_inputs; np += 2) {
+               if (np + 1 < n_physical_inputs) {
+                       char buf[32];
+                       snprintf (buf, sizeof(buf), _("in %" PRIu32 "+%" PRIu32), np + 1, np + 2);
+
+                       shared_ptr<Bundle> c (new Bundle (buf, false));
+                       c->add_channel (_("L"));
+                       c->set_port (0, _engine.get_nth_physical_input (DataType::AUDIO, np));
+                       c->add_channel (_("R"));
+                       c->set_port (1, _engine.get_nth_physical_input (DataType::AUDIO, np + 1));
+
+                       add_bundle (c);
+               }
+       }
+
        if (_master_out) {
 
                /* create master/control ports */
@@ -1214,16 +1249,16 @@ Session::audible_frame () const
                /* MOVING */
 
                /* check to see if we have passed the first guaranteed
-                  audible frame past our last stopping position. if not,
-                  the return that last stopping point because in terms
+                  audible frame past our last start position. if not,
+                  return that last start point because in terms
                   of audible frames, we have not moved yet.
                */
 
                if (_transport_speed > 0.0f) {
 
                        if (!play_loop || !have_looped) {
-                               if (tf < last_stop_frame + offset) {
-                                       return last_stop_frame;
+                               if (tf < _last_roll_location + offset) {
+                                       return _last_roll_location;
                                        
                                }
                        } 
@@ -1236,8 +1271,8 @@ Session::audible_frame () const
 
                        /* XXX wot? no backward looping? */
 
-                       if (tf > last_stop_frame - offset) {
-                               return last_stop_frame;
+                       if (tf > _last_roll_location - offset) {
+                               return _last_roll_location;
                        } else {
                                /* backwards */
                                ret += offset;