2 Copyright (C) 2005 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <libgnomecanvasmm/init.h>
21 #include <jack/types.h>
22 #include <gtkmm2ext/utils.h>
24 #include <ardour/audioregion.h>
26 #include "ardour_ui.h"
29 #include "simplerect.h"
30 #include "simpleline.h"
31 #include "waveview_p.h"
32 #include "simplerect_p.h"
33 #include "simpleline_p.h"
34 #include "canvas_impl.h"
36 #include "rgb_macros.h"
38 #include "time_axis_view.h"
39 #include "audio_time_axis.h"
42 #include "imageframe.h"
43 #include "imageframe_p.h"
50 using namespace ARDOUR;
54 using namespace Gtkmm2ext;
55 using namespace Editing;
57 /* XXX this is a hack. it ought to be the maximum value of an nframes_t */
59 const double max_canvas_coordinate = (double) JACK_MAX_FRAMES;
64 GType gnome_canvas_simpleline_get_type(void);
65 GType gnome_canvas_simplerect_get_type(void);
66 GType gnome_canvas_waveview_get_type(void);
69 GType gnome_canvas_imageframe_get_type(void);
74 static void ardour_canvas_type_init()
76 // Map gtypes to gtkmm wrapper-creation functions:
78 Glib::wrap_register(gnome_canvas_simpleline_get_type(), &Gnome::Canvas::SimpleLine_Class::wrap_new);
79 Glib::wrap_register(gnome_canvas_simplerect_get_type(), &Gnome::Canvas::SimpleRect_Class::wrap_new);
80 Glib::wrap_register(gnome_canvas_waveview_get_type(), &Gnome::Canvas::WaveView_Class::wrap_new);
83 Glib::wrap_register(gnome_canvas_imageframe_get_type(), &Gnome::Canvas::ImageFrame_Class::wrap_new);
86 // Register the gtkmm gtypes:
88 (void) Gnome::Canvas::WaveView::get_type();
89 (void) Gnome::Canvas::SimpleLine::get_type();
90 (void) Gnome::Canvas::SimpleRect::get_type();
93 (void) Gnome::Canvas::ImageFrame::get_type();
98 Editor::initialize_canvas ()
100 ArdourCanvas::init ();
101 ardour_canvas_type_init ();
103 /* don't try to center the canvas */
105 track_canvas.set_center_scroll_region (false);
106 track_canvas.set_dither (Gdk::RGB_DITHER_NONE);
108 /* need to handle 4 specific types of events as catch-alls */
110 track_canvas.signal_scroll_event().connect (mem_fun (*this, &Editor::track_canvas_scroll_event));
111 track_canvas.signal_motion_notify_event().connect (mem_fun (*this, &Editor::track_canvas_motion_notify_event));
112 track_canvas.signal_button_press_event().connect (mem_fun (*this, &Editor::track_canvas_button_press_event));
113 track_canvas.signal_button_release_event().connect (mem_fun (*this, &Editor::track_canvas_button_release_event));
115 track_canvas.set_name ("EditorMainCanvas");
116 track_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK);
117 track_canvas.signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
118 track_canvas.set_flags (CAN_FOCUS);
120 /* set up drag-n-drop */
122 vector<TargetEntry> target_table;
124 // Drag-N-Drop from the region list can generate this target
125 target_table.push_back (TargetEntry ("regions"));
127 target_table.push_back (TargetEntry ("text/plain"));
128 target_table.push_back (TargetEntry ("text/uri-list"));
129 target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
131 track_canvas.drag_dest_set (target_table);
132 track_canvas.signal_drag_data_received().connect (mem_fun(*this, &Editor::track_canvas_drag_data_received));
134 /* stuff for the verbose canvas cursor */
136 Pango::FontDescription* font = get_font_for_style (N_("VerboseCanvasCursor"));
138 verbose_canvas_cursor = new ArdourCanvas::Text (*track_canvas.root());
139 verbose_canvas_cursor->property_font_desc() = *font;
140 verbose_canvas_cursor->property_anchor() = ANCHOR_NW;
144 verbose_cursor_visible = false;
146 cursor_group = new ArdourCanvas::Group (*track_canvas.root(), 0.0, 0.0);
148 time_line_group = new ArdourCanvas::Group (*track_canvas.root(), 0.0, 0.0);
149 tempo_lines = new TempoLines(track_canvas, time_line_group);
151 time_canvas.set_name ("EditorTimeCanvas");
152 time_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK);
153 time_canvas.set_flags (CAN_FOCUS);
154 time_canvas.set_center_scroll_region (false);
155 time_canvas.set_dither (Gdk::RGB_DITHER_NONE);
157 marker_time_line_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0);
158 marker_tempo_lines = new TempoLines(time_canvas, marker_time_line_group);
160 meter_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0);
161 tempo_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height);
162 marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 2.0);
163 range_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 3.0);
164 transport_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 4.0);
166 tempo_bar = new ArdourCanvas::SimpleRect (*tempo_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
167 tempo_bar->property_outline_what() = (0x1 | 0x8);
168 tempo_bar->property_outline_pixels() = 1;
170 meter_bar = new ArdourCanvas::SimpleRect (*meter_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
171 meter_bar->property_outline_what() = (0x1 | 0x8);
172 meter_bar->property_outline_pixels() = 1;
174 marker_bar = new ArdourCanvas::SimpleRect (*marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
175 marker_bar->property_outline_what() = (0x1 | 0x8);
176 marker_bar->property_outline_pixels() = 1;
178 range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
179 range_marker_bar->property_outline_what() = (0x1 | 0x8);
180 range_marker_bar->property_outline_pixels() = 1;
182 transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
183 transport_marker_bar->property_outline_what() = (0x1 | 0x8);
184 transport_marker_bar->property_outline_pixels() = 1;
186 range_bar_drag_rect = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
187 range_bar_drag_rect->property_outline_pixels() = 0;
188 range_bar_drag_rect->hide ();
190 transport_bar_drag_rect = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
191 transport_bar_drag_rect->property_outline_pixels() = 0;
192 transport_bar_drag_rect->hide ();
194 marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
195 marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
197 marker_drag_line = new ArdourCanvas::Line (*track_canvas.root());
198 marker_drag_line->property_width_pixels() = 1;
199 marker_drag_line->property_points() = marker_drag_line_points;
200 marker_drag_line->hide();
202 range_marker_drag_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
203 range_marker_drag_rect->hide ();
205 transport_loop_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
206 transport_loop_range_rect->property_outline_pixels() = 1;
207 transport_loop_range_rect->hide();
209 transport_punch_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
210 transport_punch_range_rect->property_outline_pixels() = 0;
211 transport_punch_range_rect->hide();
213 transport_loop_range_rect->lower_to_bottom (); // loop on the bottom
215 transport_punchin_line = new ArdourCanvas::SimpleLine (*time_line_group);
216 transport_punchin_line->property_x1() = 0.0;
217 transport_punchin_line->property_y1() = 0.0;
218 transport_punchin_line->property_x2() = 0.0;
219 transport_punchin_line->property_y2() = 0.0;
220 transport_punchin_line->hide ();
222 transport_punchout_line = new ArdourCanvas::SimpleLine (*time_line_group);
223 transport_punchout_line->property_x1() = 0.0;
224 transport_punchout_line->property_y1() = 0.0;
225 transport_punchout_line->property_x2() = 0.0;
226 transport_punchout_line->property_y2() = 0.0;
227 transport_punchout_line->hide();
229 // used to show zoom mode active zooming
230 zoom_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
231 zoom_rect->property_outline_pixels() = 1;
234 zoom_rect->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_zoom_rect_event), (ArdourCanvas::Item*) 0));
236 // used as rubberband rect
237 rubberband_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
238 rubberband_rect->property_outline_pixels() = 1;
239 rubberband_rect->hide();
241 tempo_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_tempo_bar_event), tempo_bar));
242 meter_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_meter_bar_event), meter_bar));
243 marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_marker_bar_event), marker_bar));
244 range_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_range_marker_bar_event), range_marker_bar));
245 transport_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_transport_marker_bar_event), transport_marker_bar));
247 ZoomChanged.connect (bind (mem_fun(*this, &Editor::update_loop_range_view), false));
248 ZoomChanged.connect (bind (mem_fun(*this, &Editor::update_punch_range_view), false));
250 double time_height = timebar_height * 5;
251 double time_width = FLT_MAX/frames_per_unit;
252 time_canvas.set_scroll_region(0.0, 0.0, time_width, time_height);
254 edit_cursor = new Cursor (*this, &Editor::canvas_edit_cursor_event);
255 playhead_cursor = new Cursor (*this, &Editor::canvas_playhead_cursor_event);
257 initial_ruler_update_required = true;
258 track_canvas.signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate));
260 ColorsChanged.connect (mem_fun (*this, &Editor::color_handler));
266 Editor::track_canvas_allocate (Gtk::Allocation alloc)
268 canvas_allocation = alloc;
270 if (!initial_ruler_update_required) {
271 if (!canvas_idle_queued) {
272 /* call this first so that we do stuff before any pending redraw */
273 Glib::signal_idle().connect (mem_fun (*this, &Editor::track_canvas_size_allocated), false);
274 canvas_idle_queued = true;
279 initial_ruler_update_required = false;
281 track_canvas_size_allocated ();
285 Editor::track_canvas_size_allocated ()
287 if (canvas_idle_queued) {
288 canvas_idle_queued = false;
291 canvas_width = canvas_allocation.get_width();
292 canvas_height = canvas_allocation.get_height();
294 full_canvas_height = canvas_height;
297 TrackViewList::iterator i;
300 for (i = track_views.begin(); i != track_views.end(); ++i) {
301 if ((*i)->control_parent) {
302 height += (*i)->effective_height;
306 full_canvas_height = height;
309 zoom_range_clock.set ((nframes_t) floor ((canvas_width * frames_per_unit)));
310 edit_cursor->set_position (edit_cursor->current_frame);
311 playhead_cursor->set_position (playhead_cursor->current_frame);
313 reset_hscrollbar_stepping ();
314 reset_scrolling_region ();
316 if (edit_cursor) edit_cursor->set_length (canvas_height);
317 if (playhead_cursor) playhead_cursor->set_length (canvas_height);
319 if (marker_drag_line) {
320 marker_drag_line_points.back().set_y(canvas_height);
321 marker_drag_line->property_points() = marker_drag_line_points;
324 if (range_marker_drag_rect) {
325 range_marker_drag_rect->property_y1() = 0.0;
326 range_marker_drag_rect->property_y2() = canvas_height;
329 if (transport_loop_range_rect) {
330 transport_loop_range_rect->property_y1() = 0.0;
331 transport_loop_range_rect->property_y2() = canvas_height;
334 if (transport_punch_range_rect) {
335 transport_punch_range_rect->property_y1() = 0.0;
336 transport_punch_range_rect->property_y2() = canvas_height;
339 if (transport_punchin_line) {
340 transport_punchin_line->property_y1() = 0.0;
341 transport_punchin_line->property_y2() = canvas_height;
344 if (transport_punchout_line) {
345 transport_punchout_line->property_y1() = 0.0;
346 transport_punchout_line->property_y2() = canvas_height;
349 update_fixed_rulers();
350 redisplay_tempo (true);
352 Resized (); /* EMIT_SIGNAL */
358 Editor::reset_scrolling_region (Gtk::Allocation* alloc)
360 TreeModel::Children rows = route_display_model->children();
361 TreeModel::Children::iterator i;
364 for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
365 TimeAxisView *tv = (*i)[route_display_columns.tv];
366 if (tv != 0 && !tv->hidden()) {
367 pos += tv->effective_height;
371 double last_canvas_unit = last_canvas_frame / frames_per_unit;
373 track_canvas.set_scroll_region (0.0, 0.0, max (last_canvas_unit, canvas_width), pos);
375 // XXX what is the correct height value for the time canvas ? this overstates it
376 time_canvas.set_scroll_region ( 0.0, 0.0, max (last_canvas_unit, canvas_width), canvas_height);
378 controls_layout.queue_resize();
382 Editor::controls_layout_size_request (Requisition* req)
384 TreeModel::Children rows = route_display_model->children();
385 TreeModel::Children::iterator i;
388 for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
389 TimeAxisView *tv = (*i)[route_display_columns.tv];
391 pos += tv->effective_height;
395 RefPtr<Gdk::Screen> screen = get_screen();
398 screen = Gdk::Screen::get_default();
401 /* never let the width of the controls area shrink horizontally */
403 edit_controls_vbox.check_resize();
405 req->width = max (edit_controls_vbox.get_width(), controls_layout.get_width());
407 /* don't get too big. the fudge factors here are just guesses */
409 req->width = min (req->width, screen->get_width() - 300);
410 req->height = min ((gint) pos, (screen->get_height() - 400));
412 /* this one is important: it determines how big the layout thinks it really is, as
413 opposed to what it displays on the screen
416 controls_layout.set_size (req->width, (gint) pos);
420 Editor::track_canvas_map_handler (GdkEventAny* ev)
422 track_canvas.get_window()->set_cursor (*current_canvas_cursor);
427 Editor::time_canvas_map_handler (GdkEventAny* ev)
429 time_canvas.get_window()->set_cursor (*timebar_cursor);
434 Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context,
436 const SelectionData& data,
437 guint info, guint time)
439 if (data.get_target() == "regions") {
440 drop_regions (context, x, y, data, info, time);
442 drop_paths (context, x, y, data, info, time);
447 Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
449 const SelectionData& data,
450 guint info, guint time)
453 RouteTimeAxisView* tv;
455 vector<ustring> paths;
460 if (convert_drop_to_paths (paths, context, x, y, data, info, time)) {
464 /* D-n-D coordinates are window-relative, so convert to "world" coordinates
470 track_canvas.window_to_world (x, y, wx, wy);
471 wx += horizontal_adjustment.get_value();
472 wy += vertical_adjustment.get_value();
474 ev.type = GDK_BUTTON_RELEASE;
478 frame = event_frame (&ev, 0, &cy);
482 if ((tvp = trackview_by_y_position (cy)) == 0) {
484 /* drop onto canvas background: create new tracks */
487 do_embed (paths, false, ImportAsTrack, 0, pos, false);
489 } else if ((tv = dynamic_cast<RouteTimeAxisView*>(tvp)) != 0) {
491 /* check that its an audio track, not a bus */
493 if (tv->get_diskstream()) {
494 do_embed (paths, false, ImportToTrack, tv->audio_track().get(), frame, true);
499 context->drag_finish (true, false, time);
503 Editor::drop_regions (const RefPtr<Gdk::DragContext>& context,
505 const SelectionData& data,
506 guint info, guint time)
508 const SerializedObjectPointers<boost::shared_ptr<Region> >* sr =
509 reinterpret_cast<const SerializedObjectPointers<boost::shared_ptr<Region> > *> (data.get_data());
511 for (uint32_t i = 0; i < sr->cnt; ++i) {
513 boost::shared_ptr<Region> r = sr->data[i];
515 insert_region_list_drag (r, x, y);
518 context->drag_finish (true, false, time);
522 Editor::maybe_autoscroll (GdkEvent* event)
524 nframes_t rightmost_frame = leftmost_frame + current_page_frames();
525 nframes_t frame = drag_info.current_pointer_frame;
526 bool startit = false;
528 static int last_autoscroll_direction = 0;
530 if (frame > rightmost_frame) {
532 if (rightmost_frame < max_frames) {
533 autoscroll_direction = 1;
537 } else if (frame < leftmost_frame) {
539 if (leftmost_frame > 0) {
540 autoscroll_direction = -1;
546 if (drag_info.last_pointer_frame > drag_info.current_pointer_frame) {
547 autoscroll_direction = -1;
549 autoscroll_direction = 1;
554 if ((autoscroll_direction != last_autoscroll_direction) || (leftmost_frame < frame < rightmost_frame)) {
555 stop_canvas_autoscroll ();
558 if (startit && autoscroll_timeout_tag < 0) {
559 start_canvas_autoscroll (autoscroll_direction);
562 last_autoscroll_direction = autoscroll_direction;
566 Editor::_autoscroll_canvas (void *arg)
568 return ((Editor *) arg)->autoscroll_canvas ();
572 Editor::autoscroll_canvas ()
575 nframes_t limit = max_frames - current_page_frames();
577 nframes_t target_frame;
579 if (autoscroll_direction < 0) {
580 if (leftmost_frame < autoscroll_distance) {
583 new_frame = leftmost_frame - autoscroll_distance;
585 target_frame = drag_info.current_pointer_frame - autoscroll_distance;
587 if (leftmost_frame > limit - autoscroll_distance) {
590 new_frame = leftmost_frame + autoscroll_distance;
592 target_frame = drag_info.current_pointer_frame + autoscroll_distance;
595 /* now fake a motion event to get the object that is being dragged to move too */
597 ev.type = GDK_MOTION_NOTIFY;
598 ev.state &= Gdk::BUTTON1_MASK;
599 ev.x = frame_to_unit (target_frame);
600 ev.y = drag_info.current_pointer_y;
601 motion_handler (drag_info.item, (GdkEvent*) &ev, drag_info.item_type, true);
603 if (new_frame == 0 || new_frame == limit) {
610 if (autoscroll_cnt == 1) {
612 /* connect the timeout so that we get called repeatedly */
614 autoscroll_timeout_tag = g_idle_add ( _autoscroll_canvas, this);
619 if (new_frame != leftmost_frame) {
620 reset_x_origin (new_frame);
623 if (autoscroll_cnt == 50) { /* 0.5 seconds */
625 /* after about a while, speed up a bit by changing the timeout interval */
627 autoscroll_distance = (nframes_t) floor (current_page_frames()/30.0f);
629 } else if (autoscroll_cnt == 150) { /* 1.0 seconds */
631 autoscroll_distance = (nframes_t) floor (current_page_frames()/20.0f);
633 } else if (autoscroll_cnt == 300) { /* 1.5 seconds */
635 /* after about another while, speed up by increasing the shift per callback */
637 autoscroll_distance = (nframes_t) floor (current_page_frames()/10.0f);
645 Editor::start_canvas_autoscroll (int dir)
647 if (!session || autoscroll_active) {
651 stop_canvas_autoscroll ();
653 autoscroll_active = true;
654 autoscroll_direction = dir;
655 autoscroll_distance = (nframes_t) floor (current_page_frames()/50.0);
658 /* do it right now, which will start the repeated callbacks */
660 autoscroll_canvas ();
664 Editor::stop_canvas_autoscroll ()
666 if (autoscroll_timeout_tag >= 0) {
667 g_source_remove (autoscroll_timeout_tag);
668 autoscroll_timeout_tag = -1;
671 autoscroll_active = false;
675 Editor::left_track_canvas (GdkEventCrossing *ev)
677 set_entered_track (0);
678 set_entered_regionview (0);
684 Editor::canvas_horizontally_scrolled ()
686 /* this is the core function that controls horizontal scrolling of the canvas. it is called
687 whenever the horizontal_adjustment emits its "value_changed" signal. it typically executes in an
688 idle handler, which is important because tempo_map_changed() should issue redraws immediately
689 and not defer them to an idle handler.
692 leftmost_frame = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
693 nframes_t rightmost_frame = leftmost_frame + current_page_frames ();
695 if (rightmost_frame > last_canvas_frame) {
696 last_canvas_frame = rightmost_frame;
697 reset_scrolling_region ();
700 update_fixed_rulers ();
702 redisplay_tempo (!_dragging_hscrollbar);
706 Editor::color_handler()
708 edit_cursor->canvas_item.property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_EditCursor.get();
709 playhead_cursor->canvas_item.property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_PlayHead.get();
710 verbose_canvas_cursor->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_VerboseCanvasCursor.get();
712 meter_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MeterBar.get();
713 meter_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
715 tempo_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TempoBar.get();
716 tempo_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
718 marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBar.get();
719 marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
721 range_marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeMarkerBar.get();
722 range_marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
724 transport_marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TransportMarkerBar.get();
725 transport_marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
727 range_bar_drag_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragBarRect.get();
728 range_bar_drag_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragBarRect.get();
730 transport_bar_drag_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TransportDragRect.get();
731 transport_bar_drag_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TransportDragRect.get();
733 marker_drag_line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerDragLine.get();
735 range_marker_drag_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragRect.get();
736 range_marker_drag_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragRect.get();
738 transport_loop_range_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TransportLoopRect.get();
739 transport_loop_range_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TransportLoopRect.get();
741 transport_punch_range_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TransportPunchRect.get();
742 transport_punch_range_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TransportPunchRect.get();
744 transport_punchin_line->property_color_rgba() = ARDOUR_UI::config()->canvasvar_PunchLine.get();
745 transport_punchout_line->property_color_rgba() = ARDOUR_UI::config()->canvasvar_PunchLine.get();
747 zoom_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ZoomRect.get();
748 zoom_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_ZoomRect.get();
750 rubberband_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RubberBandRect.get();
751 rubberband_rect->property_fill_color_rgba() = (guint32) ARDOUR_UI::config()->canvasvar_RubberBandRect.get();
753 location_marker_color = ARDOUR_UI::config()->canvasvar_LocationMarker.get();
754 location_range_color = ARDOUR_UI::config()->canvasvar_LocationRange.get();
755 location_cd_marker_color = ARDOUR_UI::config()->canvasvar_LocationCDMarker.get();
756 location_loop_color = ARDOUR_UI::config()->canvasvar_LocationLoop.get();
757 location_punch_color = ARDOUR_UI::config()->canvasvar_LocationPunch.get();
759 refresh_location_display ();
760 redisplay_tempo (true);
763 session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers