non-AA canvas support (not used by default); new SAE menus; fix locate-play-locate ; add toggle-punch ; use primary clock for verbose cursor mode at all the right times; minimize clock redrawing part one

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3123 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-02-26 16:34:45 +00:00
parent c25149cfe2
commit 295b2da733
32 changed files with 606 additions and 176 deletions

View file

@ -50,18 +50,24 @@
<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/>
@ -126,11 +132,14 @@
<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'/>
@ -200,16 +209,13 @@
<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'>
@ -217,6 +223,7 @@
<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"/>

View file

@ -239,6 +239,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
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 ();

View file

@ -329,6 +329,9 @@ ARDOUR_UI::install_actions ()
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);

View file

@ -387,6 +387,17 @@ ARDOUR_UI::toggle_session_auto_loop ()
}
}
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 ()
{

View file

@ -501,15 +501,21 @@ AudioClock::set_frames (nframes_t when, bool force)
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);
}
}
}
}
@ -599,7 +605,9 @@ AudioClock::set_smpte (nframes_t when, bool force)
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()) {
@ -612,7 +620,9 @@ AudioClock::set_smpte (nframes_t when, bool force)
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);
}
}
}
@ -633,9 +643,13 @@ AudioClock::set_bbt (nframes_t when, bool force)
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);
}
}
}

View file

@ -456,8 +456,6 @@ static void
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

View file

@ -1,5 +1,6 @@
#include <stdio.h>
#include <math.h>
#include <cairo.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include "canvas-simpleline.h"
@ -400,15 +401,54 @@ gnome_canvas_simpleline_draw (GnomeCanvasItem *item,
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;
}
fprintf (stderr, "please don't use the CanvasSimpleLine item in a non-aa Canvas\n");
abort ();
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;
}
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
@ -433,17 +473,17 @@ gnome_canvas_simpleline_point (GnomeCanvasItem *item, double x, double y, int cx
*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;

View file

@ -1,5 +1,6 @@
#include <stdio.h>
#include <math.h>
#include <cairo.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include "canvas-simplerect.h"
@ -287,7 +288,7 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
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) {
@ -714,12 +715,111 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
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

View file

@ -21,6 +21,7 @@
#include <stdio.h>
#include <math.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include <cairo.h>
#include <string.h>
#include <limits.h>
@ -1600,22 +1601,229 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
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;
}
fprintf (stderr, "please don't use the CanvasWaveView item in a non-aa Canvas\n");
abort ();
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++;
}
/* 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)
{

View file

@ -25,6 +25,7 @@ namespace Gnome {
class Item;
class Group;
class Canvas;
class Rect;
class SimpleRect;
class SimpleLine;
class Polygon;

View file

@ -368,12 +368,12 @@ Editor::Editor ()
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");
@ -403,7 +403,7 @@ Editor::Editor ()
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");
@ -468,7 +468,7 @@ Editor::Editor ()
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);
@ -807,6 +807,16 @@ Editor::~Editor()
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
@ -4292,14 +4302,15 @@ Editor::set_loop_range (nframes_t start, nframes_t end, string cmd)
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);

View file

@ -219,14 +219,14 @@ class Editor : public PublicEditor
*/
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 ();
@ -542,8 +542,8 @@ class Editor : public PublicEditor
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;

View file

@ -1656,5 +1656,5 @@ Editor::parameter_changed (const char* parameter_name)
void
Editor::reset_focus ()
{
track_canvas.grab_focus();
track_canvas->grab_focus();
}

View file

@ -495,7 +495,7 @@ Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality qual
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()
@ -527,7 +527,7 @@ Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality qual
}
out:
track_canvas.get_window()->set_cursor (*current_canvas_cursor);
track_canvas->get_window()->set_cursor (*current_canvas_cursor);
return 0;
}
@ -542,7 +542,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
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) {
@ -643,7 +643,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
}
}
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 {
@ -682,7 +682,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
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;
}

View file

@ -110,7 +110,7 @@ Editor::toggle_meter_updating()
} else {
stop_updating ();
}
track_canvas_allocate(track_canvas.get_allocation());
track_canvas_allocate(track_canvas->get_allocation());
}
void

View file

