<menuitem action='set-punch-from-region'/>
</menu>
+ <separator/>
<menuitem action='Forward'/>
<menuitem action='Rewind'/>
<menuitem action='TransitionToRoll'/>
<menuitem action='TransitionToReverse'/>
- <menuitem action='nudge-playhead-forward'/>
- <menuitem action='nudge-playhead-backward'/>
+ <separator/>
+
+
+ <menuitem action='set-playhead'/>
<menu action="MovePlayHeadMenu">
- <menuitem action='set-playhead'/>
+
<menuitem action='playhead-to-edit'/>
<menuitem action='center-playhead'/>
<separator/>
+ <menuitem action='nudge-playhead-forward'/>
+ <menuitem action='nudge-playhead-backward'/>
+ <separator/>
<menuitem action='tab-to-transient-forwards'/>
<menuitem action='tab-to-transient-backwards'/>
<separator/>
<menuitem action='editor-separate'/>
<menuitem action='separate-from-loop'/>
<menuitem action='separate-from-punch'/>
+ <separator/>
+ <menuitem action='split-region-at-transients'/>
</menu>
<separator/>
<menuitem action='duplicate-region'/>
<menuitem action='multi-duplicate-region'/>
<menuitem action='region-fill-track'/>
+ <separator/>
<menu action="AlignMenu">
<menuitem action='align-regions-start'/>
<menuitem action='align-regions-start-relative'/>
<menuitem action='remove-region-sync'/>
<menuitem action='mute-unmute-region'/>
<separator/>
- <menuitem action='monoize-region'/>
+ <menuitem action='reverse-region'/>
+ <menuitem action='monoize-region'/>
<menuitem action='normalize-region'/>
- <menuitem action='split-region-at-transients'/>
- <separator/>
- <menu action="RegionGainMenu">
- <menuitem action='boost-region-gain'/>
- <menuitem action='cut-region-gain'/>
- </menu>
+ <menuitem action='boost-region-gain'/>
+ <menuitem action='cut-region-gain'/>
<menuitem action='pitch-shift-region'/>
- <menuitem action='reverse-region'/>
+
</menu>
<menu name='View' action = 'View'>
<menuitem action='show-editor-mixer'/>
<menuitem action='ToggleMeasureVisibility'/>
<menuitem action='ToggleLogoVisibility'/>
+ <separator/>
<menu action="PrimaryClockMenu">
<menuitem action="primary-clock-bbt"/>
<menuitem action="primary-clock-minsec"/>
void toggle_clocking ();
void toggle_auto_play ();
void toggle_auto_input ();
+ void toggle_punch ();
void toggle_punch_in ();
void toggle_punch_out ();
void toggle_auto_return ();
act = ActionManager::register_toggle_action (transport_actions, X_("TogglePunchOut"), _("Punch Out"), mem_fun(*this, &ARDOUR_UI::toggle_punch_out));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
+ act = ActionManager::register_toggle_action (transport_actions, X_("TogglePunch"), _("Punch In/Out"), mem_fun(*this, &ARDOUR_UI::toggle_punch));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (transport_actions, X_("ToggleClick"), _("Click"), mem_fun(*this, &ARDOUR_UI::toggle_click));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
}
}
+void
+ARDOUR_UI::toggle_punch ()
+{
+ Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", "TogglePunchIn");
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+ Config->set_punch_in (tact->get_active());
+ Config->set_punch_out (tact->get_active());
+ }
+}
+
void
ARDOUR_UI::toggle_punch_in ()
{
sprintf (buf, "%.3fK", rate/1000.0f);
}
- frames_upper_info_label->set_text (buf);
+ if (frames_upper_info_label->get_text() != buf) {
+ frames_upper_info_label->set_text (buf);
+ }
float vid_pullup = Config->get_video_pullup();
if (vid_pullup == 0.0) {
- frames_lower_info_label->set_text(_("none"));
+ if (frames_lower_info_label->get_text () != _("none")) {
+ frames_lower_info_label->set_text(_("none"));
+ }
} else {
sprintf (buf, "%-6.4f", vid_pullup);
- frames_lower_info_label->set_text (buf);
+ if (frames_lower_info_label->get_text() != buf) {
+ frames_lower_info_label->set_text (buf);
+ }
}
}
}
sprintf (buf, "%.2f", smpte_frames);
}
- smpte_upper_info_label->set_text (buf);
+ if (smpte_upper_info_label->get_text() != buf) {
+ smpte_upper_info_label->set_text (buf);
+ }
if ((fabs(smpte_frames - 29.97) < 0.0001) || smpte_frames == 30) {
if (session->smpte_drop_frames()) {
buf[0] = '\0';
}
- smpte_lower_info_label->set_text (buf);
+ if (smpte_lower_info_label->get_text() != buf) {
+ smpte_lower_info_label->set_text (buf);
+ }
}
}
if (bbt_upper_info_label) {
TempoMap::Metric m (session->tempo_map().metric_at (when));
sprintf (buf, "%-5.2f", m.tempo().beats_per_minute());
- bbt_lower_info_label->set_text (buf);
+ if (bbt_lower_info_label->get_text() != buf) {
+ bbt_lower_info_label->set_text (buf);
+ }
sprintf (buf, "%g|%g", m.meter().beats_per_bar(), m.meter().note_divisor());
- bbt_upper_info_label->set_text (buf);
+ if (bbt_upper_info_label->get_text() != buf) {
+ bbt_upper_info_label->set_text (buf);
+ }
}
}
gnome_canvas_imageframe_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
int x, int y, int width, int height)
{
- fprintf(stderr, "please don't use the CanvasImageFrame item in a non-aa Canvas\n") ;
- abort() ;
}
static double
#include <stdio.h>
#include <math.h>
+#include <cairo.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include "canvas-simpleline.h"
int width, int height)
{
GnomeCanvasSimpleLine *simpleline;
+ cairo_t* cr;
+ double ulx;
+ double uly;
+ double lrx;
+ double lry;
simpleline = GNOME_CANVAS_SIMPLELINE (item);
- if (parent_class->draw) {
- (* parent_class->draw) (item, drawable, x, y, width, height);
+ cr = gdk_cairo_create (drawable);
+
+ if (x > simpleline->bbox_ulx) {
+ ulx = x;
+ } else {
+ ulx = simpleline->bbox_ulx;
+ }
+
+ if (y > simpleline->bbox_uly) {
+ uly = y;
+ } else {
+ uly = simpleline->bbox_uly;
+ }
+
+ if (x + width > simpleline->bbox_lrx) {
+ lrx = simpleline->bbox_lrx;
+ } else {
+ lrx = x + width;
+ }
+
+ if (y + height > simpleline->bbox_lry) {
+ lry = simpleline->bbox_lry;
+ } else {
+ lry = y + height;
}
- fprintf (stderr, "please don't use the CanvasSimpleLine item in a non-aa Canvas\n");
- abort ();
+ ulx -= x;
+ uly -= y;
+ lrx -= x;
+ lry -= y;
+
+ cairo_set_source_rgba (cr,
+ simpleline->r/255.0,
+ simpleline->g/255.0,
+ simpleline->b/255.0,
+ simpleline->a/255.0);
+ cairo_set_line_width (cr, 1);
+ cairo_move_to (cr, ulx+0.5, uly+0.5);
+ cairo_line_to (cr, lrx+0.5, lry+0.5);
+ cairo_stroke (cr);
}
static void
*actual_item = item;
- /* Find the bounds for the rectangle plus its outline width */
+ /* Find the bounds for the line plus its outline width */
gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2);
- /* Is point inside rectangle */
+ /* Is point inside line */
if ((x >= x1) && (y >= y1) && (x <= x2) && (y <= y2)) {
return 0.0;
}
- /* Point is outside rectangle */
+ /* Point is outside line */
if (x < x1)
dx = x1 - x;
#include <stdio.h>
#include <math.h>
+#include <cairo.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include "canvas-simplerect.h"
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x1, y1, &simplerect->bbox_ulx, &simplerect->bbox_uly);
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x2, y2, &simplerect->bbox_lrx, &simplerect->bbox_lry);
- /* now queue redraws for changed areas */
+ /* now queue redraws for changed areas */
if (item->x1 == old_x1 && item->x2 == old_x2) {
static void
gnome_canvas_simplerect_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height)
+ GdkDrawable *drawable,
+ int x, int y,
+ int width, int height)
{
- fprintf (stderr, "please don't use the CanvasSimpleRect item in a non-aa Canvas\n");
- abort ();
+ GnomeCanvasSimpleRect *simplerect;
+ cairo_t* cr;
+ double ulx;
+ double uly;
+ double lrx;
+ double lry;
+
+ simplerect = GNOME_CANVAS_SIMPLERECT (item);
+
+ cr = gdk_cairo_create (drawable);
+
+ if (x > simplerect->bbox_ulx) {
+ ulx = x;
+ } else {
+ ulx = simplerect->bbox_ulx;
+ }
+
+ if (y > simplerect->bbox_uly) {
+ uly = y;
+ } else {
+ uly = simplerect->bbox_uly;
+ }
+
+ if (x + width > simplerect->bbox_lrx) {
+ lrx = simplerect->bbox_lrx;
+ } else {
+ lrx = x + width;
+ }
+
+ if (y + height > simplerect->bbox_lry) {
+ lry = simplerect->bbox_lry;
+ } else {
+ lry = y + height;
+ }
+
+ ulx -= x;
+ uly -= y;
+ lrx -= x;
+ lry -= y;
+
+ cairo_rectangle (cr, ulx, uly, lrx - ulx, lry - uly);
+
+ if (simplerect->fill) {
+ cairo_set_source_rgba (cr,
+ simplerect->fill_r/255.0,
+ simplerect->fill_g/255.0,
+ simplerect->fill_b/255.0,
+ simplerect->fill_a/255.0);
+ cairo_fill (cr);
+ }
+
+ if (simplerect->outline_what && simplerect->outline_pixels) {
+
+#define x_in_range(a) (x <= (a) && (a) < x + width)
+#define y_in_range(a) (y <= (a) && (a) < y + height)
+
+ cairo_set_line_width (cr, simplerect->outline_pixels);
+
+ cairo_set_source_rgb (cr,
+ simplerect->outline_r/255.0,
+ simplerect->outline_g/255.0,
+ simplerect->outline_b/255.0);
+
+ if (simplerect->outline_what & 0x1) {
+ /* left edge, if visible */
+ if (x_in_range (simplerect->bbox_ulx)) {
+ cairo_move_to (cr, ulx+0.5, uly+0.5);
+ cairo_line_to (cr, ulx+0.5, lry+0.5);
+ cairo_stroke (cr);
+ }
+ }
+
+ if (simplerect->outline_what & 0x2) {
+ /* right edge, if visible */
+ if (x_in_range (simplerect->bbox_lrx)) {
+ cairo_move_to (cr, lrx+0.5, uly+0.5);
+ cairo_line_to (cr, lrx+0.5, lry+0.5);
+ cairo_stroke (cr);
+ }
+ }
+
+ if (simplerect->outline_what & 0x4) {
+ /* top edge */
+ if (y_in_range (simplerect->bbox_uly)) {
+ cairo_move_to (cr, ulx+0.5, uly+0.5);
+ cairo_line_to (cr, lrx+0.5, uly+0.5);
+ cairo_stroke (cr);
+ }
+ }
+
+ if (simplerect->outline_what & 0x8) {
+ /* bottom edge */
+ if (y_in_range (simplerect->bbox_lry)) {
+ cairo_move_to (cr, ulx+0.5, lry+0.5);
+ cairo_line_to (cr, lrx+0.5, lry+0.5);
+ cairo_stroke (cr);
+ }
+ }
+ }
+
+ cairo_destroy (cr);
}
static double
#include <stdio.h>
#include <math.h>
#include <libgnomecanvas/libgnomecanvas.h>
+#include <cairo.h>
#include <string.h>
#include <limits.h>
static void
gnome_canvas_waveview_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height)
+ GdkDrawable *drawable,
+ int x, int y,
+ int width, int height)
{
GnomeCanvasWaveView *waveview;
+ cairo_t* cr;
+ gulong s1, s2;
+ int cache_index;
+ double zbegin, zend;
+ gboolean rectify;
+ double n;
+ double origin;
+ double clip_length;
+ double xoff;
+ double yoff;
+ double ulx;
+ double uly;
+ double lrx;
+ double lry;
waveview = GNOME_CANVAS_WAVEVIEW (item);
- if (parent_class->draw) {
- (* parent_class->draw) (item, drawable, x, y, width, height);
+ /* compute intersection of Drawable area and waveview,
+ in canvas coordinate space
+ */
+
+ if (x > waveview->bbox_ulx) {
+ ulx = x;
+ zbegin = ulx;
+ } else {
+ ulx = waveview->bbox_ulx;
+ zbegin = ulx + 1;
+ }
+
+ if (y > waveview->bbox_uly) {
+ uly = y;
+ } else {
+ uly = waveview->bbox_uly;
+ }
+
+ if (x + width > waveview->bbox_lrx) {
+ lrx = waveview->bbox_lrx;
+ zend = lrx - 1;
+ } else {
+ lrx = x + width;
+ zend = lrx;
+ }
+
+ if (y + height > waveview->bbox_lry) {
+ lry = waveview->bbox_lry;
+ } else {
+ lry = y + height;
+ }
+
+ /* figure out which samples we need for the resulting intersection */
+
+ s1 = floor ((ulx - waveview->bbox_ulx) * waveview->samples_per_unit) ;
+
+ if (lrx == waveview->bbox_lrx) {
+ /* This avoids minor rounding errors when we have the
+ entire region visible.
+ */
+ s2 = waveview->samples;
+ } else {
+ s2 = s1 + floor ((lrx - ulx) * waveview->samples_per_unit);
+ }
+
+ /* translate back to buffer coordinate space */
+
+ ulx -= x;
+ uly -= y;
+ lrx -= x;
+ lry -= y;
+ zbegin -= x;
+ zend -= x;
+
+ /* don't rectify at single-sample zoom */
+ if(waveview->rectified && waveview->samples_per_unit > 1.0) {
+ rectify = TRUE;
+ } else {
+ rectify = FALSE;
+ }
+
+ clip_length = MIN(5,(waveview->height/4));
+
+ cr = gdk_cairo_create (drawable);
+ cairo_set_line_width (cr, 0.5);
+
+ origin = waveview->bbox_uly - y + waveview->half_height;
+
+ cairo_rectangle (cr, ulx, uly, lrx - ulx, lry - uly);
+ cairo_clip (cr);
+
+ if (waveview->cache_updater && waveview->reload_cache_in_render) {
+ waveview->cache->start = 0;
+ waveview->cache->end = 0;
+ waveview->reload_cache_in_render = FALSE;
+ }
+
+ cache_index = gnome_canvas_waveview_ensure_cache (waveview, s1, s2);
+
+#if 0
+ printf ("%p r (%d,%d)(%d,%d)[%d x %d] bbox (%d,%d)(%d,%d)[%d x %d]"
+ " draw (%.1f,%.1f)(%.1f,%.1f)[%.1f x %.1f] s= %lu..%lu\n",
+ waveview,
+ x, y,
+ x + width,
+ y + height,
+ width,
+ height,
+ waveview->bbox_ulx,
+ waveview->bbox_uly,
+ waveview->bbox_lrx,
+ waveview->bbox_lry,
+ waveview->bbox_lrx - waveview->bbox_ulx,
+ waveview->bbox_lry - waveview->bbox_uly,
+ ulx, uly,
+ lrx, lry,
+ lrx - ulx,
+ lry - uly,
+ s1, s2);
+#endif
+
+ /* draw the top half */
+
+ for (xoff = ulx; xoff < lrx; xoff++) {
+ double max, min;
+
+ max = waveview->cache->data[cache_index].max;
+ min = waveview->cache->data[cache_index].min;
+
+ if (min <= -1.0) {
+ min = -1.0;
+ }
+
+ if (max >= 1.0) {
+ max = 1.0;
+ }
+
+ if (rectify) {
+ if (fabs (min) > fabs (max)) {
+ max = fabs (min);
+ }
+ }
+
+ yoff = origin - (waveview->half_height * max) + 0.5;
+
+ if (n == ulx) {
+ cairo_move_to (cr, xoff+0.5, yoff);
+ } else {
+ cairo_line_to (cr, xoff+0.5, yoff);
+ }
+
+ cache_index++;
}
- fprintf (stderr, "please don't use the CanvasWaveView item in a non-aa Canvas\n");
- abort ();
+ /* from the final top point, move out of the clip zone */
+
+ cairo_line_to (cr, xoff + 10, yoff);
+
+ /* now draw the bottom half */
+
+ for (--xoff, --cache_index; xoff >= ulx; --xoff) {
+ double min;
+ int clip_min;
+
+ min = waveview->cache->data[cache_index].min;
+
+ if (min <= -1.0) {
+ min = -1.0;
+ }
+
+ yoff = origin - (waveview->half_height * min) + 0.5;
+
+ cairo_line_to (cr, xoff+0.5, yoff);
+ cache_index--;
+ }
+
+ /* from the final lower point, move out of the clip zone */
+
+ cairo_line_to (cr, xoff - 10, yoff);
+
+ /* close path to fill */
+
+ cairo_close_path (cr);
+
+ /* fill and stroke */
+
+ cairo_set_source_rgba (cr,
+ (waveview->fill_r/255.0),
+ (waveview->fill_g/255.0),
+ (waveview->fill_b/255.0),
+ (waveview->fill_a/255.0));
+ cairo_fill_preserve (cr);
+ cairo_set_source_rgba (cr,
+ (waveview->wave_r/255.0),
+ (waveview->wave_g/255.0),
+ (waveview->wave_b/255.0),
+ (waveview->wave_a/255.0));
+ cairo_stroke (cr);
+
+ cairo_destroy (cr);
}
+#if 0
+ if (clip_max || clip_min) {
+ cairo_set_source_rgba (cr, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a);
+ }
+
+ if (clip_max) {
+ cairo_move_to (cr, xoff, yoff1);
+ cairo_line_to (cr, xoff, yoff1 + clip_length);
+ cairo_stroke (cr);
+ }
+
+ if (clip_min) {
+ cairo_move_to (cr, xoff, yoff2);
+ cairo_line_to (cr, xoff, yoff2 - clip_length);
+ cairo_stroke (cr);
+ }
+
+#endif
+
static void
gnome_canvas_waveview_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y2)
{
class Item;
class Group;
class Canvas;
+ class Rect;
class SimpleRect;
class SimpleLine;
class Polygon;
horizontal_adjustment.signal_value_changed().connect (mem_fun(*this, &Editor::canvas_horizontally_scrolled), false);
vertical_adjustment.signal_value_changed().connect (mem_fun(*this, &Editor::tie_vertical_scrolling), true);
- track_canvas.set_hadjustment (horizontal_adjustment);
- track_canvas.set_vadjustment (vertical_adjustment);
- time_canvas.set_hadjustment (horizontal_adjustment);
+ track_canvas->set_hadjustment (horizontal_adjustment);
+ track_canvas->set_vadjustment (vertical_adjustment);
+ time_canvas->set_hadjustment (horizontal_adjustment);
- track_canvas.signal_map_event().connect (mem_fun (*this, &Editor::track_canvas_map_handler));
- time_canvas.signal_map_event().connect (mem_fun (*this, &Editor::time_canvas_map_handler));
+ track_canvas->signal_map_event().connect (mem_fun (*this, &Editor::track_canvas_map_handler));
+ time_canvas->signal_map_event().connect (mem_fun (*this, &Editor::time_canvas_map_handler));
controls_layout.add (edit_controls_vbox);
controls_layout.set_name ("EditControlsBase");
time_canvas_vbox.pack_start (*smpte_ruler, false, false);
time_canvas_vbox.pack_start (*frames_ruler, false, false);
time_canvas_vbox.pack_start (*bbt_ruler, false, false);
- time_canvas_vbox.pack_start (time_canvas, true, true);
+ time_canvas_vbox.pack_start (*time_canvas, true, true);
time_canvas_vbox.set_size_request (-1, (int)(timebar_height * visible_timebars) + 2);
bbt_label.set_name ("EditorTimeButton");
for the canvas areas.
*/
- track_canvas_event_box.add (track_canvas);
+ track_canvas_event_box.add (*track_canvas);
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);
image_socket_listener = 0 ;
}
/* </CMT Additions> */
+
+ if (track_canvas) {
+ delete track_canvas;
+ track_canvas = 0;
+ }
+
+ if (time_canvas) {
+ delete time_canvas;
+ time_canvas = 0;
+ }
}
void
Location* tll;
if ((tll = transport_loop_location()) == 0) {
+ cerr << "Set new\n";
Location* loc = new Location (start, end, _("Loop"), Location::IsAutoLoop);
XMLNode &before = session->locations()->get_state();
session->locations()->add (loc, true);
session->set_auto_loop_location (loc);
XMLNode &after = session->locations()->get_state();
session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
- }
- else {
+ } else {
+ cerr << "Set existing\n";
XMLNode &before = tll->get_state();
tll->set_hidden (false, this);
tll->set (start, end);
*/
if (pixel >= 0) {
- return (nframes_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit);
+ return (nframes_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
} else {
return 0;
}
}
gulong frame_to_pixel (nframes64_t frame) const {
- return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit)));
+ return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
}
void flush_canvas ();
void set_canvas_cursor ();
Gdk::Cursor* which_grabber_cursor ();
- ArdourCanvas::CanvasAA track_canvas;
- ArdourCanvas::CanvasAA time_canvas;
+ ArdourCanvas::Canvas* track_canvas;
+ ArdourCanvas::Canvas* time_canvas;
ArdourCanvas::Text* first_action_message;
ArdourCanvas::Text* verbose_canvas_cursor;
void
Editor::reset_focus ()
{
- track_canvas.grab_focus();
+ track_canvas->grab_focus();
}
interthread_progress_connection = Glib::signal_timeout().connect
(bind (mem_fun(*this, &Editor::import_progress_timeout), (gpointer) 0), 100);
- track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
+ track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
ARDOUR_UI::instance()->flush_pending ();
/* start import thread for this spec. this will ultimately call Session::import_audiofile()
}
out:
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
return 0;
}
SoundFileInfo finfo;
int ret = 0;
- track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
+ track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
ARDOUR_UI::instance()->flush_pending ();
for (vector<Glib::ustring>::iterator p = paths.begin(); p != paths.end(); ++p) {
}
}
- track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
+ track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
for (int n = 0; n < finfo.channels; ++n) {
try {
ret = add_sources (paths, sources, pos, mode, target_regions, target_tracks, track, true);
out:
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
return ret;
}
} else {
stop_updating ();
}
- track_canvas_allocate(track_canvas.get_allocation());
+ track_canvas_allocate(track_canvas->get_allocation());
}
void
void
Editor::initialize_canvas ()
{
+ if (getenv ("ARDOUR_NON_AA_CANVAS")) {
+ track_canvas = new ArdourCanvas::Canvas ();
+ time_canvas = new ArdourCanvas::Canvas ();
+ } else {
+ track_canvas = new ArdourCanvas::CanvasAA ();
+ time_canvas = new ArdourCanvas::CanvasAA ();
+ }
+
ArdourCanvas::init ();
ardour_canvas_type_init ();
/* don't try to center the canvas */
- track_canvas.set_center_scroll_region (false);
- track_canvas.set_dither (Gdk::RGB_DITHER_NONE);
+ track_canvas->set_center_scroll_region (false);
+ track_canvas->set_dither (Gdk::RGB_DITHER_NONE);
/* need to handle 4 specific types of events as catch-alls */
- track_canvas.signal_scroll_event().connect (mem_fun (*this, &Editor::track_canvas_scroll_event));
- track_canvas.signal_motion_notify_event().connect (mem_fun (*this, &Editor::track_canvas_motion_notify_event));
- track_canvas.signal_button_press_event().connect (mem_fun (*this, &Editor::track_canvas_button_press_event));
- track_canvas.signal_button_release_event().connect (mem_fun (*this, &Editor::track_canvas_button_release_event));
+ track_canvas->signal_scroll_event().connect (mem_fun (*this, &Editor::track_canvas_scroll_event));
+ track_canvas->signal_motion_notify_event().connect (mem_fun (*this, &Editor::track_canvas_motion_notify_event));
+ track_canvas->signal_button_press_event().connect (mem_fun (*this, &Editor::track_canvas_button_press_event));
+ track_canvas->signal_button_release_event().connect (mem_fun (*this, &Editor::track_canvas_button_release_event));
/* just scroll stuff for the timecanvas */
- time_canvas.signal_scroll_event().connect (mem_fun (*this, &Editor::time_canvas_scroll_event));
+ time_canvas->signal_scroll_event().connect (mem_fun (*this, &Editor::time_canvas_scroll_event));
- track_canvas.set_name ("EditorMainCanvas");
- track_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK);
- track_canvas.signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
- track_canvas.set_flags (CAN_FOCUS);
+ track_canvas->set_name ("EditorMainCanvas");
+ track_canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK);
+ track_canvas->signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
+ track_canvas->set_flags (CAN_FOCUS);
/* set up drag-n-drop */
target_table.push_back (TargetEntry ("text/uri-list"));
target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
- track_canvas.drag_dest_set (target_table);
- track_canvas.signal_drag_data_received().connect (mem_fun(*this, &Editor::track_canvas_drag_data_received));
+ track_canvas->drag_dest_set (target_table);
+ track_canvas->signal_drag_data_received().connect (mem_fun(*this, &Editor::track_canvas_drag_data_received));
/* stuff for the verbose canvas cursor */
Pango::FontDescription* font = get_font_for_style (N_("VerboseCanvasCursor"));
- verbose_canvas_cursor = new ArdourCanvas::Text (*track_canvas.root());
+ verbose_canvas_cursor = new ArdourCanvas::Text (*track_canvas->root());
verbose_canvas_cursor->property_font_desc() = *font;
verbose_canvas_cursor->property_anchor() = ANCHOR_NW;
if (Profile->get_sae()) {
Image img (::get_icon (X_("saelogo")));
- logo_item = new ArdourCanvas::Pixbuf (*track_canvas.root(), 0.0, 0.0, img.get_pixbuf());
+ logo_item = new ArdourCanvas::Pixbuf (*track_canvas->root(), 0.0, 0.0, img.get_pixbuf());
// logo_item->property_height_in_pixels() = true;
// logo_item->property_width_in_pixels() = true;
// logo_item->property_height_set() = true;
/* a group to hold time (measure) lines */
- time_line_group = new ArdourCanvas::Group (*track_canvas.root(), 0.0, 0.0);
- cursor_group = new ArdourCanvas::Group (*track_canvas.root(), 0.0, 0.0);
-
- time_canvas.set_name ("EditorTimeCanvas");
- time_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK);
- time_canvas.set_flags (CAN_FOCUS);
- time_canvas.set_center_scroll_region (false);
- time_canvas.set_dither (Gdk::RGB_DITHER_NONE);
+ time_line_group = new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0);
+ cursor_group = new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0);
+
+ time_canvas->set_name ("EditorTimeCanvas");
+ time_canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK);
+ time_canvas->set_flags (CAN_FOCUS);
+ time_canvas->set_center_scroll_region (false);
+ time_canvas->set_dither (Gdk::RGB_DITHER_NONE);
- meter_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0);
- tempo_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height);
- range_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 2.0);
- transport_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 3.0);
- marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 4.0);
- cd_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 5.0);
+ meter_group = new ArdourCanvas::Group (*time_canvas->root(), 0.0, 0.0);
+ tempo_group = new ArdourCanvas::Group (*time_canvas->root(), 0.0, timebar_height);
+ range_marker_group = new ArdourCanvas::Group (*time_canvas->root(), 0.0, timebar_height * 2.0);
+ transport_marker_group = new ArdourCanvas::Group (*time_canvas->root(), 0.0, timebar_height * 3.0);
+ marker_group = new ArdourCanvas::Group (*time_canvas->root(), 0.0, timebar_height * 4.0);
+ cd_marker_group = new ArdourCanvas::Group (*time_canvas->root(), 0.0, timebar_height * 5.0);
tempo_bar = new ArdourCanvas::SimpleRect (*tempo_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
- tempo_bar->property_outline_pixels() = 0;
+ // tempo_bar->property_outline_pixels() = 0;
meter_bar = new ArdourCanvas::SimpleRect (*meter_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
- meter_bar->property_outline_pixels() = 0;
+ // meter_bar->property_outline_pixels() = 0;
marker_bar = new ArdourCanvas::SimpleRect (*marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
- marker_bar->property_outline_pixels() = 0;
+ // marker_bar->property_outline_pixels() = 0;
cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
- cd_marker_bar->property_outline_pixels() = 0;
+ // cd_marker_bar->property_outline_pixels() = 0;
range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
- range_marker_bar->property_outline_pixels() = 0;
+ // range_marker_bar->property_outline_pixels() = 0;
transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
- transport_marker_bar->property_outline_pixels() = 0;
+ // transport_marker_bar->property_outline_pixels() = 0;
cd_marker_bar_drag_rect = new ArdourCanvas::SimpleRect (*cd_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
- cd_marker_bar_drag_rect->property_outline_pixels() = 0;
+ // cd_marker_bar_drag_rect->property_outline_pixels() = 0;
cd_marker_bar_drag_rect->hide ();
range_bar_drag_rect = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.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, 0.0));
- marker_drag_line = new ArdourCanvas::Line (*track_canvas.root());
+ marker_drag_line = new ArdourCanvas::Line (*track_canvas->root());
marker_drag_line->property_width_pixels() = 1;
marker_drag_line->property_points() = marker_drag_line_points;
marker_drag_line->hide();
- range_marker_drag_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
+ range_marker_drag_rect = new ArdourCanvas::SimpleRect (*track_canvas->root(), 0.0, 0.0, 0.0, 0.0);
range_marker_drag_rect->hide ();
transport_loop_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
transport_punchout_line->hide();
// used to show zoom mode active zooming
- zoom_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
+ zoom_rect = new ArdourCanvas::SimpleRect (*track_canvas->root(), 0.0, 0.0, 0.0, 0.0);
zoom_rect->property_outline_pixels() = 1;
zoom_rect->hide();
zoom_rect->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_zoom_rect_event), (ArdourCanvas::Item*) 0));
// used as rubberband rect
- rubberband_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
+ rubberband_rect = new ArdourCanvas::SimpleRect (*track_canvas->root(), 0.0, 0.0, 0.0, 0.0);
rubberband_rect->property_outline_pixels() = 1;
rubberband_rect->hide();
double time_height = timebar_height * 5;
double time_width = FLT_MAX/frames_per_unit;
- time_canvas.set_scroll_region(0.0, 0.0, time_width, time_height);
+ time_canvas->set_scroll_region(0.0, 0.0, time_width, time_height);
playhead_cursor = new Cursor (*this, &Editor::canvas_playhead_cursor_event);
initial_ruler_update_required = true;
- track_canvas.signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate));
+ track_canvas->signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate));
if (logo_item) {
logo_item->lower_to_bottom ();
double last_canvas_unit = max ((last_canvas_frame / frames_per_unit), canvas_width);
- track_canvas.set_scroll_region (0.0, 0.0, last_canvas_unit, pos);
+ track_canvas->set_scroll_region (0.0, 0.0, last_canvas_unit, pos);
// XXX what is the correct height value for the time canvas ? this overstates it
- time_canvas.set_scroll_region ( 0.0, 0.0, last_canvas_unit, canvas_height);
+ time_canvas->set_scroll_region ( 0.0, 0.0, last_canvas_unit, canvas_height);
range_marker_drag_rect->property_y2() = canvas_height;
transport_loop_range_rect->property_y2() = canvas_height;
bool
Editor::track_canvas_map_handler (GdkEventAny* ev)
{
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
return false;
}
bool
Editor::time_canvas_map_handler (GdkEventAny* ev)
{
- time_canvas.get_window()->set_cursor (*timebar_cursor);
+ time_canvas->get_window()->set_cursor (*timebar_cursor);
return false;
}
double wx;
double wy;
- track_canvas.window_to_world (x, y, wx, wy);
+ track_canvas->window_to_world (x, y, wx, wy);
wx += horizontal_adjustment.get_value();
wy += vertical_adjustment.get_value();
Editor::flush_canvas ()
{
if (is_mapped()) {
- track_canvas.update_now ();
- // gdk_window_process_updates (GTK_LAYOUT(track_canvas.gobj())->bin_window, true);
+ track_canvas->update_now ();
+ // gdk_window_process_updates (GTK_LAYOUT(track_canvas->gobj())->bin_window, true);
}
}
if we're in mid zoom, so we have to get the damn mouse
pointer again
*/
- track_canvas.get_pointer (x, y);
- track_canvas.window_to_world (x, y, wx, wy);
+ track_canvas->get_pointer (x, y);
+ track_canvas->window_to_world (x, y, wx, wy);
wx += horizontal_adjustment.get_value();
wy += vertical_adjustment.get_value();
case GDK_SCROLL_DOWN:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
//if (ev->state == GDK_CONTROL_MASK) {
- track_canvas.get_pointer (x, y);
- track_canvas.window_to_world (x, y, wx, wy);
+ track_canvas->get_pointer (x, y);
+ track_canvas->window_to_world (x, y, wx, wy);
wx += horizontal_adjustment.get_value();
wy += vertical_adjustment.get_value();
bool
Editor::track_canvas_scroll_event (GdkEventScroll *event)
{
- track_canvas.grab_focus();
+ track_canvas->grab_focus();
track_canvas_scroll (event);
return false;
}
bool
Editor::time_canvas_scroll_event (GdkEventScroll *event)
{
- time_canvas.grab_focus();
+ time_canvas->grab_focus();
time_canvas_scroll (event);
return false;
}
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;
}
Editor::handle_new_imageframe_time_axis_view(const string & track_name, void* src)
{
ImageFrameTimeAxis* iftav ;
- iftav = new ImageFrameTimeAxis(track_name, *this, *session, track_canvas) ;
+ iftav = new ImageFrameTimeAxis(track_name, *this, *session, *track_canvas) ;
iftav->set_time_axis_name(track_name, this) ;
track_views.push_back(iftav) ;
void
Editor::handle_new_imageframe_marker_time_axis_view(const string & track_name, TimeAxisView* marked_track)
{
- MarkerTimeAxis* mta = new MarkerTimeAxis (*this, *this->current_session(), track_canvas, track_name, marked_track) ;
+ MarkerTimeAxis* mta = new MarkerTimeAxis (*this, *this->current_session(), *track_canvas, track_name, marked_track) ;
((ImageFrameTimeAxis*)marked_track)->add_marker_time_axis(mta, this) ;
track_views.push_back(mta) ;
double worldx, worldy;
GdkEvent ev;
Gdk::ModifierType mask;
- Glib::RefPtr<Gdk::Window> evw = track_canvas.get_window()->get_pointer (x, y, mask);
+ Glib::RefPtr<Gdk::Window> evw = track_canvas->get_window()->get_pointer (x, y, mask);
bool doit = false;
if (use_track_canvas && track_canvas_event_box.get_window()->get_pointer(x, y, mask) != 0) {
selection->set (entered_regionview);
}
- track_canvas.window_to_world (x, y, worldx, worldy);
+ track_canvas->window_to_world (x, y, worldx, worldy);
worldx += horizontal_adjustment.get_value();
worldy += vertical_adjustment.get_value();
double x2 = frame_to_pixel (tpl->end());
guint track_canvas_width,track_canvas_height;
- track_canvas.get_size(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;
int x, y;
double wx, wy;
Gdk::ModifierType mask;
- Glib::RefPtr<Gdk::Window> canvas_window = const_cast<Editor*>(this)->track_canvas.get_window();
+ Glib::RefPtr<Gdk::Window> canvas_window = const_cast<Editor*>(this)->track_canvas->get_window();
Glib::RefPtr<const Gdk::Window> pointer_window;
pointer_window = canvas_window->get_pointer (x, y, mask);
- if (pointer_window == track_canvas.get_bin_window()) {
+ if (pointer_window == track_canvas->get_bin_window()) {
- track_canvas.window_to_world (x, y, wx, wy);
+ track_canvas->window_to_world (x, y, wx, wy);
in_track_canvas = true;
} else {
in_track_canvas = false;
- if (pointer_window == time_canvas.get_bin_window()) {
- time_canvas.window_to_world (x, y, wx, wy);
+ if (pointer_window == time_canvas->get_bin_window()) {
+ time_canvas->window_to_world (x, y, wx, wy);
} else {
return false;
}
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
- track_canvas.w2c(event->button.x, event->button.y, *pcx, *pcy);
+ track_canvas->w2c(event->button.x, event->button.y, *pcx, *pcy);
break;
case GDK_MOTION_NOTIFY:
- track_canvas.w2c(event->motion.x, event->motion.y, *pcx, *pcy);
+ track_canvas->w2c(event->motion.x, event->motion.y, *pcx, *pcy);
break;
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
- track_canvas.w2c(event->crossing.x, event->crossing.y, *pcx, *pcy);
+ track_canvas->w2c(event->crossing.x, event->crossing.y, *pcx, *pcy);
break;
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
- // track_canvas.w2c(event->key.x, event->key.y, *pcx, *pcy);
+ // track_canvas->w2c(event->key.x, event->key.y, *pcx, *pcy);
break;
default:
warning << string_compose (_("Editor::event_frame() used on unhandled event type %1"), event->type) << endmsg;
}
if (is_drawable()) {
- track_canvas.get_window()->set_cursor(*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor(*current_canvas_cursor);
}
}
bool
Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{
- track_canvas.grab_focus();
+ track_canvas->grab_focus();
if (session && session->actively_recording()) {
return true;
scrub_reverse_distance = 0;
last_scrub_x = event->button.x;
scrubbing_direction = 0;
- track_canvas.get_window()->set_cursor (*transparent_cursor);
+ track_canvas->get_window()->set_cursor (*transparent_cursor);
/* rest handled in motion & release */
break;
case MouseAudition:
_scrubbing = false;
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
if (scrubbing_direction == 0) {
/* no drag, just a click */
switch (item_type) {
fraction = 1.0 - (cp->get_y() / cp->line.height());
if (is_drawable() && !_scrubbing) {
- track_canvas.get_window()->set_cursor (*fader_cursor);
+ track_canvas->get_window()->set_cursor (*fader_cursor);
}
last_item_entered_n++;
show_verbose_canvas_cursor ();
if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*fader_cursor);
+ track_canvas->get_window()->set_cursor (*fader_cursor);
}
}
break;
if (line)
line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_EnteredGainLine.get();
if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*fader_cursor);
+ track_canvas->get_window()->set_cursor (*fader_cursor);
}
}
break;
line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_EnteredAutomationLine.get();
}
if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*fader_cursor);
+ track_canvas->get_window()->set_cursor (*fader_cursor);
}
}
break;
case RegionViewNameHighlight:
if (is_drawable() && mouse_mode == MouseObject) {
- track_canvas.get_window()->set_cursor (*trimmer_cursor);
+ track_canvas->get_window()->set_cursor (*trimmer_cursor);
}
break;
/* </CMT Additions> */
if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*trimmer_cursor);
+ track_canvas->get_window()->set_cursor (*trimmer_cursor);
}
break;
if (is_drawable()) {
switch (_edit_point) {
case EditAtMouse:
- track_canvas.get_window()->set_cursor (*grabber_edit_point_cursor);
+ track_canvas->get_window()->set_cursor (*grabber_edit_point_cursor);
break;
default:
- track_canvas.get_window()->set_cursor (*grabber_cursor);
+ track_canvas->get_window()->set_cursor (*grabber_cursor);
break;
}
}
if (!reinterpret_cast<RegionView *> (item->get_data ("regionview"))->name_active()) {
if (mouse_mode == MouseObject && is_drawable()) {
- track_canvas.get_window()->set_cursor (*trimmer_cursor);
+ track_canvas->get_window()->set_cursor (*trimmer_cursor);
}
}
break;
break;
}
- track_canvas.get_window()->set_cursor (*cursor);
+ track_canvas->get_window()->set_cursor (*cursor);
AutomationTimeAxisView* atv;
if ((atv = static_cast<AutomationTimeAxisView*>(item->get_data ("trackview"))) != 0) {
case MeterBarItem:
case TempoBarItem:
if (is_drawable()) {
- time_canvas.get_window()->set_cursor (*timebar_cursor);
+ time_canvas->get_window()->set_cursor (*timebar_cursor);
}
break;
case MeterMarkerItem:
case TempoMarkerItem:
if (is_drawable()) {
- time_canvas.get_window()->set_cursor (*timebar_cursor);
+ time_canvas->get_window()->set_cursor (*timebar_cursor);
}
break;
case FadeInHandleItem:
}
if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
hide_verbose_canvas_cursor ();
case MarkerViewHandleEndItem:
/* </CMT Additions> */
if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
break;
line->property_fill_color_rgba() = al->get_line_color();
}
if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
break;
/* see enter_handler() for notes */
if (!reinterpret_cast<RegionView *> (item->get_data ("regionview"))->name_active()) {
if (is_drawable() && mouse_mode == MouseObject) {
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
}
break;
case TempoBarItem:
case MarkerBarItem:
if (is_drawable()) {
- time_canvas.get_window()->set_cursor (*timebar_cursor);
+ time_canvas->get_window()->set_cursor (*timebar_cursor);
}
break;
case TempoMarkerItem:
if (is_drawable()) {
- time_canvas.get_window()->set_cursor (*timebar_cursor);
+ time_canvas->get_window()->set_cursor (*timebar_cursor);
}
break;
case AutomationTrackItem:
if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
clear_entered_track = true;
Glib::signal_idle().connect (mem_fun(*this, &Editor::left_automation_track));
}
event might do, its a good tradeoff.
*/
- track_canvas.get_pointer (x, y);
+ track_canvas->get_pointer (x, y);
}
if (current_stepping_trackview) {
drag_info.grab_x = control_point->get_x();
drag_info.grab_y = control_point->get_y();
control_point->line.parent_group().i2w(drag_info.grab_x, drag_info.grab_y);
- track_canvas.w2c(drag_info.grab_x, drag_info.grab_y,
+ track_canvas->w2c(drag_info.grab_x, drag_info.grab_y,
drag_info.grab_x, drag_info.grab_y);
drag_info.grab_frame = pixel_to_frame(drag_info.grab_x);
return;
}
- switch (Profile->get_small_screen() ? ARDOUR_UI::instance()->primary_clock.mode () : ARDOUR_UI::instance()->secondary_clock.mode ()) {
+ AudioClock::Mode m;
+
+ if (Profile->get_sae() || Profile->get_small_screen()) {
+ m = ARDOUR_UI::instance()->primary_clock.mode();
+ } else {
+ m = ARDOUR_UI::instance()->secondary_clock.mode();
+ }
+
+ switch (m) {
case AudioClock::BBT:
session->bbt_time (frame, bbt);
snprintf (buf, sizeof (buf), "%02" PRIu32 "|%02" PRIu32 "|%02" PRIu32, bbt.bars, bbt.beats, bbt.ticks);
return;
}
- switch (ARDOUR_UI::instance()->secondary_clock.mode ()) {
+ AudioClock::Mode m;
+
+ if (Profile->get_sae() || Profile->get_small_screen()) {
+ m = ARDOUR_UI::instance()->primary_clock.mode ();
+ } else {
+ m = ARDOUR_UI::instance()->secondary_clock.mode ();
+ }
+
+ switch (m) {
case AudioClock::BBT:
session->bbt_time (start, sbbt);
session->bbt_time (end, ebbt);
else {
set_verbose_canvas_cursor (buf, drag_info.current_pointer_x + offset, drag_info.current_pointer_y + offset);
}
+
show_verbose_canvas_cursor ();
}
AudioTimeAxisView *atv = 0;
boost::shared_ptr<Playlist> playlist;
- track_canvas.window_to_world (x, y, wx, wy);
+ track_canvas->window_to_world (x, y, wx, wy);
wx += horizontal_adjustment.get_value();
wy += vertical_adjustment.get_value();
start_frame = get_preferred_edit_position (true);
if (session->transport_rolling()) {
- /* go to edit point and stop */
session->request_locate (start_frame, false);
return;
}
pthread_attr_destroy(&attr);
- track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
+ track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
while (!itt.done && !itt.cancel) {
gtk_main_iteration ();
interthread_progress_connection.disconnect ();
interthread_progress_window->hide_all ();
current_interthread_info = 0;
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
void
begin_reversible_command (_("normalize"));
- track_canvas.get_window()->set_cursor (*wait_cursor);
+ track_canvas->get_window()->set_cursor (*wait_cursor);
gdk_flush ();
for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) {
}
commit_reversible_command ();
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
begin_reversible_command (command);
- track_canvas.get_window()->set_cursor (*wait_cursor);
+ track_canvas->get_window()->set_cursor (*wait_cursor);
gdk_flush ();
for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ) {
rs.clear ();
out:
- track_canvas.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
void
continue;
}
- tv = new AudioTimeAxisView (*this, *session, route, track_canvas);
+ tv = new AudioTimeAxisView (*this, *session, route, *track_canvas);
//cerr << "Editor::handle_new_route() called on " << route->name() << endl;//DEBUG
row = *(route_display_model->append ());
time_canvas_event_box.get_window()->get_pointer (x, y, state);
- track_canvas.c2w (x, y, wcx, wcy);
- track_canvas.w2c (wcx, wcy, cx, cy);
+ track_canvas->c2w (x, y, wcx, wcy);
+ track_canvas->w2c (wcx, wcy, cx, cy);
nframes_t where = leftmost_frame + pixel_to_frame (x);
range_marker_group->move (0.0, tbpos - old_unit_pos);
}
range_marker_group->show();
+ cerr << "range_marker_group now at " << range_marker_group->property_y() << endl;
tbpos += timebar_height;
visible_timebars++;
} else {
return;
}
- track_canvas.get_scroll_region (x1, y1, x2, y2);
+ track_canvas->get_scroll_region (x1, y1, x2, y2);
y2 = TimeAxisView::hLargest*5000; // five thousand largest tracks should be enough.. :)
/* get the first bar spacing */
bars = (*i).bar - (*current_bbt_points->begin()).bar;
beats = current_bbt_points->size() - bars;
- beat_density = (beats * 10.0f) / track_canvas.get_width ();
+ beat_density = (beats * 10.0f) / track_canvas->get_width ();
if (beat_density > 4.0f) {
/* if the lines are too close together, they become useless
}
if (no_splash) {
- cerr << _("Copyright (C) 1999-2007 Paul Davis") << endl
+ cerr << _("Copyright (C) 1999-2008 Paul Davis") << endl
<< _("Some portions Copyright (C) Steve Harris, Ari Johnson, Brett Viren, Joel Baker") << endl
<< endl
<< _("Ardour comes with ABSOLUTELY NO WARRANTY") << endl
if (line) {
delete line;
+ line = 0;
}
}
set_colors ();
ColorsChanged.connect (mem_fun (*this, &RegionView::color_handler));
- set_pango_fontsize();
+ // set_pango_fontsize();
/* XXX sync mark drag? */
}
union {
void* ptr;
bool yes_or_no;
+ nframes_t target2_frame;
SlaveSource slave;
};
#include <pbd/error.h>
#include <pbd/pthread_utils.h>
+#include <pbd/stacktrace.h>
#include <ardour/configuration.h>
#include <ardour/audioengine.h>
{
char c = ButlerRequest::Run;
::write (butler_request_pipe[1], &c, 1);
+ // PBD::stacktrace (cerr);
}
void
case Event::LocateRollLocate:
// locate is handled by ::request_roll_at_and_return()
_requested_return_frame = ev->target_frame;
- set_transport_speed (ev->speed, true);
+ cerr << "Set RRF " << ev->target_frame << endl;
+ request_locate (ev->target2_frame, true);
break;
do_locate = true;
} else {
_transport_frame = last_stop_frame;
+ _requested_return_frame = -1;
}
if (synced_to_jack() && !play_loop) {
}
#endif
- last_stop_frame = _transport_frame;
+ if (_requested_return_frame < 0) {
+ last_stop_frame = _transport_frame;
+ } else {
+ last_stop_frame = _requested_return_frame;
+ _requested_return_frame = -1;
+ }
- send_full_time_code ();
+ send_full_time_code ();
deliver_mmc (MIDI::MachineControl::cmdStop, 0);
deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
void
Session::request_roll_at_and_return (nframes_t start, nframes_t return_to)
{
- request_locate (start, false);
Event *ev = new Event (Event::LocateRollLocate, Event::Add, Event::Immediate, return_to, 1.0);
+ ev->target2_frame = start;
queue_event (ev);
}