logo_item->show ();
}
- _master_group = new ArdourCanvas::Group (*track_canvas->root());
-
- transport_loop_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
+ /* a group to hold time (measure) lines */
+ time_line_group = new ArdourCanvas::Group (*track_canvas->root());
+
+#ifdef GTKOSX
+ /*XXX please don't laugh. this actually improves canvas performance on osx */
+ bogus_background_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, max_canvas_coordinate/3, physical_screen_height);
+ bogus_background_rect->property_outline_pixels() = 0;
+#endif
+ transport_loop_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, physical_screen_height);
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 = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, physical_screen_height);
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);
+ _background_group = new ArdourCanvas::Group (*track_canvas->root());
+ _master_group = new ArdourCanvas::Group (*track_canvas->root());
- 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 (*time_line_group, 0.0, 0.0, 0.0, physical_screen_height);
range_marker_drag_rect->hide ();
_trackview_group = new ArdourCanvas::Group (*_master_group);
_region_motion_group = new ArdourCanvas::Group (*_trackview_group);
meter_bar_group = new ArdourCanvas::Group (*track_canvas->root ());
- meter_bar = new ArdourCanvas::SimpleRect (*meter_bar_group, 0.0, 0.0, physical_screen_width, timebar_height);
+ if (Profile->get_sae()) {
+ meter_bar = new ArdourCanvas::SimpleRect (*meter_bar_group, 0.0, 0.0, physical_screen_width, timebar_height - 1);
+ meter_bar->property_outline_pixels() = 1;
+ } else {
+ meter_bar = new ArdourCanvas::SimpleRect (*meter_bar_group, 0.0, 0.0, physical_screen_width, timebar_height);
+ meter_bar->property_outline_pixels() = 0;
+ }
meter_bar->property_outline_what() = (0x1 | 0x8);
- meter_bar->property_outline_pixels() = 0;
tempo_bar_group = new ArdourCanvas::Group (*track_canvas->root ());
- tempo_bar = new ArdourCanvas::SimpleRect (*tempo_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ if (Profile->get_sae()) {
+ tempo_bar = new ArdourCanvas::SimpleRect (*tempo_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height - 1));
+ tempo_bar->property_outline_pixels() = 1;
+ } else {
+ tempo_bar = new ArdourCanvas::SimpleRect (*tempo_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ tempo_bar->property_outline_pixels() = 0;
+ }
tempo_bar->property_outline_what() = (0x1 | 0x8);
- tempo_bar->property_outline_pixels() = 0;
range_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root ());
- range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ if (Profile->get_sae()) {
+ range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height - 1));
+ range_marker_bar->property_outline_pixels() = 1;
+ } else {
+ range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ range_marker_bar->property_outline_pixels() = 0;
+ }
range_marker_bar->property_outline_what() = (0x1 | 0x8);
- range_marker_bar->property_outline_pixels() = 0;
transport_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root ());
- transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ if (Profile->get_sae()) {
+ transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height - 1));
+ transport_marker_bar->property_outline_pixels() = 1;
+ } else {
+ transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ transport_marker_bar->property_outline_pixels() = 0;
+ }
transport_marker_bar->property_outline_what() = (0x1 | 0x8);
- transport_marker_bar->property_outline_pixels() = 0;
marker_bar_group = new ArdourCanvas::Group (*track_canvas->root ());
- marker_bar = new ArdourCanvas::SimpleRect (*marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ if (Profile->get_sae()) {
+ marker_bar = new ArdourCanvas::SimpleRect (*marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height - 1));
+ marker_bar->property_outline_pixels() = 1;
+ } else {
+ marker_bar = new ArdourCanvas::SimpleRect (*marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ marker_bar->property_outline_pixels() = 0;
+ }
marker_bar->property_outline_what() = (0x1 | 0x8);
- marker_bar->property_outline_pixels() = 0;
cd_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root ());
- cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ if (Profile->get_sae()) {
+ cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height - 1));
+ cd_marker_bar->property_outline_pixels() = 1;
+ } else {
+ cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height));
+ cd_marker_bar->property_outline_pixels() = 0;
+ }
cd_marker_bar->property_outline_what() = (0x1 | 0x8);
- cd_marker_bar->property_outline_pixels() = 0;
timebar_group = new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0);
cursor_group = new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0);
cd_marker_group = new ArdourCanvas::Group (*timebar_group, 0.0, 0.0);
marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
- marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 1.0));
+ marker_drag_line_points.push_back(Gnome::Art::Point(0.0, physical_screen_height));
marker_drag_line = new ArdourCanvas::Line (*timebar_group);
marker_drag_line->property_width_pixels() = 1;
transport_punchin_line->property_x1() = 0.0;
transport_punchin_line->property_y1() = 0.0;
transport_punchin_line->property_x2() = 0.0;
- transport_punchin_line->property_y2() = 0.0;
+ transport_punchin_line->property_y2() = physical_screen_height;
transport_punchin_line->hide ();
transport_punchout_line = new ArdourCanvas::SimpleLine (*_master_group);
transport_punchout_line->property_x1() = 0.0;
transport_punchout_line->property_y1() = 0.0;
transport_punchout_line->property_x2() = 0.0;
- transport_punchout_line->property_y2() = 0.0;
+ transport_punchout_line->property_y2() = physical_screen_height;
transport_punchout_line->hide();
// used to show zoom mode active zooming
(*x)->set_line_vpos (0, canvas_height);
}
- // marker_drag_line_points.back().set_y(canvas_height);
- range_marker_drag_rect->property_y2() = canvas_height;
- transport_loop_range_rect->property_y2() = canvas_height;
- transport_punch_range_rect->property_y2() = canvas_height;
- transport_punchin_line->property_y2() = canvas_height;
- transport_punchout_line->property_y2() = canvas_height;
vertical_adjustment.set_page_size (canvas_height);
+ last_trackview_group_vertical_offset = get_trackview_group_vertical_offset ();
+ if ((vertical_adjustment.get_value() + canvas_height) >= vertical_adjustment.get_upper()) {
+ /*
+ We're increasing the size of the canvas while the bottom is visible.
+ We scroll down to keep in step with the controls layout.
+ */
+ vertical_adjustment.set_value (full_canvas_height - canvas_height);
+ }
}
- horizontal_adjustment.set_upper (session->current_end_frame()/frames_per_unit);
- horizontal_adjustment.set_page_size (current_page_frames()/frames_per_unit);
+
+ handle_new_duration ();
reset_hscrollbar_stepping ();
update_fixed_rulers();
redisplay_tempo (false);
- last_trackview_group_vertical_offset = get_trackview_group_vertical_offset ();
- if ((vertical_adjustment.get_value() + canvas_height) >= vertical_adjustment.get_upper()) {
- /*
- We're increasing the size of the canvas while the bottom is visible.
- We scroll down to keep in step with the controls layout.
- */
- vertical_adjustment.set_value (full_canvas_height - canvas_height);
- }
Resized (); /* EMIT_SIGNAL */
const SelectionData& data,
guint info, guint time)
{
- cerr << "drop on canvas, target = " << data.get_target() << endl;
-
if (data.get_target() == "regions") {
drop_regions (context, x, y, data, info, time);
} else {
}
}
+bool
+Editor::idle_drop_paths (vector<ustring> paths, nframes64_t frame, double ypos)
+{
+ drop_paths_part_two (paths, frame, ypos);
+ return false;
+}
+
void
-Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
- int x, int y,
- const SelectionData& data,
- guint info, guint time)
+Editor::drop_paths_part_two (const vector<ustring>& paths, nframes64_t frame, double ypos)
{
TimeAxisView* tvp;
AudioTimeAxisView* tv;
- double cy;
- vector<ustring> paths;
- string spath;
- GdkEvent ev;
- nframes64_t frame;
-
- if (convert_drop_to_paths (paths, context, x, y, data, info, time)) {
- goto out;
- }
-
- /* D-n-D coordinates are window-relative, so convert to "world" coordinates
- */
-
- double wx;
- double wy;
-
- track_canvas->window_to_world (x, y, wx, wy);
- //wx += horizontal_adjustment.get_value();
- //wy += vertical_adjustment.get_value();
-
- ev.type = GDK_BUTTON_RELEASE;
- ev.button.x = wx;
- ev.button.y = wy;
-
- frame = event_frame (&ev, 0, &cy);
-
- snap_to (frame);
- if ((tvp = trackview_by_y_position (cy)) == 0) {
+ if ((tvp = trackview_by_y_position (ypos)) == 0) {
/* drop onto canvas background: create new tracks */
/* check that its an audio track, not a bus */
if (tv->get_diskstream()) {
- /* select the track, then embed */
+ /* select the track, then embed/import */
selection->set (tv);
if (Profile->get_sae() || Config->get_only_copy_imported_files()) {
- do_import (paths, Editing::ImportDistinctFiles, Editing::ImportToTrack, SrcBest, frame);
+ do_import (paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, SrcBest, frame);
} else {
- do_embed (paths, Editing::ImportDistinctFiles, ImportToTrack, frame);
+ do_embed (paths, Editing::ImportSerializeFiles, ImportToTrack, frame);
}
}
}
+}
+
+void
+Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
+ int x, int y,
+ const SelectionData& data,
+ guint info, guint time)
+{
+ vector<ustring> paths;
+ GdkEvent ev;
+ nframes64_t frame;
+ double wx;
+ double wy;
+ double cy;
+
+ if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
+
+ /* D-n-D coordinates are window-relative, so convert to "world" coordinates
+ */
+
+ track_canvas->window_to_world (x, y, wx, wy);
+
+ ev.type = GDK_BUTTON_RELEASE;
+ ev.button.x = wx;
+ ev.button.y = wy;
+
+ frame = event_frame (&ev, 0, &cy);
+
+ snap_to (frame);
+
+#ifdef GTKOSX
+ /* We are not allowed to call recursive main event loops from within
+ the main event loop with GTK/Quartz. Since import/embed wants
+ to push up a progress dialog, defer all this till we go idle.
+ */
+ Glib::signal_idle().connect (bind (mem_fun (*this, &Editor::idle_drop_paths), paths, frame, cy));
+#else
+ drop_paths_part_two (paths, frame, cy);
+#endif
+ }
- out:
context->drag_finish (true, false, time);
}
const SelectionData& data,
guint info, guint time)
{
- const SerializedObjectPointers<boost::shared_ptr<Region> >* sr =
- reinterpret_cast<const SerializedObjectPointers<boost::shared_ptr<Region> > *> (data.get_data());
+ std::list<boost::shared_ptr<Region> > regions;
+ region_list_display.get_object_drag_data (regions);
- for (uint32_t i = 0; i < sr->cnt; ++i) {
+ for (list<boost::shared_ptr<Region> >::iterator r = regions.begin(); r != regions.end(); ++r) {
- boost::shared_ptr<Region> r = sr->data[i];
boost::shared_ptr<AudioRegion> ar;
- if ((ar = boost::dynamic_pointer_cast<AudioRegion>(r)) != 0) {
+ if ((ar = boost::dynamic_pointer_cast<AudioRegion>(*r)) != 0) {
insert_region_list_drag (ar, x, y);
}
}
_master_group->move (-x_delta, 0);
timebar_group->move (-x_delta, 0);
+ time_line_group->move (-x_delta, 0);
cursor_group->move (-x_delta, 0);
+
update_fixed_rulers ();
redisplay_tempo (true);
+#ifndef GTKOSX
+ if (!autoscroll_active) {
+ /* force rulers and canvas to move in lock step */
+ while (gtk_events_pending ()) {
+ gtk_main_iteration ();
+ }
+ }
+#endif
+
}
void
y_delta = last_trackview_group_vertical_offset - get_trackview_group_vertical_offset ();
_trackview_group->move (0, y_delta);
+ _background_group->move (0, y_delta);
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->clip_to_viewport ();
Editor::canvas_scroll_to (nframes64_t time_origin)
{
leftmost_frame = time_origin;
- nframes64_t rightmost_frame = leftmost_frame + current_page_frames ();
-
- if (rightmost_frame > last_canvas_frame) {
- last_canvas_frame = rightmost_frame;
- //reset_scrolling_region ();
- }
-
}
void