@ -87,28 +87,36 @@ static void ardour_canvas_type_init()
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 */
@ -121,14 +129,14 @@ Editor::initialize_canvas ()
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;
@ -140,7 +148,7 @@ Editor::initialize_canvas ()
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;
@ -150,42 +158,42 @@ Editor::initialize_canvas ()
/* 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_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_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);
@ -199,12 +207,12 @@ Editor::initialize_canvas ()
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);
@ -232,14 +240,14 @@ Editor::initialize_canvas ()
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();
@ -255,12 +263,12 @@ Editor::initialize_canvas ()
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 ();
@ -363,10 +371,10 @@ Editor::reset_scrolling_region (Gtk::Allocation* alloc)
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;
@ -422,14 +430,14 @@ Editor::controls_layout_size_request (Requisition* req)
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;
}
@ -472,7 +480,7 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
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();
@ -823,8 +831,8 @@ void
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);
}
}

View file

@ -67,8 +67,8 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
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();
@ -102,8 +102,8 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
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();
@ -163,7 +163,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
bool
Editor::track_canvas_scroll_event (GdkEventScroll *event)
{
track_canvas.grab_focus();
track_canvas->grab_focus();
track_canvas_scroll (event);
return false;
}
@ -212,7 +212,7 @@ Editor::time_canvas_scroll (GdkEventScroll* ev)
bool
Editor::time_canvas_scroll_event (GdkEventScroll *event)
{
time_canvas.grab_focus();
time_canvas->grab_focus();
time_canvas_scroll (event);
return false;
}
@ -221,7 +221,7 @@ bool
Editor::track_canvas_button_press_event (GdkEventButton *event)
{
selection->clear ();
track_canvas.grab_focus();
track_canvas->grab_focus();
return false;
}
@ -239,7 +239,7 @@ Editor::track_canvas_motion_notify_event (GdkEventMotion *event)
{
int x, y;
/* keep those motion events coming */
track_canvas.get_pointer (x, y);
track_canvas->get_pointer (x, y);
return false;
}

View file

@ -1080,7 +1080,7 @@ void
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) ;
@ -1097,7 +1097,7 @@ Editor::handle_new_imageframe_time_axis_view(const string & track_name, void* sr
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) ;

View file

@ -39,7 +39,7 @@ Editor::kbd_driver (sigc::slot<void,GdkEvent*> theslot, bool use_track_canvas, b
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) {
@ -62,7 +62,7 @@ Editor::kbd_driver (sigc::slot<void,GdkEvent*> theslot, bool use_track_canvas, b
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();

View file

@ -1113,7 +1113,7 @@ Editor::update_punch_range_view (bool visibility)
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;

View file

@ -75,21 +75,21 @@ Editor::mouse_frame (nframes64_t& where, bool& in_track_canvas) const
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;
}
@ -127,18 +127,18 @@ Editor::event_frame (GdkEvent* event, double* pcx, double* pcy) const
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;
@ -245,7 +245,7 @@ Editor::set_canvas_cursor ()
}
if (is_drawable()) {
track_canvas.get_window()->set_cursor(*current_canvas_cursor);
track_canvas->get_window()->set_cursor(*current_canvas_cursor);
}
}
@ -463,7 +463,7 @@ const static double ZERO_GAIN_FRACTION = gain_to_slider_position(dB_to_coefficie
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;
@ -750,7 +750,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
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;
@ -1102,7 +1102,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
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) {
@ -1198,7 +1198,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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++;
@ -1229,7 +1229,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
show_verbose_canvas_cursor ();
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor);
track_canvas->get_window()->set_cursor (*fader_cursor);
}
}
break;
@ -1240,7 +1240,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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;
@ -1255,14 +1255,14 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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;
@ -1276,7 +1276,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
/* </CMT Additions> */
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*trimmer_cursor);
track_canvas->get_window()->set_cursor (*trimmer_cursor);
}
break;
@ -1284,10 +1284,10 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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;
}
}
@ -1299,7 +1299,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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;
@ -1320,7 +1320,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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) {
@ -1337,7 +1337,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
case MeterBarItem:
case TempoBarItem:
if (is_drawable()) {
time_canvas.get_window()->set_cursor (*timebar_cursor);
time_canvas->get_window()->set_cursor (*timebar_cursor);
}
break;
@ -1351,7 +1351,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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:
@ -1420,7 +1420,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
}
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 ();
@ -1437,7 +1437,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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;
@ -1452,7 +1452,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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;
@ -1460,7 +1460,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
/* 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;
@ -1472,7 +1472,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
case TempoBarItem:
case MarkerBarItem:
if (is_drawable()) {
time_canvas.get_window()->set_cursor (*timebar_cursor);
time_canvas->get_window()->set_cursor (*timebar_cursor);
}
break;
@ -1489,7 +1489,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
case TempoMarkerItem:
if (is_drawable()) {
time_canvas.get_window()->set_cursor (*timebar_cursor);
time_canvas->get_window()->set_cursor (*timebar_cursor);
}
break;
@ -1508,7 +1508,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
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));
}
@ -1546,7 +1546,7 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item
event might do, its a good tradeoff.
*/
track_canvas.get_pointer (x, y);
track_canvas->get_pointer (x, y);
}
if (current_stepping_trackview) {
@ -2691,7 +2691,7 @@ Editor::start_control_point_grab (ArdourCanvas::Item* item, GdkEvent* event)
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);
@ -3912,7 +3912,15 @@ Editor::show_verbose_time_cursor (nframes_t frame, double offset, double xpos, d
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);
@ -3964,7 +3972,15 @@ Editor::show_verbose_duration_cursor (nframes_t start, nframes_t end, double off
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);
@ -4019,6 +4035,7 @@ Editor::show_verbose_duration_cursor (nframes_t start, nframes_t end, double off
else {
set_verbose_canvas_cursor (buf, drag_info.current_pointer_x + offset, drag_info.current_pointer_y + offset);
}
show_verbose_canvas_cursor ();
}

View file

@ -2098,7 +2098,7 @@ Editor::insert_region_list_drag (boost::shared_ptr<AudioRegion> region, int x, i
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();
@ -2276,7 +2276,6 @@ Editor::play_from_edit_point_and_return ()
start_frame = get_preferred_edit_position (true);
if (session->transport_rolling()) {
/* go to edit point and stop */
session->request_locate (start_frame, false);
return;
}
@ -3489,7 +3488,7 @@ Editor::freeze_route ()
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 ();
@ -3498,7 +3497,7 @@ Editor::freeze_route ()
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
@ -4161,7 +4160,7 @@ Editor::normalize_region ()
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) {
@ -4174,7 +4173,7 @@ Editor::normalize_region ()
}
commit_reversible_command ();
track_canvas.get_window()->set_cursor (*current_canvas_cursor);
track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
@ -4284,7 +4283,7 @@ Editor::apply_filter (AudioFilter& filter, string command)
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(); ) {
@ -4316,7 +4315,7 @@ Editor::apply_filter (AudioFilter& filter, string command)
rs.clear ();
out:
track_canvas.get_window()->set_cursor (*current_canvas_cursor);
track_canvas->get_window()->set_cursor (*current_canvas_cursor);
}
void

View file

@ -61,7 +61,7 @@ Editor::handle_new_route (Session::RouteList& routes)
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 ());

View file

@ -276,8 +276,8 @@ Editor::ruler_mouse_motion (GdkEventMotion* ev)
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);
@ -687,6 +687,7 @@ Editor::update_ruler_visibility ()
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 {

View file

@ -222,7 +222,7 @@ Editor::draw_measures ()
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 */
@ -232,7 +232,7 @@ Editor::draw_measures ()
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

View file

@ -271,7 +271,7 @@ int main (int argc, char* argv[])
}
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

View file

@ -283,6 +283,7 @@ Marker::~Marker ()
if (line) {
delete line;
line = 0;
}
}

View file

@ -143,7 +143,7 @@ RegionView::init (Gdk::Color& basic_color, bool wfd)
set_colors ();
ColorsChanged.connect (mem_fun (*this, &RegionView::color_handler));
set_pango_fontsize();
// set_pango_fontsize();
/* XXX sync mark drag? */
}

View file

@ -162,6 +162,7 @@ class Session : public PBD::StatefulDestructible
union {
void* ptr;
bool yes_or_no;
nframes_t target2_frame;
SlaveSource slave;
};

View file

@ -29,6 +29,7 @@
#include <pbd/error.h>
#include <pbd/pthread_utils.h>
#include <pbd/stacktrace.h>
#include <ardour/configuration.h>
#include <ardour/audioengine.h>
@ -130,6 +131,7 @@ Session::summon_butler ()
{
char c = ButlerRequest::Run;
::write (butler_request_pipe[1], &c, 1);
// PBD::stacktrace (cerr);
}
void

View file

@ -351,7 +351,8 @@ Session::process_event (Event* ev)
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;

View file

@ -394,6 +394,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
do_locate = true;
} else {
_transport_frame = last_stop_frame;
_requested_return_frame = -1;
}
if (synced_to_jack() && !play_loop) {
@ -429,9 +430,14 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
}
#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);
@ -1188,8 +1194,8 @@ Session::setup_auto_play ()
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);
}