diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index caaa5744f1..76e15aa528 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -61,15 +61,7 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv) crossfades_visible = true; _waveform_scale = LinearWaveform; _waveform_shape = Traditional; - - if (tv.is_track()) - stream_base_color = ARDOUR_UI::config()->canvasvar_AudioTrackBase.get(); - else - stream_base_color = ARDOUR_UI::config()->canvasvar_AudioBusBase.get(); - - canvas_rect->property_fill_color_rgba() = stream_base_color; - canvas_rect->property_outline_color_rgba() = RGBA_BLACK; - + color_handler (); _amplitude_above_axis = 1.0; use_rec_regions = tv.editor.show_waveforms_recording (); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index dc791996cd..778cdd73a6 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4653,10 +4653,8 @@ Editor::idle_visual_changer () /* if we seek beyond the current end of the canvas, move the end */ if (current_time_origin != pending_visual_change.time_origin) { - //if (horizontal_adjustment.get_upper() < pending_visual_change.time_origin) { last_canvas_frame = (cef > (pending_visual_change.time_origin + current_page_frames())) ? cef : pending_visual_change.time_origin + current_page_frames(); horizontal_adjustment.set_upper ((cef - csf) / frames_per_unit); - //} horizontal_adjustment.set_value (pending_visual_change.time_origin / frames_per_unit); } else { update_fixed_rulers(); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index ec1315d40a..e1140bb646 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -141,11 +141,18 @@ Editor::initialize_canvas () transport_loop_range_rect->property_outline_pixels() = 1; transport_loop_range_rect->hide(); + transport_punch_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0); + transport_punch_range_rect->property_outline_pixels() = 0; + transport_punch_range_rect->hide(); + /* a group to hold time (measure) lines */ time_line_group = new ArdourCanvas::Group (*_master_group, 0.0, 0.0); + range_marker_drag_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0); + range_marker_drag_rect->hide (); + _trackview_group = new ArdourCanvas::Group (*_master_group, 0.0, 0.0); - _region_motion_group = new ArdourCanvas::Group (*_master_group, 0.0, 0.0); + _region_motion_group = new ArdourCanvas::Group (*_trackview_group, 0.0, 0.0); /* el barrio */ @@ -179,10 +186,6 @@ Editor::initialize_canvas () cd_marker_bar->property_outline_what() = (0x1 | 0x8); cd_marker_bar->property_outline_pixels() = 1; - range_marker_drag_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0); - //range_marker_drag_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0); - range_marker_drag_rect->hide (); - timebar_group = new ArdourCanvas::Group (*track_canvas->root()); cursor_group = new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0); @@ -213,11 +216,6 @@ Editor::initialize_canvas () transport_bar_drag_rect->property_outline_pixels() = 0; transport_bar_drag_rect->hide (); - transport_punch_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0); - transport_punch_range_rect->property_outline_pixels() = 0; - transport_punch_range_rect->hide(); - -// transport_loop_range_rect->lower_to_bottom (); // loop on the bottom transport_punchin_line = new ArdourCanvas::SimpleLine (*_master_group); transport_punchin_line->property_x1() = 0.0; @@ -252,9 +250,6 @@ Editor::initialize_canvas () cd_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_cd_marker_bar_event), cd_marker_bar)); range_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_range_marker_bar_event), range_marker_bar)); transport_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_transport_marker_bar_event), transport_marker_bar)); - - ZoomChanged.connect (bind (mem_fun(*this, &Editor::update_loop_range_view), false)); - ZoomChanged.connect (bind (mem_fun(*this, &Editor::update_punch_range_view), false)); playhead_cursor = new Cursor (*this, &Editor::canvas_playhead_cursor_event); @@ -870,6 +865,8 @@ Editor::scroll_canvas_horizontally () _master_group->move (-x_delta, 0); timebar_group->move (-x_delta, 0); cursor_group->move (-x_delta, 0); + update_fixed_rulers (); + redisplay_tempo (true); } void @@ -879,15 +876,12 @@ Editor::scroll_canvas_vertically () double x1, x2, y1, y2, y_delta; _trackview_group->get_bounds(x1, y1, x2, y2); - y_delta = y1 + vertical_adjustment.get_value() - canvas_timebars_vsize; + y_delta = y1 + get_trackview_group_vertical_offset (); _trackview_group->move (0, -y_delta); - _region_motion_group->move (0, -y_delta); -#ifndef GTKOSX /* required to keep the controls_layout in lock step with the canvas group */ track_canvas->update_now (); -#endif } void @@ -898,6 +892,7 @@ Editor::canvas_horizontally_scrolled () if (time_origin != leftmost_frame) { canvas_scroll_to (time_origin); } + redisplay_tempo (true); } void @@ -910,11 +905,6 @@ Editor::canvas_scroll_to (nframes64_t time_origin) last_canvas_frame = rightmost_frame; //reset_scrolling_region (); } - - update_fixed_rulers (); - - //redisplay_tempo (!_dragging_hscrollbar); - redisplay_tempo (true); } void diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 508d73a01a..2d1b34575a 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -1149,17 +1149,15 @@ Editor::update_punch_range_view (bool visibility) if ((Config->get_punch_in() || Config->get_punch_out()) && ((tpl = transport_punch_location()) != 0)) { - double x1 = frame_to_pixel (tpl->start()); - double x2 = frame_to_pixel (tpl->end()); - guint track_canvas_width,track_canvas_height; track_canvas->get_size(track_canvas_width,track_canvas_height); - - transport_punch_range_rect->property_x1() = x1; - transport_punch_range_rect->property_x2() = x2; - - transport_punch_range_rect->property_x1() = (Config->get_punch_in() ? x1 : 0); - transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? x2 : track_canvas_width); + if (Config->get_punch_in()) { + transport_punch_range_rect->property_x1() = frame_to_pixel (tpl->start()); + transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? frame_to_pixel (tpl->end()) : frame_to_pixel (JACK_MAX_FRAMES)); + } else { + transport_punch_range_rect->property_x1() = 0; + transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? frame_to_pixel (tpl->end()) : track_canvas_width); + } if (visibility) { transport_punch_range_rect->show(); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index ca71c13c48..8d1332c55d 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -1879,6 +1879,7 @@ Editor::finalize_drag () drag_info.last_pointer_frame = 0; drag_info.current_pointer_frame = 0; drag_info.brushing = false; + range_marker_drag_rect->hide(); drag_info.clear_copied_locations (); } @@ -3184,7 +3185,7 @@ Editor::start_region_grab (ArdourCanvas::Item* item, GdkEvent* event) if (selection->regions.empty() || clicked_regionview == 0) { return; } - + _region_motion_group->raise_to_top (); drag_info.copy = false; drag_info.item = item; drag_info.data = clicked_regionview; @@ -3213,19 +3214,9 @@ Editor::start_region_grab (ArdourCanvas::Item* item, GdkEvent* event) drag_info.dest_trackview = drag_info.source_trackview; // we want a move threshold drag_info.want_move_threshold = true; - show_verbose_time_cursor (drag_info.last_frame_position, 10); begin_reversible_command (_("move region(s)")); - /* - the group containing moved regions may have been - offset during autoscroll. reset its y offset - (we should really handle this in the same way - we do with the x axis, but a simple way of achieving that - eludes me right now). - */ - - _region_motion_group->property_y() = 0; /* sync the canvas to what we think is its current state */ track_canvas->update_now(); @@ -3251,7 +3242,7 @@ Editor::start_region_copy_grab (ArdourCanvas::Item* item, GdkEvent* event) if (selection->regions.empty() || clicked_regionview == 0) { return; } - + _region_motion_group->raise_to_top (); drag_info.copy = true; drag_info.item = item; drag_info.data = clicked_regionview; @@ -3275,8 +3266,6 @@ Editor::start_region_copy_grab (ArdourCanvas::Item* item, GdkEvent* event) drag_info.motion_callback = &Editor::region_drag_motion_callback; drag_info.finished_callback = &Editor::region_drag_finished_callback; show_verbose_time_cursor (drag_info.last_frame_position, 10); - - _region_motion_group->property_y() = 0; } void @@ -3400,7 +3389,7 @@ Editor::check_region_drag_possible (RouteTimeAxisView** tv) hide_verbose_canvas_cursor (); return false; } - + return true; } @@ -3742,7 +3731,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) if (-x_delta > ix1 + horizontal_adjustment.get_value()) { // do_move = false; - cerr << "illegal move" << endl; x_delta = 0; pending_region_position = drag_info.last_frame_position; break; @@ -3806,6 +3794,13 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) rv->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2); rv->get_canvas_frame()->i2w (ix1, iy1); + + cerr << "adjust y from " << iy1 << " using " + << vertical_adjustment.get_value() << " - " + << canvas_timebars_vsize + << endl; + + iy1 += get_trackview_group_vertical_offset ();; if (drag_info.first_move) { @@ -3825,16 +3820,6 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) rv->fake_set_opaque (true); } - /* for evaluation of the track position of iy1, we have to adjust - to allow for the vertical scrolling adjustment and the height of the timebars. - */ - - cerr << "adjust y from " << iy1 << " using " - << vertical_adjustment.get_value() << " - " - << canvas_timebars_vsize - << endl; - - iy1 += vertical_adjustment.get_value() - canvas_timebars_vsize; TimeAxisView* tvp2 = trackview_by_y_position (iy1); RouteTimeAxisView* canvas_rtv = dynamic_cast(tvp2); @@ -3957,13 +3942,6 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event nocommit = false; - /* XXX is this true??? i can''t tell the difference. - The regionview has been moved at some stage during the grab so we need - to account for any mouse movement between this event and the last one. - */ - - //region_drag_motion_callback (item, event); - if (Config->get_edit_mode() == Splice && !pre_drag_region_selection.empty()) { selection->set (pre_drag_region_selection); pre_drag_region_selection.clear (); diff --git a/gtk2_ardour/tempo_lines.cc b/gtk2_ardour/tempo_lines.cc index 3d2f54a2ff..ec0be1415e 100644 --- a/gtk2_ardour/tempo_lines.cc +++ b/gtk2_ardour/tempo_lines.cc @@ -45,10 +45,10 @@ TempoLines::tempo_map_changed() for (Lines::iterator i = _lines.begin(); i != _lines.end(); ++d) { Lines::iterator next = i; ++next; - i->second->property_x1() = DBL_MAX - d; - i->second->property_x2() = DBL_MAX - d; + i->second->property_x1() = - d; + i->second->property_x2() = - d; _lines.erase(i); - _lines.insert(make_pair(DBL_MAX - d, i->second)); + _lines.insert(make_pair(- d, i->second)); i = next; } }