a) fix special button press handling for solo+mute buttons
[ardour.git] / libs / ardour / session_transport.cc
index 82b067a288c54fe23782955479ad33413cf13fe9..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);
        }
@@ -631,7 +645,7 @@ Session::locate (jack_nframes_t target_frame, bool with_roll, bool with_flush, b
                        RWLockMonitor dsm (diskstream_lock, false, __LINE__, __FILE__);
                        for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
                                if ((*i)->record_enabled ()) {
-                                       cerr << "switching from input" << __FILE__ << __LINE__ << endl << endl;
+                                       //cerr << "switching from input" << __FILE__ << __LINE__ << endl << endl;
                                        (*i)->monitor_input (!auto_input);
                                }
                        }
@@ -646,7 +660,7 @@ Session::locate (jack_nframes_t target_frame, bool with_roll, bool with_flush, b
                        RWLockMonitor dsm (diskstream_lock, false, __LINE__, __FILE__);
                        for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
                                if ((*i)->record_enabled ()) {
-                                       cerr << "switching to input" << __FILE__ << __LINE__ << endl << endl;
+                                       //cerr << "switching to input" << __FILE__ << __LINE__ << endl << endl;
                                        (*i)->monitor_input (true);
                                }
                        }
@@ -825,7 +839,7 @@ Session::start_transport ()
                break;
 
        case Recording:
-               disable_record ();
+               disable_record (false);
                break;
 
        default: