fix problem with x-axis origin computation moving the origin at the wrong time

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2820 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-01-02 21:54:33 +00:00
parent 284185ca73
commit 4dedfa9eb4
5 changed files with 9 additions and 21 deletions

View file

@ -4087,13 +4087,14 @@ Editor::idle_visual_changer ()
pending_visual_change.pending = (VisualChange::Type) 0;
pending_visual_change.idle_handler_id = -1;
if (p & VisualChange::ZoomLevel) {
set_frames_per_unit (pending_visual_change.frames_per_unit);
}
if (p & VisualChange::TimeOrigin) {
if (pending_visual_change.time_origin != leftmost_frame) {
double val = horizontal_adjustment.get_value();
if ((nframes_t) floor (val * frames_per_unit) != pending_visual_change.time_origin) {
horizontal_adjustment.set_value (pending_visual_change.time_origin/frames_per_unit);
/* the signal handler will do the rest */
} else {

View file

@ -371,7 +371,7 @@ Editor::reset_scrolling_region (Gtk::Allocation* alloc)
transport_punchin_line->property_y2() = track_canvas_height;
transport_punchout_line->property_y2() = track_canvas_height;
update_punch_range_view(true);
update_punch_range_view (true);
controls_layout.queue_resize();
}
@ -695,7 +695,7 @@ Editor::canvas_horizontally_scrolled ()
leftmost_frame = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
nframes_t rightmost_frame = leftmost_frame + current_page_frames ();
if (rightmost_frame > last_canvas_frame) {
last_canvas_frame = rightmost_frame;
reset_scrolling_region ();

View file

@ -735,8 +735,9 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
} else {
start_region_grab (item, event);
}
return true;
break;
case GainAutomationControlPointItem:
case PanAutomationControlPointItem:
case RedirectAutomationControlPointItem:
@ -3121,7 +3122,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
possibly_copy_regions_during_grab (event);
if (!check_region_drag_possible (&tv)) {
cerr << "early return in RDMC\n";
return;
}
@ -3137,12 +3137,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
goto y_axis_done;
}
cerr << "last tv order = " << drag_info.last_trackview->name() << " order = "
<< drag_info.last_trackview->order
<< " vs " << tv->name()
<< " order " << tv->order
<< endl;
if ((pointer_y_span = (drag_info.last_trackview->order - tv->order)) != 0) {
int32_t children = 0, numtracks = 0;
@ -3150,8 +3144,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
bitset <1024> tracks (0x00);
/* get a bitmask representing the visible tracks */
cerr << "Pointer y span non zero (" << pointer_y_span << ")\n";
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
TimeAxisView *tracklist_timeview;
tracklist_timeview = (*i);
@ -3362,8 +3354,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
PREPARE TO MOVE
************************************************************/
cerr << "prep +> xdelta = " << x_delta << " pys = " << pointer_y_span << endl;
if (x_delta == 0 && (pointer_y_span == 0)) {
/* haven't reached next snap point, and we're not switching
trackviews. nothing to do.
@ -3411,8 +3401,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
const list<RegionView*>& layered_regions = selection->regions.by_layer();
cerr << "moving " << layered_regions.size() << "regions\n";
for (list<RegionView*>::const_iterator i = layered_regions.begin(); i != layered_regions.end(); ++i) {
RegionView* rv = (*i);
@ -3519,8 +3507,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
rv->fake_set_opaque (true);
}
cerr << "about to move, xd = " << x_delta << " yd = " << y_delta << endl;
if (drag_info.brushing) {
mouse_brush_insert_region (rv, pending_region_position);
} else {

View file

@ -382,6 +382,8 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
vector<RegionView*> all_equivalent_regions;
bool commit = false;
cerr << "Set selected regionview from click, op = " << op << " press ? " << press << " ntr ? " << no_track_remove << endl;
if (!clicked_regionview || !clicked_audio_trackview) {
return false;
}

View file

@ -219,7 +219,6 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
canvas_display->show();/* XXX not necessary */
y_position = y;
order = nth;
cerr << name() << " has order set to " << nth << endl;
_hidden = false;
/* height in pixels depends on _order, so update it now we've changed _order */