diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 3c01e73514..23074fa827 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2269,15 +2269,12 @@ what you would like to do.\n")); switch (dialog.run ()) { case RESPONSE_ACCEPT: - break; - default: return 1; + default: + return 0; } - - return 0; } - void ARDOUR_UI::disconnect_from_jack () { diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index ecdf4d67dd..b4a5413d04 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -141,10 +141,10 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt _route.panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans)); - solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press)); - solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release)); - mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press)); - mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release)); + solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press), false); + solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release), false); + mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press), false); + mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release), false); rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press)); edit_group_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::edit_click), false); playlist_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::playlist_click)); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index a82baa2dae..d69bfe43d3 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -313,10 +313,10 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) output_button.signal_button_release_event().connect (mem_fun(*this, &MixerStrip::output_press), false); rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press)); - solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press)); - solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release)); - mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press)); - mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release)); + solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press), false); + solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release), false); + mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press), false); + mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release), false); gain_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::gain_automation_style_button_event), false); gain_automation_style_button.signal_button_release_event().connect (mem_fun(*this, &MixerStrip::gain_automation_style_button_event), false); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index a96ca82009..8ed4bcd1c8 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -249,24 +249,23 @@ RouteUI::solo_press(GdkEventButton* ev) } } - return stop_signal (*solo_button, "button-press-event"); + return true; } gint RouteUI::solo_release(GdkEventButton* ev) { - if(!ignore_toggle){ - if (wait_for_release){ + if (!ignore_toggle) { + if (wait_for_release) { wait_for_release = false; // undo the last op // because the press was the last undoable thing we did _session.undo (1U); - - stop_signal (*solo_button, "button-release-event"); } } - return TRUE; + + return true; } gint diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index a422e52d3d..1e25c5f38b 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -320,7 +320,7 @@ class Session : public sigc::trackable, public Stateful bool record_enabling_legal () const; void maybe_enable_record (); - void disable_record (bool force = false); + void disable_record (bool rt_context, bool force = false); void step_back_from_record (); sigc::signal going_away; diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index b5bb83ee78..5e1f8251c7 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -452,8 +452,6 @@ DiskStream::setup_destructive_playlist () { AudioRegion::SourceList srcs; - cerr << "setting up destructive playlist with " << channels.size() << " channels\n"; - for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) { srcs.push_back ((*chan).write_source); } diff --git a/libs/ardour/filesource.cc b/libs/ardour/filesource.cc index bb14d31757..d4f728c13b 100644 --- a/libs/ardour/filesource.cc +++ b/libs/ardour/filesource.cc @@ -1417,7 +1417,7 @@ FileSource::repair (string path, jack_nframes_t rate) goto out; } - if (memcmp (&buf[0], "RIFF", 4) || memcmp (&buf[8], "WAVE", 4) || memcmp (&buf[0], "RIFX", 4)) { + if ((memcmp (&buf[0], "RIFF", 4) && memcmp (&buf[0], "RIFX", 4)) || memcmp (&buf[8], "WAVE", 4)) { /* no header. too dangerous to proceed */ goto out; } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 9b581ce790..71270f5e35 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1268,7 +1268,7 @@ Session::enable_record () } void -Session::disable_record (bool force) +Session::disable_record (bool rt_context, bool force) { RecordState rs; @@ -1299,7 +1299,10 @@ Session::disable_record (bool force) } RecordStateChanged (); /* emit signal */ - remove_pending_capture_state (); + + if (!rt_context) { + remove_pending_capture_state (); + } } } diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index cf97e47803..ec543f8fa1 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -214,6 +214,7 @@ Session::butler_thread_work () case ButlerRequest::Wake: break; + case ButlerRequest::Run: butler_should_run = true; break; diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 0ccea59b81..677b2c1258 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -508,7 +508,7 @@ Session::prepare_to_export (AudioExportSpecification& spec) /* make sure we are actually rolling */ if (get_record_enabled()) { - disable_record (); + disable_record (false); } _exporting = true; diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index b2b1d263a7..1ac7d9e300 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -637,7 +637,7 @@ void Session::mmc_record_exit (MIDI::MachineControl &mmc) { if (mmc_control) { - disable_record (); + disable_record (false); } } diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 6a42c0e4d1..58f1d7c0a0 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -765,8 +765,11 @@ Session::load_state (string snapshot_name) /* there is pending state from a crashed capture attempt */ if (AskAboutPendingState()) { + cerr << "use pending state\n"; state_was_pending = true; - } + } else { + cerr << "do not use pending state\n"; + } } if (!state_was_pending) { @@ -1270,7 +1273,7 @@ Session::get_template() sources in their state node. */ - disable_record (); + disable_record (false); return state(false); } diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index e2a9f23890..2f9f8257f9 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -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; @@ -405,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); } @@ -835,7 +839,7 @@ Session::start_transport () break; case Recording: - disable_record (); + disable_record (false); break; default: