export GTK_PATH=~/.ardour3:$libs/clearlooks-newer
export VAMP_PATH=$libs/vamp-plugins${VAMP_PATH:+:$VAMP_PATH}
-export LD_LIBRARY_PATH=$libs/qm-dsp:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/gnomecanvas:$libs/libsndfile:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/audiographer:$libs/timecode:$libs/libltc${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH=$libs/qm-dsp:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/gnomecanvas:$libs/libsndfile:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/audiographer:$libs/timecode:$libs/libltc:$libs/canvas${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
# DYLD_LIBRARY_PATH is for darwin.
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
+ ARDOURVERSION=@VERSION@
EXECUTABLE=@EXECUTABLE@
}
ui_config = new UIConfiguration();
+ ui_config->ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
+ boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
+ ui_config->map_parameters (pc);
editor = 0;
mixer = 0;
add_video_dialog->hide();
if (r != RESPONSE_ACCEPT) { return; }
- bool local_file;
+ bool local_file, orig_local_file;
std::string path = add_video_dialog->file_name(local_file);
+
+ std::string orig_path = path;
+ orig_local_file = local_file;
+
bool auto_set_session_fps = add_video_dialog->auto_set_session_fps();
if (local_file && !Glib::file_test(path, Glib::FILE_TEST_EXISTS)) {
node->add_property (X_("Filename"), path);
node->add_property (X_("AutoFPS"), auto_set_session_fps?X_("1"):X_("0"));
node->add_property (X_("LocalFile"), local_file?X_("1"):X_("0"));
+ if (orig_local_file) {
+ node->add_property (X_("OriginalVideoFile"), orig_path);
+ } else {
+ node->remove_property (X_("OriginalVideoFile"));
+ }
_session->add_extra_xml (*node);
_session->set_dirty ();
#include "ardour/tempo.h"
#include "ardour/utils.h"
+#include "canvas/debug.h"
+#include "canvas/text.h"
+
#include "control_protocol/control_protocol.h"
#include "actions.h"
#include "audio_time_axis.h"
#include "automation_time_axis.h"
#include "bundle_manager.h"
-#include "canvas-noevent-text.h"
-#include "canvas_impl.h"
#include "crossfade_edit.h"
#include "debug.h"
#include "editing.h"
#include "rhythm_ferret.h"
#include "selection.h"
#include "sfdb_ui.h"
-#include "simpleline.h"
#include "tempo_lines.h"
#include "time_axis_view.h"
#include "utils.h"
*/
, vertical_adjustment (0.0, 0.0, 10.0, 400.0)
+ , horizontal_adjustment (0.0, 0.0, 1e16)
+ , unused_adjustment (0.0, 0.0, 10.0, 400.0)
+
+ , controls_layout (unused_adjustment, vertical_adjustment)
/* tool bar related */
snap_threshold = 5.0;
bbt_beat_subdivision = 4;
- _canvas_width = 0;
- _canvas_height = 0;
+ _visible_canvas_width = 0;
+ _visible_canvas_height = 0;
last_autoscroll_x = 0;
last_autoscroll_y = 0;
autoscroll_active = false;
sfbrowser = 0;
- location_marker_color = ARDOUR_UI::config()->canvasvar_LocationMarker.get();
- location_range_color = ARDOUR_UI::config()->canvasvar_LocationRange.get();
- location_cd_marker_color = ARDOUR_UI::config()->canvasvar_LocationCDMarker.get();
- location_loop_color = ARDOUR_UI::config()->canvasvar_LocationLoop.get();
- location_punch_color = ARDOUR_UI::config()->canvasvar_LocationPunch.get();
+ location_marker_color = ARDOUR_UI::config()->get_canvasvar_LocationMarker();
+ location_range_color = ARDOUR_UI::config()->get_canvasvar_LocationRange();
+ location_cd_marker_color = ARDOUR_UI::config()->get_canvasvar_LocationCDMarker();
+ location_loop_color = ARDOUR_UI::config()->get_canvasvar_LocationLoop();
+ location_punch_color = ARDOUR_UI::config()->get_canvasvar_LocationPunch();
_edit_point = EditAtMouse;
_internal_editing = false;
current_canvas_cursor = 0;
- frames_per_unit = 2048; /* too early to use reset_zoom () */
+ samples_per_pixel = 2048; /* too early to use reset_zoom () */
_scroll_callbacks = 0;
edit_controls_vbox.set_spacing (0);
vertical_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &Editor::tie_vertical_scrolling), true);
- track_canvas->signal_map_event().connect (sigc::mem_fun (*this, &Editor::track_canvas_map_handler));
+ _track_canvas->signal_map_event().connect (sigc::mem_fun (*this, &Editor::track_canvas_map_handler));
HBox* h = manage (new HBox);
_group_tabs = new EditorGroupTabs (this);
_cursors = new MouseCursors;
- ArdourCanvas::Canvas* time_pad = manage(new ArdourCanvas::Canvas());
- ArdourCanvas::SimpleLine* pad_line_1 = manage(new ArdourCanvas::SimpleLine(*time_pad->root(),
- 0.0, 1.0, 100.0, 1.0));
+ ArdourCanvas::GtkCanvas* time_pad = manage (new ArdourCanvas::GtkCanvas ());
- pad_line_1->property_color_rgba() = 0xFF0000FF;
+ ArdourCanvas::Line* pad_line_1 = new ArdourCanvas::Line (time_pad->root());
+ pad_line_1->set (ArdourCanvas::Duple (0.0, 1.0), ArdourCanvas::Duple (100.0, 1.0));
+ pad_line_1->set_outline_color (0xFF0000FF);
pad_line_1->show();
+ // CAIROCANVAS
time_pad->show();
time_canvas_vbox.set_size_request (-1, (int)(timebar_height * visible_timebars) + 2);
ruler_label_event_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
ruler_label_event_box.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::ruler_label_button_release));
- time_button_event_box.add (time_button_vbox);
- time_button_event_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
- time_button_event_box.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::ruler_label_button_release));
-
- /* these enable us to have a dedicated window (for cursor setting, etc.)
- for the canvas areas.
- */
-
- track_canvas_event_box.add (*track_canvas);
+ time_bars_event_box.add (time_bars_vbox);
+ time_bars_event_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
+ time_bars_event_box.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::ruler_label_button_release));
time_canvas_event_box.add (time_canvas_vbox);
time_canvas_event_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
/* labels for the rulers */
edit_packer.attach (ruler_label_event_box, 1, 2, 0, 1, FILL, SHRINK, 0, 0);
- /* labels for the marker "tracks" */
- edit_packer.attach (time_button_event_box, 1, 2, 1, 2, FILL, SHRINK, 0, 0);
+ /* labels for the marker "tracks" (time bars) */
+ edit_packer.attach (time_bars_event_box, 1, 2, 1, 2, FILL, SHRINK, 0, 0);
/* the rulers */
edit_packer.attach (time_canvas_event_box, 2, 3, 0, 1, FILL|EXPAND, FILL, 0, 0);
/* track controls */
edit_packer.attach (controls_layout, 0, 2, 2, 3, FILL, FILL|EXPAND, 0, 0);
- /* main canvas */
- edit_packer.attach (track_canvas_event_box, 2, 3, 1, 3, FILL|EXPAND, FILL|EXPAND, 0, 0);
+ /* time bars canvas */
+ edit_packer.attach (*_time_bars_canvas_viewport, 2, 3, 1, 2, FILL, FILL, 0, 0);
+ /* track canvas */
+ edit_packer.attach (*_track_canvas_viewport, 2, 3, 2, 3, FILL|EXPAND, FILL|EXPAND, 0, 0);
bottom_hbox.set_border_width (2);
bottom_hbox.set_spacing (3);
delete button_bindings;
delete _routes;
delete _route_groups;
- delete track_canvas;
+ delete _time_bars_canvas_viewport;
+ delete _track_canvas_viewport;
delete _drags;
}
return;
}
- double fpu = zoom_range_clock->current_duration() / _canvas_width;
- bool clamped = clamp_frames_per_unit (fpu);
+ framecnt_t fpu = llrintf (zoom_range_clock->current_duration() / _visible_canvas_width);
+ bool clamped = clamp_samples_per_pixel (fpu);
if (clamped) {
- zoom_range_clock->set ((framepos_t) floor (fpu * _canvas_width));
+ zoom_range_clock->set ((framepos_t) floor (fpu * _visible_canvas_width));
}
temporal_zoom (fpu);
return;
}
- double step = fraction * current_page_frames();
+ double step = fraction * current_page_samples();
/*
_control_scroll_target is an optional<T>
if ((fraction < 0.0f) && (*_control_scroll_target < (framepos_t) fabs(step))) {
*_control_scroll_target = 0;
} else if ((fraction > 0.0f) && (max_framepos - *_control_scroll_target < step)) {
- *_control_scroll_target = max_framepos - (current_page_frames()*2); // allow room for slop in where the PH is on the screen
+ *_control_scroll_target = max_framepos - (current_page_samples()*2); // allow room for slop in where the PH is on the screen
} else {
*_control_scroll_target += (framepos_t) floor (step);
}
playhead_cursor->set_position (*_control_scroll_target);
UpdateAllTransportClocks (*_control_scroll_target);
- if (*_control_scroll_target > (current_page_frames() / 2)) {
+ if (*_control_scroll_target > (current_page_samples() / 2)) {
/* try to center PH in window */
- reset_x_origin (*_control_scroll_target - (current_page_frames()/2));
+ reset_x_origin (*_control_scroll_target - (current_page_samples()/2));
} else {
reset_x_origin (0);
}
void
Editor::center_screen (framepos_t frame)
{
- double page = _canvas_width * frames_per_unit;
+ framecnt_t const page = _visible_canvas_width * samples_per_pixel;
/* if we're off the page, then scroll.
*/
/* catch up with the playhead */
- _session->request_locate (playhead_cursor->current_frame);
+ _session->request_locate (playhead_cursor->current_frame ());
_pending_initial_locate = true;
update_title ();
_session->locations()->StateChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::refresh_location_display, this), gui_context());
_session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context());
- playhead_cursor->canvas_item.show ();
+ playhead_cursor->show ();
boost::function<void (string)> pc (boost::bind (&Editor::parameter_changed, this, _1));
Config->map_parameters (pc);
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks);
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
- (static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
+ (static_cast<TimeAxisView*>(*i))->set_samples_per_pixel (samples_per_pixel);
}
super_rapid_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin;
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end;
- compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_frames(),
+ compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
- compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_frames(),
+ compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end);
break;
}
if ((prop = node.property ("zoom"))) {
- reset_zoom (PBD::atof (prop->value()));
+ /* older versions of ardour used floating point samples_per_pixel */
+ double f = PBD::atof (prop->value());
+ reset_zoom (llrintf (f));
} else {
- reset_zoom (frames_per_unit);
+ reset_zoom (samples_per_pixel);
}
if ((prop = node.property ("snap-to"))) {
maybe_add_mixer_strip_width (*node);
node->add_property ("zoom-focus", enum_2_string (zoom_focus));
- snprintf (buf, sizeof(buf), "%f", frames_per_unit);
+
+ snprintf (buf, sizeof(buf), "%" PRId64, samples_per_pixel);
node->add_property ("zoom", buf);
node->add_property ("snap-to", enum_2_string (_snap_type));
node->add_property ("snap-mode", enum_2_string (_snap_mode));
node->add_property ("pre-internal-snap-mode", enum_2_string (pre_internal_snap_mode));
node->add_property ("edit-point", enum_2_string (_edit_point));
- snprintf (buf, sizeof (buf), "%" PRIi64, playhead_cursor->current_frame);
+ snprintf (buf, sizeof (buf), "%" PRIi64, playhead_cursor->current_frame ());
node->add_property ("playhead", buf);
snprintf (buf, sizeof (buf), "%" PRIi64, leftmost_frame);
node->add_property ("left-frame", buf);
case SnapMagnetic:
if (presnap > start) {
- if (presnap > (start + unit_to_frame(snap_threshold))) {
+ if (presnap > (start + pixel_to_sample(snap_threshold))) {
start = presnap;
}
} else if (presnap < start) {
- if (presnap < (start - unit_to_frame(snap_threshold))) {
+ if (presnap < (start - pixel_to_sample(snap_threshold))) {
start = presnap;
}
}
*/
string txt = data.get_text();
- const char* p;
+ char* p;
const char* q;
- p = (const char *) malloc (txt.length() + 1);
- txt.copy (const_cast<char *> (p), txt.length(), 0);
- const_cast<char*>(p)[txt.length()] = '\0';
+ p = (char *) malloc (txt.length() + 1);
+ txt.copy (p, txt.length(), 0);
+ p[txt.length()] = '\0';
while (p)
{
if (tempo_lines) {
tempo_lines->show();
}
- (void) redraw_measures ();
- }
+
+ ARDOUR::TempoMap::BBTPointList::const_iterator begin;
+ ARDOUR::TempoMap::BBTPointList::const_iterator end;
+
+ compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), begin, end);
+ draw_measures (begin, end);
+ }
+
instant_save ();
}
}
}
void
-Editor::reset_zoom (double fpu)
+Editor::reset_zoom (framecnt_t spp)
{
- clamp_frames_per_unit (fpu);
+ clamp_samples_per_pixel (spp);
- if (fpu == frames_per_unit) {
+ if (spp == samples_per_pixel) {
return;
}
pending_visual_change.add (VisualChange::ZoomLevel);
- pending_visual_change.frames_per_unit = fpu;
+ pending_visual_change.samples_per_pixel = spp;
ensure_visual_change_idle_handler ();
}
{
VisualState* vs = new VisualState (with_tracks);
vs->y_position = vertical_adjustment.get_value();
- vs->frames_per_unit = frames_per_unit;
+ vs->samples_per_pixel = samples_per_pixel;
vs->leftmost_frame = leftmost_frame;
vs->zoom_focus = zoom_focus;
vertical_adjustment.set_value (vs.y_position);
set_zoom_focus (vs.zoom_focus);
- reposition_and_zoom (vs.leftmost_frame, vs.frames_per_unit);
+ reposition_and_zoom (vs.leftmost_frame, vs.samples_per_pixel);
if (vs.gui_state) {
*ARDOUR_UI::instance()->gui_object_state = *vs.gui_state;
* @param fpu New frames per unit; should already have been clamped so that it is sensible.
*/
void
-Editor::set_frames_per_unit (double fpu)
+Editor::set_samples_per_pixel (framecnt_t spp)
{
+ clamp_samples_per_pixel (spp);
+ samples_per_pixel = spp;
+
if (tempo_lines) {
tempo_lines->tempo_map_changed();
}
- frames_per_unit = fpu;
-
/* convert fpu to frame count */
- framepos_t frames = (framepos_t) floor (frames_per_unit * _canvas_width);
+ framepos_t frames = samples_per_pixel * _visible_canvas_width;
- if (frames_per_unit != zoom_range_clock->current_duration()) {
+ if (samples_per_pixel != zoom_range_clock->current_duration()) {
zoom_range_clock->set (frames);
}
//reset_scrolling_region ();
if (playhead_cursor) {
- playhead_cursor->set_position (playhead_cursor->current_frame);
+ playhead_cursor->set_position (playhead_cursor->current_frame ());
}
refresh_location_display();
{
if (pending_visual_change.idle_handler_id < 0) {
pending_visual_change.idle_handler_id = g_idle_add (_idle_visual_changer, this);
+ pending_visual_change.being_handled = false;
}
}
double const last_time_origin = horizontal_position ();
+
if (p & VisualChange::ZoomLevel) {
- set_frames_per_unit (pending_visual_change.frames_per_unit);
+ set_samples_per_pixel (pending_visual_change.samples_per_pixel);
compute_fixed_ruler_scale ();
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin;
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end;
- compute_current_bbt_points (pending_visual_change.time_origin, pending_visual_change.time_origin + current_page_frames(),
+ compute_current_bbt_points (pending_visual_change.time_origin, pending_visual_change.time_origin + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
- compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + current_page_frames(),
+ compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end);
- }
- if (p & VisualChange::ZoomLevel) {
update_video_timeline();
}
if (p & VisualChange::TimeOrigin) {
- set_horizontal_position (pending_visual_change.time_origin / frames_per_unit);
+ set_horizontal_position (pending_visual_change.time_origin / samples_per_pixel);
}
if (p & VisualChange::YOrigin) {
EditPoint ep = _edit_point;
if (from_context_menu && (ep == EditAtMouse)) {
- return event_frame (&context_click_event, 0, 0);
+ return window_event_frame (&context_click_event, 0, 0);
}
if (entered_marker) {
}
_pending_resize_amount = 0;
- flush_canvas ();
_group_tabs->set_dirty ();
resize_idle_id = -1;
DataType dt = route->input()->default_type();
if (dt == ARDOUR::DataType::AUDIO) {
- rtv = new AudioTimeAxisView (*this, _session, *track_canvas);
+ rtv = new AudioTimeAxisView (*this, _session, *_track_canvas);
rtv->set_route (route);
} else if (dt == ARDOUR::DataType::MIDI) {
- rtv = new MidiTimeAxisView (*this, _session, *track_canvas);
+ rtv = new MidiTimeAxisView (*this, _session, *_track_canvas);
rtv->set_route (route);
} else {
throw unknown_type();
void
Editor::reset_x_origin_to_follow_playhead ()
{
- framepos_t const frame = playhead_cursor->current_frame;
+ framepos_t const frame = playhead_cursor->current_frame ();
- if (frame < leftmost_frame || frame > leftmost_frame + current_page_frames()) {
+ if (frame < leftmost_frame || frame > leftmost_frame + current_page_samples()) {
if (_session->transport_speed() < 0) {
- if (frame > (current_page_frames() / 2)) {
- center_screen (frame-(current_page_frames()/2));
+ if (frame > (current_page_samples() / 2)) {
+ center_screen (frame-(current_page_samples()/2));
} else {
- center_screen (current_page_frames()/2);
+ center_screen (current_page_samples()/2);
}
} else {
/* moving left */
if (_session->transport_rolling()) {
/* rolling; end up with the playhead at the right of the page */
- l = frame - current_page_frames ();
+ l = frame - current_page_samples ();
} else {
/* not rolling: end up with the playhead 1/4 of the way along the page */
- l = frame - current_page_frames() / 4;
+ l = frame - current_page_samples() / 4;
}
} else {
/* moving right */
l = frame;
} else {
/* not rolling: end up with the playhead 3/4 of the way along the page */
- l = frame - 3 * current_page_frames() / 4;
+ l = frame - 3 * current_page_samples() / 4;
}
}
l = 0;
}
- center_screen_internal (l + (current_page_frames() / 2), current_page_frames ());
+ center_screen_internal (l + (current_page_samples() / 2), current_page_samples ());
}
}
}
*/
#if 0
// FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code
- double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_unit;
+ double target = ((double)frame - (double)current_page_samples()/2.0) / samples_per_pixel;
if (target <= 0.0) {
target = 0.0;
}
- if (fabs(target - current) < current_page_frames() / frames_per_unit) {
+ if (fabs(target - current) < current_page_samples() / samples_per_pixel) {
target = (target * 0.15) + (current * 0.85);
} else {
/* relax */
last_update_frame = 0;
_drags->abort ();
- playhead_cursor->canvas_item.hide ();
+ playhead_cursor->hide ();
/* rip everything out of the list displays */
#include "ardour/region_factory.h"
#include "ardour/profile.h"
+#include "canvas/canvas.h"
+#include "canvas/text.h"
+
#include "editor.h"
#include "keyboard.h"
#include "public_editor.h"
#include "audio_region_view.h"
#include "audio_streamview.h"
-#include "canvas-noevent-text.h"
#include "audio_time_axis.h"
#include "region_gain_line.h"
#include "automation_line.h"
#include "automation_time_axis.h"
#include "automation_line.h"
#include "control_point.h"
-#include "canvas_impl.h"
-#include "simplerect.h"
#include "editor_drag.h"
#include "midi_time_axis.h"
#include "editor_regions.h"
framepos_t xdelta;
int direction = ev->direction;
+ /* this event arrives without transformation by the canvas, so we have
+ * to transform the coordinates to be able to look things up.
+ */
+
+ Duple event_coords = _track_canvas->window_to_canvas (Duple (ev->x, ev->y));
+
retry:
switch (direction) {
case GDK_SCROLL_UP:
- if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
+ if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
//for mouse-wheel zoom, force zoom-focus to mouse
Editing::ZoomFocus temp_focus = zoom_focus;
zoom_focus = Editing::ZoomFocusMouse;
temporal_zoom_step (false);
zoom_focus = temp_focus;
return true;
- } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
direction = GDK_SCROLL_LEFT;
goto retry;
- } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
if (!current_stepping_trackview) {
step_timeout = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Editor::track_height_step_timeout), 500);
- std::pair<TimeAxisView*, int> const p = trackview_by_y_position (ev->y + vertical_adjustment.get_value() - canvas_timebars_vsize);
+ std::pair<TimeAxisView*, int> const p = trackview_by_y_position (event_coords.y);
current_stepping_trackview = p.first;
if (!current_stepping_trackview) {
return false;
break;
case GDK_SCROLL_DOWN:
- if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
+ if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
//for mouse-wheel zoom, force zoom-focus to mouse
Editing::ZoomFocus temp_focus = zoom_focus;
zoom_focus = Editing::ZoomFocusMouse;
temporal_zoom_step (true);
zoom_focus = temp_focus;
return true;
- } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
direction = GDK_SCROLL_RIGHT;
goto retry;
- } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
if (!current_stepping_trackview) {
step_timeout = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Editor::track_height_step_timeout), 500);
- std::pair<TimeAxisView*, int> const p = trackview_by_y_position (ev->y + vertical_adjustment.get_value() - canvas_timebars_vsize);
+ std::pair<TimeAxisView*, int> const p = trackview_by_y_position (event_coords.y);
current_stepping_trackview = p.first;
if (!current_stepping_trackview) {
return false;
break;
case GDK_SCROLL_LEFT:
- xdelta = (current_page_frames() / 8);
+ xdelta = (current_page_samples() / 8);
if (leftmost_frame > xdelta) {
reset_x_origin (leftmost_frame - xdelta);
} else {
break;
case GDK_SCROLL_RIGHT:
- xdelta = (current_page_frames() / 8);
+ xdelta = (current_page_samples() / 8);
if (max_framepos - xdelta > leftmost_frame) {
reset_x_origin (leftmost_frame + xdelta);
} else {
- reset_x_origin (max_framepos - current_page_frames());
+ reset_x_origin (max_framepos - current_page_samples());
}
break;
bool
Editor::track_canvas_scroll_event (GdkEventScroll *event)
{
- track_canvas->grab_focus();
+ _track_canvas->grab_focus();
return track_canvas_scroll (event);
}
Editor::track_canvas_button_press_event (GdkEventButton */*event*/)
{
selection->clear ();
- track_canvas->grab_focus();
+ _track_canvas->grab_focus();
return false;
}
{
int x, y;
/* keep those motion events coming */
- track_canvas->get_pointer (x, y);
+ _track_canvas->get_pointer (x, y);
return false;
}
bool
Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, int x, int y, guint time)
{
- double wx;
- double wy;
boost::shared_ptr<Region> region;
boost::shared_ptr<Region> region_copy;
RouteTimeAxisView* rtav;
double px;
double py;
- string target = track_canvas->drag_dest_find_target (context, track_canvas->drag_dest_get_target_list());
+ string target = _track_canvas->drag_dest_find_target (context, _track_canvas->drag_dest_get_target_list());
if (target.empty()) {
return false;
}
- track_canvas->window_to_world (x, y, wx, wy);
-
event.type = GDK_MOTION_NOTIFY;
- event.button.x = wx;
- event.button.y = wy;
+ event.button.x = x;
+ event.button.y = y;
/* assume we're dragging with button 1 */
event.motion.state = Gdk::BUTTON1_MASK;
- (void) event_frame (&event, &px, &py);
+ (void) window_event_frame (&event, &px, &py);
std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py);
bool can_drop = false;
const SelectionData& /*data*/,
guint /*info*/, guint /*time*/)
{
- double wx;
- double wy;
boost::shared_ptr<Region> region;
boost::shared_ptr<Region> region_copy;
RouteTimeAxisView* rtav;
double px;
double py;
- track_canvas->window_to_world (x, y, wx, wy);
-
event.type = GDK_MOTION_NOTIFY;
- event.button.x = wx;
- event.button.y = wy;
+ event.button.x = x;
+ event.button.y = y;
/* assume we're dragging with button 1 */
event.motion.state = Gdk::BUTTON1_MASK;
- framepos_t const pos = event_frame (&event, &px, &py);
+ framepos_t const pos = window_event_frame (&event, &px, &py);
std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py);
#include "ardour/session.h"
+#include "canvas/debug.h"
+
#include "time_axis_view.h"
#include "streamview.h"
#include "editor_summary.h"
/* XXX: colour should be set from configuration file */
cairo_set_source_rgba (cr, 1, 0, 0, 1);
- const double ph= playhead_frame_to_position (_editor->playhead_cursor->current_frame);
+ const double ph= playhead_frame_to_position (_editor->playhead_cursor->current_frame());
cairo_move_to (cr, ph, 0);
cairo_line_to (cr, ph, get_height());
cairo_stroke (cr);
_moved = false;
_editor->_dragging_playhead = true;
_editor->set_follow_playhead (false);
+
+ ArdourCanvas::checkpoint ("sum", "------------------ summary move drag starts.\n");
}
}
/* Otherwise query the editor for its actual position */
- x->first = (_editor->leftmost_position () - _start) * _x_scale;
- x->second = x->first + _editor->current_page_frames() * _x_scale;
+ x->first = (_editor->leftmost_sample () - _start) * _x_scale;
+ x->second = x->first + _editor->current_page_samples() * _x_scale;
y->first = editor_y_to_summary (_editor->vertical_adjustment.get_value ());
- y->second = editor_y_to_summary (_editor->vertical_adjustment.get_value () + _editor->canvas_height() - _editor->get_canvas_timebars_vsize());
+ y->second = editor_y_to_summary (_editor->vertical_adjustment.get_value () + _editor->visible_canvas_height());
}
}
double x = xr.first;
double y = yr.first;
- double amount = 8;
-
- if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) {
- amount = 64;
- } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
- amount = 1;
- }
-
- if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
-
- /* secondary-wheel == left-right scrolling */
-
- if (ev->direction == GDK_SCROLL_UP) {
- x -= amount;
- } else if (ev->direction == GDK_SCROLL_DOWN) {
- x += amount;
- }
-
- } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
-
- /* primary-wheel == zoom */
-
- if (ev->direction == GDK_SCROLL_UP) {
- _editor->temporal_zoom_step (false);
- } else {
- _editor->temporal_zoom_step (true);
- }
-
- } else {
-
- if (ev->direction == GDK_SCROLL_DOWN) {
- y += amount;
- } else if (ev->direction == GDK_SCROLL_UP) {
- y -= amount;
- } else if (ev->direction == GDK_SCROLL_LEFT) {
- x -= amount;
- } else if (ev->direction == GDK_SCROLL_RIGHT) {
- x += amount;
- }
+ switch (ev->direction) {
+ case GDK_SCROLL_UP:
+ if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
+ x -= 64;
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
+ _editor->temporal_zoom_step (false);
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
+ yr.first += 4;
+ yr.second -= 4;
+ set_editor (xr, yr);
+ return true;
+ } else {
+ y -= 8;
+ }
+ break;
+ case GDK_SCROLL_DOWN:
+ if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
+ x += 64;
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
+ _editor->temporal_zoom_step (true);
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
+ yr.first -= 4;
+ yr.second += 4;
+ set_editor (xr, yr);
+ return true;
+ } else {
+ y += 8;
+ }
+ break;
+ case GDK_SCROLL_LEFT:
+ if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) {
+ x -= 64;
+ } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
+ x -= 1;
+ } else {
+ x -= 8;
+ }
+ break;
+ case GDK_SCROLL_RIGHT:
+ if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) {
+ x += 64;
+ } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
+ x += 1;
+ } else {
+ x += 8;
+ }
+ break;
+ default:
+ break;
}
set_editor (x, y);
void
EditorSummary::set_editor (double const x, double const y)
{
- if (_editor->pending_visual_change.idle_handler_id >= 0) {
+ if (_editor->pending_visual_change.idle_handler_id >= 0 && _editor->pending_visual_change.being_handled == true) {
/* As a side-effect, the Editor's visual change idle handler processes
pending GTK events. Hence this motion notify handler can be called
double const nx = (
((x.second - x.first) / _x_scale) /
- _editor->frame_to_unit (_editor->current_page_frames())
+ _editor->sample_to_pixel (_editor->current_page_samples())
);
if (nx != _editor->get_current_zoom ()) {
EditorSummary::set_editor_y (double const y)
{
double y1 = summary_y_to_editor (y);
- double const eh = _editor->canvas_height() - _editor->get_canvas_timebars_vsize ();
+ double const eh = _editor->visible_canvas_height();
double y2 = y1 + eh;
- double const full_editor_height = _editor->full_canvas_height - _editor->get_canvas_timebars_vsize();
+ double const full_editor_height = _editor->_full_canvas_height;
if (y2 > full_editor_height) {
y1 -= y2 - full_editor_height;
/* Height that we will use for scaling; use the whole editor height unless there are not
enough tracks to fill it.
*/
- double const ch = min (total_height, _editor->canvas_height() - _editor->get_canvas_timebars_vsize());
+ double const ch = min (total_height, _editor->visible_canvas_height());
/* hence required scale factor of the complete tracks to fit the required y range;
the amount of space they should take up divided by the amount they currently take up.
#include "ardour_ui.h"
#include "editor.h"
-#include "simplerect.h"
-#include "canvas_impl.h"
+#include "canvas/rectangle.h"
#include "editing.h"
#include "audio_time_axis.h"
#include "video_image_frame.h"
#include "export_video_infobox.h"
#include "interthread_progress_window.h"
+ #include "pbd/openuri.h"
#include "i18n.h"
using namespace std;
if (videotl_bar_height == h) { return; }
if (h < 2 || h > 8) { return; }
videotl_bar_height = h;
- const double nh = (videotl_bar_height * timebar_height - ((ARDOUR::Profile->get_sae())?1.0:0.0));
videotl_label.set_size_request (-1, (int)timebar_height * videotl_bar_height);
- videotl_bar->property_y2().set_value(nh);
ARDOUR_UI::instance()->video_timeline->set_height(videotl_bar_height * timebar_height);
update_ruler_visibility();
}
void
Editor::update_video_timeline (bool flush)
{
-#if DEBUG
- framepos_t rightmost_frame = leftmost_frame + current_page_frames();
- std::cout << "VIDEO SCROLL: " << leftmost_frame << " -- " << rightmost_frame << std::endl;
- std::cout << "SCROLL UNITS: " << frame_to_unit(leftmost_frame) << " -- " << frame_to_unit(rightmost_frame)
- << " = " << frame_to_unit(rightmost_frame) - frame_to_unit(leftmost_frame)
- << std::endl;
-#endif
-
- // TODO later: make this a list for mult. video tracks
- // also modify ardour_ui_dialogs.cc : set_session()
if (flush) {
ARDOUR_UI::instance()->video_timeline->flush_local_cache();
}
{
if (ARDOUR::Config->get_show_video_export_info()) {
ExportVideoInfobox infobox (_session);
- infobox.run();
+ Gtk::ResponseType rv = (Gtk::ResponseType) infobox.run();
if (infobox.show_again()) {
ARDOUR::Config->set_show_video_export_info(false);
}
+ switch (rv) {
+ case GTK_RESPONSE_YES:
+ PBD::open_uri (ARDOUR::Config->get_reference_manual_url() + "/video-timeline/operations/#export");
+ break;
+ default:
+ break;
+ }
}
ExportVideoDialog dialog (*this, _session);
- Gtk::ResponseType r = (Gtk::ResponseType) dialog.run();
+ dialog.run();
dialog.hide();
-#if 0
- if (r == Gtk::RESPONSE_ACCEPT) {
- ARDOUR_UI::instance()->popup_error(string_compose(_("Export Successful: %1"),dialog.get_exported_filename()));
- }
-#endif
}
#include "ardour/session.h"
#include "ardour/route.h"
#include "ardour/meter.h"
+ #include "ardour/audio_track.h"
+ #include "ardour/midi_track.h"
#include "i18n.h"
GainMeterBase::set_flat_buttons ()
{
printf("set_flat_butt\n");
-// gain_slider->set_flat_buttons( ARDOUR_UI::config()->flat_buttons.get() );
+// gain_slider->set_flat_buttons( ARDOUR_UI::config()->get_flat_buttons() );
}
GainMeterBase::~GainMeterBase ()
void
GainMeter::meter_configuration_changed (ChanCount c)
{
+ int type = 0;
_types.clear ();
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
if (c.get (*i) > 0) {
_types.push_back (*i);
+ type |= 1 << (*i);
+ }
+ }
+
+ if (boost::dynamic_pointer_cast<AudioTrack>(_route) == 0
+ && boost::dynamic_pointer_cast<MidiTrack>(_route) == 0
+ ) {
+ if (_route->active()) {
+ set_meter_strip_name ("AudioBusMetrics");
+ } else {
+ set_meter_strip_name ("AudioBusMetricsInactive");
+ }
+ }
+ else if (type == (1 << DataType::AUDIO)) {
+ if (_route->active()) {
+ set_meter_strip_name ("AudioTrackMetrics");
+ } else {
+ set_meter_strip_name ("AudioTrackMetricsInactive");
+ }
+ }
+ else if (type == (1 << DataType::MIDI)) {
+ if (_route->active()) {
+ set_meter_strip_name ("MidiTrackMetrics");
+ } else {
+ set_meter_strip_name ("MidiTrackMetricsInactive");
+ }
+ } else {
+ if (_route->active()) {
+ set_meter_strip_name ("AudioMidiTrackMetrics");
+ } else {
+ set_meter_strip_name ("AudioMidiTrackMetricsInactive");
}
}
#include <string>
#include <list>
-#include <libgnomecanvasmm.h>
-#include <libgnomecanvasmm/canvas.h>
-#include <libgnomecanvasmm/item.h>
#include "pbd/error.h"
#include "pbd/convert.h"
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/selector.h>
+#include "canvas/rectangle.h"
+#include "canvas/debug.h"
+
#include "ardour_ui.h"
#include "ardour_dialog.h"
#include "global_signals.h"
#include "time_axis_view.h"
#include "region_view.h"
#include "ghostregion.h"
-#include "simplerect.h"
-#include "simpleline.h"
#include "selection.h"
#include "keyboard.h"
#include "rgb_macros.h"
compute_heights ();
}
- _canvas_background = new Group (*ed.get_background_group (), 0.0, 0.0);
- _canvas_display = new Group (*ed.get_trackview_group (), 0.0, 0.0);
+ _canvas_display = new Group (ed.get_trackview_group (), ArdourCanvas::Duple (0.0, 0.0));
_canvas_display->hide(); // reveal as needed
- selection_group = new Group (*_canvas_display);
+ selection_group = new Group (_canvas_display);
selection_group->set_data (X_("timeselection"), (void *) 1);
selection_group->hide();
- _ghost_group = new Group (*_canvas_display);
+ _ghost_group = new Group (_canvas_display);
_ghost_group->lower_to_bottom();
_ghost_group->show();
}
for (list<SelectionRect*>::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) {
- delete (*i)->rect;
+ delete (*i)->rect;
delete (*i)->start_trim;
delete (*i)->end_trim;
delete selection_group;
selection_group = 0;
- delete _canvas_background;
- _canvas_background = 0;
-
delete _canvas_display;
_canvas_display = 0;
}
_canvas_display->hide ();
- _canvas_background->hide ();
if (control_parent) {
control_parent->remove (time_axis_vbox);
_order = nth;
if (_y_position != y) {
- _canvas_display->property_y () = y;
- _canvas_background->property_y () = y;
- /* silly canvas */
- _canvas_display->move (0.0, 0.0);
- _canvas_background->move (0.0, 0.0);
+ _canvas_display->set_y_position (y);
_y_position = y;
}
- _canvas_background->raise_to_top ();
_canvas_display->raise_to_top ();
-
- _canvas_background->show ();
_canvas_display->show ();
_hidden = false;
return _effective_height;
}
-void
-TimeAxisView::clip_to_viewport ()
-{
- if (marked_for_display()) {
- if (_y_position + _effective_height < _editor.get_trackview_group_vertical_offset () || _y_position > _editor.get_trackview_group_vertical_offset () + _canvas_display->get_canvas()->get_height()) {
- _canvas_background->hide ();
- _canvas_display->hide ();
- return;
- }
- _canvas_background->show ();
- _canvas_display->show ();
- }
- return;
-}
-
bool
TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
{
switch (ev->direction) {
case GDK_SCROLL_UP:
- if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
+ if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
/* See Editor::_stepping_axis_view for notes on this hack */
Editor& e = dynamic_cast<Editor&> (_editor);
if (!e.stepping_axis_view ()) {
break;
case GDK_SCROLL_DOWN:
- if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
+ if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
/* See Editor::_stepping_axis_view for notes on this hack */
Editor& e = dynamic_cast<Editor&> (_editor);
if (!e.stepping_axis_view ()) {
*/
int tx, ty;
controls_ebox.translate_coordinates (*control_parent, ev->x, ev->y, tx, ty);
- ev->y = ty - _editor.get_trackview_group_vertical_offset();
+ ev->y = ty;
_editor.drags()->motion_handler ((GdkEvent *) ev, false);
_editor.maybe_autoscroll (false, true, false, ev->y_root < _resize_drag_start);
(*i)->set_height ();
}
- if (canvas_item_visible (selection_group)) {
+ if (selection_group->visible ()) {
/* resize the selection rect */
show_selection (_editor.get_selection().time);
}
}
void
-TimeAxisView::set_samples_per_unit (double spu)
+TimeAxisView::set_samples_per_pixel (double fpp)
{
for (Children::iterator i = children.begin(); i != children.end(); ++i) {
- (*i)->set_samples_per_unit (spu);
+ (*i)->set_samples_per_pixel (fpp);
}
-
- AnalysisFeatureList::const_iterator i;
- list<ArdourCanvas::SimpleLine*>::iterator l;
}
void
(*i)->show_selection (ts);
}
- if (canvas_item_visible (selection_group)) {
+ if (selection_group->visible ()) {
while (!used_selection_rects.empty()) {
free_selection_rects.push_front (used_selection_rects.front());
used_selection_rects.pop_front();
rect = get_selection_rect ((*i).id);
- x1 = _editor.frame_to_unit (start);
- x2 = _editor.frame_to_unit (start + cnt - 1);
+ x1 = _editor.sample_to_pixel (start);
+ x2 = _editor.sample_to_pixel (start + cnt - 1);
y2 = current_height();
- rect->rect->property_x1() = x1;
- rect->rect->property_y1() = 1.0;
- rect->rect->property_x2() = x2;
- rect->rect->property_y2() = y2;
+ rect->rect->set (ArdourCanvas::Rect (x1, 1, x2, y2));
// trim boxes are at the top for selections
if (x2 > x1) {
- rect->start_trim->property_x1() = x1;
- rect->start_trim->property_y1() = 1.0;
- rect->start_trim->property_x2() = x1 + trim_handle_size;
- rect->start_trim->property_y2() = y2;
-
- rect->end_trim->property_x1() = x2 - trim_handle_size;
- rect->end_trim->property_y1() = 1.0;
- rect->end_trim->property_x2() = x2;
- rect->end_trim->property_y2() = y2;
+ rect->start_trim->set (ArdourCanvas::Rect (x1, 1, x1 + trim_handle_size, y2));
+ rect->end_trim->set (ArdourCanvas::Rect (x2 - trim_handle_size, 1, x2, y2));
rect->start_trim->show();
rect->end_trim->show();
void
TimeAxisView::hide_selection ()
{
- if (canvas_item_visible (selection_group)) {
+ if (selection_group->visible ()) {
while (!used_selection_rects.empty()) {
free_selection_rects.push_front (used_selection_rects.front());
used_selection_rects.pop_front();
rect = new SelectionRect;
- rect->rect = new SimpleRect (*selection_group);
- rect->rect->property_outline_what() = 0x0;
- rect->rect->property_x1() = 0.0;
- rect->rect->property_y1() = 0.0;
- rect->rect->property_x2() = 0.0;
- rect->rect->property_y2() = 0.0;
- rect->rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectionRect.get();
+ rect->rect = new ArdourCanvas::Rectangle (selection_group);
+ CANVAS_DEBUG_NAME (rect->rect, "selection rect");
+ rect->rect->set_outline (false);
+ rect->rect->set_fill_color (ARDOUR_UI::config()->get_canvasvar_SelectionRect());
- rect->start_trim = new SimpleRect (*selection_group);
- rect->start_trim->property_outline_what() = 0x0;
- rect->start_trim->property_x1() = 0.0;
- rect->start_trim->property_x2() = 0.0;
+ rect->start_trim = new ArdourCanvas::Rectangle (selection_group);
+ CANVAS_DEBUG_NAME (rect->rect, "selection rect start trim");
+ rect->start_trim->set_outline (false);
+ rect->start_trim->set_fill (false);
- rect->end_trim = new SimpleRect (*selection_group);
- rect->end_trim->property_outline_what() = 0x0;
- rect->end_trim->property_x1() = 0.0;
- rect->end_trim->property_x2() = 0.0;
+ rect->end_trim = new ArdourCanvas::Rectangle (selection_group);
+ CANVAS_DEBUG_NAME (rect->rect, "selection rect end trim");
+ rect->end_trim->set_outline (false);
+ rect->end_trim->set_fill (false);
free_selection_rects.push_front (rect);
- rect->rect->signal_event().connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_selection_rect_event), rect->rect, rect));
- rect->start_trim->signal_event().connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_selection_start_trim_event), rect->rect, rect));
- rect->end_trim->signal_event().connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_selection_end_trim_event), rect->rect, rect));
+ rect->rect->Event.connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_selection_rect_event), rect->rect, rect));
+ rect->start_trim->Event.connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_selection_start_trim_event), rect->rect, rect));
+ rect->end_trim->Event.connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_selection_end_trim_event), rect->rect, rect));
}
rect = free_selection_rects.front();
for (list<SelectionRect*>::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i) {
- (*i)->rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectionRect.get();
- (*i)->rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
-
- (*i)->start_trim->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
- (*i)->start_trim->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
+ (*i)->rect->set_fill_color (ARDOUR_UI::config()->get_canvasvar_SelectionRect());
+ (*i)->rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_Selection());
- (*i)->end_trim->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
- (*i)->end_trim->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
+ (*i)->start_trim->set_fill_color (ARDOUR_UI::config()->get_canvasvar_Selection());
+ (*i)->start_trim->set_outline_color (ARDOUR_UI::config()->get_canvasvar_Selection());
+
+ (*i)->end_trim->set_fill_color (ARDOUR_UI::config()->get_canvasvar_Selection());
+ (*i)->end_trim->set_outline_color (ARDOUR_UI::config()->get_canvasvar_Selection());
}
-
+
for (list<SelectionRect*>::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) {
-
- (*i)->rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectionRect.get();
- (*i)->rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
-
- (*i)->start_trim->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
- (*i)->start_trim->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
-
- (*i)->end_trim->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
- (*i)->end_trim->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
+
+ (*i)->rect->set_fill_color (ARDOUR_UI::config()->get_canvasvar_SelectionRect());
+ (*i)->rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_Selection());
+
+ (*i)->start_trim->set_fill_color (ARDOUR_UI::config()->get_canvasvar_Selection());
+ (*i)->start_trim->set_outline_color (ARDOUR_UI::config()->get_canvasvar_Selection());
+
+ (*i)->end_trim->set_fill_color (ARDOUR_UI::config()->get_canvasvar_Selection());
+ (*i)->end_trim->set_outline_color (ARDOUR_UI::config()->get_canvasvar_Selection());
}
}
'libs/gtkmm2ext',
'libs/clearlooks-newer',
'libs/audiographer',
+ 'libs/canvas',
'gtk2_ardour',
'export',
'midi_maps',
conf.env.append_value('CXXFLAGS', '-D__STDC_LIMIT_MACROS')
conf.env.append_value('CXXFLAGS', '-D__STDC_FORMAT_MACROS')
+ conf.env.append_value('CXXFLAGS', '-DCANVAS_COMPATIBILITY')
+ conf.env.append_value('CXXFLAGS', '-DCANVAS_DEBUG')
if opt.nls:
conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
if Options.options.freebie:
conf.env.append_value ('CFLAGS', '-DNO_PLUGIN_STATE')
conf.env.append_value ('CXXFLAGS', '-DNO_PLUGIN_STATE')
+ conf.define ('NO_PLUGIN_STATE', 1)
if sys.platform == 'darwin':
conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'AudioToolbox', '-framework', 'AudioUnit'])
conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Cocoa'])
- if not Options.options.freebie:
- conf.env.append_value('CXXFLAGS_AUDIOUNITS')
-
if re.search ("^[1-9][0-9]\.", os.uname()[2]) == None and not Options.options.nocarbon:
conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DWITH_CARBON")
conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Carbon'])
write_config_text('Architecture flags', opts.arch)
write_config_text('Aubio', conf.is_defined('HAVE_AUBIO'))
write_config_text('AudioUnits', conf.is_defined('AUDIOUNIT_SUPPORT'))
- write_config_text('AU state support', conf.is_defined('AU_STATE_SUPPORT'))
+ write_config_text('No plugin state', conf.is_defined('NO_PLUGIN_STATE'))
write_config_text('Build target', conf.env['build_target'])
write_config_text('CoreAudio', conf.is_defined('HAVE_COREAUDIO'))
write_config_text('Debug RT allocations', conf.is_defined('DEBUG_RT_ALLOC'))