diff options
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index f2d49fa1d7..8e5db51948 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -2311,133 +2311,6 @@ Editor::cancel_selection () void -Editor::single_contents_trim (RegionView& rv, framepos_t frame_delta, bool left_direction, bool swap_direction) -{ - boost::shared_ptr<Region> region (rv.region()); - - if (region->locked()) { - return; - } - - framepos_t new_bound; - - double speed = 1.0; - TimeAxisView* tvp = clicked_axisview; - RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp); - - if (tv && tv->is_track()) { - speed = tv->track()->speed(); - } - - if (left_direction) { - if (swap_direction) { - new_bound = (framepos_t) (region->position()/speed) + frame_delta; - } else { - new_bound = (framepos_t) (region->position()/speed) - frame_delta; - } - } else { - if (swap_direction) { - new_bound = (framepos_t) (region->position()/speed) - frame_delta; - } else { - new_bound = (framepos_t) (region->position()/speed) + frame_delta; - } - } - - region->trim_start ((framepos_t) (new_bound * speed), this); - rv.region_changed (PropertyChange (ARDOUR::Properties::start)); -} - -void -Editor::single_start_trim (RegionView& rv, framepos_t new_bound, bool no_overlap) -{ - boost::shared_ptr<Region> region (rv.region()); - - if (region->locked()) { - return; - } - - double speed = 1.0; - TimeAxisView* tvp = clicked_axisview; - RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp); - - if (tv && tv->is_track()) { - speed = tv->track()->speed(); - } - - framepos_t pre_trim_first_frame = region->first_frame(); - - region->trim_front ((framepos_t) (new_bound * speed), this); - - if (no_overlap) { - //Get the next region on the left of this region and shrink/expand it. - boost::shared_ptr<Playlist> playlist (region->playlist()); - boost::shared_ptr<Region> region_left = playlist->find_next_region (pre_trim_first_frame, End, 0); - - bool regions_touching = false; - - if (region_left != 0 && (pre_trim_first_frame == region_left->last_frame() + 1)){ - regions_touching = true; - } - - //Only trim region on the left if the first frame has gone beyond the left region's last frame. - if (region_left != 0 && - (region_left->last_frame() > region->first_frame() || regions_touching)) - { - region_left->trim_end(region->first_frame() - 1, this); - } - } - - rv.region_changed (ARDOUR::bounds_change); -} - -void -Editor::single_end_trim (RegionView& rv, framepos_t new_bound, bool no_overlap) -{ - boost::shared_ptr<Region> region (rv.region()); - - if (region->locked()) { - return; - } - - double speed = 1.0; - TimeAxisView* tvp = clicked_axisview; - RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp); - - if (tv && tv->is_track()) { - speed = tv->track()->speed(); - } - - framepos_t pre_trim_last_frame = region->last_frame(); - - region->trim_end ((framepos_t) (new_bound * speed), this); - - if (no_overlap) { - //Get the next region on the right of this region and shrink/expand it. - boost::shared_ptr<Playlist> playlist (region->playlist()); - boost::shared_ptr<Region> region_right = playlist->find_next_region (pre_trim_last_frame, Start, 1); - - bool regions_touching = false; - - if (region_right != 0 && (pre_trim_last_frame == region_right->first_frame() - 1)) { - regions_touching = true; - } - - //Only trim region on the right if the last frame has gone beyond the right region's first frame. - if (region_right != 0 && - (region_right->first_frame() < region->last_frame() || regions_touching)) - { - region_right->trim_front(region->last_frame() + 1, this); - } - - rv.region_changed (ARDOUR::bounds_change); - - } else { - rv.region_changed (PropertyChange (ARDOUR::Properties::length)); - } -} - - -void Editor::point_trim (GdkEvent* event, framepos_t new_bound) { RegionView* rv = clicked_regionview; @@ -2505,24 +2378,6 @@ Editor::point_trim (GdkEvent* event, framepos_t new_bound) } void -Editor::thaw_region_after_trim (RegionView& rv) -{ - boost::shared_ptr<Region> region (rv.region()); - - if (region->locked()) { - return; - } - - region->resume_property_changes (); - - AudioRegionView* arv = dynamic_cast<AudioRegionView*>(&rv); - - if (arv) { - arv->unhide_envelope (); - } -} - -void Editor::hide_marker (ArdourCanvas::Item* item, GdkEvent* /*event*/) { Marker* marker; |