From 9946e615cac53998de4a48c5f1fe061efa6edf1e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 21 Dec 2006 20:13:37 +0000 Subject: fix crashing bug on cut operation; panner noodling git-svn-id: svn://localhost/ardour2/trunk@1243 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour2_ui.rc | 8 ++++---- gtk2_ardour/panner.cc | 14 ++++---------- gtk2_ardour/panner.h | 2 -- gtk2_ardour/route_time_axis.cc | 1 - gtk2_ardour/time_axis_view.cc | 3 ++- libs/ardour/playlist.cc | 8 ++++++-- libs/ardour/playlist_factory.cc | 1 - libs/gtkmm2ext/barcontroller.cc | 16 ++++++---------- 8 files changed, 22 insertions(+), 31 deletions(-) diff --git a/gtk2_ardour/ardour2_ui.rc b/gtk2_ardour/ardour2_ui.rc index 074e75c0bc..771210829d 100644 --- a/gtk2_ardour/ardour2_ui.rc +++ b/gtk2_ardour/ardour2_ui.rc @@ -971,11 +971,11 @@ style "pan_slider" # used to draw the triangular indicators - base[NORMAL] = { 0.803, 0.792, 0.619 } - base[ACTIVE] = { 0.803, 0.792, 0.619 } + base[NORMAL] = { 0.80, 0.80, 0.80 } + base[ACTIVE] = { 0.80, 0.80, 0.80 } base[INSENSITIVE] = {0.32, 0.39, 0.45 } # matches default_base - base[SELECTED] = { 0.803, 0.792, 0.619 } - base[PRELIGHT] = { 0.803, 0.792, 0.619 } + base[SELECTED] = { 0.80, 0.80, 0.80 } + base[PRELIGHT] = { 0.80, 0.80, 0.80 } } diff --git a/gtk2_ardour/panner.cc b/gtk2_ardour/panner.cc index 49bdf778e4..89f86b3337 100644 --- a/gtk2_ardour/panner.cc +++ b/gtk2_ardour/panner.cc @@ -52,20 +52,20 @@ PannerBar::expose (GdkEventExpose* ev) // center - points[0].x = darea.get_width()/2 - (triangle_size - 2); + points[0].x = (darea.get_width()/2 - (triangle_size/2)) - 1; points[0].y = 0; - points[1].x = darea.get_width()/2 + (triangle_size - 2); + points[1].x = (darea.get_width()/2 + (triangle_size/2)) - 1; points[1].y = 0; points[2].x = darea.get_width()/2 - 1; - points[2].y = triangle_size - 3; + points[2].y = triangle_size - 1; gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3); // right - points[0].x = darea.get_width() - triangle_size; + points[0].x = (darea.get_width() - triangle_size) - 1; points[0].y = 0; points[1].x = darea.get_width(); @@ -116,9 +116,3 @@ PannerBar::button_release (GdkEventButton* ev) return BarController::button_release (ev); } -void -PannerBar::on_size_request (Gtk::Requisition* req) -{ - req->width = -1; - req->height = 50; -} diff --git a/gtk2_ardour/panner.h b/gtk2_ardour/panner.h index 580d8e9c67..d06a4c21e3 100644 --- a/gtk2_ardour/panner.h +++ b/gtk2_ardour/panner.h @@ -9,8 +9,6 @@ class PannerBar : public Gtkmm2ext::BarController PannerBar (Gtk::Adjustment& adj, PBD::Controllable&); ~PannerBar (); - void on_size_request (Gtk::Requisition*); - protected: bool expose (GdkEventExpose*); bool button_press (GdkEventButton*); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 87f5e8e7cc..67a86b385f 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1181,7 +1181,6 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op) playlist = ds->playlist(); - TimeSelection time (selection.time); float speed = ds->speed(); if (speed != 1.0f) { diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 2909fa46e9..36bf40ae36 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -761,8 +761,9 @@ TimeAxisView::get_selection_rect (uint32_t id) for (list::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) { if ((*i)->id == id) { + SelectionRect* ret = (*i); free_selection_rects.erase (i); - return (*i); + return ret; } } diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 8c1c608e1b..bdaa33f0aa 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -122,12 +122,14 @@ Playlist::Playlist (boost::shared_ptr other, string namestr, boo Playlist::Playlist (boost::shared_ptr other, nframes_t start, nframes_t cnt, string str, bool hide) : _name (str), _session (other->_session), _orig_diskstream_id(other->_orig_diskstream_id) { - RegionLock rlock2 (&((Playlist&)other)); - + RegionLock rlock2 (const_cast (other.get())); + nframes_t end = start + cnt - 1; init (hide); + in_set_state++; + for (RegionList::const_iterator i = other->regions.begin(); i != other->regions.end(); i++) { boost::shared_ptr region; @@ -178,6 +180,8 @@ Playlist::Playlist (boost::shared_ptr other, nframes_t start, nf add_region_internal (new_region, position); } + in_set_state--; + /* this constructor does NOT notify others (session) */ } diff --git a/libs/ardour/playlist_factory.cc b/libs/ardour/playlist_factory.cc index f5f19d5b5b..636b09213d 100644 --- a/libs/ardour/playlist_factory.cc +++ b/libs/ardour/playlist_factory.cc @@ -89,7 +89,6 @@ PlaylistFactory::create (boost::shared_ptr old, nframes_t start, pl->set_region_ownership (); } - /* this factory method does NOT notify others */ return pl; diff --git a/libs/gtkmm2ext/barcontroller.cc b/libs/gtkmm2ext/barcontroller.cc index 618891e424..cfa56eefbc 100644 --- a/libs/gtkmm2ext/barcontroller.cc +++ b/libs/gtkmm2ext/barcontroller.cc @@ -121,6 +121,8 @@ BarController::button_press (GdkEventButton* ev) bool BarController::button_release (GdkEventButton* ev) { + double fract; + switch (ev->button) { case 1: if (switch_on_release) { @@ -150,16 +152,10 @@ BarController::button_release (GdkEventButton* ev) break; case 2: - if (true) { // XXX FIX ME - /* relax */ - } else { - double fract; - fract = ev->x / (darea.get_width() - 2.0); - adjustment.set_value (adjustment.get_lower() + - fract * (adjustment.get_upper() - adjustment.get_lower())); - } - return true; - + fract = ev->x / (darea.get_width() - 2.0); + adjustment.set_value (adjustment.get_lower() + fract * (adjustment.get_upper() - adjustment.get_lower())); + break; + case 3: return false; -- cgit v1.2.3