[Summary] Fixed bug 45124: Tracks crashes if record was started while trimming region

[Details] Drags should be aborted when record starts
[Reviewed by QA] MKosharniy
This commit is contained in:
GZharun 2015-01-23 14:49:30 +02:00
parent 6505581165
commit bab88ebe9c
3 changed files with 13 additions and 2 deletions

View file

@ -1234,6 +1234,14 @@ Editor::start_session_auto_save_event_timing ()
_session_auto_save_timeout_connection = Glib::signal_timeout().connect (sigc::mem_fun (*this, &Editor::session_auto_save_timeout_callback), 1 * 1000);
}
void
Editor::on_record_state_changed ()
{
if (_session->actively_recording() ) {
_drags->abort ();
}
}
bool
Editor::session_auto_save_timeout_callback ()
{
@ -1478,6 +1486,7 @@ Editor::set_session (Session *t)
_session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context());
_session->RecordStateChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&Editor::start_lock_event_timing, this), gui_context());
_session->RecordStateChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::start_session_auto_save_event_timing, this), gui_context());
_session->RecordStateChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::on_record_state_changed, this), gui_context());
_session->locations()->session_range_location()->StartChanged.connect(_session_connections, invalidator (*this), boost::bind (&Editor::update_horizontal_adjustment_limits, this), gui_context() );
_session->locations()->session_range_location()->EndChanged.connect(_session_connections, invalidator (*this), boost::bind (&Editor::update_horizontal_adjustment_limits, this), gui_context() );

View file

@ -2016,6 +2016,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
bool on_key_press_event (GdkEventKey*);
bool on_key_release_event (GdkEventKey*);
void on_record_state_changed ();
void session_state_saved (std::string);
void set_session_dirty ();

View file

@ -390,7 +390,7 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll)
motion (event, first_move && !_starting_point_passed);
_starting_point_passed = first_move;
_last_pointer_x = _drags->current_pointer_x ();
_last_pointer_y = current_pointer_y ();
_last_pointer_frame = adjusted_current_frame (event);
@ -2500,7 +2500,7 @@ TrimDrag::aborted (bool movement_occurred)
finished (0, true);
if (movement_occurred) {
_editor->undo ();
_editor->session()->undo (1);
}
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {