mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Cleanups and a few comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@4374 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
69ed2a3c27
commit
042997e5ed
28 changed files with 342 additions and 339 deletions
|
|
@ -161,7 +161,7 @@ AudioRegionView::init (Gdk::Color& basic_color, bool wfd)
|
|||
store_flags ();
|
||||
}
|
||||
|
||||
if (trackview.editor.new_regionviews_display_gain()) {
|
||||
if (trackview.editor().new_regionviews_display_gain()) {
|
||||
_flags |= EnvelopeVisible;
|
||||
}
|
||||
|
||||
|
|
@ -996,7 +996,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
|
|||
|
||||
item->w2i (x, y);
|
||||
|
||||
nframes_t fx = trackview.editor.pixel_to_frame (x);
|
||||
nframes_t fx = trackview.editor().pixel_to_frame (x);
|
||||
|
||||
if (fx > _region->length()) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
|
|||
color_handler ();
|
||||
_amplitude_above_axis = 1.0;
|
||||
|
||||
use_rec_regions = tv.editor.show_waveforms_recording ();
|
||||
use_rec_regions = tv.editor().show_waveforms_recording ();
|
||||
}
|
||||
|
||||
AudioStreamView::~AudioStreamView ()
|
||||
|
|
@ -189,7 +189,7 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
|
|||
|
||||
/* follow global waveform setting */
|
||||
|
||||
region_view->set_waveform_visible(_trackview.editor.show_waveforms());
|
||||
region_view->set_waveform_visible(_trackview.editor().show_waveforms());
|
||||
|
||||
/* catch regionview going away */
|
||||
region->GoingAway.connect (bind (mem_fun (*this, &AudioStreamView::remove_region_view), boost::weak_ptr<Region> (r)));
|
||||
|
|
@ -331,7 +331,7 @@ AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
|
|||
}
|
||||
}
|
||||
|
||||
CrossfadeView *cv = new CrossfadeView (_trackview.canvas_display,
|
||||
CrossfadeView *cv = new CrossfadeView (_trackview.canvas_display (),
|
||||
_trackview,
|
||||
crossfade,
|
||||
_samples_per_unit,
|
||||
|
|
@ -545,7 +545,7 @@ AudioStreamView::setup_rec_box ()
|
|||
at = _trackview.audio_track(); /* we know what it is already */
|
||||
boost::shared_ptr<AudioDiskstream> ds = at->audio_diskstream();
|
||||
nframes_t frame_pos = ds->current_capture_start ();
|
||||
gdouble xstart = _trackview.editor.frame_to_pixel (frame_pos);
|
||||
gdouble xstart = _trackview.editor().frame_to_pixel (frame_pos);
|
||||
gdouble xend;
|
||||
uint32_t fill_color;
|
||||
|
||||
|
|
@ -720,7 +720,7 @@ AudioStreamView::update_rec_regions ()
|
|||
|
||||
/* also update rect */
|
||||
ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle;
|
||||
gdouble xend = _trackview.editor.frame_to_pixel (region->position() + region->length());
|
||||
gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length());
|
||||
rect->property_x2() = xend;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
|
|||
/* ask for notifications of any new RegionViews */
|
||||
_view->RegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
|
||||
|
||||
if (!editor.have_idled()) {
|
||||
if (!_editor.have_idled()) {
|
||||
/* first idle will do what we need */
|
||||
} else {
|
||||
first_idle ();
|
||||
|
|
@ -187,7 +187,7 @@ AudioTimeAxisView::append_extra_display_menu_items ()
|
|||
waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
|
||||
waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
|
||||
ignore_toggle = true;
|
||||
waveform_item->set_active (editor.show_waveforms());
|
||||
waveform_item->set_active (_editor.show_waveforms());
|
||||
ignore_toggle = false;
|
||||
|
||||
waveform_items.push_back (SeparatorElem());
|
||||
|
|
@ -334,7 +334,7 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
|
|||
|
||||
boost::shared_ptr<AutomationTimeAxisView> gain_track(new AutomationTimeAxisView (_session,
|
||||
_route, _route, c,
|
||||
editor,
|
||||
_editor,
|
||||
*this,
|
||||
false,
|
||||
parent_canvas,
|
||||
|
|
@ -382,7 +382,7 @@ AudioTimeAxisView::ensure_pan_views (bool show)
|
|||
boost::shared_ptr<AutomationTimeAxisView> pan_track (
|
||||
new AutomationTimeAxisView (_session,
|
||||
_route, _route, pan_control,
|
||||
editor,
|
||||
_editor,
|
||||
*this,
|
||||
false,
|
||||
parent_canvas,
|
||||
|
|
|
|||
|
|
@ -207,10 +207,10 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
|
|||
y = min (1.0, y);
|
||||
y = _height - (y * _height);
|
||||
|
||||
double const x = trackview.editor.frame_to_unit ((*cp.model())->when);
|
||||
double const x = trackview.editor().frame_to_unit ((*cp.model())->when);
|
||||
|
||||
trackview.editor.current_session()->begin_reversible_command (_("automation event move"));
|
||||
trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
trackview.editor().current_session()->begin_reversible_command (_("automation event move"));
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
|
||||
cp.move_to (x, y, ControlPoint::Full);
|
||||
reset_line_coords (cp);
|
||||
|
|
@ -225,9 +225,9 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
|
|||
|
||||
update_pending = false;
|
||||
|
||||
trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
|
||||
trackview.editor.current_session()->commit_reversible_command ();
|
||||
trackview.editor.current_session()->set_dirty ();
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
|||
already in frames. it needs to be converted to canvas units.
|
||||
*/
|
||||
|
||||
x = trackview.editor.frame_to_unit (x);
|
||||
x = trackview.editor().frame_to_unit (x);
|
||||
|
||||
/* clamp x position using view coordinates */
|
||||
|
||||
|
|
@ -309,7 +309,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
|||
|
||||
/* leave the x-coordinate alone */
|
||||
|
||||
x = trackview.editor.frame_to_unit ((*cp.model())->when);
|
||||
x = trackview.editor().frame_to_unit ((*cp.model())->when);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -381,10 +381,10 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
|
|||
|
||||
/* if xval has not changed, set it directly from the model to avoid rounding errors */
|
||||
|
||||
if (mr.xval == trackview.editor.frame_to_unit((*cp.model())->when)) {
|
||||
if (mr.xval == trackview.editor().frame_to_unit((*cp.model())->when)) {
|
||||
mr.xval = (nframes_t) (*cp.model())->when;
|
||||
} else {
|
||||
mr.xval = trackview.editor.unit_to_frame (mr.xval);
|
||||
mr.xval = trackview.editor().unit_to_frame (mr.xval);
|
||||
}
|
||||
|
||||
/* virtual call: this will do the right thing
|
||||
|
|
@ -634,7 +634,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
|||
|
||||
}
|
||||
|
||||
set_selected_points (trackview.editor.get_selection().points);
|
||||
set_selected_points (trackview.editor().get_selection().points);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -718,7 +718,7 @@ AutomationLine::invalidate_point (ALPoints& p, uint32_t index)
|
|||
void
|
||||
AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
||||
{
|
||||
if (trackview.editor.current_session() == 0) { /* how? */
|
||||
if (trackview.editor().current_session() == 0) { /* how? */
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -730,8 +730,8 @@ AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
|||
str = _("automation range drag");
|
||||
}
|
||||
|
||||
trackview.editor.current_session()->begin_reversible_command (str);
|
||||
trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
trackview.editor().current_session()->begin_reversible_command (str);
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
|
||||
drag_x = x;
|
||||
drag_distance = 0;
|
||||
|
|
@ -778,7 +778,7 @@ AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_p
|
|||
|
||||
for (uint32_t i = i1 ; i <= i2; i++) {
|
||||
cp = nth (i);
|
||||
modify_view_point (*cp, trackview.editor.unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
|
||||
modify_view_point (*cp, trackview.editor().unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
|
||||
}
|
||||
|
||||
if (line_points.size() > 1) {
|
||||
|
|
@ -807,9 +807,9 @@ AutomationLine::end_drag (ControlPoint* cp)
|
|||
|
||||
update_pending = false;
|
||||
|
||||
trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
|
||||
trackview.editor.current_session()->commit_reversible_command ();
|
||||
trackview.editor.current_session()->set_dirty ();
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -891,7 +891,7 @@ AutomationLine::control_points_adjacent (double xval, uint32_t & before, uint32_
|
|||
|
||||
/* xval is in frames */
|
||||
|
||||
unit_xval = trackview.editor.frame_to_unit (xval);
|
||||
unit_xval = trackview.editor().frame_to_unit (xval);
|
||||
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
|
||||
|
|
@ -952,15 +952,15 @@ AutomationLine::remove_point (ControlPoint& cp)
|
|||
|
||||
model_representation (cp, mr);
|
||||
|
||||
trackview.editor.current_session()->begin_reversible_command (_("remove control point"));
|
||||
trackview.editor().current_session()->begin_reversible_command (_("remove control point"));
|
||||
XMLNode &before = alist->get_state();
|
||||
|
||||
alist->erase (mr.start, mr.end);
|
||||
|
||||
trackview.editor.current_session()->add_command(new MementoCommand<AutomationList>(
|
||||
trackview.editor().current_session()->add_command(new MementoCommand<AutomationList>(
|
||||
*alist.get(), &before, &alist->get_state()));
|
||||
trackview.editor.current_session()->commit_reversible_command ();
|
||||
trackview.editor.current_session()->set_dirty ();
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1050,8 +1050,8 @@ AutomationLine::set_selected_points (PointSelection& points)
|
|||
|
||||
double rstart, rend;
|
||||
|
||||
rstart = trackview.editor.frame_to_unit ((*r).start);
|
||||
rend = trackview.editor.frame_to_unit ((*r).end);
|
||||
rstart = trackview.editor().frame_to_unit ((*r).start);
|
||||
rend = trackview.editor().frame_to_unit ((*r).end);
|
||||
|
||||
if ((*i)->get_x() >= rstart && (*i)->get_x() <= rend) {
|
||||
|
||||
|
|
@ -1081,7 +1081,7 @@ void AutomationLine::set_colors() {
|
|||
void
|
||||
AutomationLine::show_selection ()
|
||||
{
|
||||
TimeSelection& time (trackview.editor.get_selection().time);
|
||||
TimeSelection& time (trackview.editor().get_selection().time);
|
||||
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
|
||||
|
|
@ -1090,8 +1090,8 @@ AutomationLine::show_selection ()
|
|||
for (list<AudioRange>::iterator r = time.begin(); r != time.end(); ++r) {
|
||||
double rstart, rend;
|
||||
|
||||
rstart = trackview.editor.frame_to_unit ((*r).start);
|
||||
rend = trackview.editor.frame_to_unit ((*r).end);
|
||||
rstart = trackview.editor().frame_to_unit ((*r).start);
|
||||
rend = trackview.editor().frame_to_unit ((*r).end);
|
||||
|
||||
if ((*i)->get_x() >= rstart && (*i)->get_x() <= rend) {
|
||||
(*i)->set_selected(true);
|
||||
|
|
@ -1147,7 +1147,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
|
|||
void
|
||||
AutomationLine::add_model_point (ALPoints& tmp_points, double frame, double yfract)
|
||||
{
|
||||
tmp_points.push_back (ALPoint (trackview.editor.frame_to_unit (frame),
|
||||
tmp_points.push_back (ALPoint (trackview.editor().frame_to_unit (frame),
|
||||
_height - (yfract * _height)));
|
||||
}
|
||||
|
||||
|
|
@ -1169,9 +1169,9 @@ AutomationLine::clear ()
|
|||
/* parent must create command */
|
||||
XMLNode &before = get_state();
|
||||
alist->clear();
|
||||
trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, &before, &get_state()));
|
||||
trackview.editor.current_session()->commit_reversible_command ();
|
||||
trackview.editor.current_session()->set_dirty ();
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationLine>(*this, &before, &get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ AutomationRegionView::canvas_event(GdkEvent* ev)
|
|||
{
|
||||
if (ev->type == GDK_BUTTON_RELEASE) {
|
||||
|
||||
const nframes_t when = trackview.editor.pixel_to_frame((nframes_t)ev->button.x)
|
||||
const nframes_t when = trackview.editor().pixel_to_frame((nframes_t)ev->button.x)
|
||||
- _region->position();
|
||||
add_automation_event(ev, when, ev->button.y);
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ AutomationRegionView::add_automation_event (GdkEvent* event, nframes_t when, dou
|
|||
double x = 0;
|
||||
AutomationTimeAxisView* const view = automation_view();
|
||||
|
||||
view->canvas_display->w2i (x, y);
|
||||
view->canvas_display()->w2i (x, y);
|
||||
|
||||
/* compute vertical fractional position */
|
||||
|
||||
|
|
|
|||
|
|
@ -54,14 +54,14 @@ using namespace Editing;
|
|||
|
||||
AutomationStreamView::AutomationStreamView (AutomationTimeAxisView& tv)
|
||||
: StreamView (*dynamic_cast<RouteTimeAxisView*>(tv.get_parent()),
|
||||
new ArdourCanvas::Group(*tv.canvas_display))
|
||||
new ArdourCanvas::Group(*tv.canvas_display()))
|
||||
, _controller(tv.controller())
|
||||
, _automation_view(tv)
|
||||
{
|
||||
//canvas_rect->property_fill_color_rgba() = stream_base_color;
|
||||
canvas_rect->property_outline_color_rgba() = RGBA_BLACK;
|
||||
|
||||
use_rec_regions = tv.editor.show_waveforms_recording ();
|
||||
use_rec_regions = tv.editor().show_waveforms_recording ();
|
||||
}
|
||||
|
||||
AutomationStreamView::~AutomationStreamView ()
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
|||
ignore_state_request = false;
|
||||
first_call_to_set_height = true;
|
||||
|
||||
_base_rect = new SimpleRect(*canvas_display);
|
||||
_base_rect = new SimpleRect(*_canvas_display);
|
||||
_base_rect->property_x1() = 0.0;
|
||||
_base_rect->property_y1() = 0.0;
|
||||
_base_rect->property_x2() = LONG_MAX - 2;
|
||||
|
|
@ -99,7 +99,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
|||
|
||||
_base_rect->set_data ("trackview", this);
|
||||
|
||||
_base_rect->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_automation_track_event),
|
||||
_base_rect->signal_event().connect (bind (mem_fun (_editor, &PublicEditor::canvas_automation_track_event),
|
||||
_base_rect, this));
|
||||
|
||||
_base_rect->lower_to_bottom();
|
||||
|
|
@ -214,7 +214,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
|||
boost::shared_ptr<AutomationLine> line(new AutomationLine (
|
||||
ARDOUR::EventTypeMap::instance().to_symbol(_control->parameter()),
|
||||
*this,
|
||||
*canvas_display,
|
||||
*_canvas_display,
|
||||
_control->alist()));
|
||||
|
||||
line->set_line_color (ARDOUR_UI::config()->canvasvar_ProcessorAutomationLine.get());
|
||||
|
|
@ -561,7 +561,7 @@ AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEvent
|
|||
|
||||
double x = 0;
|
||||
|
||||
canvas_display->w2i (x, y);
|
||||
_canvas_display->w2i (x, y);
|
||||
|
||||
/* compute vertical fractional position */
|
||||
|
||||
|
|
@ -601,14 +601,14 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
|
|||
switch (op) {
|
||||
case Cut:
|
||||
if ((what_we_got = alist->cut (selection.time.front().start, selection.time.front().end)) != 0) {
|
||||
editor.get_cut_buffer().add (what_we_got);
|
||||
_editor.get_cut_buffer().add (what_we_got);
|
||||
_session.add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
|
||||
ret = true;
|
||||
}
|
||||
break;
|
||||
case Copy:
|
||||
if ((what_we_got = alist->copy (selection.time.front().start, selection.time.front().end)) != 0) {
|
||||
editor.get_cut_buffer().add (what_we_got);
|
||||
_editor.get_cut_buffer().add (what_we_got);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -678,14 +678,14 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
|
|||
switch (op) {
|
||||
case Cut:
|
||||
if ((what_we_got = alist->cut ((*i).start, (*i).end)) != 0) {
|
||||
editor.get_cut_buffer().add (what_we_got);
|
||||
_editor.get_cut_buffer().add (what_we_got);
|
||||
_session.add_command (new MementoCommand<AutomationList>(*alist.get(), new XMLNode (before), &alist->get_state()));
|
||||
ret = true;
|
||||
}
|
||||
break;
|
||||
case Copy:
|
||||
if ((what_we_got = alist->copy ((*i).start, (*i).end)) != 0) {
|
||||
editor.get_cut_buffer().add (what_we_got);
|
||||
_editor.get_cut_buffer().add (what_we_got);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -757,14 +757,14 @@ AutomationTimeAxisView::get_selectables (nframes_t start, nframes_t end, double
|
|||
double botfrac;
|
||||
|
||||
/* remember: this is X Window - coordinate space starts in upper left and moves down.
|
||||
y_position is the "origin" or "top" of the track.
|
||||
_y_position is the "origin" or "top" of the track.
|
||||
*/
|
||||
|
||||
double mybot = y_position + height;
|
||||
double mybot = _y_position + height;
|
||||
|
||||
if (y_position >= top && mybot <= bot) {
|
||||
if (_y_position >= top && mybot <= bot) {
|
||||
|
||||
/* y_position is below top, mybot is above bot, so we're fully
|
||||
/* _y_position is below top, mybot is above bot, so we're fully
|
||||
covered vertically.
|
||||
*/
|
||||
|
||||
|
|
@ -773,10 +773,10 @@ AutomationTimeAxisView::get_selectables (nframes_t start, nframes_t end, double
|
|||
|
||||
} else {
|
||||
|
||||
/* top and bot are within y_position .. mybot */
|
||||
/* top and bot are within _y_position .. mybot */
|
||||
|
||||
topfrac = 1.0 - ((top - y_position) / height);
|
||||
botfrac = 1.0 - ((bot - y_position) / height);
|
||||
topfrac = 1.0 - ((top - _y_position) / height);
|
||||
botfrac = 1.0 - ((bot - _y_position) / height);
|
||||
}
|
||||
|
||||
if (_line)
|
||||
|
|
@ -869,7 +869,7 @@ AutomationTimeAxisView::set_state (const XMLNode& node)
|
|||
XMLProperty const * shown = node.property ("shown");
|
||||
if (shown && shown->value () == "yes") {
|
||||
set_marked_for_display (true);
|
||||
canvas_display->show (); /* FIXME: necessary? show_at? */
|
||||
_canvas_display->show (); /* FIXME: necessary? show_at? */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
|
|||
bool select_mod;
|
||||
uint8_t d_velocity = 10;
|
||||
|
||||
if (_region.get_time_axis_view().editor.current_mouse_mode() != Editing::MouseNote)
|
||||
if (_region.get_time_axis_view().editor().current_mouse_mode() != Editing::MouseNote)
|
||||
return false;
|
||||
|
||||
switch (ev->type) {
|
||||
|
|
@ -284,7 +284,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
|
|||
|
||||
switch (_state) {
|
||||
case Pressed: // Drag begin
|
||||
if (_region.midi_view()->editor.current_midi_edit_mode() == Editing::MidiEditSelect
|
||||
if (_region.midi_view()->editor().current_midi_edit_mode() == Editing::MidiEditSelect
|
||||
&& _region.mouse_state() != MidiRegionView::SelectTouchDragging
|
||||
&& _region.mouse_state() != MidiRegionView::EraseTouchDragging) {
|
||||
_item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
|
||||
|
|
@ -356,7 +356,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
|
|||
|
||||
switch (_state) {
|
||||
case Pressed: // Clicked
|
||||
if (_region.midi_view()->editor.current_midi_edit_mode() == Editing::MidiEditSelect) {
|
||||
if (_region.midi_view()->editor().current_midi_edit_mode() == Editing::MidiEditSelect) {
|
||||
_state = None;
|
||||
|
||||
if (_selected && !select_mod && _region.selection_size() > 1)
|
||||
|
|
@ -365,7 +365,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
|
|||
_region.note_deselected(this, select_mod);
|
||||
else
|
||||
_region.note_selected(this, select_mod);
|
||||
} else if (_region.midi_view()->editor.current_midi_edit_mode() == Editing::MidiEditErase) {
|
||||
} else if (_region.midi_view()->editor().current_midi_edit_mode() == Editing::MidiEditErase) {
|
||||
_region.start_delta_command();
|
||||
_region.command_remove_note(this);
|
||||
_region.apply_command();
|
||||
|
|
@ -378,7 +378,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
|
|||
|
||||
if (_note)
|
||||
_region.note_dropped(this,
|
||||
_region.midi_view()->editor.pixel_to_frame(abs(drag_delta_x))
|
||||
_region.midi_view()->editor().pixel_to_frame(abs(drag_delta_x))
|
||||
* ((drag_delta_x < 0.0) ? -1 : 1),
|
||||
drag_delta_note);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ CanvasNote::on_event(GdkEvent* ev)
|
|||
static double middle_point, last_x;
|
||||
Gdk::Cursor cursor;
|
||||
static NoteEnd note_end;
|
||||
Editing::MidiEditMode edit_mode = _region.get_trackview().editor.current_midi_edit_mode();
|
||||
Editing::MidiEditMode edit_mode = _region.get_trackview().editor().current_midi_edit_mode();
|
||||
|
||||
switch (ev->type) {
|
||||
case GDK_BUTTON_PRESS:
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
|||
vestigial_frame->hide();
|
||||
show_vestigial = false;
|
||||
|
||||
group->signal_event().connect (bind (mem_fun (tv.editor, &PublicEditor::canvas_crossfade_view_event), group, this));
|
||||
group->signal_event().connect (bind (mem_fun (tv.editor(), &PublicEditor::canvas_crossfade_view_event), group, this));
|
||||
|
||||
crossfade_changed (Change (~0));
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ CrossfadeView::redraw_curves ()
|
|||
return;
|
||||
}
|
||||
|
||||
npoints = get_time_axis_view().editor.frame_to_pixel (crossfade->length());
|
||||
npoints = get_time_axis_view().editor().frame_to_pixel (crossfade->length());
|
||||
// npoints = std::min (gdk_screen_width(), npoints);
|
||||
|
||||
if (!_visible || !crossfade->active() || npoints < 3) {
|
||||
|
|
|
|||
|
|
@ -4824,7 +4824,7 @@ Editor::idle_visual_changer ()
|
|||
|
||||
struct EditorOrderTimeAxisSorter {
|
||||
bool operator() (const TimeAxisView* a, const TimeAxisView* b) const {
|
||||
return a->order < b->order;
|
||||
return a->order () < b->order ();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -341,9 +341,7 @@ Editor::track_canvas_size_allocated ()
|
|||
double height = 0;
|
||||
|
||||
for (i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if ((*i)->control_parent) {
|
||||
height += (*i)->effective_height;
|
||||
}
|
||||
height += (*i)->effective_height ();
|
||||
(*i)->clip_to_viewport ();
|
||||
}
|
||||
|
||||
|
|
@ -391,7 +389,7 @@ Editor::controls_layout_size_request (Requisition* req)
|
|||
for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
|
||||
TimeAxisView *tv = (*i)[route_display_columns.tv];
|
||||
if (tv != 0) {
|
||||
pos += tv->effective_height;
|
||||
pos += tv->effective_height ();
|
||||
tv->clip_to_viewport ();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3658,7 +3658,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
return;
|
||||
}
|
||||
|
||||
original_pointer_order = drag_info.dest_trackview->order;
|
||||
original_pointer_order = drag_info.dest_trackview->order ();
|
||||
|
||||
/************************************************************
|
||||
Y-Delta Computation
|
||||
|
|
@ -3670,61 +3670,55 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
goto y_axis_done;
|
||||
}
|
||||
|
||||
if ((pointer_y_span = (drag_info.dest_trackview->order - tv->order)) != 0) {
|
||||
if ((pointer_y_span = (drag_info.dest_trackview->order() - tv->order())) != 0) {
|
||||
|
||||
int32_t children = 0, numtracks = 0;
|
||||
int32_t children = 0;
|
||||
// XXX hard coding track limit, oh my, so very very bad
|
||||
bitset <1024> tracks (0x00);
|
||||
/* get a bitmask representing the visible tracks */
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
TimeAxisView *tracklist_timeview;
|
||||
tracklist_timeview = (*i);
|
||||
RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*>(tracklist_timeview);
|
||||
RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
TimeAxisView::Children children_list;
|
||||
|
||||
/* zeroes are audio tracks. ones are other types. */
|
||||
|
||||
if (!rtv2->hidden()) {
|
||||
|
||||
if (visible_y_high < rtv2->order) {
|
||||
visible_y_high = rtv2->order;
|
||||
if (visible_y_high < rtv2->order()) {
|
||||
visible_y_high = rtv2->order();
|
||||
}
|
||||
if (visible_y_low > rtv2->order) {
|
||||
visible_y_low = rtv2->order;
|
||||
if (visible_y_low > rtv2->order()) {
|
||||
visible_y_low = rtv2->order();
|
||||
}
|
||||
|
||||
if (!rtv2->is_track()) {
|
||||
tracks = tracks |= (0x01 << rtv2->order);
|
||||
tracks = tracks |= (0x01 << rtv2->order());
|
||||
}
|
||||
|
||||
height_list[rtv2->order] = (*i)->current_height();
|
||||
height_list[rtv2->order()] = (*i)->current_height();
|
||||
children = 1;
|
||||
|
||||
if ((children_list = rtv2->get_child_list()).size() > 0) {
|
||||
for (TimeAxisView::Children::iterator j = children_list.begin(); j != children_list.end(); ++j) {
|
||||
tracks = tracks |= (0x01 << (rtv2->order + children));
|
||||
height_list[rtv2->order + children] = (*j)->current_height();
|
||||
numtracks++;
|
||||
tracks = tracks |= (0x01 << (rtv2->order() + children));
|
||||
height_list[rtv2->order() + children] = (*j)->current_height();
|
||||
children++;
|
||||
}
|
||||
}
|
||||
numtracks++;
|
||||
}
|
||||
}
|
||||
/* find the actual span according to the canvas */
|
||||
|
||||
canvas_pointer_y_span = pointer_y_span;
|
||||
if (drag_info.dest_trackview->order >= tv->order) {
|
||||
int32_t y;
|
||||
for (y = tv->order; y < drag_info.dest_trackview->order; y++) {
|
||||
if (drag_info.dest_trackview->order() >= tv->order()) {
|
||||
for (int32_t y = tv->order(); y < drag_info.dest_trackview->order(); y++) {
|
||||
if (height_list[y] == 0) {
|
||||
canvas_pointer_y_span--;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int32_t y;
|
||||
for (y = drag_info.dest_trackview->order;y <= tv->order; y++) {
|
||||
for (int32_t y = drag_info.dest_trackview->order(); y <= tv->order(); y++) {
|
||||
if (height_list[y] == 0) {
|
||||
canvas_pointer_y_span++;
|
||||
}
|
||||
|
|
@ -3747,25 +3741,25 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
TimeAxisView* tvp2 = trackview_by_y_position (iy1);
|
||||
RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*>(tvp2);
|
||||
|
||||
if (rtv2->order != original_pointer_order) {
|
||||
if (rtv2->order() != original_pointer_order) {
|
||||
/* this isn't the pointer track */
|
||||
|
||||
if (canvas_pointer_y_span > 0) {
|
||||
|
||||
/* moving up the canvas */
|
||||
if ((rtv2->order - canvas_pointer_y_span) >= visible_y_low) {
|
||||
if ((rtv2->order() - canvas_pointer_y_span) >= visible_y_low) {
|
||||
|
||||
int32_t visible_tracks = 0;
|
||||
while (visible_tracks < canvas_pointer_y_span ) {
|
||||
visible_tracks++;
|
||||
|
||||
while (height_list[rtv2->order - (visible_tracks - n)] == 0) {
|
||||
while (height_list[rtv2->order() - (visible_tracks - n)] == 0) {
|
||||
/* we're passing through a hidden track */
|
||||
n--;
|
||||
}
|
||||
}
|
||||
|
||||
if (tracks[rtv2->order - (canvas_pointer_y_span - n)] != 0x00) {
|
||||
if (tracks[rtv2->order() - (canvas_pointer_y_span - n)] != 0x00) {
|
||||
clamp_y_axis = true;
|
||||
}
|
||||
|
||||
|
|
@ -3777,7 +3771,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
|
||||
/*moving down the canvas*/
|
||||
|
||||
if ((rtv2->order - (canvas_pointer_y_span - n)) <= visible_y_high) { // we will overflow
|
||||
if ((rtv2->order() - (canvas_pointer_y_span - n)) <= visible_y_high) { // we will overflow
|
||||
|
||||
|
||||
int32_t visible_tracks = 0;
|
||||
|
|
@ -3785,11 +3779,11 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
while (visible_tracks > canvas_pointer_y_span ) {
|
||||
visible_tracks--;
|
||||
|
||||
while (height_list[rtv2->order - (visible_tracks - n)] == 0) {
|
||||
while (height_list[rtv2->order() - (visible_tracks - n)] == 0) {
|
||||
n++;
|
||||
}
|
||||
}
|
||||
if ( tracks[rtv2->order - ( canvas_pointer_y_span - n)] != 0x00) {
|
||||
if ( tracks[rtv2->order() - ( canvas_pointer_y_span - n)] != 0x00) {
|
||||
clamp_y_axis = true;
|
||||
|
||||
}
|
||||
|
|
@ -3802,9 +3796,9 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
} else {
|
||||
|
||||
/* this is the pointer's track */
|
||||
if ((rtv2->order - pointer_y_span) > visible_y_high) { // we will overflow
|
||||
if ((rtv2->order() - pointer_y_span) > visible_y_high) { // we will overflow
|
||||
clamp_y_axis = true;
|
||||
} else if ((rtv2->order - pointer_y_span) < visible_y_low) { // we will underflow
|
||||
} else if ((rtv2->order() - pointer_y_span) < visible_y_low) { // we will underflow
|
||||
clamp_y_axis = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -4008,7 +4002,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
y_delta = 0;
|
||||
int32_t x = 0;
|
||||
for (j = height_list.begin(); j!= height_list.end(); j++) {
|
||||
if (x == canvas_rtv->order) {
|
||||
if (x == canvas_rtv->order()) {
|
||||
/* we found the track the region is on */
|
||||
if (x != original_pointer_order) {
|
||||
/*this isn't from the same track we're dragging from */
|
||||
|
|
|
|||
|
|
@ -5340,11 +5340,11 @@ Editor::ensure_track_visible(TimeAxisView *track)
|
|||
if (track->hidden())
|
||||
return;
|
||||
|
||||
double current_view_min_y = vertical_adjustment.get_value();
|
||||
double current_view_max_y = vertical_adjustment.get_value() + vertical_adjustment.get_page_size() - canvas_timebars_vsize;
|
||||
double const current_view_min_y = vertical_adjustment.get_value();
|
||||
double const current_view_max_y = vertical_adjustment.get_value() + vertical_adjustment.get_page_size() - canvas_timebars_vsize;
|
||||
|
||||
double track_min_y = track->y_position;
|
||||
double track_max_y = track->y_position + (double)track->effective_height;
|
||||
double const track_min_y = track->y_position ();
|
||||
double const track_max_y = track->y_position () + track->effective_height ();
|
||||
|
||||
if (track_min_y >= current_view_min_y &&
|
||||
track_max_y <= current_view_max_y) {
|
||||
|
|
@ -5358,7 +5358,7 @@ Editor::ensure_track_visible(TimeAxisView *track)
|
|||
new_value = track_min_y;
|
||||
} else {
|
||||
// Track is below the current view
|
||||
new_value = track->y_position + (double)track->effective_height + canvas_timebars_vsize - vertical_adjustment.get_page_size();
|
||||
new_value = track->y_position () + track->effective_height() + canvas_timebars_vsize - vertical_adjustment.get_page_size();
|
||||
}
|
||||
|
||||
vertical_adjustment.set_value(new_value);
|
||||
|
|
@ -6216,7 +6216,7 @@ Editor::fit_tracks ()
|
|||
continue;
|
||||
}
|
||||
|
||||
child_heights += ((*t)->effective_height - (*t)->current_height());
|
||||
child_heights += (*t)->effective_height() - (*t)->current_height();
|
||||
}
|
||||
|
||||
uint32_t h = (uint32_t) floor ((canvas_height - child_heights - canvas_timebars_vsize)/selection->tracks.size());
|
||||
|
|
@ -6251,7 +6251,7 @@ Editor::fit_tracks ()
|
|||
|
||||
if (is_selected) {
|
||||
(*t)->set_height (h);
|
||||
first_y_pos = std::min ((*t)->y_position, first_y_pos);
|
||||
first_y_pos = std::min ((*t)->y_position (), first_y_pos);
|
||||
} else {
|
||||
if (prev_was_selected && next_is_selected) {
|
||||
hide_track_in_display (**t);
|
||||
|
|
|
|||
|
|
@ -347,6 +347,7 @@ Editor::redisplay_route_list ()
|
|||
|
||||
bool visible = (*i)[route_display_columns.visible];
|
||||
|
||||
/* show or hide the TimeAxisView */
|
||||
if (visible) {
|
||||
tv->set_marked_for_display (true);
|
||||
position += tv->show_at (position, n, &edit_controls_vbox);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ using namespace Editing;
|
|||
struct TrackViewByPositionSorter
|
||||
{
|
||||
bool operator() (const TimeAxisView* a, const TimeAxisView *b) {
|
||||
return a->y_position < b->y_position;
|
||||
return a->y_position() < b->y_position();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ GhostRegion::is_automation_ghost() {
|
|||
}
|
||||
|
||||
AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
|
||||
: GhostRegion(tv.ghost_group, tv, source_tv, initial_unit_pos) {
|
||||
: GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos) {
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -157,7 +157,7 @@ AudioGhostRegion::set_colors ()
|
|||
* no range controller in these tracks. maybe show the whole range.
|
||||
*/
|
||||
MidiGhostRegion::MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
|
||||
: GhostRegion(tv.ghost_group, tv, source_tv, initial_unit_pos)
|
||||
: GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos)
|
||||
{
|
||||
|
||||
base_rect->lower_to_bottom();
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
|
||||
static ArdourCanvas::SimpleRect* drag_rect = NULL;
|
||||
|
||||
if (trackview.editor.current_mouse_mode() != MouseNote)
|
||||
if (trackview.editor().current_mouse_mode() != MouseNote)
|
||||
return false;
|
||||
|
||||
// Mmmm, spaghetti
|
||||
|
|
@ -214,8 +214,8 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
case GDK_KEY_PRESS:
|
||||
if (ev->key.keyval == GDK_Delete && !delete_mod) {
|
||||
delete_mod = true;
|
||||
original_mode = trackview.editor.current_midi_edit_mode();
|
||||
trackview.editor.set_midi_edit_mode(MidiEditErase);
|
||||
original_mode = trackview.editor().current_midi_edit_mode();
|
||||
trackview.editor().set_midi_edit_mode(MidiEditErase);
|
||||
start_delta_command(_("erase notes"));
|
||||
_mouse_state = EraseTouchDragging;
|
||||
return true;
|
||||
|
|
@ -235,7 +235,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
apply_command();
|
||||
}
|
||||
if (delete_mod) {
|
||||
trackview.editor.set_midi_edit_mode(original_mode);
|
||||
trackview.editor().set_midi_edit_mode(original_mode);
|
||||
_mouse_state = None;
|
||||
delete_mod = false;
|
||||
}
|
||||
|
|
@ -272,8 +272,8 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
group->w2i(event_x, event_y);
|
||||
|
||||
// convert event_x to global frame
|
||||
event_frame = trackview.editor.pixel_to_frame(event_x) + _region->position();
|
||||
trackview.editor.snap_to(event_frame);
|
||||
event_frame = trackview.editor().pixel_to_frame(event_x) + _region->position();
|
||||
trackview.editor().snap_to(event_frame);
|
||||
// convert event_frame back to local coordinates relative to position
|
||||
event_frame -= _region->position();
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
case Pressed: // Drag start
|
||||
|
||||
// Select drag start
|
||||
if (_pressed_button == 1 && trackview.editor.current_midi_edit_mode() == MidiEditSelect) {
|
||||
if (_pressed_button == 1 && trackview.editor().current_midi_edit_mode() == MidiEditSelect) {
|
||||
group->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
|
||||
Gdk::Cursor(Gdk::FLEUR), ev->motion.time);
|
||||
last_x = event_x;
|
||||
|
|
@ -304,7 +304,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
return true;
|
||||
|
||||
// Add note drag start
|
||||
} else if (trackview.editor.current_midi_edit_mode() == MidiEditPencil) {
|
||||
} else if (trackview.editor().current_midi_edit_mode() == MidiEditPencil) {
|
||||
group->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
|
||||
Gdk::Cursor(Gdk::FLEUR), ev->motion.time);
|
||||
last_x = event_x;
|
||||
|
|
@ -313,7 +313,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
drag_start_y = event_y;
|
||||
|
||||
drag_rect = new ArdourCanvas::SimpleRect(*group);
|
||||
drag_rect->property_x1() = trackview.editor.frame_to_pixel(event_frame);
|
||||
drag_rect->property_x1() = trackview.editor().frame_to_pixel(event_frame);
|
||||
|
||||
drag_rect->property_y1() = midi_stream_view()->note_to_y(midi_stream_view()->y_to_note(event_y));
|
||||
drag_rect->property_x2() = event_x;
|
||||
|
|
@ -341,7 +341,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
}
|
||||
|
||||
if (_mouse_state == AddDragging)
|
||||
event_x = trackview.editor.frame_to_pixel(event_frame);
|
||||
event_x = trackview.editor().frame_to_pixel(event_frame);
|
||||
|
||||
if (drag_rect) {
|
||||
if (event_x > drag_start_x)
|
||||
|
|
@ -376,7 +376,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
event_y = ev->motion.y;
|
||||
group->w2i(event_x, event_y);
|
||||
group->ungrab(ev->button.time);
|
||||
event_frame = trackview.editor.pixel_to_frame(event_x);
|
||||
event_frame = trackview.editor().pixel_to_frame(event_x);
|
||||
|
||||
if (_pressed_button != 1) {
|
||||
return false;
|
||||
|
|
@ -384,7 +384,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
|
||||
switch (_mouse_state) {
|
||||
case Pressed: // Clicked
|
||||
switch (trackview.editor.current_midi_edit_mode()) {
|
||||
switch (trackview.editor().current_midi_edit_mode()) {
|
||||
case MidiEditSelect:
|
||||
case MidiEditResize:
|
||||
clear_selection();
|
||||
|
|
@ -404,7 +404,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
_mouse_state = None;
|
||||
if (drag_rect->property_x2() > drag_rect->property_x1() + 2) {
|
||||
const double x = drag_rect->property_x1();
|
||||
const double length = trackview.editor.pixel_to_frame(
|
||||
const double length = trackview.editor().pixel_to_frame(
|
||||
drag_rect->property_x2() - drag_rect->property_x1());
|
||||
|
||||
create_note_at(x, drag_rect->property_y1(), length);
|
||||
|
|
@ -434,7 +434,7 @@ MidiRegionView::create_note_at(double x, double y, double length)
|
|||
assert(note >= 0.0);
|
||||
assert(note <= 127.0);
|
||||
|
||||
nframes64_t new_note_time = trackview.editor.pixel_to_frame (x);
|
||||
nframes64_t new_note_time = trackview.editor().pixel_to_frame (x);
|
||||
assert(new_note_time >= 0);
|
||||
new_note_time += _region->start();
|
||||
|
||||
|
|
@ -773,7 +773,7 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force)
|
|||
note->property_y1() = y1;
|
||||
note->property_y2() = y2;
|
||||
} else if (CanvasHit* hit = dynamic_cast<CanvasHit*>(event)) {
|
||||
double x = trackview.editor.frame_to_pixel((nframes64_t)
|
||||
double x = trackview.editor().frame_to_pixel((nframes64_t)
|
||||
event->note()->time() - _region->start());
|
||||
const double diamond_size = midi_stream_view()->note_height() / 2.0;
|
||||
double y = midi_stream_view()->note_to_y(event->note()->note())
|
||||
|
|
@ -864,7 +864,7 @@ MidiRegionView::resolve_note(uint8_t note, double end_time)
|
|||
return;
|
||||
|
||||
if (_active_notes && _active_notes[note]) {
|
||||
_active_notes[note]->property_x2() = trackview.editor.frame_to_pixel((nframes64_t)end_time);
|
||||
_active_notes[note]->property_x2() = trackview.editor().frame_to_pixel((nframes64_t)end_time);
|
||||
_active_notes[note]->property_outline_what() = (guint32) 0xF; // all edges
|
||||
_active_notes[note] = NULL;
|
||||
}
|
||||
|
|
@ -882,7 +882,7 @@ MidiRegionView::extend_active_notes()
|
|||
|
||||
for (unsigned i=0; i < 128; ++i) {
|
||||
if (_active_notes[i]) {
|
||||
_active_notes[i]->property_x2() = trackview.editor.frame_to_pixel(_region->length());
|
||||
_active_notes[i]->property_x2() = trackview.editor().frame_to_pixel(_region->length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -890,7 +890,7 @@ MidiRegionView::extend_active_notes()
|
|||
void
|
||||
MidiRegionView::play_midi_note(boost::shared_ptr<Evoral::Note> note)
|
||||
{
|
||||
if (!trackview.editor.is_midi_sound_notes_active()) {
|
||||
if (!trackview.editor().is_midi_sound_notes_active()) {
|
||||
cerr << "not_active " << endl;
|
||||
return;
|
||||
}
|
||||
|
|
@ -942,13 +942,13 @@ MidiRegionView::add_note(const boost::shared_ptr<Evoral::Note> note)
|
|||
|
||||
CanvasNoteEvent* event = 0;
|
||||
|
||||
const double x = trackview.editor.frame_to_pixel((nframes64_t)note->time() - _region->start());
|
||||
const double x = trackview.editor().frame_to_pixel((nframes64_t)note->time() - _region->start());
|
||||
|
||||
if (midi_view()->note_mode() == Sustained) {
|
||||
|
||||
const double y1 = midi_stream_view()->note_to_y(note->note());
|
||||
const double note_endpixel =
|
||||
trackview.editor.frame_to_pixel((nframes64_t)note->end_time() - _region->start());
|
||||
trackview.editor().frame_to_pixel((nframes64_t)note->end_time() - _region->start());
|
||||
|
||||
CanvasNote* ev_rect = new CanvasNote(*this, *group, note);
|
||||
ev_rect->property_x1() = x;
|
||||
|
|
@ -956,7 +956,7 @@ MidiRegionView::add_note(const boost::shared_ptr<Evoral::Note> note)
|
|||
if (note->length() > 0)
|
||||
ev_rect->property_x2() = note_endpixel;
|
||||
else
|
||||
ev_rect->property_x2() = trackview.editor.frame_to_pixel(_region->length());
|
||||
ev_rect->property_x2() = trackview.editor().frame_to_pixel(_region->length());
|
||||
ev_rect->property_y2() = y1 + floor(midi_stream_view()->note_height());
|
||||
|
||||
if (note->length() == 0) {
|
||||
|
|
@ -1030,7 +1030,7 @@ MidiRegionView::add_pgm_change(ControlEvent& program, string displaytext)
|
|||
return;
|
||||
|
||||
ArdourCanvas::Group* const group = (ArdourCanvas::Group*)get_canvas_group();
|
||||
const double x = trackview.editor.frame_to_pixel((nframes64_t)program.time - _region->start());
|
||||
const double x = trackview.editor().frame_to_pixel((nframes64_t)program.time - _region->start());
|
||||
|
||||
double height = midi_stream_view()->contents_height();
|
||||
|
||||
|
|
@ -1387,7 +1387,7 @@ MidiRegionView::note_dropped(CanvasNoteEvent* ev, double dt, uint8_t dnote)
|
|||
nframes64_t
|
||||
MidiRegionView::snap_to_frame(double x)
|
||||
{
|
||||
PublicEditor &editor = trackview.editor;
|
||||
PublicEditor &editor = trackview.editor();
|
||||
// x is region relative
|
||||
// convert x to global frame
|
||||
nframes64_t frame = editor.pixel_to_frame(x) + _region->position();
|
||||
|
|
@ -1400,7 +1400,7 @@ MidiRegionView::snap_to_frame(double x)
|
|||
nframes64_t
|
||||
MidiRegionView::snap_to_frame(nframes64_t x)
|
||||
{
|
||||
PublicEditor &editor = trackview.editor;
|
||||
PublicEditor &editor = trackview.editor();
|
||||
// x is region relative
|
||||
// convert x to global frame
|
||||
nframes64_t frame = x + _region->position();
|
||||
|
|
@ -1413,14 +1413,14 @@ MidiRegionView::snap_to_frame(nframes64_t x)
|
|||
double
|
||||
MidiRegionView::snap_to_pixel(double x)
|
||||
{
|
||||
return (double) trackview.editor.frame_to_pixel(snap_to_frame(x));
|
||||
return (double) trackview.editor().frame_to_pixel(snap_to_frame(x));
|
||||
}
|
||||
|
||||
double
|
||||
MidiRegionView::get_position_pixels()
|
||||
{
|
||||
nframes64_t region_frame = get_position();
|
||||
return trackview.editor.frame_to_pixel(region_frame);
|
||||
return trackview.editor().frame_to_pixel(region_frame);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
|
|||
else
|
||||
stream_base_color = ARDOUR_UI::config()->canvasvar_MidiBusBase.get();
|
||||
|
||||
use_rec_regions = tv.editor.show_waveforms_recording ();
|
||||
use_rec_regions = tv.editor().show_waveforms_recording ();
|
||||
|
||||
/* use a group dedicated to MIDI underlays. Audio underlays are not in this group. */
|
||||
midi_underlay_group = new ArdourCanvas::Group (*canvas_group);
|
||||
|
|
@ -79,10 +79,10 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
|
|||
|
||||
_note_lines->property_x1() = 0;
|
||||
_note_lines->property_y1() = 0;
|
||||
_note_lines->property_x2() = trackview().editor.frame_to_pixel (max_frames);
|
||||
_note_lines->property_x2() = trackview().editor().frame_to_pixel (max_frames);
|
||||
_note_lines->property_y2() = 0;
|
||||
|
||||
_note_lines->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), _note_lines, &_trackview));
|
||||
_note_lines->signal_event().connect (bind (mem_fun (_trackview.editor(), &PublicEditor::canvas_stream_view_event), _note_lines, &_trackview));
|
||||
_note_lines->lower_to_bottom();
|
||||
|
||||
ColorsChanged.connect(mem_fun(*this, &MidiStreamView::draw_note_lines));
|
||||
|
|
@ -457,7 +457,7 @@ MidiStreamView::setup_rec_box ()
|
|||
boost::shared_ptr<MidiTrack> mt = _trackview.midi_track(); /* we know what it is already */
|
||||
boost::shared_ptr<MidiDiskstream> ds = mt->midi_diskstream();
|
||||
jack_nframes_t frame_pos = ds->current_capture_start ();
|
||||
gdouble xstart = _trackview.editor.frame_to_pixel (frame_pos);
|
||||
gdouble xstart = _trackview.editor().frame_to_pixel (frame_pos);
|
||||
gdouble xend;
|
||||
uint32_t fill_color;
|
||||
|
||||
|
|
@ -595,7 +595,7 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
|
|||
|
||||
/* also update rect */
|
||||
ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle;
|
||||
gdouble xend = _trackview.editor.frame_to_pixel (region->position() + region->length());
|
||||
gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length());
|
||||
rect->property_x2() = xend;
|
||||
|
||||
/* draw events */
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ MidiTimeAxisView::add_cc_track()
|
|||
|
||||
{
|
||||
AddMidiCCTrackDialog dialog;
|
||||
dialog.set_transient_for(editor);
|
||||
dialog.set_transient_for (_editor);
|
||||
response = dialog.run();
|
||||
|
||||
if (response == Gtk::RESPONSE_ACCEPT)
|
||||
|
|
@ -496,7 +496,7 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
|
|||
|
||||
boost::shared_ptr<AutomationTimeAxisView> track(new AutomationTimeAxisView (_session,
|
||||
_route, boost::shared_ptr<ARDOUR::Automatable>(), c,
|
||||
editor,
|
||||
_editor,
|
||||
*this,
|
||||
true,
|
||||
parent_canvas,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
|
|||
|
||||
model_representation (cp, mr);
|
||||
|
||||
trackview.editor.current_session()->begin_reversible_command (_("remove control point"));
|
||||
trackview.editor().current_session()->begin_reversible_command (_("remove control point"));
|
||||
XMLNode &before = alist->get_state();
|
||||
|
||||
if (!rv.audio_region()->envelope_active()) {
|
||||
|
|
@ -81,9 +81,9 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
|
|||
|
||||
alist->erase (mr.start, mr.end);
|
||||
|
||||
trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
|
||||
trackview.editor.current_session()->commit_reversible_command ();
|
||||
trackview.editor.current_session()->set_dirty ();
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -268,10 +268,10 @@ struct RegionSortByTrack {
|
|||
|
||||
/* really, track and position */
|
||||
|
||||
if (a->get_trackview().order == b->get_trackview().order) {
|
||||
if (a->get_trackview().order() == b->get_trackview().order()) {
|
||||
return a->region()->position() < b->region()->position();
|
||||
} else {
|
||||
return a->get_trackview().order < b->get_trackview().order;
|
||||
return a->get_trackview().order() < b->get_trackview().order();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -643,14 +643,14 @@ RegionView::update_coverage_frames (LayerDisplay d)
|
|||
|
||||
/* finish off any old rect, if required */
|
||||
if (cr && me != new_me) {
|
||||
cr->property_x2() = trackview.editor.frame_to_pixel (t - position);
|
||||
cr->property_x2() = trackview.editor().frame_to_pixel (t - position);
|
||||
}
|
||||
|
||||
/* start off any new rect, if required */
|
||||
if (cr == 0 || me != new_me) {
|
||||
cr = new ArdourCanvas::SimpleRect (*group);
|
||||
_coverage_frames.push_back (cr);
|
||||
cr->property_x1() = trackview.editor.frame_to_pixel (t - position);
|
||||
cr->property_x1() = trackview.editor().frame_to_pixel (t - position);
|
||||
cr->property_y1() = 1;
|
||||
cr->property_y2() = _height + 1;
|
||||
cr->property_outline_pixels() = 0;
|
||||
|
|
@ -668,6 +668,6 @@ RegionView::update_coverage_frames (LayerDisplay d)
|
|||
|
||||
if (cr) {
|
||||
/* finish off the last rectangle */
|
||||
cr->property_x2() = trackview.editor.frame_to_pixel (end - position);
|
||||
cr->property_x2() = trackview.editor().frame_to_pixel (end - position);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
|
|||
controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
}
|
||||
|
||||
y_position = -1;
|
||||
_y_position = -1;
|
||||
|
||||
_route->mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
|
||||
_route->solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
|
||||
|
|
@ -241,7 +241,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
|
|||
|
||||
}
|
||||
|
||||
editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
|
||||
_editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
|
||||
ColorsChanged.connect (mem_fun (*this, &RouteTimeAxisView::color_handler));
|
||||
|
||||
gm.get_gain_slider().signal_scroll_event().connect(mem_fun(*this, &RouteTimeAxisView::controls_ebox_scroll), false);
|
||||
|
|
@ -372,7 +372,7 @@ RouteTimeAxisView::label_view ()
|
|||
void
|
||||
RouteTimeAxisView::route_name_changed ()
|
||||
{
|
||||
editor.route_name_changed (this);
|
||||
_editor.route_name_changed (this);
|
||||
label_view ();
|
||||
}
|
||||
|
||||
|
|
@ -716,7 +716,7 @@ RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
|
|||
#endif
|
||||
|
||||
if (timestretch_rect == 0) {
|
||||
timestretch_rect = new SimpleRect (*canvas_display);
|
||||
timestretch_rect = new SimpleRect (*canvas_display ());
|
||||
timestretch_rect->property_x1() = 0.0;
|
||||
timestretch_rect->property_y1() = 0.0;
|
||||
timestretch_rect->property_x2() = 0.0;
|
||||
|
|
@ -728,8 +728,8 @@ RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
|
|||
timestretch_rect->show ();
|
||||
timestretch_rect->raise_to_top ();
|
||||
|
||||
x1 = start / editor.get_current_zoom();
|
||||
x2 = (end - 1) / editor.get_current_zoom();
|
||||
x1 = start / _editor.get_current_zoom();
|
||||
x2 = (end - 1) / _editor.get_current_zoom();
|
||||
y2 = current_height() - 2;
|
||||
|
||||
timestretch_rect->property_x1() = x1;
|
||||
|
|
@ -882,7 +882,7 @@ RouteTimeAxisView::select_track_color ()
|
|||
void
|
||||
RouteTimeAxisView::reset_samples_per_unit ()
|
||||
{
|
||||
set_samples_per_unit (editor.get_current_zoom());
|
||||
set_samples_per_unit (_editor.get_current_zoom());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1120,7 +1120,7 @@ RouteTimeAxisView::clear_playlist ()
|
|||
if (!pl)
|
||||
return;
|
||||
|
||||
editor.clear_playlist (pl);
|
||||
_editor.clear_playlist (pl);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1151,38 +1151,38 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev)
|
|||
if (Keyboard::modifier_state_equals (ev->state, (Keyboard::TertiaryModifier|Keyboard::PrimaryModifier))) {
|
||||
|
||||
/* special case: select/deselect all tracks */
|
||||
if (editor.get_selection().selected (this)) {
|
||||
editor.get_selection().clear_tracks ();
|
||||
if (_editor.get_selection().selected (this)) {
|
||||
_editor.get_selection().clear_tracks ();
|
||||
} else {
|
||||
editor.select_all_tracks ();
|
||||
_editor.select_all_tracks ();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route->edit_group());
|
||||
PublicEditor::TrackViewList* tracks = _editor.get_valid_views (this, _route->edit_group());
|
||||
|
||||
switch (Keyboard::selection_type (ev->state)) {
|
||||
case Selection::Toggle:
|
||||
editor.get_selection().toggle (*tracks);
|
||||
_editor.get_selection().toggle (*tracks);
|
||||
break;
|
||||
|
||||
case Selection::Set:
|
||||
editor.get_selection().set (*tracks);
|
||||
_editor.get_selection().set (*tracks);
|
||||
break;
|
||||
|
||||
case Selection::Extend:
|
||||
if (tracks->size() > 1) {
|
||||
/* add each one, do not "extend" */
|
||||
editor.get_selection().add (*tracks);
|
||||
_editor.get_selection().add (*tracks);
|
||||
} else {
|
||||
/* extend to the single track */
|
||||
editor.extend_selection_to_track (*tracks->front());
|
||||
_editor.extend_selection_to_track (*tracks->front());
|
||||
}
|
||||
break;
|
||||
|
||||
case Selection::Add:
|
||||
editor.get_selection().add (*tracks);
|
||||
_editor.get_selection().add (*tracks);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1339,7 +1339,7 @@ RouteTimeAxisView::hide_click ()
|
|||
// LAME fix for hide_button refresh fix
|
||||
hide_button.set_sensitive(false);
|
||||
|
||||
editor.hide_track_in_display (*this);
|
||||
_editor.hide_track_in_display (*this);
|
||||
|
||||
hide_button.set_sensitive(true);
|
||||
}
|
||||
|
|
@ -1398,14 +1398,14 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
|
|||
switch (op) {
|
||||
case Cut:
|
||||
if ((what_we_got = playlist->cut (time)) != 0) {
|
||||
editor.get_cut_buffer().add (what_we_got);
|
||||
_editor.get_cut_buffer().add (what_we_got);
|
||||
_session.add_command( new MementoCommand<Playlist>(*playlist.get(), &before, &playlist->get_state()));
|
||||
ret = true;
|
||||
}
|
||||
break;
|
||||
case Copy:
|
||||
if ((what_we_got = playlist->copy (time)) != 0) {
|
||||
editor.get_cut_buffer().add (what_we_got);
|
||||
_editor.get_cut_buffer().add (what_we_got);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -1508,18 +1508,18 @@ RouteTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
|
|||
playlist_items.push_back (SeparatorElem());
|
||||
|
||||
if (!edit_group() || !edit_group()->is_active()) {
|
||||
playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(editor, &PublicEditor::new_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(editor, &PublicEditor::copy_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(_editor, &PublicEditor::new_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(_editor, &PublicEditor::copy_playlists), this)));
|
||||
|
||||
} else {
|
||||
// Use a label which tells the user what is happening
|
||||
playlist_items.push_back (MenuElem (_("New Take"), bind(mem_fun(editor, &PublicEditor::new_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("Copy Take"), bind(mem_fun(editor, &PublicEditor::copy_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("New Take"), bind(mem_fun(_editor, &PublicEditor::new_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("Copy Take"), bind(mem_fun(_editor, &PublicEditor::copy_playlists), this)));
|
||||
|
||||
}
|
||||
|
||||
playlist_items.push_back (SeparatorElem());
|
||||
playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(editor, &PublicEditor::clear_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(_editor, &PublicEditor::clear_playlists), this)));
|
||||
playlist_items.push_back (SeparatorElem());
|
||||
|
||||
playlist_items.push_back (MenuElem(_("Select from all ..."), mem_fun(*this, &RouteTimeAxisView::show_playlist_selector)));
|
||||
|
|
@ -1590,7 +1590,7 @@ RouteTimeAxisView::use_playlist (boost::weak_ptr<Playlist> wpl)
|
|||
void
|
||||
RouteTimeAxisView::show_playlist_selector ()
|
||||
{
|
||||
editor.playlist_selector().show_for (this);
|
||||
_editor.playlist_selector().show_for (this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1642,7 +1642,7 @@ RouteTimeAxisView::toggle_automation_track (Evoral::Parameter param)
|
|||
if (showit != node->track->marked_for_display()) {
|
||||
if (showit) {
|
||||
node->track->set_marked_for_display (true);
|
||||
node->track->canvas_display->show();
|
||||
node->track->canvas_display()->show();
|
||||
node->track->get_state_node()->add_property ("shown", X_("yes"));
|
||||
} else {
|
||||
node->track->set_marked_for_display (false);
|
||||
|
|
@ -1687,7 +1687,7 @@ RouteTimeAxisView::show_all_automation ()
|
|||
map<Evoral::Parameter, RouteAutomationNode*>::iterator i;
|
||||
for (i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
|
||||
i->second->track->set_marked_for_display (true);
|
||||
i->second->track->canvas_display->show();
|
||||
i->second->track->canvas_display()->show();
|
||||
i->second->track->get_state_node()->add_property ("shown", X_("yes"));
|
||||
i->second->menu_item->set_active(true);
|
||||
}
|
||||
|
|
@ -1723,7 +1723,7 @@ RouteTimeAxisView::show_existing_automation ()
|
|||
for (i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
|
||||
if (i->second->track->line() && i->second->track->line()->npoints() > 0) {
|
||||
i->second->track->set_marked_for_display (true);
|
||||
i->second->track->canvas_display->show();
|
||||
i->second->track->canvas_display()->show();
|
||||
i->second->track->get_state_node()->add_property ("shown", X_("yes"));
|
||||
i->second->menu_item->set_active(true);
|
||||
}
|
||||
|
|
@ -1884,7 +1884,7 @@ RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr<Processor>
|
|||
|
||||
pan->view = boost::shared_ptr<AutomationTimeAxisView>(
|
||||
new AutomationTimeAxisView (_session, _route, processor, control,
|
||||
editor, *this, false, parent_canvas, name, state_name));
|
||||
_editor, *this, false, parent_canvas, name, state_name));
|
||||
|
||||
pan->view->Hiding.connect (bind (mem_fun(*this, &RouteTimeAxisView::processor_automation_track_hidden), pan, processor));
|
||||
|
||||
|
|
@ -2082,8 +2082,8 @@ RouteTimeAxisView::processor_menu_item_toggled (RouteTimeAxisView::ProcessorAuto
|
|||
|
||||
if (showit) {
|
||||
pan->view->set_marked_for_display (true);
|
||||
pan->view->canvas_display->show();
|
||||
pan->view->canvas_background->show();
|
||||
pan->view->canvas_display()->show();
|
||||
pan->view->canvas_background()->show();
|
||||
} else {
|
||||
rai->processor->mark_automation_visible (pan->what, true);
|
||||
pan->view->set_marked_for_display (false);
|
||||
|
|
@ -2274,7 +2274,7 @@ RouteTimeAxisView::set_underlay_state()
|
|||
if (prop) {
|
||||
PBD::ID id (prop->value());
|
||||
|
||||
RouteTimeAxisView* v = editor.get_route_view_by_id(id);
|
||||
RouteTimeAxisView* v = _editor.get_route_view_by_id (id);
|
||||
|
||||
if (v) {
|
||||
add_underlay(v->view(), false);
|
||||
|
|
|
|||
|
|
@ -48,12 +48,12 @@ using namespace Editing;
|
|||
StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
|
||||
: _trackview (tv)
|
||||
, owns_canvas_group(group == 0)
|
||||
, _background_group(new ArdourCanvas::Group(*_trackview.canvas_background))
|
||||
, canvas_group(group ? group : new ArdourCanvas::Group(*_trackview.canvas_display))
|
||||
, _samples_per_unit(_trackview.editor.get_current_zoom())
|
||||
, _background_group (new ArdourCanvas::Group (*_trackview.canvas_background()))
|
||||
, canvas_group(group ? group : new ArdourCanvas::Group(*_trackview.canvas_display()))
|
||||
, _samples_per_unit (_trackview.editor().get_current_zoom ())
|
||||
, rec_updating(false)
|
||||
, rec_active(false)
|
||||
, use_rec_regions(tv.editor.show_waveforms_recording())
|
||||
, use_rec_regions (tv.editor().show_waveforms_recording ())
|
||||
, region_color(_trackview.color())
|
||||
, stream_base_color(0xFFFFFFFF)
|
||||
, layers(1)
|
||||
|
|
@ -66,7 +66,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
|
|||
canvas_rect = new ArdourCanvas::SimpleRect (*_background_group);
|
||||
canvas_rect->property_x1() = 0.0;
|
||||
canvas_rect->property_y1() = 0.0;
|
||||
canvas_rect->property_x2() = _trackview.editor.get_physical_screen_width();
|
||||
canvas_rect->property_x2() = _trackview.editor().get_physical_screen_width ();
|
||||
canvas_rect->property_y2() = (double) tv.current_height();
|
||||
canvas_rect->raise(1); // raise above tempo lines
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
|
|||
//canvas_rect->property_outline_what() = (guint32) (0x1|0x2|0x8); // outline ends and bottom
|
||||
// (Fill/Outline colours set in derived classes)
|
||||
|
||||
canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
|
||||
canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor(), &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
|
||||
|
||||
if (_trackview.is_track()) {
|
||||
_trackview.track()->DiskstreamChanged.connect (mem_fun (*this, &StreamView::diskstream_changed));
|
||||
|
|
@ -151,8 +151,8 @@ StreamView::set_samples_per_unit (gdouble spp)
|
|||
for (vector<RecBoxInfo>::iterator xi = rec_rects.begin(); xi != rec_rects.end(); ++xi) {
|
||||
RecBoxInfo &recbox = (*xi);
|
||||
|
||||
gdouble xstart = _trackview.editor.frame_to_pixel ( recbox.start );
|
||||
gdouble xend = _trackview.editor.frame_to_pixel ( recbox.start + recbox.length );
|
||||
gdouble xstart = _trackview.editor().frame_to_pixel (recbox.start);
|
||||
gdouble xend = _trackview.editor().frame_to_pixel (recbox.start + recbox.length);
|
||||
|
||||
recbox.rectangle->property_x1() = xstart;
|
||||
recbox.rectangle->property_x2() = xend;
|
||||
|
|
@ -351,14 +351,14 @@ StreamView::update_rec_box ()
|
|||
switch (_trackview.track()->mode()) {
|
||||
case Normal:
|
||||
rect.length = at - rect.start;
|
||||
xstart = _trackview.editor.frame_to_pixel (rect.start);
|
||||
xend = _trackview.editor.frame_to_pixel (at);
|
||||
xstart = _trackview.editor().frame_to_pixel (rect.start);
|
||||
xend = _trackview.editor().frame_to_pixel (at);
|
||||
break;
|
||||
|
||||
case Destructive:
|
||||
rect.length = 2;
|
||||
xstart = _trackview.editor.frame_to_pixel (_trackview.get_diskstream()->current_capture_start());
|
||||
xend = _trackview.editor.frame_to_pixel (at);
|
||||
xstart = _trackview.editor().frame_to_pixel (_trackview.get_diskstream()->current_capture_start());
|
||||
xend = _trackview.editor().frame_to_pixel (at);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,24 +73,24 @@
|
|||
|
||||
TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* rent, Canvas& canvas)
|
||||
: AxisView (sess),
|
||||
editor (ed),
|
||||
y_position(0),
|
||||
order(0),
|
||||
controls_table (2, 8)
|
||||
controls_table (2, 8),
|
||||
_y_position (0),
|
||||
_editor (ed),
|
||||
_order (0)
|
||||
{
|
||||
if (need_size_info) {
|
||||
compute_controls_size_info ();
|
||||
need_size_info = false;
|
||||
}
|
||||
canvas_background = new Group (*ed.get_background_group (), 0.0, 0.0);
|
||||
canvas_display = new Group (*ed.get_trackview_group (), 0.0, 0.0);
|
||||
_canvas_background = new Group (*ed.get_background_group (), 0.0, 0.0);
|
||||
_canvas_display = new Group (*ed.get_trackview_group (), 0.0, 0.0);
|
||||
|
||||
selection_group = new Group (*canvas_display);
|
||||
selection_group = new Group (*_canvas_display);
|
||||
selection_group->hide();
|
||||
|
||||
ghost_group = new Group (*canvas_display);
|
||||
ghost_group->lower_to_bottom();
|
||||
ghost_group->show();
|
||||
_ghost_group = new Group (*_canvas_display);
|
||||
_ghost_group->lower_to_bottom();
|
||||
_ghost_group->show();
|
||||
|
||||
control_parent = 0;
|
||||
display_menu = 0;
|
||||
|
|
@ -98,12 +98,12 @@
|
|||
_hidden = false;
|
||||
in_destructor = false;
|
||||
height = 0;
|
||||
effective_height = 0;
|
||||
_effective_height = 0;
|
||||
parent = rent;
|
||||
_has_state = false;
|
||||
last_name_entry_key_press_event = 0;
|
||||
name_packing = NamePackingBits (0);
|
||||
resize_drag_start = -1;
|
||||
_resize_drag_start = -1;
|
||||
|
||||
/*
|
||||
Create the standard LHS Controls
|
||||
|
|
@ -208,16 +208,23 @@
|
|||
delete selection_group;
|
||||
selection_group = 0;
|
||||
|
||||
delete canvas_background;
|
||||
canvas_background = 0;
|
||||
delete _canvas_background;
|
||||
_canvas_background = 0;
|
||||
|
||||
delete canvas_display;
|
||||
canvas_display = 0;
|
||||
delete _canvas_display;
|
||||
_canvas_display = 0;
|
||||
|
||||
delete display_menu;
|
||||
display_menu = 0;
|
||||
}
|
||||
|
||||
/** Display this TimeAxisView as the nth component of the parent box, at y.
|
||||
*
|
||||
* @param y y position.
|
||||
* @param nth index for this TimeAxisView, increased if this view has children.
|
||||
* @param parent parent component.
|
||||
* @return height of this TimeAxisView.
|
||||
*/
|
||||
guint32
|
||||
TimeAxisView::show_at (double y, int& nth, VBox *parent)
|
||||
{
|
||||
|
|
@ -229,54 +236,54 @@
|
|||
parent->reorder_child (controls_hbox, nth);
|
||||
}
|
||||
|
||||
order = nth;
|
||||
_order = nth;
|
||||
|
||||
if (y_position != y) {
|
||||
canvas_display->property_y () = y;
|
||||
canvas_background->property_y () = y;
|
||||
if (_y_position != y) {
|
||||
_canvas_display->property_y () = y;
|
||||
_canvas_background->property_y () = y;
|
||||
/* silly canvas */
|
||||
canvas_display->move (0.0, 0.0);
|
||||
canvas_background->move (0.0, 0.0);
|
||||
y_position = y;
|
||||
_canvas_display->move (0.0, 0.0);
|
||||
_canvas_background->move (0.0, 0.0);
|
||||
_y_position = y;
|
||||
|
||||
}
|
||||
|
||||
canvas_background->raise_to_top ();
|
||||
canvas_display->raise_to_top ();
|
||||
_canvas_background->raise_to_top ();
|
||||
_canvas_display->raise_to_top ();
|
||||
|
||||
if (_marked_for_display) {
|
||||
controls_hbox.show ();
|
||||
controls_ebox.show ();
|
||||
canvas_background->show ();
|
||||
_canvas_background->show ();
|
||||
}
|
||||
|
||||
_hidden = false;
|
||||
|
||||
effective_height = current_height();
|
||||
_effective_height = current_height ();
|
||||
|
||||
/* now show children */
|
||||
|
||||
for (Children::iterator i = children.begin(); i != children.end(); ++i) {
|
||||
if (canvas_item_visible ((*i)->canvas_display)) {
|
||||
if (canvas_item_visible ((*i)->_canvas_display)) {
|
||||
++nth;
|
||||
effective_height += (*i)->show_at (y + effective_height, nth, parent);
|
||||
_effective_height += (*i)->show_at (y + _effective_height, nth, parent);
|
||||
}
|
||||
}
|
||||
|
||||
return effective_height;
|
||||
return _effective_height;
|
||||
}
|
||||
|
||||
void
|
||||
TimeAxisView::clip_to_viewport ()
|
||||
{
|
||||
if (_marked_for_display) {
|
||||
if (y_position + effective_height < editor.get_trackview_group_vertical_offset () || y_position > editor.get_trackview_group_vertical_offset () + canvas_display->get_canvas()->get_height()) {
|
||||
canvas_background->hide ();
|
||||
canvas_display->hide ();
|
||||
if (_y_position + _effective_height < _editor.get_trackview_group_vertical_offset () || _y_position > _editor.get_trackview_group_vertical_offset () + _canvas_display->get_canvas()->get_height()) {
|
||||
_canvas_background->hide ();
|
||||
_canvas_display->hide ();
|
||||
return;
|
||||
}
|
||||
canvas_background->show();
|
||||
canvas_display->show ();
|
||||
_canvas_background->show ();
|
||||
_canvas_display->show ();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -290,7 +297,7 @@
|
|||
step_height (true);
|
||||
return true;
|
||||
} else if (Keyboard::no_modifiers_active (ev->state)) {
|
||||
editor.scroll_tracks_up_line();
|
||||
_editor.scroll_tracks_up_line();
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
|
@ -300,7 +307,7 @@
|
|||
step_height (false);
|
||||
return true;
|
||||
} else if (Keyboard::no_modifiers_active (ev->state)) {
|
||||
editor.scroll_tracks_down_line();
|
||||
_editor.scroll_tracks_down_line();
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
|
@ -333,7 +340,7 @@
|
|||
TimeAxisView::selection_click (GdkEventButton* ev)
|
||||
{
|
||||
Selection::Operation op = Keyboard::selection_type (ev->state);
|
||||
editor.set_selected_track (*this, op, false);
|
||||
_editor.set_selected_track (*this, op, false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -343,8 +350,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
canvas_display->hide();
|
||||
canvas_background->hide();
|
||||
_canvas_display->hide ();
|
||||
_canvas_background->hide ();
|
||||
controls_frame.hide ();
|
||||
|
||||
if (control_parent) {
|
||||
|
|
@ -352,7 +359,7 @@
|
|||
control_parent = 0;
|
||||
}
|
||||
|
||||
y_position = -1;
|
||||
_y_position = -1;
|
||||
_hidden = true;
|
||||
|
||||
/* now hide children */
|
||||
|
|
@ -363,7 +370,7 @@
|
|||
|
||||
/* if its hidden, it cannot be selected */
|
||||
|
||||
editor.get_selection().remove (this);
|
||||
_editor.get_selection().remove (this);
|
||||
|
||||
Hiding ();
|
||||
}
|
||||
|
|
@ -387,7 +394,7 @@
|
|||
void
|
||||
TimeAxisView::set_heights (uint32_t h)
|
||||
{
|
||||
TrackSelection& ts (editor.get_selection().tracks);
|
||||
TrackSelection& ts (_editor.get_selection().tracks);
|
||||
|
||||
for (TrackSelection::iterator i = ts.begin(); i != ts.end(); ++i) {
|
||||
(*i)->set_height (h);
|
||||
|
|
@ -406,7 +413,7 @@
|
|||
|
||||
if (canvas_item_visible (selection_group)) {
|
||||
/* resize the selection rect */
|
||||
show_selection (editor.get_selection().time);
|
||||
show_selection (_editor.get_selection().time);
|
||||
}
|
||||
|
||||
reshow_feature_lines ();
|
||||
|
|
@ -432,7 +439,7 @@
|
|||
case GDK_ISO_Left_Tab:
|
||||
case GDK_Tab:
|
||||
name_entry_changed ();
|
||||
allviews = editor.get_valid_views (0);
|
||||
allviews = _editor.get_valid_views (0);
|
||||
if (allviews != 0) {
|
||||
i = find (allviews->begin(), allviews->end(), this);
|
||||
if (ev->keyval == GDK_Tab) {
|
||||
|
|
@ -558,10 +565,10 @@
|
|||
void
|
||||
TimeAxisView::conditionally_add_to_selection ()
|
||||
{
|
||||
Selection& s (editor.get_selection());
|
||||
Selection& s (_editor.get_selection ());
|
||||
|
||||
if (!s.selected (this)) {
|
||||
editor.set_selected_track (*this, Selection::Set);
|
||||
_editor.set_selected_track (*this, Selection::Set);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -608,8 +615,8 @@
|
|||
controls_vbox.set_name (controls_base_selected_name);
|
||||
/* propagate any existing selection, if the mode is right */
|
||||
|
||||
if (editor.current_mouse_mode() == Editing::MouseRange && !editor.get_selection().time.empty()) {
|
||||
show_selection (editor.get_selection().time);
|
||||
if (_editor.current_mouse_mode() == Editing::MouseRange && !_editor.get_selection().time.empty()) {
|
||||
show_selection (_editor.get_selection().time);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -670,8 +677,8 @@
|
|||
list<ArdourCanvas::SimpleLine*>::iterator l;
|
||||
|
||||
for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
|
||||
(*l)->property_x1() = editor.frame_to_pixel (*i);
|
||||
(*l)->property_x2() = editor.frame_to_pixel (*i);
|
||||
(*l)->property_x1() = _editor.frame_to_pixel (*i);
|
||||
(*l)->property_x2() = _editor.frame_to_pixel (*i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -726,8 +733,8 @@
|
|||
|
||||
rect = get_selection_rect ((*i).id);
|
||||
|
||||
x1 = editor.frame_to_unit (start);
|
||||
x2 = editor.frame_to_unit (start + cnt - 1);
|
||||
x1 = _editor.frame_to_unit (start);
|
||||
x2 = _editor.frame_to_unit (start + cnt - 1);
|
||||
y2 = current_height();
|
||||
|
||||
rect->rect->property_x1() = x1;
|
||||
|
|
@ -863,9 +870,9 @@
|
|||
|
||||
free_selection_rects.push_front (rect);
|
||||
|
||||
rect->rect->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_rect_event), rect->rect, rect));
|
||||
rect->start_trim->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_start_trim_event), rect->rect, rect));
|
||||
rect->end_trim->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_end_trim_event), rect->rect, rect));
|
||||
rect->rect->signal_event().connect (bind (mem_fun (_editor, &PublicEditor::canvas_selection_rect_event), rect->rect, rect));
|
||||
rect->start_trim->signal_event().connect (bind (mem_fun (_editor, &PublicEditor::canvas_selection_start_trim_event), rect->rect, rect));
|
||||
rect->end_trim->signal_event().connect (bind (mem_fun (_editor, &PublicEditor::canvas_selection_end_trim_event), rect->rect, rect));
|
||||
}
|
||||
|
||||
rect = free_selection_rects.front();
|
||||
|
|
@ -948,11 +955,11 @@ TimeAxisView::touched (double top, double bot)
|
|||
y_position is the "origin" or "top" of the track.
|
||||
*/
|
||||
|
||||
double mybot = y_position + current_height();
|
||||
double mybot = _y_position + current_height();
|
||||
|
||||
return ((y_position <= bot && y_position >= top) ||
|
||||
return ((_y_position <= bot && _y_position >= top) ||
|
||||
((mybot <= bot) && (top < mybot)) ||
|
||||
(mybot >= bot && y_position < top));
|
||||
(mybot >= bot && _y_position < top));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1184,6 +1191,10 @@ TimeAxisView::color_handler ()
|
|||
}
|
||||
}
|
||||
|
||||
/** Returns a TimeAxisView* if this object covers y, or one of its children does.
|
||||
* If the covering object is a child axis, then the child is returned.
|
||||
* Returns 0 otherwise.
|
||||
*/
|
||||
TimeAxisView*
|
||||
TimeAxisView::covers_y_position (double y)
|
||||
{
|
||||
|
|
@ -1191,7 +1202,7 @@ TimeAxisView::covers_y_position (double y)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (y_position <= y && y < (y_position + height)) {
|
||||
if (_y_position <= y && y < (_y_position + height)) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -1228,7 +1239,7 @@ void
|
|||
TimeAxisView::reshow_feature_lines ()
|
||||
{
|
||||
while (feature_lines.size()< analysis_features.size()) {
|
||||
ArdourCanvas::SimpleLine* l = new ArdourCanvas::SimpleLine (*canvas_display);
|
||||
ArdourCanvas::SimpleLine* l = new ArdourCanvas::SimpleLine (*_canvas_display);
|
||||
l->property_color_rgba() = (guint) ARDOUR_UI::config()->canvasvar_ZeroLine.get();
|
||||
feature_lines.push_back (l);
|
||||
}
|
||||
|
|
@ -1243,8 +1254,8 @@ TimeAxisView::reshow_feature_lines ()
|
|||
list<ArdourCanvas::SimpleLine*>::iterator l;
|
||||
|
||||
for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
|
||||
(*l)->property_x1() = editor.frame_to_pixel (*i);
|
||||
(*l)->property_x2() = editor.frame_to_pixel (*i);
|
||||
(*l)->property_x1() = _editor.frame_to_pixel (*i);
|
||||
(*l)->property_x2() = _editor.frame_to_pixel (*i);
|
||||
(*l)->property_y1() = 0;
|
||||
(*l)->property_y2() = current_height();
|
||||
(*l)->show ();
|
||||
|
|
@ -1254,17 +1265,17 @@ TimeAxisView::reshow_feature_lines ()
|
|||
bool
|
||||
TimeAxisView::resizer_button_press (GdkEventButton* event)
|
||||
{
|
||||
resize_drag_start = event->y_root;
|
||||
resize_idle_target = current_height();
|
||||
editor.start_resize_line_ops ();
|
||||
_resize_drag_start = event->y_root;
|
||||
_resize_idle_target = current_height ();
|
||||
_editor.start_resize_line_ops ();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TimeAxisView::resizer_button_release (GdkEventButton* ev)
|
||||
{
|
||||
resize_drag_start = -1;
|
||||
editor.end_resize_line_ops ();
|
||||
_resize_drag_start = -1;
|
||||
_editor.end_resize_line_ops ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1277,16 +1288,16 @@ TimeAxisView::idle_resize (uint32_t h)
|
|||
bool
|
||||
TimeAxisView::resizer_motion (GdkEventMotion* ev)
|
||||
{
|
||||
if (resize_drag_start < 0) {
|
||||
if (_resize_drag_start < 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t delta = (int32_t) floor (resize_drag_start - ev->y_root);
|
||||
int32_t const delta = (int32_t) floor (_resize_drag_start - ev->y_root);
|
||||
|
||||
resize_idle_target = std::max (resize_idle_target - delta, (int) hSmall);
|
||||
editor.add_to_idle_resize (this, resize_idle_target);
|
||||
_resize_idle_target = std::max (_resize_idle_target - delta, (int) hSmall);
|
||||
_editor.add_to_idle_resize (this, _resize_idle_target);
|
||||
|
||||
resize_drag_start = ev->y_root;
|
||||
_resize_drag_start = ev->y_root;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,43 +91,33 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
TimeAxisView(ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* parent, ArdourCanvas::Canvas& canvas);
|
||||
virtual ~TimeAxisView ();
|
||||
|
||||
XMLNode& get_state (void);
|
||||
XMLNode& get_state ();
|
||||
int set_state (const XMLNode&);
|
||||
|
||||
/* public data: XXX create accessor/mutators for these ?? */
|
||||
/** @return index of this TimeAxisView within its parent */
|
||||
int order () const { return _order; }
|
||||
|
||||
PublicEditor& editor;
|
||||
ArdourCanvas::Group* canvas_display () { return _canvas_display; }
|
||||
ArdourCanvas::Group* canvas_background () { return _canvas_background; }
|
||||
ArdourCanvas::Group* ghost_group () { return _ghost_group; }
|
||||
|
||||
uint32_t effective_height; /* in canvas units */
|
||||
double y_position;
|
||||
int order;
|
||||
/** @return effective height (taking children into account) in canvas units, or
|
||||
0 if this TimeAxisView has not yet been shown */
|
||||
uint32_t effective_height () const { return _effective_height; }
|
||||
|
||||
/** @return y position, or -1 if hidden */
|
||||
double y_position () const { return _y_position; }
|
||||
|
||||
/** @return our Editor */
|
||||
PublicEditor& editor () const { return _editor; }
|
||||
|
||||
uint32_t current_height() const { return height; }
|
||||
|
||||
ArdourCanvas::Group *canvas_background;
|
||||
ArdourCanvas::Group *canvas_display;
|
||||
Gtk::VBox *control_parent;
|
||||
|
||||
/* The Standard LHS Controls */
|
||||
Gtk::Frame controls_frame;
|
||||
Gtk::HBox controls_hbox;
|
||||
Gtk::EventBox controls_lhs_pad;
|
||||
Gtk::Table controls_table;
|
||||
Gtk::EventBox controls_ebox;
|
||||
Gtk::VBox controls_vbox;
|
||||
Gtk::DrawingArea resizer;
|
||||
Gtk::HBox resizer_box;
|
||||
Gtk::HBox name_hbox;
|
||||
Gtk::Frame name_frame;
|
||||
Gtkmm2ext::FocusEntry name_entry;
|
||||
|
||||
bool resizer_button_press (GdkEventButton*);
|
||||
bool resizer_button_release (GdkEventButton*);
|
||||
bool resizer_motion (GdkEventMotion*);
|
||||
bool resizer_expose (GdkEventExpose*);
|
||||
|
||||
double resize_drag_start;
|
||||
int32_t resize_idle_target;
|
||||
void idle_resize (uint32_t);
|
||||
|
||||
void hide_name_label ();
|
||||
|
|
@ -135,21 +125,16 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
void show_name_label ();
|
||||
void show_name_entry ();
|
||||
|
||||
/** Display this TrackView as the nth component of the parent box, at y.
|
||||
*
|
||||
* @param y
|
||||
* @param nth
|
||||
* @param parent the parent component
|
||||
* @return the height of this TrackView
|
||||
*/
|
||||
virtual guint32 show_at (double y, int& nth, Gtk::VBox *parent);
|
||||
|
||||
void clip_to_viewport ();
|
||||
|
||||
bool touched (double top, double bot);
|
||||
|
||||
/** Hides this TrackView */
|
||||
/** Hide this TrackView */
|
||||
virtual void hide ();
|
||||
|
||||
/** @return true if hidden, otherwise false */
|
||||
bool hidden () const { return _hidden; }
|
||||
|
||||
virtual void set_selected (bool);
|
||||
|
|
@ -164,12 +149,6 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
virtual void set_height (uint32_t h);
|
||||
void reset_height();
|
||||
|
||||
/**
|
||||
* Returns a TimeAxisView* if this object covers y, or one of its children does.
|
||||
* If the covering object is a child axis, then the child is returned.
|
||||
* Returns 0 otherwise.
|
||||
*/
|
||||
|
||||
TimeAxisView* covers_y_position (double y);
|
||||
|
||||
/**
|
||||
|
|
@ -213,20 +192,14 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
virtual void get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable*>& results);
|
||||
virtual void get_inverted_selectables (Selection&, list<Selectable *>& results);
|
||||
|
||||
ArdourCanvas::Group* ghost_group;
|
||||
|
||||
void add_ghost (RegionView*);
|
||||
void remove_ghost (RegionView*);
|
||||
void erase_ghost (GhostRegion*);
|
||||
|
||||
/* called at load time when first GUI idle occurs. put
|
||||
expensive data loading/redisplay code in here.
|
||||
*/
|
||||
|
||||
/** called at load time when first GUI idle occurs. put
|
||||
expensive data loading/redisplay code in here. */
|
||||
virtual void first_idle () {}
|
||||
|
||||
/* state/serialization management */
|
||||
|
||||
TimeAxisView* get_parent () { return parent; }
|
||||
void set_parent (TimeAxisView& p);
|
||||
bool has_state () const;
|
||||
|
|
@ -238,6 +211,19 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
typedef std::vector<boost::shared_ptr<TimeAxisView> > Children;
|
||||
|
||||
protected:
|
||||
/* The Standard LHS Controls */
|
||||
Gtk::Frame controls_frame;
|
||||
Gtk::HBox controls_hbox;
|
||||
Gtk::EventBox controls_lhs_pad;
|
||||
Gtk::Table controls_table;
|
||||
Gtk::EventBox controls_ebox;
|
||||
Gtk::VBox controls_vbox;
|
||||
Gtk::DrawingArea resizer;
|
||||
Gtk::HBox resizer_box;
|
||||
Gtk::HBox name_hbox;
|
||||
Gtk::Frame name_frame;
|
||||
Gtkmm2ext::FocusEntry name_entry;
|
||||
|
||||
uint32_t height; /* in canvas units */
|
||||
|
||||
string controls_base_unselected_name;
|
||||
|
|
@ -337,13 +323,26 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
void set_heights (uint32_t h);
|
||||
void color_handler ();
|
||||
|
||||
|
||||
std::list<ArdourCanvas::SimpleLine*> feature_lines;
|
||||
ARDOUR::AnalysisFeatureList analysis_features;
|
||||
void reshow_feature_lines ();
|
||||
|
||||
void conditionally_add_to_selection ();
|
||||
|
||||
ArdourCanvas::Group* _canvas_display;
|
||||
double _y_position;
|
||||
PublicEditor& _editor;
|
||||
|
||||
private:
|
||||
|
||||
ArdourCanvas::Group* _canvas_background;
|
||||
Gtk::VBox* control_parent;
|
||||
int _order;
|
||||
uint32_t _effective_height;
|
||||
double _resize_drag_start;
|
||||
int32_t _resize_idle_target;
|
||||
ArdourCanvas::Group* _ghost_group;
|
||||
|
||||
}; /* class TimeAxisView */
|
||||
|
||||
#endif /* __ardour_gtk_time_axis_h__ */
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
|
|||
frame = new ArdourCanvas::SimpleRect (*group);
|
||||
frame->property_x1() = (double) 0.0;
|
||||
frame->property_y1() = (double) 1.0;
|
||||
frame->property_x2() = (double) trackview.editor.frame_to_pixel(duration);
|
||||
frame->property_x2() = (double) trackview.editor().frame_to_pixel(duration);
|
||||
frame->property_y2() = (double) trackview.current_height();
|
||||
frame->property_outline_pixels() = 1;
|
||||
frame->property_outline_what() = 0xF;
|
||||
|
|
@ -193,10 +193,10 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
|
|||
name_highlight = new ArdourCanvas::SimpleRect (*group);
|
||||
if (visibility & FullWidthNameHighlight) {
|
||||
name_highlight->property_x1() = (double) 0.0;
|
||||
name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration));
|
||||
name_highlight->property_x2() = (double) (trackview.editor().frame_to_pixel(item_duration));
|
||||
} else {
|
||||
name_highlight->property_x1() = (double) 1.0;
|
||||
name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1;
|
||||
name_highlight->property_x2() = (double) (trackview.editor().frame_to_pixel(item_duration)) - 1;
|
||||
}
|
||||
name_highlight->property_y1() = (double) (trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
|
||||
name_highlight->property_y2() = (double) (trackview.current_height() - 1);
|
||||
|
|
@ -234,8 +234,8 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
|
|||
frame_handle_start->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
|
||||
|
||||
frame_handle_end = new ArdourCanvas::SimpleRect (*group);
|
||||
frame_handle_end->property_x1() = (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
|
||||
frame_handle_end->property_x2() = (double) trackview.editor.frame_to_pixel(get_duration());
|
||||
frame_handle_end->property_x1() = (double) (trackview.editor().frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
|
||||
frame_handle_end->property_x2() = (double) trackview.editor().frame_to_pixel(get_duration());
|
||||
frame_handle_end->property_y1() = (double) 1;
|
||||
frame_handle_end->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1;
|
||||
frame_handle_end->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
|
||||
|
|
@ -339,7 +339,7 @@ TimeAxisViewItem::set_duration (nframes_t dur, void* src)
|
|||
|
||||
item_duration = dur;
|
||||
|
||||
reset_width_dependent_items (trackview.editor.frame_to_pixel (dur));
|
||||
reset_width_dependent_items (trackview.editor().frame_to_pixel (dur));
|
||||
|
||||
DurationChanged (dur, src) ; /* EMIT_SIGNAL */
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue