a) fix special button press handling for solo+mute buttons
[ardour.git] / libs / ardour / session_transport.cc
index 096267d0dd30f0a0c3e560dcb217dda1a295409f..2f9f8257f9344d3d8e3f2e38515861ec6e18cfa7 100644 (file)
@@ -189,7 +189,7 @@ Session::realtime_stop (bool abort)
        _clear_event_type (Event::RangeStop);
        _clear_event_type (Event::RangeLocate);
 
-       disable_record ();
+       disable_record (true);
 
        reset_slave_state ();
                
@@ -282,9 +282,9 @@ Session::non_realtime_stop (bool abort)
        struct tm* now;
        time_t     xnow;
        bool       did_record;
-
+       
        did_record = false;
-
+       
        for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
                if ((*i)->get_captured_frames () != 0) {
                        did_record = true;
@@ -386,8 +386,18 @@ Session::non_realtime_stop (bool abort)
        deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
 
        if (did_record) {
-               atomic_set (&_record_status, Disabled);
-               RecordDisabled (); /* EMIT SIGNAL */
+
+               /* XXX its a little odd that we're doing this here
+                  when realtime_stop(), which has already executed,
+                  will have done this.
+               */
+
+               if (!Config->get_latched_record_enable()) {
+                       atomic_set (&_record_status, Disabled);
+               } else {
+                       atomic_set (&_record_status, Enabled);
+               }
+               RecordStateChanged (); /* emit signal */
        }
        
        if ((post_transport_work & PostTransportLocate) && get_record_enabled()) {
@@ -395,8 +405,12 @@ Session::non_realtime_stop (bool abort)
                save_state ("", true);
        }
 
-       /* save the current state of things if appropriate */
+        /* always try to get rid of this */
+
+        remove_pending_capture_state ();
        
+       /* save the current state of things if appropriate */
+
        if (did_record) {
                save_state (_current_snapshot_name);
        }
@@ -825,7 +839,7 @@ Session::start_transport ()
                break;
 
        case Recording:
-               disable_record ();
+               disable_record (false);
                break;
 
        default: