X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_canvas.cc;h=2e92a374804a99ad06e6624d7296ac38b29f0d3a;hb=df28a71252f4593c65ec03611586dfc8a62a834f;hp=cf25538d492792c2e27733035174d1384274a4e6;hpb=dc61256466cb02daa4c6de0dbaebf4b9ed1325d6;p=ardour.git diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index cf25538d49..2e92a37480 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -373,6 +373,9 @@ Editor::track_canvas_drag_data_received (const RefPtr& context const SelectionData& data, guint info, guint time) { + if (!ARDOUR_UI_UTILS::engine_is_running ()) { + return; + } if (data.get_target() == "regions") { drop_regions (context, x, y, data, info, time); } else { @@ -584,24 +587,25 @@ Editor::autoscroll_active () const } std::pair -Editor::session_gui_extents ( bool use_extra ) const +Editor::session_gui_extents (bool use_extra) const { if (!_session) { return std::pair (max_samplepos,0); } - + samplecnt_t session_extent_start = _session->current_start_sample(); samplecnt_t session_extent_end = _session->current_end_sample(); - //calculate the extents of all regions in every playlist - //NOTE: we should listen to playlists, and cache these values so we don't calculate them every time. + /* calculate the extents of all regions in every playlist + * NOTE: we should listen to playlists, and cache these values so we don't calculate them every time. + */ { boost::shared_ptr rl = _session->get_routes(); for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) { boost::shared_ptr tr = boost::dynamic_pointer_cast (*r); if (tr) { boost::shared_ptr pl = tr->playlist(); - if ( pl && !pl->all_regions_empty() ) { + if (pl && !pl->all_regions_empty()) { pair e; e = pl->get_extent(); if (e.first < session_extent_start) { @@ -615,23 +619,23 @@ Editor::session_gui_extents ( bool use_extra ) const } } - //ToDo: also incorporate automation regions (in case the session has no audio/midi but is just used for automating plugins or the like) + /* ToDo: also incorporate automation regions (in case the session has no audio/midi but is just used for automating plugins or the like) */ - //add additional time to the ui extents ( user-defined in config ) + /* add additional time to the ui extents (user-defined in config) */ if (use_extra) { samplecnt_t const extra = UIConfiguration::instance().get_extra_ui_extents_time() * 60 * _session->nominal_sample_rate(); session_extent_end += extra; session_extent_start -= extra; } - - //range-check + + /* range-check */ if (session_extent_end > max_samplepos) { session_extent_end = max_samplepos; } if (session_extent_start < 0) { session_extent_start = 0; } - + std::pair ret (session_extent_start, session_extent_end); return ret; } @@ -667,7 +671,7 @@ Editor::autoscroll_canvas () dx += 10 + (2 * (autoscroll_cnt/2)); dx = pixel_to_sample (dx); - + dx *= UIConfiguration::instance().get_draggable_playhead_speed(); if (_leftmost_sample < max_samplepos - dx) { @@ -1336,13 +1340,13 @@ Editor::which_canvas_cursor(ItemType type) const cursor = _cursors->cross_hair; break; case LeftFrameHandle: - if ( effective_mouse_mode() == MouseObject ) // (smart mode): if the user is in the btm half, show the trim cursor + if (effective_mouse_mode() == MouseObject) // (smart mode): if the user is in the btm half, show the trim cursor cursor = which_trim_cursor (true); else - cursor = _cursors->selector; // (smart mode): in the top half, just show the selection (range) cursor + cursor = _cursors->selector; // (smart mode): in the top half, just show the selection (range) cursor break; case RightFrameHandle: - if ( effective_mouse_mode() == MouseObject ) //see above + if (effective_mouse_mode() == MouseObject) // see above cursor = which_trim_cursor (false); else cursor = _cursors->selector;