mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
change all Region::nt_*() methods to names without the nt_ prefix (GUI version)
This commit is contained in:
parent
82e84e6b92
commit
18d64f0402
26 changed files with 245 additions and 246 deletions
|
|
@ -1422,7 +1422,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, b
|
|||
|
||||
trackview.session()->add_command (new MementoCommand<AutomationList>(*audio_region()->envelope().get(), &before, &after));
|
||||
|
||||
gain_line->get_selectables (region ()->nt_position () + timecnt_t (fx), region ()->nt_position () + timecnt_t (fx), 0.0, 1.0, results);
|
||||
gain_line->get_selectables (region ()->position () + timecnt_t (fx), region ()->position () + timecnt_t (fx), 0.0, 1.0, results);
|
||||
trackview.editor ().get_selection ().set (results);
|
||||
|
||||
trackview.editor ().commit_reversible_command ();
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ AudioStreamView::hide_xfades_with (boost::shared_ptr<AudioRegion> ar)
|
|||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||
if (arv) {
|
||||
switch (arv->region()->coverage (ar->nt_position(), ar->nt_last())) {
|
||||
switch (arv->region()->coverage (ar->position(), ar->nt_last())) {
|
||||
case Temporal::OverlapNone:
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ AutomationRegionView::AutomationRegionView (ArdourCanvas::Container*
|
|||
: RegionView(parent, time_axis, region, spu, basic_color, true)
|
||||
, _parameter(param)
|
||||
{
|
||||
TimeAxisViewItem::set_position (_region->nt_position(), this);
|
||||
TimeAxisViewItem::set_position (_region->position(), this);
|
||||
|
||||
if (list) {
|
||||
assert(list->parameter() == param);
|
||||
|
|
@ -104,8 +104,8 @@ AutomationRegionView::create_line (boost::shared_ptr<ARDOUR::AutomationList> lis
|
|||
_line->set_colors();
|
||||
_line->set_height ((uint32_t)rint(trackview.current_height() - 2.5 - NAME_HIGHLIGHT_SIZE));
|
||||
_line->set_visibility (AutomationLine::VisibleAspects (AutomationLine::Line|AutomationLine::ControlPoints));
|
||||
_line->set_maximum_time (timepos_t (_region->nt_length()));
|
||||
_line->set_offset (_region->nt_start ());
|
||||
_line->set_maximum_time (timepos_t (_region->length()));
|
||||
_line->set_offset (_region->start ());
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
|
@ -187,7 +187,7 @@ AutomationRegionView::add_automation_event (GdkEvent *, timepos_t const & w, dou
|
|||
|
||||
/* snap time */
|
||||
|
||||
when = snap_region_time_to_region_time (when.earlier (_region->nt_start()), false) + _region->nt_start ();
|
||||
when = snap_region_time_to_region_time (when.earlier (_region->start()), false) + _region->start ();
|
||||
|
||||
/* map using line */
|
||||
|
||||
|
|
@ -276,7 +276,7 @@ bool
|
|||
AutomationRegionView::set_position (timepos_t const & pos, void* src, double* ignored)
|
||||
{
|
||||
if (_line) {
|
||||
_line->set_maximum_time (timepos_t (_region->nt_length ()));
|
||||
_line->set_maximum_time (timepos_t (_region->length ()));
|
||||
}
|
||||
|
||||
return RegionView::set_position(pos, src, ignored);
|
||||
|
|
@ -304,11 +304,11 @@ AutomationRegionView::region_resized (const PBD::PropertyChange& what_changed)
|
|||
}
|
||||
|
||||
if (what_changed.contains (ARDOUR::Properties::start)) {
|
||||
_line->set_offset (_region->nt_start ());
|
||||
_line->set_offset (_region->start ());
|
||||
}
|
||||
|
||||
if (what_changed.contains (ARDOUR::Properties::length)) {
|
||||
_line->set_maximum_time (timepos_t (_region->nt_length()));
|
||||
_line->set_maximum_time (timepos_t (_region->length()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ AutomationStreamView::paste (timepos_t const & pos,
|
|||
list<RegionView*>::const_iterator prev = region_views.begin ();
|
||||
|
||||
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
if ((*i)->region()->nt_position() > pos) {
|
||||
if ((*i)->region()->position() > pos) {
|
||||
break;
|
||||
}
|
||||
prev = i;
|
||||
|
|
@ -348,7 +348,7 @@ AutomationStreamView::paste (timepos_t const & pos,
|
|||
boost::shared_ptr<Region> r = (*prev)->region ();
|
||||
|
||||
/* If *prev doesn't cover pos, it's no good */
|
||||
if (r->nt_position() > pos || ((r->nt_position() + r->nt_length()) < pos)) {
|
||||
if (r->position() > pos || ((r->position() + r->length()) < pos)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,10 +112,10 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, set<NoteBase*> n)
|
|||
_length_clock.set_mode (AudioClock::BBT);
|
||||
|
||||
dur = _region_view->region_relative_distance (timecnt_t ((*_events.begin())->note()->end_time (), timepos_t()), BarTime);
|
||||
pos = _region_view->region()->nt_position() + dur;
|
||||
pos = _region_view->region()->position() + dur;
|
||||
timecnt_t offset;
|
||||
dur = _region_view->region_relative_distance (timecnt_t ((*_events.begin())->note()->time (), timepos_t()), BarTime);
|
||||
offset = timecnt_t (_region_view->region()->nt_position(), timepos_t()) + dur;
|
||||
offset = timecnt_t (_region_view->region()->position(), timepos_t()) + dur;
|
||||
|
||||
_length_clock.set_is_duration (true, pos);
|
||||
_length_clock.set_duration (offset, true);
|
||||
|
|
@ -208,7 +208,7 @@ EditNoteDialog::done (int r)
|
|||
}
|
||||
}
|
||||
|
||||
timepos_t source_start = _region_view->region()->nt_position().earlier (_region_view->region()->nt_start());
|
||||
timepos_t source_start = _region_view->region()->position().earlier (_region_view->region()->start());
|
||||
|
||||
/* convert current clock time into an offset from the start of the source */
|
||||
|
||||
|
|
|
|||
|
|
@ -281,9 +281,7 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, timepos_t const & pos)
|
|||
return;
|
||||
}
|
||||
|
||||
const samplecnt_t sample_rate = _session->sample_rate ();
|
||||
#warning NUTEMPO need to be able to create a tempo map with no entries
|
||||
// TempoMap new_map (sample_rate);
|
||||
TempoMap::SharedPtr new_map (new TempoMap (Tempo (120), Meter (4, 4)));
|
||||
Meter last_meter (4.0, 4.0);
|
||||
bool have_initial_meter = false;
|
||||
|
|
@ -996,14 +994,14 @@ Editor::add_sources (vector<string> paths,
|
|||
|
||||
finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track, track_names[n], pgroup_id, instrument);
|
||||
|
||||
rlen = (*r)->nt_length();
|
||||
rlen = (*r)->length();
|
||||
|
||||
if (target_tracks != 1) {
|
||||
track.reset ();
|
||||
} else {
|
||||
if (!use_timestamp || !ar) {
|
||||
/* line each one up right after the other */
|
||||
pos += (*r)->nt_length();
|
||||
pos += (*r)->length();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -878,7 +878,7 @@ RegionMotionDrag::compute_x_delta (GdkEvent const * event, Temporal::timepos_t &
|
|||
pending_region_position = _last_position;
|
||||
}
|
||||
|
||||
if (pending_region_position > timepos_t::max (pending_region_position.time_domain()).earlier (_primary->region()->nt_length())) {
|
||||
if (pending_region_position > timepos_t::max (pending_region_position.time_domain()).earlier (_primary->region()->length())) {
|
||||
pending_region_position = _last_position;
|
||||
}
|
||||
|
||||
|
|
@ -900,7 +900,7 @@ RegionMotionDrag::compute_x_delta (GdkEvent const * event, Temporal::timepos_t &
|
|||
timecnt_t total_dx = timecnt_t (samplepos_t (_editor->pixel_to_sample (_total_x_delta + dx)), grab_time());
|
||||
|
||||
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
|
||||
const timepos_t off = i->view->region()->nt_position() + total_dx;
|
||||
const timepos_t off = i->view->region()->position() + total_dx;
|
||||
if (off.negative()) {
|
||||
dx = dx - _editor->time_to_pixel_unrounded (off);
|
||||
pending_region_position = pending_region_position.earlier (timecnt_t (off, timepos_t (pending_region_position.time_domain())));
|
||||
|
|
@ -1613,7 +1613,7 @@ RegionMoveDrag::finished (GdkEvent* ev, bool movement_occurred)
|
|||
i->view->get_canvas_group()->show ();
|
||||
}
|
||||
|
||||
bool const changed_position = (_last_position != _primary->region()->nt_position());
|
||||
bool const changed_position = (_last_position != _primary->region()->position());
|
||||
bool changed_tracks;
|
||||
|
||||
if (_views.front().time_axis_view >= (int) _time_axis_views.size()) {
|
||||
|
|
@ -1711,6 +1711,7 @@ RegionMoveDrag::finished_copy (bool const changed_position, bool const /*changed
|
|||
RegionSelection new_views;
|
||||
PlaylistSet modified_playlists;
|
||||
RouteTimeAxisView* new_time_axis_view = 0;
|
||||
|
||||
timecnt_t const drag_delta = _last_position.distance (_primary->region()->nt_position());
|
||||
RegionList ripple_exclude;
|
||||
|
||||
|
|
@ -1740,9 +1741,9 @@ RegionMoveDrag::finished_copy (bool const changed_position, bool const /*changed
|
|||
timepos_t where;
|
||||
|
||||
if (changed_position && !_x_constrained) {
|
||||
where = timepos_t (i->view->region()->nt_position().earlier (drag_delta));
|
||||
where = timepos_t (i->view->region()->position().earlier (drag_delta));
|
||||
} else {
|
||||
where = timepos_t (i->view->region()->nt_position());
|
||||
where = timepos_t (i->view->region()->position());
|
||||
}
|
||||
|
||||
/* compute full extent of regions that we're going to insert */
|
||||
|
|
@ -1840,6 +1841,7 @@ RegionMoveDrag::finished_no_copy (
|
|||
PlaylistSet frozen_playlists;
|
||||
set<RouteTimeAxisView*> views_to_update;
|
||||
RouteTimeAxisView* new_time_axis_view = 0;
|
||||
|
||||
timecnt_t const drag_delta = last_position.distance (_primary->region()->nt_position());
|
||||
RegionList ripple_exclude;
|
||||
|
||||
|
|
@ -1900,9 +1902,9 @@ RegionMoveDrag::finished_no_copy (
|
|||
timepos_t where;
|
||||
|
||||
if (changed_position && !_x_constrained) {
|
||||
where = rv->region()->nt_position().earlier (drag_delta);
|
||||
where = rv->region()->position().earlier (drag_delta);
|
||||
} else {
|
||||
where = rv->region()->nt_position();
|
||||
where = rv->region()->position();
|
||||
}
|
||||
|
||||
/* compute full extent of regions that we're going to insert */
|
||||
|
|
@ -2189,7 +2191,7 @@ RegionMoveDrag::RegionMoveDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p,
|
|||
{
|
||||
DEBUG_TRACE (DEBUG::Drags, "New RegionMoveDrag\n");
|
||||
|
||||
_last_position = _primary->region()->nt_position();
|
||||
_last_position = _primary->region()->position();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2258,7 +2260,6 @@ RegionInsertDrag::aborted (bool)
|
|||
_views.clear ();
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* ripple mode...
|
||||
*/
|
||||
|
|
@ -2272,7 +2273,7 @@ RegionRippleDrag::add_all_after_to_views(TimeAxisView *tav, timepos_t const & wh
|
|||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tav);
|
||||
RegionSelection to_ripple;
|
||||
for (RegionList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||
if ((*i)->nt_position() >= where) {
|
||||
if ((*i)->position() >= where) {
|
||||
to_ripple.push_back (rtv->view()->find_view(*i));
|
||||
}
|
||||
}
|
||||
|
|
@ -2330,7 +2331,7 @@ RegionRippleDrag::remove_unselected_from_views(timecnt_t const & amount, bool mo
|
|||
if (move_regions) {
|
||||
thawlist.add (rv->region ());
|
||||
// move the underlying region to match the view
|
||||
rv->region()->set_position (rv->region()->nt_position() + amount);
|
||||
rv->region()->set_position (rv->region()->position() + amount);
|
||||
} else {
|
||||
// restore the view to match the underlying region's original position
|
||||
#warning NUTEMPO ALERT paul test this code in 5.x /* how can this work ... amount used to be in samples but ::move() expect pixels */
|
||||
|
|
@ -2394,7 +2395,7 @@ RegionRippleDrag::RegionRippleDrag (Editor* e, ArdourCanvas::Item* i, RegionView
|
|||
assert (first_selected_on_this_track); // we should always find the region in one of the playlists...
|
||||
add_all_after_to_views (
|
||||
&first_selected_on_this_track->get_time_axis_view(),
|
||||
first_selected_on_this_track->region()->nt_position(),
|
||||
first_selected_on_this_track->region()->position(),
|
||||
selected_regions, false);
|
||||
}
|
||||
|
||||
|
|
@ -2527,7 +2528,7 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
}
|
||||
}
|
||||
if (!found) {
|
||||
const timepos_t pos_after = r->nt_position();
|
||||
const timepos_t pos_after = r->position();
|
||||
const timepos_t pos_before = pos_after + selection_length;
|
||||
r->set_position(pos_before);
|
||||
r->clear_changes();
|
||||
|
|
@ -3039,9 +3040,9 @@ TrimDrag::TrimDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<Region
|
|||
void
|
||||
TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||
{
|
||||
timepos_t const region_start = _primary->region()->nt_position();
|
||||
timepos_t const region_end = _primary->region()->nt_end();
|
||||
timecnt_t const region_length = _primary->region()->nt_length();
|
||||
timepos_t const region_start = _primary->region()->position();
|
||||
timepos_t const region_end = _primary->region()->end();
|
||||
timecnt_t const region_length = _primary->region()->length();
|
||||
|
||||
timepos_t const pf = adjusted_current_time (event);
|
||||
setup_snap_delta (region_start);
|
||||
|
|
@ -3237,13 +3238,13 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
|||
|
||||
switch (_operation) {
|
||||
case StartTrim:
|
||||
show_verbose_cursor_time (rv->region()->nt_position());
|
||||
show_verbose_cursor_time (rv->region()->position());
|
||||
break;
|
||||
case EndTrim:
|
||||
show_verbose_cursor_duration (rv->region()->nt_position(), rv->region()->nt_end());
|
||||
show_verbose_cursor_duration (rv->region()->position(), rv->region()->end());
|
||||
break;
|
||||
}
|
||||
show_view_preview ((_operation == StartTrim ? rv->region()->nt_position() : rv->region()->nt_end()));
|
||||
show_view_preview ((_operation == StartTrim ? rv->region()->position() : rv->region()->end()));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -3286,7 +3287,7 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
}
|
||||
}
|
||||
if (_jump_position_when_done) {
|
||||
i->view->region()->set_position (timepos_t (i->initial_end).earlier (i->view->region()->nt_length()));
|
||||
i->view->region()->set_position (timepos_t (i->initial_end).earlier (i->view->region()->length()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4317,10 +4318,10 @@ FadeInDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
|||
|
||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
|
||||
boost::shared_ptr<AudioRegion> const r = arv->audio_region ();
|
||||
setup_snap_delta (r->nt_position());
|
||||
setup_snap_delta (r->position());
|
||||
|
||||
show_verbose_cursor_duration (r->nt_position(), r->nt_position() + r->fade_in()->back()->when, 32);
|
||||
show_view_preview (r->nt_position() + r->fade_in()->back()->when);
|
||||
show_verbose_cursor_duration (r->position(), r->position() + r->fade_in()->back()->when, 32);
|
||||
show_view_preview (r->position() + r->fade_in()->back()->when);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -4328,7 +4329,7 @@ FadeInDrag::setup_pointer_offset ()
|
|||
{
|
||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
|
||||
boost::shared_ptr<AudioRegion> const r = arv->audio_region ();
|
||||
_pointer_offset = (r->fade_in()->back()->when + r->nt_position()).distance (raw_grab_time());
|
||||
_pointer_offset = (r->fade_in()->back()->when + r->position()).distance (raw_grab_time());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -4364,8 +4365,8 @@ FadeInDrag::motion (GdkEvent* event, bool)
|
|||
tmp->reset_fade_in_shape_width (tmp->audio_region(), fade_length);
|
||||
}
|
||||
|
||||
show_verbose_cursor_duration (region->nt_position(), region->nt_position() + timepos_t (fade_length), 32);
|
||||
show_view_preview (region->nt_position() + timepos_t (fade_length));
|
||||
show_verbose_cursor_duration (region->position(), region->position() + timepos_t (fade_length), 32);
|
||||
show_view_preview (region->position() + timepos_t (fade_length));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -4459,7 +4460,7 @@ FadeOutDrag::setup_pointer_offset ()
|
|||
{
|
||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
|
||||
boost::shared_ptr<AudioRegion> r = arv->audio_region ();
|
||||
_pointer_offset = (r->nt_position() + (r->nt_length() - r->fade_out()->back()->when)).distance (raw_grab_time());
|
||||
_pointer_offset = (r->position() + (r->length() - r->fade_out()->back()->when)).distance (raw_grab_time());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -5506,8 +5507,8 @@ TimeFXDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
|||
Drag::start_grab (event, cursor);
|
||||
|
||||
_editor->get_selection().add (_primary);
|
||||
timepos_t where (_primary->region()->nt_position());
|
||||
setup_snap_delta (_primary->region()->nt_position());
|
||||
timepos_t where (_primary->region()->position());
|
||||
setup_snap_delta (_primary->region()->position());
|
||||
|
||||
show_verbose_cursor_duration (where, adjusted_current_time (event), 0);
|
||||
}
|
||||
|
|
@ -5526,11 +5527,11 @@ TimeFXDrag::motion (GdkEvent* event, bool)
|
|||
_editor->snap_to_with_modifier (pf, event);
|
||||
pf.shift_earlier (snap_delta (event->button.state));
|
||||
|
||||
if (pf > rv->region()->nt_position()) {
|
||||
rv->get_time_axis_view().show_timestretch (rv->region()->nt_position(), pf, layers, layer);
|
||||
if (pf > rv->region()->position()) {
|
||||
rv->get_time_axis_view().show_timestretch (rv->region()->position(), pf, layers, layer);
|
||||
}
|
||||
|
||||
show_verbose_cursor_duration (_primary->region()->nt_position(), pf);
|
||||
show_verbose_cursor_duration (_primary->region()->position(), pf);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -5551,19 +5552,19 @@ TimeFXDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
|
||||
timepos_t adjusted_pos = adjusted_current_time (event);
|
||||
|
||||
if (adjusted_pos < _primary->region()->nt_position()) {
|
||||
if (adjusted_pos < _primary->region()->position()) {
|
||||
/* backwards drag of the left edge - not usable */
|
||||
return;
|
||||
}
|
||||
|
||||
timecnt_t newlen = _primary->region()->nt_position().distance (adjusted_pos);
|
||||
timecnt_t newlen = _primary->region()->position().distance (adjusted_pos);
|
||||
|
||||
fraction = newlen / _primary->region()->nt_length();
|
||||
fraction = newlen / _primary->region()->length();
|
||||
|
||||
#ifndef USE_RUBBERBAND
|
||||
// Soundtouch uses fraction / 100 instead of normal (/ 1)
|
||||
if (_primary->region()->data_type() == DataType::AUDIO) {
|
||||
fraction = ((newlen - _primary->region()->nt_length()) / newlen) * 100;
|
||||
fraction = ((newlen - _primary->region()->length()) / newlen) * 100;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -6326,8 +6327,8 @@ NoteDrag::total_dx (GdkEvent * event) const
|
|||
timecnt_t ret = timecnt_t (snap.earlier (n_qn).earlier (snap_delta (event->button.state)));
|
||||
|
||||
/* prevent the earliest note being dragged earlier than the region's start position */
|
||||
if (ret + _earliest < _region->region()->nt_start()) {
|
||||
ret -= (ret + _earliest) - _region->region()->nt_start();
|
||||
if (ret + _earliest < _region->region()->start()) {
|
||||
ret -= (ret + _earliest) - _region->region()->start();
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
@ -6744,8 +6745,8 @@ DraggingView::DraggingView (RegionView* v, RegionDrag* parent, TimeAxisView* ita
|
|||
layer = v->region()->layer ();
|
||||
initial_y = v->get_canvas_group()->position().y;
|
||||
initial_playlist = v->region()->playlist ();
|
||||
initial_position = v->region()->nt_position ();
|
||||
initial_end = v->region()->nt_position () + v->region()->nt_length ();
|
||||
initial_position = v->region()->position ();
|
||||
initial_end = v->region()->position () + v->region()->length ();
|
||||
}
|
||||
|
||||
PatchChangeDrag::PatchChangeDrag (Editor* e, PatchChange* i, MidiRegionView* r)
|
||||
|
|
@ -6764,7 +6765,7 @@ PatchChangeDrag::motion (GdkEvent* ev, bool)
|
|||
{
|
||||
timepos_t f = adjusted_current_time (ev);
|
||||
boost::shared_ptr<Region> r = _region_view->region ();
|
||||
f = max (f, r->nt_position ());
|
||||
f = max (f, r->position ());
|
||||
f = min (f, r->nt_last ());
|
||||
|
||||
timecnt_t const dxf = grab_time().distance (f); // permitted dx
|
||||
|
|
@ -6785,7 +6786,7 @@ PatchChangeDrag::finished (GdkEvent* ev, bool movement_occurred)
|
|||
|
||||
boost::shared_ptr<Region> r (_region_view->region ());
|
||||
timepos_t f = adjusted_current_time (ev);
|
||||
f = max (f, r->nt_position ());
|
||||
f = max (f, r->position ());
|
||||
f = min (f, r->nt_last ());
|
||||
|
||||
_region_view->move_patch_change (*_patch_change, _region_view->region()->absolute_time_to_region_beats (f));
|
||||
|
|
@ -6992,7 +6993,7 @@ NoteCreateDrag::motion (GdkEvent* event, bool)
|
|||
aligned_beats += grid_beats;
|
||||
}
|
||||
|
||||
_note[1] = max (Temporal::Beats(), aligned_beats - _region_view->region()->nt_position ().beats());
|
||||
_note[1] = max (Temporal::Beats(), aligned_beats - _region_view->region()->position ().beats());
|
||||
|
||||
double const x0 = _editor->time_to_pixel (_note[0]);
|
||||
double const x1 = _editor->time_to_pixel (_note[1]);
|
||||
|
|
@ -7062,7 +7063,7 @@ HitCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
|||
return;
|
||||
}
|
||||
|
||||
const Temporal::Beats start = beats - _region_view->region()->nt_position().beats ();
|
||||
const Temporal::Beats start = beats - _region_view->region()->position().beats ();
|
||||
Temporal::Beats length = _region_view->get_grid_beats (pos);
|
||||
|
||||
_editor->begin_reversible_command (_("Create Hit"));
|
||||
|
|
@ -7083,7 +7084,7 @@ HitCreateDrag::motion (GdkEvent* event, bool)
|
|||
}
|
||||
|
||||
const Beats beats = pos.beats ();
|
||||
const Temporal::Beats start = beats - _region_view->region()->nt_position ().beats();
|
||||
const Temporal::Beats start = beats - _region_view->region()->position ().beats();
|
||||
|
||||
if (_last_pos == start) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
|||
|
||||
/* don't do duplicate of the entire source if that's what is going on here */
|
||||
|
||||
if (region->nt_start().zero() && region->nt_length() == region->source_length(0)) {
|
||||
if (region->start().zero() && region->length() == region->source_length(0)) {
|
||||
/* XXX should link(2) to create a new inode with "path" */
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1142,7 +1142,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
if (!prev) {
|
||||
_drags->set (new RegionCreateDrag (this, item, parent), event);
|
||||
} else {
|
||||
prev->set_length (prev->nt_position ().distance (t));
|
||||
prev->set_length (prev->position ().distance (t));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -2542,7 +2542,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, timepos_t const & pos)
|
|||
|
||||
/* don't brush a copy over the original */
|
||||
|
||||
if (pos == rv->region()->nt_position()) {
|
||||
if (pos == rv->region()->position()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ Editor::split_regions_at (timepos_t const & where, RegionSelection& regions)
|
|||
//if the user wants newly-created regions to be selected, then select them:
|
||||
if (mouse_mode == MouseObject) {
|
||||
for (RegionSelection::iterator ri = latest_regionviews.begin(); ri != latest_regionviews.end(); ri++) {
|
||||
if ((*ri)->region()->nt_position() < where) {
|
||||
if ((*ri)->region()->position() < where) {
|
||||
// new regions created before the split
|
||||
if (rsas & NewlyCreatedLeft) {
|
||||
selection->add (*ri);
|
||||
|
|
@ -418,14 +418,14 @@ Editor::nudge_forward (bool next, bool force_playhead)
|
|||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||
boost::shared_ptr<Region> r ((*i)->region());
|
||||
|
||||
distance = get_nudge_distance (r->nt_position(), next_distance);
|
||||
distance = get_nudge_distance (r->position(), next_distance);
|
||||
|
||||
if (next) {
|
||||
distance = next_distance;
|
||||
}
|
||||
|
||||
r->clear_changes ();
|
||||
r->set_position (r->nt_position() + distance);
|
||||
r->set_position (r->position() + distance);
|
||||
_session->add_command (new StatefulDiffCommand (r));
|
||||
}
|
||||
|
||||
|
|
@ -506,7 +506,7 @@ Editor::nudge_backward (bool next, bool force_playhead)
|
|||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||
boost::shared_ptr<Region> r ((*i)->region());
|
||||
|
||||
distance = get_nudge_distance (r->nt_position(), next_distance);
|
||||
distance = get_nudge_distance (r->position(), next_distance);
|
||||
|
||||
if (next) {
|
||||
distance = next_distance;
|
||||
|
|
@ -514,8 +514,8 @@ Editor::nudge_backward (bool next, bool force_playhead)
|
|||
|
||||
r->clear_changes ();
|
||||
|
||||
if (r->nt_position() > distance) {
|
||||
r->set_position (r->nt_position().earlier (distance));
|
||||
if (r->position() > distance) {
|
||||
r->set_position (r->position().earlier (distance));
|
||||
} else {
|
||||
r->set_position (timepos_t());
|
||||
}
|
||||
|
|
@ -602,7 +602,7 @@ Editor::nudge_forward_capture_offset ()
|
|||
boost::shared_ptr<Region> r ((*i)->region());
|
||||
|
||||
r->clear_changes ();
|
||||
r->set_position (r->nt_position() + timecnt_t (distance));
|
||||
r->set_position (r->position() + timecnt_t (distance));
|
||||
_session->add_command(new StatefulDiffCommand (r));
|
||||
}
|
||||
|
||||
|
|
@ -627,8 +627,8 @@ Editor::nudge_backward_capture_offset ()
|
|||
|
||||
r->clear_changes ();
|
||||
|
||||
if (r->nt_position() > distance) {
|
||||
r->set_position (r->nt_position().earlier (distance));
|
||||
if (r->position() > distance) {
|
||||
r->set_position (r->position().earlier (distance));
|
||||
} else {
|
||||
r->set_position (timepos_t ());
|
||||
}
|
||||
|
|
@ -640,7 +640,7 @@ Editor::nudge_backward_capture_offset ()
|
|||
|
||||
struct RegionSelectionPositionSorter {
|
||||
bool operator() (RegionView* a, RegionView* b) {
|
||||
return a->region()->nt_position() < b->region()->nt_position();
|
||||
return a->region()->position() < b->region()->position();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -688,7 +688,7 @@ Editor::sequence_regions ()
|
|||
}
|
||||
_session->add_command (new StatefulDiffCommand (r));
|
||||
|
||||
r_end=r->nt_position() + r->nt_length();
|
||||
r_end=r->position() + r->length();
|
||||
|
||||
iCount++;
|
||||
}
|
||||
|
|
@ -802,11 +802,11 @@ Editor::build_region_boundary_cache ()
|
|||
|
||||
switch (*p) {
|
||||
case Start:
|
||||
rpos = r->nt_position();
|
||||
rpos = r->position();
|
||||
break;
|
||||
|
||||
case End:
|
||||
rpos = r->nt_end();
|
||||
rpos = r->end();
|
||||
break;
|
||||
|
||||
case SyncPoint:
|
||||
|
|
@ -871,11 +871,11 @@ Editor::find_next_region (timepos_t const & pos, RegionPoint point, int32_t dir,
|
|||
|
||||
switch (point) {
|
||||
case Start:
|
||||
rpos = r->nt_position ();
|
||||
rpos = r->position ();
|
||||
break;
|
||||
|
||||
case End:
|
||||
rpos = r->nt_end ();
|
||||
rpos = r->end ();
|
||||
break;
|
||||
|
||||
case SyncPoint:
|
||||
|
|
@ -1039,7 +1039,7 @@ Editor::cursor_to_region_point (EditorCursor* cursor, RegionPoint point, int32_t
|
|||
|
||||
switch (point) {
|
||||
case Start:
|
||||
pos = r->nt_position ();
|
||||
pos = r->position ();
|
||||
break;
|
||||
|
||||
case End:
|
||||
|
|
@ -1227,7 +1227,7 @@ Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir)
|
|||
break;
|
||||
|
||||
case SyncPoint:
|
||||
pos = r->adjust_to_sync (r->nt_position());
|
||||
pos = r->adjust_to_sync (r->position());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1955,12 +1955,12 @@ Editor::get_selection_extents (timepos_t &start, timepos_t &end) const
|
|||
|
||||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||
|
||||
if ((*i)->region()->nt_position() < start) {
|
||||
start = (*i)->region()->nt_position();
|
||||
if ((*i)->region()->position() < start) {
|
||||
start = (*i)->region()->position();
|
||||
}
|
||||
|
||||
if ((*i)->region()->nt_end() > end) {
|
||||
end = (*i)->region()->nt_end();
|
||||
if ((*i)->region()->end() > end) {
|
||||
end = (*i)->region()->end();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2396,7 +2396,7 @@ Editor::add_locations_from_region ()
|
|||
|
||||
boost::shared_ptr<Region> region = (*i)->region ();
|
||||
|
||||
Location *location = new Location (*_session, region->nt_position(), region->nt_end(), region->name(), Location::IsRangeMarker);
|
||||
Location *location = new Location (*_session, region->position(), region->end(), region->name(), Location::IsRangeMarker);
|
||||
|
||||
_session->locations()->add (location, true);
|
||||
commit = true;
|
||||
|
|
@ -3029,11 +3029,11 @@ Editor::play_selected_region ()
|
|||
}
|
||||
|
||||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||
if ((*i)->region()->nt_position() < start) {
|
||||
start = (*i)->region()->nt_position();
|
||||
if ((*i)->region()->position() < start) {
|
||||
start = (*i)->region()->position();
|
||||
}
|
||||
if ((*i)->region()->nt_end() > end) {
|
||||
end = (*i)->region()->nt_end();
|
||||
if ((*i)->region()->end() > end) {
|
||||
end = (*i)->region()->end();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3078,12 +3078,12 @@ Editor::region_from_selection ()
|
|||
continue;
|
||||
}
|
||||
|
||||
internal_start = current->nt_position().distance (start);
|
||||
internal_start = current->position().distance (start);
|
||||
RegionFactory::region_name (new_name, current->name(), true);
|
||||
|
||||
PropertyList plist;
|
||||
|
||||
plist.add (ARDOUR::Properties::start, current->nt_start() + internal_start);
|
||||
plist.add (ARDOUR::Properties::start, current->start() + internal_start);
|
||||
plist.add (ARDOUR::Properties::length, selection_cnt);
|
||||
plist.add (ARDOUR::Properties::name, new_name);
|
||||
plist.add (ARDOUR::Properties::layer, 0);
|
||||
|
|
@ -3125,12 +3125,12 @@ Editor::create_region_from_selection (vector<boost::shared_ptr<Region> >& new_re
|
|||
continue;
|
||||
}
|
||||
|
||||
internal_start = current->nt_position().distance (start);
|
||||
internal_start = current->position().distance (start);
|
||||
RegionFactory::region_name (new_name, current->name(), true);
|
||||
|
||||
PropertyList plist;
|
||||
|
||||
plist.add (ARDOUR::Properties::start, current->nt_start() + internal_start);
|
||||
plist.add (ARDOUR::Properties::start, current->start() + internal_start);
|
||||
plist.add (ARDOUR::Properties::length, start.distance (end));
|
||||
plist.add (ARDOUR::Properties::name, new_name);
|
||||
|
||||
|
|
@ -3424,10 +3424,10 @@ Editor::separate_under_selected_regions ()
|
|||
}
|
||||
|
||||
//Partition on the region bounds
|
||||
playlist->partition ((*rl)->nt_position().decrement(), (*rl)->nt_end(), true);
|
||||
playlist->partition ((*rl)->position().decrement(), (*rl)->end(), true);
|
||||
|
||||
//Re-add region that was just removed due to the partition operation
|
||||
playlist->add_region ((*rl), (*rl)->nt_position());
|
||||
playlist->add_region ((*rl), (*rl)->position());
|
||||
}
|
||||
|
||||
vector<PlaylistState>::iterator pl;
|
||||
|
|
@ -3525,10 +3525,10 @@ Editor::crop_region_to (timepos_t const & start, timepos_t const & end)
|
|||
/* now adjust lengths */
|
||||
for (vector<boost::shared_ptr<Region> >::iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||
|
||||
pos = (*i)->nt_position();
|
||||
pos = (*i)->position();
|
||||
new_start = max (start, pos);
|
||||
if (timepos_t::max (pos.time_domain()).earlier (pos) > (*i)->nt_length()) {
|
||||
new_end = (*i)->nt_end();
|
||||
if (timepos_t::max (pos.time_domain()).earlier (pos) > (*i)->length()) {
|
||||
new_end = (*i)->end();
|
||||
} else {
|
||||
new_end = timepos_t::max (pos.time_domain());
|
||||
}
|
||||
|
|
@ -3576,7 +3576,7 @@ Editor::region_fill_track ()
|
|||
Playlist::duplicate_until gets modified. Maybe change this to
|
||||
be more consistent with other APIs
|
||||
*/
|
||||
timepos_t position = end_time + start_time.distance (r->nt_position());
|
||||
timepos_t position = end_time + start_time.distance (r->position());
|
||||
playlist = (*i)->region()->playlist();
|
||||
playlist->clear_changes ();
|
||||
playlist->duplicate_until (r, position, gap, end);
|
||||
|
|
@ -3696,7 +3696,7 @@ Editor::align_regions (RegionPoint what)
|
|||
|
||||
struct RegionSortByTime {
|
||||
bool operator() (const RegionView* a, const RegionView* b) {
|
||||
return a->region()->nt_position() < b->region()->nt_position();
|
||||
return a->region()->position() < b->region()->position();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -3723,10 +3723,10 @@ Editor::align_regions_relative (RegionPoint point)
|
|||
switch (point) {
|
||||
case Start:
|
||||
pos = position;
|
||||
if (position > r->nt_position()) {
|
||||
distance = r->nt_position().distance (position);
|
||||
if (position > r->position()) {
|
||||
distance = r->position().distance (position);
|
||||
} else {
|
||||
distance = position.distance (r->nt_position());
|
||||
distance = position.distance (r->position());
|
||||
dir = -1;
|
||||
}
|
||||
break;
|
||||
|
|
@ -3734,26 +3734,26 @@ Editor::align_regions_relative (RegionPoint point)
|
|||
case End:
|
||||
if (position > r->nt_last()) {
|
||||
distance = r->nt_last().distance (position);
|
||||
pos = r->nt_position() + distance;
|
||||
pos = r->position() + distance;
|
||||
} else {
|
||||
distance = position.distance (r->nt_last());
|
||||
pos = r->nt_position().earlier (distance);
|
||||
pos = r->position().earlier (distance);
|
||||
dir = -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case SyncPoint:
|
||||
pos = r->adjust_to_sync (position);
|
||||
if (pos > r->nt_position()) {
|
||||
distance = r->nt_position().distance (pos);
|
||||
if (pos > r->position()) {
|
||||
distance = r->position().distance (pos);
|
||||
} else {
|
||||
distance = pos.distance (r->nt_position());
|
||||
distance = pos.distance (r->position());
|
||||
dir = -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (pos == r->nt_position()) {
|
||||
if (pos == r->position()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3776,9 +3776,9 @@ Editor::align_regions_relative (RegionPoint point)
|
|||
region->clear_changes ();
|
||||
|
||||
if (dir > 0) {
|
||||
region->set_position (region->nt_position() + distance);
|
||||
region->set_position (region->position() + distance);
|
||||
} else {
|
||||
region->set_position (region->nt_position().earlier (distance));
|
||||
region->set_position (region->position().earlier (distance));
|
||||
}
|
||||
|
||||
_session->add_command(new StatefulDiffCommand (region));
|
||||
|
|
@ -3807,8 +3807,8 @@ Editor::align_region_internal (boost::shared_ptr<Region> region, RegionPoint poi
|
|||
break;
|
||||
|
||||
case End:
|
||||
if (position > region->nt_length()) {
|
||||
region->set_position (position.earlier (region->nt_length()));
|
||||
if (position > region->length()) {
|
||||
region->set_position (position.earlier (region->length()));
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -3967,24 +3967,24 @@ Editor::trim_to_region(bool forward)
|
|||
|
||||
if (forward) {
|
||||
|
||||
next_region = playlist->find_next_region (region->nt_position(), Start, 1);
|
||||
next_region = playlist->find_next_region (region->position(), Start, 1);
|
||||
|
||||
if (!next_region) {
|
||||
continue;
|
||||
}
|
||||
|
||||
region->trim_end (next_region->nt_position().decrement());
|
||||
region->trim_end (next_region->position().decrement());
|
||||
arv->region_changed (PropertyChange (ARDOUR::Properties::length));
|
||||
}
|
||||
else {
|
||||
|
||||
next_region = playlist->find_next_region (region->nt_position(), Start, 0);
|
||||
next_region = playlist->find_next_region (region->position(), Start, 0);
|
||||
|
||||
if (!next_region) {
|
||||
continue;
|
||||
}
|
||||
|
||||
region->trim_front (next_region->nt_end());
|
||||
region->trim_front (next_region->end());
|
||||
arv->region_changed (ARDOUR::bounds_change);
|
||||
}
|
||||
|
||||
|
|
@ -4729,7 +4729,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
|
|||
|
||||
for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) {
|
||||
|
||||
first_position = min ((*x)->region()->nt_position(), first_position);
|
||||
first_position = min ((*x)->region()->position(), first_position);
|
||||
|
||||
if (op == Cut || op == Clear || op == Delete) {
|
||||
boost::shared_ptr<Playlist> pl = (*x)->region()->playlist();
|
||||
|
|
@ -4816,28 +4816,28 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
|
|||
case Delete:
|
||||
pl->remove_region (r);
|
||||
if (should_ripple()) {
|
||||
pl->ripple (r->position(), -r->length(), boost::shared_ptr<Region>());
|
||||
do_ripple (pl, r->position(), -r->length(), boost::shared_ptr<Region>(), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case Cut:
|
||||
_xx = RegionFactory::create (r, false);
|
||||
npl->add_region (_xx, timepos_t (first_position.distance (r->nt_position())));
|
||||
npl->add_region (_xx, r->position() - first_position);
|
||||
pl->remove_region (r);
|
||||
if (should_ripple()) {
|
||||
pl->ripple (r->position(), -r->length(), boost::shared_ptr<Region>());
|
||||
do_ripple (pl, r->position(), -r->length(), boost::shared_ptr<Region>(), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case Copy:
|
||||
/* copy region before adding, so we're not putting same object into two different playlists */
|
||||
npl->add_region (RegionFactory::create (r, false), timepos_t (first_position.distance (r->nt_position())));
|
||||
npl->add_region (RegionFactory::create (r, false), r->position() - first_position);
|
||||
break;
|
||||
|
||||
case Clear:
|
||||
pl->remove_region (r);
|
||||
if (should_ripple()) {
|
||||
pl->ripple (r->position(), -r->length(), boost::shared_ptr<Region>());
|
||||
do_ripple (pl, r->position(), -r->length(), boost::shared_ptr<Region>(), false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -5098,7 +5098,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
|
|||
latest_regionviews.clear ();
|
||||
sigc::connection c = rtv->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view));
|
||||
|
||||
timepos_t position = end_sample + (start_sample.distance (r->nt_end()));
|
||||
timepos_t position = end_sample + (start_sample.distance (r->end()));
|
||||
playlist = (*i)->region()->playlist();
|
||||
|
||||
if (!should_ripple()) {
|
||||
|
|
@ -5709,7 +5709,7 @@ Editor::apply_midi_note_edit_op_to_region (MidiOperator& op, MidiRegionView& mrv
|
|||
vector<Evoral::Sequence<Temporal::Beats>::Notes> v;
|
||||
v.push_back (selected);
|
||||
|
||||
timepos_t pos = mrv.midi_region()->nt_position().earlier (mrv.midi_region()->nt_start ());
|
||||
timepos_t pos = mrv.midi_region()->position().earlier (mrv.midi_region()->start ());
|
||||
|
||||
#warning NUTEMPO triple check pos computation above to make sure we are doing this right
|
||||
|
||||
|
|
@ -5777,7 +5777,7 @@ Editor::fork_region ()
|
|||
in_command = true;
|
||||
}
|
||||
playlist->clear_changes ();
|
||||
playlist->replace_region (mrv->region(), newregion, mrv->region()->nt_position());
|
||||
playlist->replace_region (mrv->region(), newregion, mrv->region()->position());
|
||||
_session->add_command(new StatefulDiffCommand (playlist));
|
||||
} catch (...) {
|
||||
error << string_compose (_("Could not unlink %1"), mrv->region()->name()) << endmsg;
|
||||
|
|
@ -5933,8 +5933,8 @@ Editor::insert_patch_change (bool from_context)
|
|||
for (RegionSelection::iterator i = rs.begin (); i != rs.end(); ++i) {
|
||||
MidiRegionView* const mrv = dynamic_cast<MidiRegionView*> (*i);
|
||||
if (mrv) {
|
||||
if (p >= mrv->region()->nt_position() && p <= mrv->region()->nt_last()) {
|
||||
mrv->add_patch_change (mrv->region()->nt_position().distance (p), d.patch ());
|
||||
if (p >= mrv->region()->position() && p <= mrv->region()->nt_last()) {
|
||||
mrv->add_patch_change (mrv->region()->position().distance (p), d.patch ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5989,12 +5989,12 @@ Editor::apply_filter (Filter& filter, string command, ProgressReporter* progress
|
|||
std::vector<boost::shared_ptr<Region> >::iterator res = filter.results.begin ();
|
||||
|
||||
/* first region replaces the old one */
|
||||
playlist->replace_region (arv->region(), *res, (*res)->nt_position());
|
||||
playlist->replace_region (arv->region(), *res, (*res)->position());
|
||||
++res;
|
||||
|
||||
/* add the rest */
|
||||
while (res != filter.results.end()) {
|
||||
playlist->add_region (*res, (*res)->nt_position());
|
||||
playlist->add_region (*res, (*res)->position());
|
||||
++res;
|
||||
}
|
||||
|
||||
|
|
@ -6388,11 +6388,11 @@ Editor::set_fade_length (bool in)
|
|||
}
|
||||
|
||||
if (in) {
|
||||
if (pos <= rv->region()->nt_position()) {
|
||||
if (pos <= rv->region()->position()) {
|
||||
/* can't do it */
|
||||
return;
|
||||
}
|
||||
len = rv->region()->nt_position().distance (pos);
|
||||
len = rv->region()->position().distance (pos);
|
||||
cmd = _("set fade in length");
|
||||
} else {
|
||||
if (pos >= rv->region()->last_sample()) {
|
||||
|
|
@ -7065,7 +7065,7 @@ Editor::set_tempo_from_region ()
|
|||
|
||||
RegionView* rv = rs.front();
|
||||
|
||||
define_one_bar (rv->region()->nt_position(), rv->region()->nt_end());
|
||||
define_one_bar (rv->region()->position(), rv->region()->end());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -7271,7 +7271,7 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
|
|||
|
||||
timepos_t pos;
|
||||
|
||||
const timepos_t rstart = r->nt_position ();
|
||||
const timepos_t rstart = r->position ();
|
||||
const samplepos_t start_sample = r->position_sample();
|
||||
const samplepos_t end_sample = r->last_sample() + 1;
|
||||
|
||||
|
|
@ -7286,7 +7286,7 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
|
|||
|
||||
/* file start = original start + how far we from the initial position ? */
|
||||
|
||||
timecnt_t file_start = r->nt_start() + pos;
|
||||
timecnt_t file_start = r->start() + pos;
|
||||
|
||||
/* length = next position - current position */
|
||||
|
||||
|
|
@ -7339,8 +7339,8 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
|
|||
/* Add the final region */
|
||||
PropertyList plist;
|
||||
|
||||
plist.add (ARDOUR::Properties::start, r->nt_start() + pos);
|
||||
plist.add (ARDOUR::Properties::length, (r->nt_position() + pos).distance (r->nt_end()));
|
||||
plist.add (ARDOUR::Properties::start, r->start() + pos);
|
||||
plist.add (ARDOUR::Properties::length, (r->position() + pos).distance (r->end()));
|
||||
plist.add (ARDOUR::Properties::name, new_name);
|
||||
plist.add (ARDOUR::Properties::layer, 0);
|
||||
|
||||
|
|
@ -7349,7 +7349,7 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
|
|||
RegionFactory map
|
||||
*/
|
||||
RegionFactory::map_add (nr);
|
||||
pl->add_region (nr, r->nt_position() + pos);
|
||||
pl->add_region (nr, r->position() + pos);
|
||||
|
||||
if (select_new) {
|
||||
new_regions.push_front(nr);
|
||||
|
|
@ -7531,9 +7531,9 @@ Editor::close_region_gaps ()
|
|||
pl->freeze();
|
||||
}
|
||||
|
||||
timepos_t position = (*r)->region()->nt_position();
|
||||
timepos_t position = (*r)->region()->position();
|
||||
|
||||
if (idx == 0 || position < last_region->nt_position()){
|
||||
if (idx == 0 || position < last_region->position()){
|
||||
last_region = (*r)->region();
|
||||
idx++;
|
||||
continue;
|
||||
|
|
@ -8783,7 +8783,7 @@ Editor::filter_to_unique_midi_region_views (RegionSelection const & ms) const
|
|||
continue;
|
||||
}
|
||||
|
||||
MapEntry entry = make_pair (mrv->midi_region()->midi_source(), mrv->region()->nt_start());
|
||||
MapEntry entry = make_pair (mrv->midi_region()->midi_source(), mrv->region()->start());
|
||||
|
||||
if (single_region_set.insert (entry).second) {
|
||||
views.push_back (mrv);
|
||||
|
|
|
|||
|
|
@ -779,7 +779,7 @@ EditorRegions::populate_row_length (boost::shared_ptr<Region> region, TreeModel:
|
|||
// Temporal::BBT_Time bbt = map->bbt_duration_at (region->position(), region->length());
|
||||
snprintf (buf, sizeof (buf), "%03d|%02d|%04d", bbt.bars, bbt.beats, bbt.ticks);
|
||||
} else {
|
||||
format_position (timepos_t (region->nt_length ()), buf, sizeof (buf));
|
||||
format_position (timepos_t (region->length ()), buf, sizeof (buf));
|
||||
}
|
||||
|
||||
row[_columns.length] = buf;
|
||||
|
|
@ -804,10 +804,10 @@ EditorRegions::populate_row_end (boost::shared_ptr<Region> region, TreeModel::Ro
|
|||
void
|
||||
EditorRegions::populate_row_position (boost::shared_ptr<Region> region, TreeModel::Row const& row)
|
||||
{
|
||||
row[_columns.position] = region->nt_position ();
|
||||
row[_columns.position] = region->position ();
|
||||
|
||||
char buf[16];
|
||||
format_position (region->nt_position (), buf, sizeof (buf));
|
||||
format_position (region->position (), buf, sizeof (buf));
|
||||
row[_columns.start] = buf;
|
||||
}
|
||||
|
||||
|
|
@ -817,7 +817,7 @@ EditorRegions::populate_row_sync (boost::shared_ptr<Region> region, TreeModel::R
|
|||
#ifndef SHOW_REGION_EXTRAS
|
||||
return;
|
||||
#endif
|
||||
if (region->sync_position () == region->nt_position ()) {
|
||||
if (region->sync_position () == region->position ()) {
|
||||
row[_columns.sync] = _ ("Start");
|
||||
} else if (region->sync_position () == (region->last_sample ())) {
|
||||
row[_columns.sync] = _ ("End");
|
||||
|
|
|
|||
|
|
@ -761,7 +761,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
|||
/* 1. find the last selected regionview in the track that was clicked in */
|
||||
|
||||
last_pos = 0;
|
||||
first_pos = timepos_t::max (selection->regions.empty() ? Temporal::AudioTime : selection->regions.front()->region()->nt_position().time_domain());
|
||||
first_pos = timepos_t::max (selection->regions.empty() ? Temporal::AudioTime : selection->regions.front()->region()->position().time_domain());
|
||||
|
||||
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) {
|
||||
if (&(*x)->get_time_axis_view() == &clicked_regionview->get_time_axis_view()) {
|
||||
|
|
@ -770,8 +770,8 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
|||
last_pos = (*x)->region()->nt_last();
|
||||
}
|
||||
|
||||
if ((*x)->region()->nt_position() < first_pos) {
|
||||
first_pos = (*x)->region()->nt_position();
|
||||
if ((*x)->region()->position() < first_pos) {
|
||||
first_pos = (*x)->region()->position();
|
||||
}
|
||||
|
||||
same_track = true;
|
||||
|
|
@ -784,32 +784,32 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
|||
|
||||
switch (clicked_regionview->region()->coverage (first_pos, last_pos)) {
|
||||
case Temporal::OverlapNone:
|
||||
if (last_pos < clicked_regionview->region()->nt_position()) {
|
||||
if (last_pos < clicked_regionview->region()->position()) {
|
||||
first_pos = last_pos;
|
||||
last_pos = clicked_regionview->region()->nt_last();
|
||||
} else {
|
||||
last_pos = first_pos;
|
||||
first_pos = clicked_regionview->region()->nt_position();
|
||||
first_pos = clicked_regionview->region()->position();
|
||||
}
|
||||
break;
|
||||
|
||||
case Temporal::OverlapExternal:
|
||||
if (last_pos < clicked_regionview->region()->nt_position()) {
|
||||
if (last_pos < clicked_regionview->region()->position()) {
|
||||
first_pos = last_pos;
|
||||
last_pos = clicked_regionview->region()->nt_last();
|
||||
} else {
|
||||
last_pos = first_pos;
|
||||
first_pos = clicked_regionview->region()->nt_position();
|
||||
first_pos = clicked_regionview->region()->position();
|
||||
}
|
||||
break;
|
||||
|
||||
case Temporal::OverlapInternal:
|
||||
if (last_pos < clicked_regionview->region()->nt_position()) {
|
||||
if (last_pos < clicked_regionview->region()->position()) {
|
||||
first_pos = last_pos;
|
||||
last_pos = clicked_regionview->region()->nt_last();
|
||||
} else {
|
||||
last_pos = first_pos;
|
||||
first_pos = clicked_regionview->region()->nt_position();
|
||||
first_pos = clicked_regionview->region()->position();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -829,14 +829,14 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
|||
*/
|
||||
|
||||
|
||||
first_pos = clicked_regionview->region()->nt_position();
|
||||
first_pos = clicked_regionview->region()->position();
|
||||
last_pos = clicked_regionview->region()->nt_last();
|
||||
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
if ((*i)->region()->nt_position() < first_pos) {
|
||||
first_pos = (*i)->region()->nt_position();
|
||||
if ((*i)->region()->position() < first_pos) {
|
||||
first_pos = (*i)->region()->position();
|
||||
}
|
||||
if ((*i)->region()->nt_end() > last_pos) {
|
||||
if ((*i)->region()->end() > last_pos) {
|
||||
last_pos = (*i)->region()->nt_last();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ EditorSummary::render_region (RegionView* r, cairo_t* cr, double y) const
|
|||
cairo_move_to (cr, 0, y);
|
||||
}
|
||||
|
||||
if ((r->region()->nt_position() + r->region()->nt_length()) > _start) {
|
||||
if ((r->region()->position() + r->region()->length()) > _start) {
|
||||
cairo_line_to (cr, ((r->region()->position_sample() - _start + r->region()->length_samples())) * _x_scale, y);
|
||||
} else {
|
||||
cairo_line_to (cr, 0, y);
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ Editor::time_stretch (RegionSelection& regions, float fraction)
|
|||
stretch.run (*i);
|
||||
|
||||
playlist->replace_region (regions.front()->region(), stretch.results[0],
|
||||
regions.front()->region()->nt_position());
|
||||
regions.front()->region()->position());
|
||||
midi_playlists_affected.insert (playlist);
|
||||
}
|
||||
|
||||
|
|
@ -168,9 +168,9 @@ Editor::time_fx (RegionList& regions, float val, bool pitching)
|
|||
return 0;
|
||||
}
|
||||
|
||||
const timecnt_t oldlen = regions.front()->nt_length();
|
||||
const timecnt_t newlen = regions.front()->nt_length() * val;
|
||||
const timepos_t pos = regions.front()->nt_position ();
|
||||
const timecnt_t oldlen = regions.front()->length();
|
||||
const timecnt_t newlen = regions.front()->length() * val;
|
||||
const timepos_t pos = regions.front()->position ();
|
||||
|
||||
current_timefx = new TimeFXDialog (*this, pitching, oldlen, newlen, pos);
|
||||
current_timefx->regions = regions;
|
||||
|
|
@ -427,7 +427,7 @@ Editor::do_timefx ()
|
|||
boost::shared_ptr<Region> region = i->first;
|
||||
boost::shared_ptr<Region> new_region = i->second;
|
||||
boost::shared_ptr<Playlist> playlist = region->playlist();
|
||||
playlist->replace_region (region, new_region, region->nt_position());
|
||||
playlist->replace_region (region, new_region, region->position());
|
||||
|
||||
PBD::StatefulDiffCommand* cmd = new StatefulDiffCommand (playlist);
|
||||
_session->add_command (cmd);
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@ ExportRegionDialog::init_gui ()
|
|||
void
|
||||
ExportRegionDialog::init_components ()
|
||||
{
|
||||
string loc_id = profile_manager->set_single_range (region.position_sample(), (region.nt_position() + region.nt_length()).samples(), region.name());
|
||||
string loc_id = profile_manager->set_single_range (region.position_sample(), (region.position() + region.length()).samples(), region.name());
|
||||
|
||||
preset_selector.reset (new ExportPresetSelector ());
|
||||
timespan_selector.reset (new ExportTimespanSelectorSingle (_session, profile_manager, loc_id));
|
||||
|
|
|
|||
|
|
@ -765,8 +765,8 @@ MidiListEditor::redisplay_model ()
|
|||
TreeModel::Row row;
|
||||
stringstream ss;
|
||||
|
||||
MidiModel::Notes::const_iterator i = m->note_lower_bound (region->nt_start().beats());
|
||||
Temporal::Beats end_time = (region->nt_start() + region->nt_length()).beats();
|
||||
MidiModel::Notes::const_iterator i = m->note_lower_bound (region->start().beats());
|
||||
Temporal::Beats end_time = (region->start() + region->length()).beats();
|
||||
|
||||
for (; i != m->notes().end() && (*i)->time() < end_time; ++i) {
|
||||
row = *(model->append());
|
||||
|
|
|
|||
|
|
@ -1250,7 +1250,7 @@ MidiRegionView::display_patch_changes_on_channel (uint8_t channel, bool active_c
|
|||
|
||||
const timepos_t region_time = _region->source_beats_to_region_time ((*i)->time());
|
||||
|
||||
if (region_time < timepos_t() || region_time >= _region->nt_length()) {
|
||||
if (region_time < timepos_t() || region_time >= _region->length()) {
|
||||
p->hide();
|
||||
} else {
|
||||
const double x = trackview.editor().time_to_pixel (region_time);
|
||||
|
|
@ -1341,7 +1341,7 @@ MidiRegionView::display_sysexes()
|
|||
}
|
||||
|
||||
// Show unless message is beyond the region bounds
|
||||
if (_region->source_relative_position (time) >= _region->nt_length() || time < _region->nt_start()) {
|
||||
if (_region->source_relative_position (time) >= _region->length() || time < _region->start()) {
|
||||
sysex->hide();
|
||||
} else {
|
||||
sysex->show();
|
||||
|
|
@ -1465,7 +1465,7 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force)
|
|||
GhostRegion*
|
||||
MidiRegionView::add_ghost (TimeAxisView& tv)
|
||||
{
|
||||
double unit_position = trackview.editor().time_to_pixel (_region->nt_position ());
|
||||
double unit_position = trackview.editor().time_to_pixel (_region->position ());
|
||||
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&tv);
|
||||
MidiGhostRegion* ghost;
|
||||
|
||||
|
|
@ -1480,7 +1480,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv)
|
|||
|
||||
ghost->set_colors ();
|
||||
ghost->set_height ();
|
||||
ghost->set_duration (_region->nt_length().samples() / samples_per_pixel);
|
||||
ghost->set_duration (_region->length().samples() / samples_per_pixel);
|
||||
|
||||
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
|
||||
ghost->add_note(i->second);
|
||||
|
|
@ -1552,7 +1552,7 @@ MidiRegionView::extend_active_notes()
|
|||
|
||||
for (unsigned i = 0; i < 128; ++i) {
|
||||
if (_active_notes[i]) {
|
||||
_active_notes[i]->set_x1 (trackview.editor().duration_to_pixels (_region->nt_length()));
|
||||
_active_notes[i]->set_x1 (trackview.editor().duration_to_pixels (_region->length()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1613,7 +1613,7 @@ MidiRegionView::note_in_region_range (const boost::shared_ptr<NoteType> note, bo
|
|||
const boost::shared_ptr<ARDOUR::MidiRegion> midi_reg = midi_region();
|
||||
|
||||
/* must compare double explicitly as Beats::operator< rounds to ppqn */
|
||||
const bool outside = (timepos_t (note->time()) < _region->nt_start()) || (timepos_t (note->time()) >= _region->nt_start() + _region->nt_length());
|
||||
const bool outside = (timepos_t (note->time()) < _region->start()) || (timepos_t (note->time()) >= _region->start() + _region->length());
|
||||
|
||||
visible = (note->note() >= _current_range_min) &&
|
||||
(note->note() <= _current_range_max);
|
||||
|
|
@ -1661,8 +1661,8 @@ MidiRegionView::update_sustained (Note* ev, bool update_ghost_regions)
|
|||
|
||||
timepos_t note_end (note->end_time());
|
||||
|
||||
if (note_end > mr->nt_start() + mr->nt_length()) {
|
||||
note_end = mr->nt_start() + mr->nt_length();
|
||||
if (note_end > mr->start() + mr->length()) {
|
||||
note_end = mr->start() + mr->length();
|
||||
}
|
||||
|
||||
x1 = std::max(1., trackview.editor().time_to_pixel (note_end)) - 1;
|
||||
|
|
@ -1671,7 +1671,7 @@ MidiRegionView::update_sustained (Note* ev, bool update_ghost_regions)
|
|||
|
||||
/* nascent note currently being recorded, noteOff has not yet arrived */
|
||||
|
||||
x1 = std::max(1., trackview.editor().duration_to_pixels (_region->nt_length())) - 1;
|
||||
x1 = std::max(1., trackview.editor().duration_to_pixels (_region->length())) - 1;
|
||||
}
|
||||
|
||||
y1 = y0 + std::max(1., floor(note_height()) - 1);
|
||||
|
|
@ -1812,7 +1812,7 @@ MidiRegionView::step_add_note (uint8_t channel, uint8_t number, uint8_t velocity
|
|||
timepos_t region_end = _region->nt_last();
|
||||
|
||||
if (note_end > region_end) {
|
||||
_region->set_length (timecnt_t (note_end.earlier (_region->nt_position()), timepos_t()));
|
||||
_region->set_length (timecnt_t (note_end.earlier (_region->position()), timepos_t()));
|
||||
}
|
||||
|
||||
MidiTimeAxisView* const mtv = dynamic_cast<MidiTimeAxisView*>(&trackview);
|
||||
|
|
@ -1866,7 +1866,7 @@ MidiRegionView::add_canvas_patch_change (MidiModel::PatchChangePtr patch)
|
|||
|
||||
if (patch_change->item().width() < _pixel_width) {
|
||||
// Show unless patch change is beyond the region bounds
|
||||
if (patch_time < _region->nt_position() || patch_time >= _region->nt_last()) {
|
||||
if (patch_time < _region->position() || patch_time >= _region->nt_last()) {
|
||||
patch_change->hide();
|
||||
} else {
|
||||
patch_change->show();
|
||||
|
|
@ -2000,7 +2000,7 @@ MidiRegionView::add_patch_change (timecnt_t const & t, Evoral::PatchChange<Tempo
|
|||
|
||||
c->add (MidiModel::PatchChangePtr (
|
||||
new Evoral::PatchChange<Temporal::Beats>
|
||||
(_region->source_relative_position (_region->nt_position() + t).beats(),
|
||||
(_region->source_relative_position (_region->position() + t).beats(),
|
||||
patch.channel(), patch.program(), patch.bank())));
|
||||
|
||||
_model->apply_command (*trackview.session(), c);
|
||||
|
|
@ -2887,8 +2887,8 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
*/
|
||||
current_x = 0;
|
||||
}
|
||||
if (current_x > trackview.editor().duration_to_pixels (_region->nt_length())) {
|
||||
current_x = trackview.editor().duration_to_pixels (_region->nt_length());
|
||||
if (current_x > trackview.editor().duration_to_pixels (_region->length())) {
|
||||
current_x = trackview.editor().duration_to_pixels (_region->length());
|
||||
}
|
||||
|
||||
if (at_front) {
|
||||
|
|
@ -2917,9 +2917,9 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
|
||||
/* negative beat offsets aren't allowed */
|
||||
if (snap_delta_samps > 0) {
|
||||
snap_delta_beats = _region->region_distance_to_region_beats (timecnt_t (snap_delta_samps, _region->nt_position()));
|
||||
snap_delta_beats = _region->region_distance_to_region_beats (timecnt_t (snap_delta_samps, _region->position()));
|
||||
} else if (snap_delta_samps < 0) {
|
||||
snap_delta_beats = _region->region_distance_to_region_beats (timecnt_t (-snap_delta_samps, _region->nt_position()));
|
||||
snap_delta_beats = _region->region_distance_to_region_beats (timecnt_t (-snap_delta_samps, _region->position()));
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
|
|
@ -2956,7 +2956,7 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
|
||||
cursor_set = true;
|
||||
|
||||
trackview.editor().set_snapped_cursor_position (snapped_x + midi_region()->nt_position());
|
||||
trackview.editor().set_snapped_cursor_position (snapped_x + midi_region()->position());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3002,8 +3002,8 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
current_x = 0;
|
||||
}
|
||||
|
||||
if (current_x > trackview.editor().duration_to_pixels (_region->nt_length())) {
|
||||
current_x = trackview.editor().duration_to_pixels (_region->nt_length());
|
||||
if (current_x > trackview.editor().duration_to_pixels (_region->length())) {
|
||||
current_x = trackview.editor().duration_to_pixels (_region->length());
|
||||
}
|
||||
|
||||
/* Convert snap delta from pixels to beats with sign. */
|
||||
|
|
@ -3012,9 +3012,9 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
int sign = 1;
|
||||
|
||||
if (snap_delta_samps > 0) {
|
||||
snap_delta_beats = _region->region_distance_to_region_beats (timecnt_t (snap_delta_samps, _region->nt_position()));
|
||||
snap_delta_beats = _region->region_distance_to_region_beats (timecnt_t (snap_delta_samps, _region->position()));
|
||||
} else if (snap_delta_samps < 0) {
|
||||
snap_delta_beats = _region->region_distance_to_region_beats (timecnt_t (-snap_delta_samps, _region->nt_position()));
|
||||
snap_delta_beats = _region->region_distance_to_region_beats (timecnt_t (-snap_delta_samps, _region->position()));
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
|
|
@ -3332,7 +3332,7 @@ MidiRegionView::change_note_lengths (bool fine, bool shorter, Temporal::Beats de
|
|||
delta = Temporal::Beats::ticks (Temporal::ticks_per_beat / 128);
|
||||
} else {
|
||||
/* grab the current grid distance */
|
||||
delta = get_grid_beats (_region->nt_position());
|
||||
delta = get_grid_beats (_region->position());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3379,7 +3379,7 @@ MidiRegionView::nudge_notes (bool forward, bool fine)
|
|||
|
||||
timecnt_t unused;
|
||||
const timecnt_t distance = trackview.editor().get_nudge_distance (ref_point, unused);
|
||||
delta = _region->region_distance_to_region_beats (timecnt_t (distance.beats(), _region->nt_position()));
|
||||
delta = _region->region_distance_to_region_beats (timecnt_t (distance.beats(), _region->position()));
|
||||
|
||||
} else {
|
||||
|
||||
|
|
@ -3686,7 +3686,7 @@ MidiRegionView::paste_internal (timepos_t const & pos, unsigned paste_count, flo
|
|||
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("Paste data spans from %1 to %2 (%3) ; paste pos beats = %4 (based on %5 - %6)\n",
|
||||
first_time,
|
||||
last_time,
|
||||
duration, pos, _region->nt_position(),
|
||||
duration, pos, _region->position(),
|
||||
quarter_note));
|
||||
|
||||
for (int n = 0; n < (int) times; ++n) {
|
||||
|
|
@ -3715,7 +3715,7 @@ MidiRegionView::paste_internal (timepos_t const & pos, unsigned paste_count, flo
|
|||
|
||||
_region->clear_changes ();
|
||||
/* we probably need to get the snap modifier somehow to make this correct for non-musical use */
|
||||
_region->set_length (_region->nt_position().distance (end));
|
||||
_region->set_length (_region->position().distance (end));
|
||||
trackview.session()->add_command (new StatefulDiffCommand (_region));
|
||||
}
|
||||
|
||||
|
|
@ -3876,7 +3876,7 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state)
|
|||
const Temporal::Beats snapped_beats = snap_sample_to_grid_underneath (unsnapped_sample, shift_snap);
|
||||
|
||||
/* prevent Percussive mode from displaying a ghost hit at region end */
|
||||
if (!shift_snap && snapped_beats >= _region->nt_start().beats() + _region->nt_length().beats()) {
|
||||
if (!shift_snap && snapped_beats >= _region->start().beats() + _region->length().beats()) {
|
||||
_ghost_note->hide();
|
||||
hide_verbose_cursor ();
|
||||
return;
|
||||
|
|
@ -3895,7 +3895,7 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state)
|
|||
_ghost_note->show();
|
||||
|
||||
/* calculate time in beats relative to start of source */
|
||||
const Temporal::Beats length = get_grid_beats (_region->nt_position() + timepos_t (unsnapped_sample));
|
||||
const Temporal::Beats length = get_grid_beats (_region->position() + timepos_t (unsnapped_sample));
|
||||
|
||||
_ghost_note->note()->set_time (snapped_beats);
|
||||
_ghost_note->note()->set_length (length);
|
||||
|
|
@ -4143,7 +4143,7 @@ MidiRegionView::trim_front_starting ()
|
|||
void
|
||||
MidiRegionView::trim_front_ending ()
|
||||
{
|
||||
if (_region->nt_start().negative()) {
|
||||
if (_region->start().negative()) {
|
||||
/* Trim drag made start time -ve; fix this */
|
||||
midi_region()->fix_negative_start ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ MidiStreamView::setup_rec_box ()
|
|||
|
||||
timepos_t start;
|
||||
if (rec_regions.size() > 0) {
|
||||
start = rec_regions.back().first->nt_start()
|
||||
start = rec_regions.back().first->start()
|
||||
+ timepos_t (_trackview.track()->get_captured_samples (rec_regions.size() - 1));
|
||||
}
|
||||
|
||||
|
|
@ -674,7 +674,7 @@ MidiStreamView::resume_updates ()
|
|||
|
||||
struct RegionPositionSorter {
|
||||
bool operator() (RegionView* a, RegionView* b) {
|
||||
return a->region()->nt_position() < b->region()->nt_position();
|
||||
return a->region()->position() < b->region()->position();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -693,7 +693,7 @@ MidiStreamView::paste (timepos_t const & pos, const Selection& selection, PasteC
|
|||
list<RegionView*>::const_iterator prev = region_views.begin ();
|
||||
|
||||
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
if ((*i)->region()->nt_position() > pos) {
|
||||
if ((*i)->region()->position() > pos) {
|
||||
break;
|
||||
}
|
||||
prev = i;
|
||||
|
|
@ -702,7 +702,7 @@ MidiStreamView::paste (timepos_t const & pos, const Selection& selection, PasteC
|
|||
boost::shared_ptr<Region> r = (*prev)->region ();
|
||||
|
||||
/* If *prev doesn't cover pos, it's no good */
|
||||
if (r->nt_position() > pos || ((r->nt_position() + r->nt_length()) < pos)) {
|
||||
if (r->position() > pos || ((r->position() + r->length()) < pos)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ RegionEditor::length_clock_changed ()
|
|||
in_command = true;
|
||||
|
||||
_region->clear_changes ();
|
||||
_region->trim_end (_region->nt_position() + len.decrement());
|
||||
_region->trim_end (_region->position() + len.decrement());
|
||||
_session->add_command(new StatefulDiffCommand (_region));
|
||||
}
|
||||
|
||||
|
|
@ -344,7 +344,7 @@ RegionEditor::length_clock_changed ()
|
|||
PublicEditor::instance().commit_reversible_command ();
|
||||
}
|
||||
|
||||
length_clock.set_duration (_region->nt_length());
|
||||
length_clock.set_duration (_region->length());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -369,15 +369,15 @@ void
|
|||
RegionEditor::bounds_changed (const PropertyChange& what_changed)
|
||||
{
|
||||
if (what_changed.contains (ARDOUR::Properties::position) && what_changed.contains (ARDOUR::Properties::length)) {
|
||||
position_clock.set (_region->nt_position(), true);
|
||||
position_clock.set (_region->position(), true);
|
||||
end_clock.set (_region->nt_last(), true);
|
||||
length_clock.set_duration (_region->nt_length(), true);
|
||||
length_clock.set_duration (_region->length(), true);
|
||||
} else if (what_changed.contains (ARDOUR::Properties::position)) {
|
||||
position_clock.set (_region->nt_position(), true);
|
||||
position_clock.set (_region->position(), true);
|
||||
end_clock.set (_region->nt_last(), true);
|
||||
} else if (what_changed.contains (ARDOUR::Properties::length)) {
|
||||
end_clock.set (_region->nt_last(), true);
|
||||
length_clock.set_duration (_region->nt_length(), true);
|
||||
length_clock.set_duration (_region->length(), true);
|
||||
}
|
||||
|
||||
if (what_changed.contains (ARDOUR::Properties::sync_position) || what_changed.contains (ARDOUR::Properties::position)) {
|
||||
|
|
@ -391,11 +391,11 @@ RegionEditor::bounds_changed (const PropertyChange& what_changed)
|
|||
sync_offset_relative_clock.set_duration (off, true);
|
||||
}
|
||||
|
||||
sync_offset_absolute_clock.set (_region->nt_position () + off, true);
|
||||
sync_offset_absolute_clock.set (_region->position () + off, true);
|
||||
}
|
||||
|
||||
if (what_changed.contains (ARDOUR::Properties::start)) {
|
||||
start_clock.set (timepos_t (_region->nt_start()), true);
|
||||
start_clock.set (timepos_t (_region->start()), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -441,7 +441,7 @@ RegionEditor::sync_offset_relative_clock_changed ()
|
|||
PublicEditor::instance().begin_reversible_command (_("change region sync point"));
|
||||
|
||||
_region->clear_changes ();
|
||||
_region->set_sync_position (sync_offset_relative_clock.current_time() + _region->nt_position ());
|
||||
_region->set_sync_position (sync_offset_relative_clock.current_time() + _region->position ());
|
||||
_session->add_command (new StatefulDiffCommand (_region));
|
||||
|
||||
PublicEditor::instance().commit_reversible_command ();
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
|
||||
AudioRegionGainLine::AudioRegionGainLine (const string & name, AudioRegionView& r, ArdourCanvas::Container& parent, boost::shared_ptr<AutomationList> l)
|
||||
: AutomationLine (name, r.get_time_axis_view(), parent, l, l->parameter(), Temporal::DistanceMeasure (r.region()->nt_position()))
|
||||
: AutomationLine (name, r.get_time_axis_view(), parent, l, l->parameter(), Temporal::DistanceMeasure (r.region()->position()))
|
||||
, rv (r)
|
||||
{
|
||||
// If this isn't true something is horribly wrong, and we'll get catastrophic gain values
|
||||
|
|
@ -111,7 +111,7 @@ AudioRegionGainLine::region_changed (const PropertyChange& what_changed)
|
|||
interesting_stuff.add (ARDOUR::Properties::position);
|
||||
|
||||
if (what_changed.contains (ARDOUR::Properties::position)) {
|
||||
set_distance_measure_origin (rv.region()->nt_position());
|
||||
set_distance_measure_origin (rv.region()->position());
|
||||
}
|
||||
|
||||
if (what_changed.contains (interesting_stuff)) {
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ RegionSelection::add_to_layer (RegionView * rv)
|
|||
|
||||
struct RegionSortByTime {
|
||||
bool operator() (const RegionView* a, const RegionView* b) const {
|
||||
return a->region()->nt_position() < b->region()->nt_position();
|
||||
return a->region()->position() < b->region()->position();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ struct RegionSortByTrack {
|
|||
/* really, track and position */
|
||||
|
||||
if (a->get_time_axis_view().order() == b->get_time_axis_view().order()) {
|
||||
return a->region()->nt_position() < b->region()->nt_position();
|
||||
return a->region()->position() < b->region()->position();
|
||||
} else {
|
||||
return a->get_time_axis_view().order() < b->get_time_axis_view().order();
|
||||
}
|
||||
|
|
@ -293,13 +293,13 @@ RegionSelection::start_time () const
|
|||
return timepos_t ();
|
||||
}
|
||||
|
||||
timepos_t s = timepos_t::max (front()->region()->nt_position().time_domain());
|
||||
timepos_t s = timepos_t::max (front()->region()->position().time_domain());
|
||||
|
||||
for (RegionSelection::const_iterator i = begin(); i != end(); ++i) {
|
||||
s = min (s, (*i)->region()->nt_position ());
|
||||
s = min (s, (*i)->region()->position ());
|
||||
}
|
||||
|
||||
if (s == timepos_t::max (front()->region()->nt_position().time_domain())) {
|
||||
if (s == timepos_t::max (front()->region()->position().time_domain())) {
|
||||
return timepos_t ();
|
||||
}
|
||||
|
||||
|
|
@ -313,10 +313,10 @@ RegionSelection::end_time () const
|
|||
return timepos_t ();
|
||||
}
|
||||
|
||||
timepos_t e (timepos_t::zero (front()->region()->nt_position().time_domain()));
|
||||
timepos_t e (timepos_t::zero (front()->region()->position().time_domain()));
|
||||
|
||||
for (RegionSelection::const_iterator i = begin(); i != end(); ++i) {
|
||||
e = max (e, (*i)->region()->nt_end ());
|
||||
e = max (e, (*i)->region()->end ());
|
||||
}
|
||||
|
||||
return e;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ RegionView::RegionView (ArdourCanvas::Container* parent,
|
|||
double spu,
|
||||
uint32_t basic_color,
|
||||
bool automation)
|
||||
: TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->nt_position(), r->nt_length(), false, automation,
|
||||
: TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->position(), r->length(), false, automation,
|
||||
(automation ? TimeAxisViewItem::ShowFrame :
|
||||
TimeAxisViewItem::Visibility ((UIConfiguration::instance().get_show_region_name() ? TimeAxisViewItem::ShowNameText : 0) |
|
||||
TimeAxisViewItem::ShowNameHighlight| TimeAxisViewItem::ShowFrame)))
|
||||
|
|
@ -157,7 +157,7 @@ RegionView::RegionView (ArdourCanvas::Container* parent,
|
|||
uint32_t basic_color,
|
||||
bool recording,
|
||||
TimeAxisViewItem::Visibility visibility)
|
||||
: TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->nt_position(), r->nt_length(), recording, false, visibility)
|
||||
: TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->position(), r->length(), recording, false, visibility)
|
||||
, _region (r)
|
||||
, sync_mark(0)
|
||||
, sync_line(0)
|
||||
|
|
@ -471,7 +471,7 @@ RegionView::region_resized (const PropertyChange& what_changed)
|
|||
double unit_length;
|
||||
|
||||
if (what_changed.contains (ARDOUR::Properties::position)) {
|
||||
set_position (_region->nt_position(), 0);
|
||||
set_position (_region->position(), 0);
|
||||
}
|
||||
|
||||
PropertyChange s_and_l;
|
||||
|
|
@ -480,7 +480,7 @@ RegionView::region_resized (const PropertyChange& what_changed)
|
|||
|
||||
if (what_changed.contains (s_and_l)) {
|
||||
|
||||
set_duration (_region->nt_length(), 0);
|
||||
set_duration (_region->length(), 0);
|
||||
|
||||
unit_length = _region->length_samples() / samples_per_pixel;
|
||||
|
||||
|
|
@ -863,7 +863,7 @@ RegionView::region_sync_changed ()
|
|||
|
||||
} else {
|
||||
|
||||
if ((sync_dir < 0) || ((sync_dir > 0) && (sync_offset > _region->nt_length()))) {
|
||||
if ((sync_dir < 0) || ((sync_dir > 0) && (sync_offset > _region->length()))) {
|
||||
|
||||
/* no sync mark - its out of the bounds of the region */
|
||||
|
||||
|
|
@ -998,7 +998,7 @@ RegionView::update_coverage_frame (LayerDisplay d)
|
|||
return;
|
||||
}
|
||||
|
||||
timepos_t const position = _region->nt_position ();
|
||||
timepos_t const position = _region->position ();
|
||||
timepos_t t (position);
|
||||
timepos_t const end = _region->nt_last ();
|
||||
|
||||
|
|
@ -1073,11 +1073,11 @@ RegionView::trim_front (timepos_t const & new_bound, bool no_overlap)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (_region->nt_position() == new_bound) {
|
||||
if (_region->position() == new_bound) {
|
||||
return false;
|
||||
}
|
||||
|
||||
timepos_t const pos = _region->nt_position();
|
||||
timepos_t const pos = _region->position();
|
||||
|
||||
_region->trim_front (new_bound);
|
||||
|
||||
|
|
@ -1088,19 +1088,19 @@ RegionView::trim_front (timepos_t const & new_bound, bool no_overlap)
|
|||
|
||||
bool regions_touching = false;
|
||||
|
||||
if (region_left != 0 && (pos == region_left->nt_end())) {
|
||||
if (region_left != 0 && (pos == region_left->end())) {
|
||||
regions_touching = true;
|
||||
}
|
||||
|
||||
/* Only trim region on the left if the first sample has gone beyond the left region's last sample. */
|
||||
if (region_left != 0 && (region_left->nt_last() > _region->nt_position() || regions_touching)) {
|
||||
region_left->trim_end (_region->nt_position().decrement());
|
||||
if (region_left != 0 && (region_left->nt_last() > _region->position() || regions_touching)) {
|
||||
region_left->trim_end (_region->position().decrement());
|
||||
}
|
||||
}
|
||||
|
||||
region_changed (ARDOUR::bounds_change);
|
||||
|
||||
return (pos != _region->nt_position()); // return true if we actually changed something
|
||||
return (pos != _region->position()); // return true if we actually changed something
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -1121,13 +1121,13 @@ RegionView::trim_end (timepos_t const & new_bound, bool no_overlap)
|
|||
|
||||
bool regions_touching = false;
|
||||
|
||||
if (region_right != 0 && (last == region_right->nt_position().decrement())) {
|
||||
if (region_right != 0 && (last == region_right->position().decrement())) {
|
||||
regions_touching = true;
|
||||
}
|
||||
|
||||
/* Only trim region on the right if the last sample has gone beyond the right region's first sample. */
|
||||
if (region_right != 0 && (region_right->nt_position() < _region->nt_last() || regions_touching)) {
|
||||
region_right->trim_front (_region->nt_end());
|
||||
if (region_right != 0 && (region_right->position() < _region->nt_last() || regions_touching)) {
|
||||
region_right->trim_front (_region->end());
|
||||
}
|
||||
|
||||
region_changed (ARDOUR::bounds_change);
|
||||
|
|
@ -1173,14 +1173,14 @@ RegionView::snap_region_time_to_region_time (timepos_t const & x, bool ensure_sn
|
|||
{
|
||||
PublicEditor& editor = trackview.editor();
|
||||
/* x is region relative, convert it to global absolute time */
|
||||
timepos_t const session_pos = _region->nt_position() + x;
|
||||
timepos_t const session_pos = _region->position() + x;
|
||||
|
||||
/* try a snap in either direction */
|
||||
timepos_t snapped = session_pos;
|
||||
editor.snap_to (snapped, Temporal::RoundNearest, SnapToAny_Visual, ensure_snap);
|
||||
|
||||
/* if we went off the beginning of the region, snap forwards */
|
||||
if (snapped < _region->nt_position ()) {
|
||||
if (snapped < _region->position ()) {
|
||||
snapped = session_pos;
|
||||
editor.snap_to (snapped, Temporal::RoundUpAlways, SnapToAny_Visual, ensure_snap);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public:
|
|||
|
||||
struct PositionOrder {
|
||||
bool operator()(const RegionView* a, const RegionView* b) {
|
||||
return a->region()->nt_position() < b->region()->nt_position();
|
||||
return a->region()->position() < b->region()->position();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ StepEditor::reset_step_edit_beat_pos ()
|
|||
assert (step_edit_region_view);
|
||||
|
||||
const timepos_t ep = _editor.get_preferred_edit_position();
|
||||
timecnt_t distance_from_start (step_edit_region->nt_position().distance (ep));
|
||||
timecnt_t distance_from_start (step_edit_region->position().distance (ep));
|
||||
|
||||
if (distance_from_start < 0) {
|
||||
/* this can happen with snap enabled, and the edit point == Playhead. we snap the
|
||||
|
|
@ -237,7 +237,7 @@ StepEditor::move_step_edit_beat_pos (Temporal::Beats beats)
|
|||
return;
|
||||
}
|
||||
if (beats > 0.0) {
|
||||
step_edit_beat_pos = min (step_edit_beat_pos + beats, step_edit_region->nt_length().beats());
|
||||
step_edit_beat_pos = min (step_edit_beat_pos + beats, step_edit_region->length().beats());
|
||||
} else if (beats < 0.0) {
|
||||
if (-beats < step_edit_beat_pos) {
|
||||
step_edit_beat_pos += beats; // its negative, remember
|
||||
|
|
@ -415,7 +415,7 @@ StepEditor::step_edit_bar_sync ()
|
|||
timepos_t fpos = step_edit_region_view->region()->region_beats_to_absolute_time (step_edit_beat_pos);
|
||||
#warning NUTEMPO FIXME need way to get bbt from timepos_t
|
||||
//fpos = fpos.bbt().round_up_to_bar ();
|
||||
step_edit_beat_pos = step_edit_region->nt_position().distance (fpos).beats().round_up_to_beat();
|
||||
step_edit_beat_pos = step_edit_region->position().distance (fpos).beats().round_up_to_beat();
|
||||
step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -719,7 +719,7 @@ StreamView::setup_new_rec_layer_time (boost::shared_ptr<Region> region)
|
|||
top-layered region after the start of the region we are recording and make a note of it.
|
||||
*/
|
||||
if (_layer_display == Stacked) {
|
||||
_new_rec_layer_time = _trackview.track()->playlist()->find_next_top_layer_position (region->nt_position()).samples();
|
||||
_new_rec_layer_time = _trackview.track()->playlist()->find_next_top_layer_position (region->position()).samples();
|
||||
} else {
|
||||
_new_rec_layer_time = max_samplepos;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ StripSilenceDialog::StripSilenceDialog (Session* s, list<RegionView*> const & v)
|
|||
views.push_back (ViewInterval (*r));
|
||||
}
|
||||
|
||||
_minimum_length->set_is_duration (true, views.front().view->region()->nt_position());
|
||||
_fade_length->set_is_duration (true, views.front().view->region()->nt_position());
|
||||
_minimum_length->set_is_duration (true, views.front().view->region()->position());
|
||||
_fade_length->set_is_duration (true, views.front().view->region()->position());
|
||||
|
||||
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox);
|
||||
|
||||
|
|
@ -345,13 +345,13 @@ StripSilenceDialog::threshold_changed ()
|
|||
samplecnt_t
|
||||
StripSilenceDialog::minimum_length () const
|
||||
{
|
||||
return std::max((samplecnt_t)1, _minimum_length->current_duration (views.front().view->region()->nt_position()).samples());
|
||||
return std::max((samplecnt_t)1, _minimum_length->current_duration (views.front().view->region()->position()).samples());
|
||||
}
|
||||
|
||||
samplecnt_t
|
||||
StripSilenceDialog::fade_length () const
|
||||
{
|
||||
return std::max((samplecnt_t)0, _fade_length->current_duration (views.front().view->region()->nt_position()).samples());
|
||||
return std::max((samplecnt_t)0, _fade_length->current_duration (views.front().view->region()->position()).samples());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue