mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +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));
|
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 ().get_selection ().set (results);
|
||||||
|
|
||||||
trackview.editor ().commit_reversible_command ();
|
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) {
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||||
if (arv) {
|
if (arv) {
|
||||||
switch (arv->region()->coverage (ar->nt_position(), ar->nt_last())) {
|
switch (arv->region()->coverage (ar->position(), ar->nt_last())) {
|
||||||
case Temporal::OverlapNone:
|
case Temporal::OverlapNone:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ AutomationRegionView::AutomationRegionView (ArdourCanvas::Container*
|
||||||
: RegionView(parent, time_axis, region, spu, basic_color, true)
|
: RegionView(parent, time_axis, region, spu, basic_color, true)
|
||||||
, _parameter(param)
|
, _parameter(param)
|
||||||
{
|
{
|
||||||
TimeAxisViewItem::set_position (_region->nt_position(), this);
|
TimeAxisViewItem::set_position (_region->position(), this);
|
||||||
|
|
||||||
if (list) {
|
if (list) {
|
||||||
assert(list->parameter() == param);
|
assert(list->parameter() == param);
|
||||||
|
|
@ -104,8 +104,8 @@ AutomationRegionView::create_line (boost::shared_ptr<ARDOUR::AutomationList> lis
|
||||||
_line->set_colors();
|
_line->set_colors();
|
||||||
_line->set_height ((uint32_t)rint(trackview.current_height() - 2.5 - NAME_HIGHLIGHT_SIZE));
|
_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_visibility (AutomationLine::VisibleAspects (AutomationLine::Line|AutomationLine::ControlPoints));
|
||||||
_line->set_maximum_time (timepos_t (_region->nt_length()));
|
_line->set_maximum_time (timepos_t (_region->length()));
|
||||||
_line->set_offset (_region->nt_start ());
|
_line->set_offset (_region->start ());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
|
|
@ -187,7 +187,7 @@ AutomationRegionView::add_automation_event (GdkEvent *, timepos_t const & w, dou
|
||||||
|
|
||||||
/* snap time */
|
/* 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 */
|
/* map using line */
|
||||||
|
|
||||||
|
|
@ -276,7 +276,7 @@ bool
|
||||||
AutomationRegionView::set_position (timepos_t const & pos, void* src, double* ignored)
|
AutomationRegionView::set_position (timepos_t const & pos, void* src, double* ignored)
|
||||||
{
|
{
|
||||||
if (_line) {
|
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);
|
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)) {
|
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)) {
|
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 ();
|
list<RegionView*>::const_iterator prev = region_views.begin ();
|
||||||
|
|
||||||
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
prev = i;
|
prev = i;
|
||||||
|
|
@ -348,7 +348,7 @@ AutomationStreamView::paste (timepos_t const & pos,
|
||||||
boost::shared_ptr<Region> r = (*prev)->region ();
|
boost::shared_ptr<Region> r = (*prev)->region ();
|
||||||
|
|
||||||
/* If *prev doesn't cover pos, it's no good */
|
/* 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,10 +112,10 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, set<NoteBase*> n)
|
||||||
_length_clock.set_mode (AudioClock::BBT);
|
_length_clock.set_mode (AudioClock::BBT);
|
||||||
|
|
||||||
dur = _region_view->region_relative_distance (timecnt_t ((*_events.begin())->note()->end_time (), timepos_t()), BarTime);
|
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;
|
timecnt_t offset;
|
||||||
dur = _region_view->region_relative_distance (timecnt_t ((*_events.begin())->note()->time (), timepos_t()), BarTime);
|
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_is_duration (true, pos);
|
||||||
_length_clock.set_duration (offset, true);
|
_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 */
|
/* 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const samplecnt_t sample_rate = _session->sample_rate ();
|
|
||||||
#warning NUTEMPO need to be able to create a tempo map with no entries
|
#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)));
|
TempoMap::SharedPtr new_map (new TempoMap (Tempo (120), Meter (4, 4)));
|
||||||
Meter last_meter (4.0, 4.0);
|
Meter last_meter (4.0, 4.0);
|
||||||
bool have_initial_meter = false;
|
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);
|
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) {
|
if (target_tracks != 1) {
|
||||||
track.reset ();
|
track.reset ();
|
||||||
} else {
|
} else {
|
||||||
if (!use_timestamp || !ar) {
|
if (!use_timestamp || !ar) {
|
||||||
/* line each one up right after the other */
|
/* 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;
|
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;
|
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());
|
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) {
|
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()) {
|
if (off.negative()) {
|
||||||
dx = dx - _editor->time_to_pixel_unrounded (off);
|
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())));
|
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 ();
|
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;
|
bool changed_tracks;
|
||||||
|
|
||||||
if (_views.front().time_axis_view >= (int) _time_axis_views.size()) {
|
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;
|
RegionSelection new_views;
|
||||||
PlaylistSet modified_playlists;
|
PlaylistSet modified_playlists;
|
||||||
RouteTimeAxisView* new_time_axis_view = 0;
|
RouteTimeAxisView* new_time_axis_view = 0;
|
||||||
|
|
||||||
timecnt_t const drag_delta = _last_position.distance (_primary->region()->nt_position());
|
timecnt_t const drag_delta = _last_position.distance (_primary->region()->nt_position());
|
||||||
RegionList ripple_exclude;
|
RegionList ripple_exclude;
|
||||||
|
|
||||||
|
|
@ -1740,9 +1741,9 @@ RegionMoveDrag::finished_copy (bool const changed_position, bool const /*changed
|
||||||
timepos_t where;
|
timepos_t where;
|
||||||
|
|
||||||
if (changed_position && !_x_constrained) {
|
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 {
|
} 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 */
|
/* compute full extent of regions that we're going to insert */
|
||||||
|
|
@ -1840,6 +1841,7 @@ RegionMoveDrag::finished_no_copy (
|
||||||
PlaylistSet frozen_playlists;
|
PlaylistSet frozen_playlists;
|
||||||
set<RouteTimeAxisView*> views_to_update;
|
set<RouteTimeAxisView*> views_to_update;
|
||||||
RouteTimeAxisView* new_time_axis_view = 0;
|
RouteTimeAxisView* new_time_axis_view = 0;
|
||||||
|
|
||||||
timecnt_t const drag_delta = last_position.distance (_primary->region()->nt_position());
|
timecnt_t const drag_delta = last_position.distance (_primary->region()->nt_position());
|
||||||
RegionList ripple_exclude;
|
RegionList ripple_exclude;
|
||||||
|
|
||||||
|
|
@ -1900,9 +1902,9 @@ RegionMoveDrag::finished_no_copy (
|
||||||
timepos_t where;
|
timepos_t where;
|
||||||
|
|
||||||
if (changed_position && !_x_constrained) {
|
if (changed_position && !_x_constrained) {
|
||||||
where = rv->region()->nt_position().earlier (drag_delta);
|
where = rv->region()->position().earlier (drag_delta);
|
||||||
} else {
|
} else {
|
||||||
where = rv->region()->nt_position();
|
where = rv->region()->position();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* compute full extent of regions that we're going to insert */
|
/* 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");
|
DEBUG_TRACE (DEBUG::Drags, "New RegionMoveDrag\n");
|
||||||
|
|
||||||
_last_position = _primary->region()->nt_position();
|
_last_position = _primary->region()->position();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2258,7 +2260,6 @@ RegionInsertDrag::aborted (bool)
|
||||||
_views.clear ();
|
_views.clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* ripple mode...
|
* ripple mode...
|
||||||
*/
|
*/
|
||||||
|
|
@ -2272,7 +2273,7 @@ RegionRippleDrag::add_all_after_to_views(TimeAxisView *tav, timepos_t const & wh
|
||||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tav);
|
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tav);
|
||||||
RegionSelection to_ripple;
|
RegionSelection to_ripple;
|
||||||
for (RegionList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
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));
|
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) {
|
if (move_regions) {
|
||||||
thawlist.add (rv->region ());
|
thawlist.add (rv->region ());
|
||||||
// move the underlying region to match the view
|
// 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 {
|
} else {
|
||||||
// restore the view to match the underlying region's original position
|
// 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 */
|
#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...
|
assert (first_selected_on_this_track); // we should always find the region in one of the playlists...
|
||||||
add_all_after_to_views (
|
add_all_after_to_views (
|
||||||
&first_selected_on_this_track->get_time_axis_view(),
|
&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);
|
selected_regions, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2527,7 +2528,7 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
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;
|
const timepos_t pos_before = pos_after + selection_length;
|
||||||
r->set_position(pos_before);
|
r->set_position(pos_before);
|
||||||
r->clear_changes();
|
r->clear_changes();
|
||||||
|
|
@ -3039,9 +3040,9 @@ TrimDrag::TrimDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<Region
|
||||||
void
|
void
|
||||||
TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||||
{
|
{
|
||||||
timepos_t const region_start = _primary->region()->nt_position();
|
timepos_t const region_start = _primary->region()->position();
|
||||||
timepos_t const region_end = _primary->region()->nt_end();
|
timepos_t const region_end = _primary->region()->end();
|
||||||
timecnt_t const region_length = _primary->region()->nt_length();
|
timecnt_t const region_length = _primary->region()->length();
|
||||||
|
|
||||||
timepos_t const pf = adjusted_current_time (event);
|
timepos_t const pf = adjusted_current_time (event);
|
||||||
setup_snap_delta (region_start);
|
setup_snap_delta (region_start);
|
||||||
|
|
@ -3237,13 +3238,13 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
||||||
|
|
||||||
switch (_operation) {
|
switch (_operation) {
|
||||||
case StartTrim:
|
case StartTrim:
|
||||||
show_verbose_cursor_time (rv->region()->nt_position());
|
show_verbose_cursor_time (rv->region()->position());
|
||||||
break;
|
break;
|
||||||
case EndTrim:
|
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;
|
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
|
void
|
||||||
|
|
@ -3286,7 +3287,7 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_jump_position_when_done) {
|
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);
|
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
|
||||||
boost::shared_ptr<AudioRegion> const r = arv->audio_region ();
|
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_verbose_cursor_duration (r->position(), r->position() + r->fade_in()->back()->when, 32);
|
||||||
show_view_preview (r->nt_position() + r->fade_in()->back()->when);
|
show_view_preview (r->position() + r->fade_in()->back()->when);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -4328,7 +4329,7 @@ FadeInDrag::setup_pointer_offset ()
|
||||||
{
|
{
|
||||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
|
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
|
||||||
boost::shared_ptr<AudioRegion> const r = arv->audio_region ();
|
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
|
void
|
||||||
|
|
@ -4364,8 +4365,8 @@ FadeInDrag::motion (GdkEvent* event, bool)
|
||||||
tmp->reset_fade_in_shape_width (tmp->audio_region(), fade_length);
|
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_verbose_cursor_duration (region->position(), region->position() + timepos_t (fade_length), 32);
|
||||||
show_view_preview (region->nt_position() + timepos_t (fade_length));
|
show_view_preview (region->position() + timepos_t (fade_length));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -4459,7 +4460,7 @@ FadeOutDrag::setup_pointer_offset ()
|
||||||
{
|
{
|
||||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
|
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
|
||||||
boost::shared_ptr<AudioRegion> r = arv->audio_region ();
|
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
|
void
|
||||||
|
|
@ -5506,8 +5507,8 @@ TimeFXDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||||
Drag::start_grab (event, cursor);
|
Drag::start_grab (event, cursor);
|
||||||
|
|
||||||
_editor->get_selection().add (_primary);
|
_editor->get_selection().add (_primary);
|
||||||
timepos_t where (_primary->region()->nt_position());
|
timepos_t where (_primary->region()->position());
|
||||||
setup_snap_delta (_primary->region()->nt_position());
|
setup_snap_delta (_primary->region()->position());
|
||||||
|
|
||||||
show_verbose_cursor_duration (where, adjusted_current_time (event), 0);
|
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);
|
_editor->snap_to_with_modifier (pf, event);
|
||||||
pf.shift_earlier (snap_delta (event->button.state));
|
pf.shift_earlier (snap_delta (event->button.state));
|
||||||
|
|
||||||
if (pf > rv->region()->nt_position()) {
|
if (pf > rv->region()->position()) {
|
||||||
rv->get_time_axis_view().show_timestretch (rv->region()->nt_position(), pf, layers, layer);
|
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
|
void
|
||||||
|
|
@ -5551,19 +5552,19 @@ TimeFXDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||||
|
|
||||||
timepos_t adjusted_pos = adjusted_current_time (event);
|
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 */
|
/* backwards drag of the left edge - not usable */
|
||||||
return;
|
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
|
#ifndef USE_RUBBERBAND
|
||||||
// Soundtouch uses fraction / 100 instead of normal (/ 1)
|
// Soundtouch uses fraction / 100 instead of normal (/ 1)
|
||||||
if (_primary->region()->data_type() == DataType::AUDIO) {
|
if (_primary->region()->data_type() == DataType::AUDIO) {
|
||||||
fraction = ((newlen - _primary->region()->nt_length()) / newlen) * 100;
|
fraction = ((newlen - _primary->region()->length()) / newlen) * 100;
|
||||||
}
|
}
|
||||||
#endif
|
#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)));
|
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 */
|
/* prevent the earliest note being dragged earlier than the region's start position */
|
||||||
if (ret + _earliest < _region->region()->nt_start()) {
|
if (ret + _earliest < _region->region()->start()) {
|
||||||
ret -= (ret + _earliest) - _region->region()->nt_start();
|
ret -= (ret + _earliest) - _region->region()->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -6744,8 +6745,8 @@ DraggingView::DraggingView (RegionView* v, RegionDrag* parent, TimeAxisView* ita
|
||||||
layer = v->region()->layer ();
|
layer = v->region()->layer ();
|
||||||
initial_y = v->get_canvas_group()->position().y;
|
initial_y = v->get_canvas_group()->position().y;
|
||||||
initial_playlist = v->region()->playlist ();
|
initial_playlist = v->region()->playlist ();
|
||||||
initial_position = v->region()->nt_position ();
|
initial_position = v->region()->position ();
|
||||||
initial_end = v->region()->nt_position () + v->region()->nt_length ();
|
initial_end = v->region()->position () + v->region()->length ();
|
||||||
}
|
}
|
||||||
|
|
||||||
PatchChangeDrag::PatchChangeDrag (Editor* e, PatchChange* i, MidiRegionView* r)
|
PatchChangeDrag::PatchChangeDrag (Editor* e, PatchChange* i, MidiRegionView* r)
|
||||||
|
|
@ -6764,7 +6765,7 @@ PatchChangeDrag::motion (GdkEvent* ev, bool)
|
||||||
{
|
{
|
||||||
timepos_t f = adjusted_current_time (ev);
|
timepos_t f = adjusted_current_time (ev);
|
||||||
boost::shared_ptr<Region> r = _region_view->region ();
|
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 ());
|
f = min (f, r->nt_last ());
|
||||||
|
|
||||||
timecnt_t const dxf = grab_time().distance (f); // permitted dx
|
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 ());
|
boost::shared_ptr<Region> r (_region_view->region ());
|
||||||
timepos_t f = adjusted_current_time (ev);
|
timepos_t f = adjusted_current_time (ev);
|
||||||
f = max (f, r->nt_position ());
|
f = max (f, r->position ());
|
||||||
f = min (f, r->nt_last ());
|
f = min (f, r->nt_last ());
|
||||||
|
|
||||||
_region_view->move_patch_change (*_patch_change, _region_view->region()->absolute_time_to_region_beats (f));
|
_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;
|
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 x0 = _editor->time_to_pixel (_note[0]);
|
||||||
double const x1 = _editor->time_to_pixel (_note[1]);
|
double const x1 = _editor->time_to_pixel (_note[1]);
|
||||||
|
|
@ -7062,7 +7063,7 @@ HitCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||||
return;
|
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);
|
Temporal::Beats length = _region_view->get_grid_beats (pos);
|
||||||
|
|
||||||
_editor->begin_reversible_command (_("Create Hit"));
|
_editor->begin_reversible_command (_("Create Hit"));
|
||||||
|
|
@ -7083,7 +7084,7 @@ HitCreateDrag::motion (GdkEvent* event, bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
const Beats beats = pos.beats ();
|
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) {
|
if (_last_pos == start) {
|
||||||
return;
|
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 */
|
/* 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" */
|
/* XXX should link(2) to create a new inode with "path" */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1142,7 +1142,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
if (!prev) {
|
if (!prev) {
|
||||||
_drags->set (new RegionCreateDrag (this, item, parent), event);
|
_drags->set (new RegionCreateDrag (this, item, parent), event);
|
||||||
} else {
|
} else {
|
||||||
prev->set_length (prev->nt_position ().distance (t));
|
prev->set_length (prev->position ().distance (t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2542,7 +2542,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, timepos_t const & pos)
|
||||||
|
|
||||||
/* don't brush a copy over the original */
|
/* don't brush a copy over the original */
|
||||||
|
|
||||||
if (pos == rv->region()->nt_position()) {
|
if (pos == rv->region()->position()) {
|
||||||
return;
|
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 the user wants newly-created regions to be selected, then select them:
|
||||||
if (mouse_mode == MouseObject) {
|
if (mouse_mode == MouseObject) {
|
||||||
for (RegionSelection::iterator ri = latest_regionviews.begin(); ri != latest_regionviews.end(); ri++) {
|
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
|
// new regions created before the split
|
||||||
if (rsas & NewlyCreatedLeft) {
|
if (rsas & NewlyCreatedLeft) {
|
||||||
selection->add (*ri);
|
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) {
|
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||||
boost::shared_ptr<Region> r ((*i)->region());
|
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) {
|
if (next) {
|
||||||
distance = next_distance;
|
distance = next_distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
r->clear_changes ();
|
r->clear_changes ();
|
||||||
r->set_position (r->nt_position() + distance);
|
r->set_position (r->position() + distance);
|
||||||
_session->add_command (new StatefulDiffCommand (r));
|
_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) {
|
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||||
boost::shared_ptr<Region> r ((*i)->region());
|
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) {
|
if (next) {
|
||||||
distance = next_distance;
|
distance = next_distance;
|
||||||
|
|
@ -514,8 +514,8 @@ Editor::nudge_backward (bool next, bool force_playhead)
|
||||||
|
|
||||||
r->clear_changes ();
|
r->clear_changes ();
|
||||||
|
|
||||||
if (r->nt_position() > distance) {
|
if (r->position() > distance) {
|
||||||
r->set_position (r->nt_position().earlier (distance));
|
r->set_position (r->position().earlier (distance));
|
||||||
} else {
|
} else {
|
||||||
r->set_position (timepos_t());
|
r->set_position (timepos_t());
|
||||||
}
|
}
|
||||||
|
|
@ -602,7 +602,7 @@ Editor::nudge_forward_capture_offset ()
|
||||||
boost::shared_ptr<Region> r ((*i)->region());
|
boost::shared_ptr<Region> r ((*i)->region());
|
||||||
|
|
||||||
r->clear_changes ();
|
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));
|
_session->add_command(new StatefulDiffCommand (r));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -627,8 +627,8 @@ Editor::nudge_backward_capture_offset ()
|
||||||
|
|
||||||
r->clear_changes ();
|
r->clear_changes ();
|
||||||
|
|
||||||
if (r->nt_position() > distance) {
|
if (r->position() > distance) {
|
||||||
r->set_position (r->nt_position().earlier (distance));
|
r->set_position (r->position().earlier (distance));
|
||||||
} else {
|
} else {
|
||||||
r->set_position (timepos_t ());
|
r->set_position (timepos_t ());
|
||||||
}
|
}
|
||||||
|
|
@ -640,7 +640,7 @@ Editor::nudge_backward_capture_offset ()
|
||||||
|
|
||||||
struct RegionSelectionPositionSorter {
|
struct RegionSelectionPositionSorter {
|
||||||
bool operator() (RegionView* a, RegionView* b) {
|
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));
|
_session->add_command (new StatefulDiffCommand (r));
|
||||||
|
|
||||||
r_end=r->nt_position() + r->nt_length();
|
r_end=r->position() + r->length();
|
||||||
|
|
||||||
iCount++;
|
iCount++;
|
||||||
}
|
}
|
||||||
|
|
@ -802,11 +802,11 @@ Editor::build_region_boundary_cache ()
|
||||||
|
|
||||||
switch (*p) {
|
switch (*p) {
|
||||||
case Start:
|
case Start:
|
||||||
rpos = r->nt_position();
|
rpos = r->position();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case End:
|
case End:
|
||||||
rpos = r->nt_end();
|
rpos = r->end();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SyncPoint:
|
case SyncPoint:
|
||||||
|
|
@ -871,11 +871,11 @@ Editor::find_next_region (timepos_t const & pos, RegionPoint point, int32_t dir,
|
||||||
|
|
||||||
switch (point) {
|
switch (point) {
|
||||||
case Start:
|
case Start:
|
||||||
rpos = r->nt_position ();
|
rpos = r->position ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case End:
|
case End:
|
||||||
rpos = r->nt_end ();
|
rpos = r->end ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SyncPoint:
|
case SyncPoint:
|
||||||
|
|
@ -1039,7 +1039,7 @@ Editor::cursor_to_region_point (EditorCursor* cursor, RegionPoint point, int32_t
|
||||||
|
|
||||||
switch (point) {
|
switch (point) {
|
||||||
case Start:
|
case Start:
|
||||||
pos = r->nt_position ();
|
pos = r->position ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case End:
|
case End:
|
||||||
|
|
@ -1227,7 +1227,7 @@ Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SyncPoint:
|
case SyncPoint:
|
||||||
pos = r->adjust_to_sync (r->nt_position());
|
pos = r->adjust_to_sync (r->position());
|
||||||
break;
|
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) {
|
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||||
|
|
||||||
if ((*i)->region()->nt_position() < start) {
|
if ((*i)->region()->position() < start) {
|
||||||
start = (*i)->region()->nt_position();
|
start = (*i)->region()->position();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*i)->region()->nt_end() > end) {
|
if ((*i)->region()->end() > end) {
|
||||||
end = (*i)->region()->nt_end();
|
end = (*i)->region()->end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2396,7 +2396,7 @@ Editor::add_locations_from_region ()
|
||||||
|
|
||||||
boost::shared_ptr<Region> region = (*i)->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);
|
_session->locations()->add (location, true);
|
||||||
commit = true;
|
commit = true;
|
||||||
|
|
@ -3029,11 +3029,11 @@ Editor::play_selected_region ()
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||||
if ((*i)->region()->nt_position() < start) {
|
if ((*i)->region()->position() < start) {
|
||||||
start = (*i)->region()->nt_position();
|
start = (*i)->region()->position();
|
||||||
}
|
}
|
||||||
if ((*i)->region()->nt_end() > end) {
|
if ((*i)->region()->end() > end) {
|
||||||
end = (*i)->region()->nt_end();
|
end = (*i)->region()->end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3078,12 +3078,12 @@ Editor::region_from_selection ()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal_start = current->nt_position().distance (start);
|
internal_start = current->position().distance (start);
|
||||||
RegionFactory::region_name (new_name, current->name(), true);
|
RegionFactory::region_name (new_name, current->name(), true);
|
||||||
|
|
||||||
PropertyList plist;
|
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::length, selection_cnt);
|
||||||
plist.add (ARDOUR::Properties::name, new_name);
|
plist.add (ARDOUR::Properties::name, new_name);
|
||||||
plist.add (ARDOUR::Properties::layer, 0);
|
plist.add (ARDOUR::Properties::layer, 0);
|
||||||
|
|
@ -3125,12 +3125,12 @@ Editor::create_region_from_selection (vector<boost::shared_ptr<Region> >& new_re
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal_start = current->nt_position().distance (start);
|
internal_start = current->position().distance (start);
|
||||||
RegionFactory::region_name (new_name, current->name(), true);
|
RegionFactory::region_name (new_name, current->name(), true);
|
||||||
|
|
||||||
PropertyList plist;
|
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::length, start.distance (end));
|
||||||
plist.add (ARDOUR::Properties::name, new_name);
|
plist.add (ARDOUR::Properties::name, new_name);
|
||||||
|
|
||||||
|
|
@ -3424,10 +3424,10 @@ Editor::separate_under_selected_regions ()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Partition on the region bounds
|
//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
|
//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;
|
vector<PlaylistState>::iterator pl;
|
||||||
|
|
@ -3525,10 +3525,10 @@ Editor::crop_region_to (timepos_t const & start, timepos_t const & end)
|
||||||
/* now adjust lengths */
|
/* now adjust lengths */
|
||||||
for (vector<boost::shared_ptr<Region> >::iterator i = regions.begin(); i != regions.end(); ++i) {
|
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);
|
new_start = max (start, pos);
|
||||||
if (timepos_t::max (pos.time_domain()).earlier (pos) > (*i)->nt_length()) {
|
if (timepos_t::max (pos.time_domain()).earlier (pos) > (*i)->length()) {
|
||||||
new_end = (*i)->nt_end();
|
new_end = (*i)->end();
|
||||||
} else {
|
} else {
|
||||||
new_end = timepos_t::max (pos.time_domain());
|
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
|
Playlist::duplicate_until gets modified. Maybe change this to
|
||||||
be more consistent with other APIs
|
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 = (*i)->region()->playlist();
|
||||||
playlist->clear_changes ();
|
playlist->clear_changes ();
|
||||||
playlist->duplicate_until (r, position, gap, end);
|
playlist->duplicate_until (r, position, gap, end);
|
||||||
|
|
@ -3696,7 +3696,7 @@ Editor::align_regions (RegionPoint what)
|
||||||
|
|
||||||
struct RegionSortByTime {
|
struct RegionSortByTime {
|
||||||
bool operator() (const RegionView* a, const RegionView* b) {
|
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) {
|
switch (point) {
|
||||||
case Start:
|
case Start:
|
||||||
pos = position;
|
pos = position;
|
||||||
if (position > r->nt_position()) {
|
if (position > r->position()) {
|
||||||
distance = r->nt_position().distance (position);
|
distance = r->position().distance (position);
|
||||||
} else {
|
} else {
|
||||||
distance = position.distance (r->nt_position());
|
distance = position.distance (r->position());
|
||||||
dir = -1;
|
dir = -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -3734,26 +3734,26 @@ Editor::align_regions_relative (RegionPoint point)
|
||||||
case End:
|
case End:
|
||||||
if (position > r->nt_last()) {
|
if (position > r->nt_last()) {
|
||||||
distance = r->nt_last().distance (position);
|
distance = r->nt_last().distance (position);
|
||||||
pos = r->nt_position() + distance;
|
pos = r->position() + distance;
|
||||||
} else {
|
} else {
|
||||||
distance = position.distance (r->nt_last());
|
distance = position.distance (r->nt_last());
|
||||||
pos = r->nt_position().earlier (distance);
|
pos = r->position().earlier (distance);
|
||||||
dir = -1;
|
dir = -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SyncPoint:
|
case SyncPoint:
|
||||||
pos = r->adjust_to_sync (position);
|
pos = r->adjust_to_sync (position);
|
||||||
if (pos > r->nt_position()) {
|
if (pos > r->position()) {
|
||||||
distance = r->nt_position().distance (pos);
|
distance = r->position().distance (pos);
|
||||||
} else {
|
} else {
|
||||||
distance = pos.distance (r->nt_position());
|
distance = pos.distance (r->position());
|
||||||
dir = -1;
|
dir = -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos == r->nt_position()) {
|
if (pos == r->position()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3776,9 +3776,9 @@ Editor::align_regions_relative (RegionPoint point)
|
||||||
region->clear_changes ();
|
region->clear_changes ();
|
||||||
|
|
||||||
if (dir > 0) {
|
if (dir > 0) {
|
||||||
region->set_position (region->nt_position() + distance);
|
region->set_position (region->position() + distance);
|
||||||
} else {
|
} else {
|
||||||
region->set_position (region->nt_position().earlier (distance));
|
region->set_position (region->position().earlier (distance));
|
||||||
}
|
}
|
||||||
|
|
||||||
_session->add_command(new StatefulDiffCommand (region));
|
_session->add_command(new StatefulDiffCommand (region));
|
||||||
|
|
@ -3807,8 +3807,8 @@ Editor::align_region_internal (boost::shared_ptr<Region> region, RegionPoint poi
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case End:
|
case End:
|
||||||
if (position > region->nt_length()) {
|
if (position > region->length()) {
|
||||||
region->set_position (position.earlier (region->nt_length()));
|
region->set_position (position.earlier (region->length()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -3967,24 +3967,24 @@ Editor::trim_to_region(bool forward)
|
||||||
|
|
||||||
if (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) {
|
if (!next_region) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
region->trim_end (next_region->nt_position().decrement());
|
region->trim_end (next_region->position().decrement());
|
||||||
arv->region_changed (PropertyChange (ARDOUR::Properties::length));
|
arv->region_changed (PropertyChange (ARDOUR::Properties::length));
|
||||||
}
|
}
|
||||||
else {
|
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) {
|
if (!next_region) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
region->trim_front (next_region->nt_end());
|
region->trim_front (next_region->end());
|
||||||
arv->region_changed (ARDOUR::bounds_change);
|
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) {
|
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) {
|
if (op == Cut || op == Clear || op == Delete) {
|
||||||
boost::shared_ptr<Playlist> pl = (*x)->region()->playlist();
|
boost::shared_ptr<Playlist> pl = (*x)->region()->playlist();
|
||||||
|
|
@ -4816,28 +4816,28 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
|
||||||
case Delete:
|
case Delete:
|
||||||
pl->remove_region (r);
|
pl->remove_region (r);
|
||||||
if (should_ripple()) {
|
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;
|
break;
|
||||||
|
|
||||||
case Cut:
|
case Cut:
|
||||||
_xx = RegionFactory::create (r, false);
|
_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);
|
pl->remove_region (r);
|
||||||
if (should_ripple()) {
|
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;
|
break;
|
||||||
|
|
||||||
case Copy:
|
case Copy:
|
||||||
/* copy region before adding, so we're not putting same object into two different playlists */
|
/* 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;
|
break;
|
||||||
|
|
||||||
case Clear:
|
case Clear:
|
||||||
pl->remove_region (r);
|
pl->remove_region (r);
|
||||||
if (should_ripple()) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -5098,7 +5098,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
|
||||||
latest_regionviews.clear ();
|
latest_regionviews.clear ();
|
||||||
sigc::connection c = rtv->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view));
|
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();
|
playlist = (*i)->region()->playlist();
|
||||||
|
|
||||||
if (!should_ripple()) {
|
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;
|
vector<Evoral::Sequence<Temporal::Beats>::Notes> v;
|
||||||
v.push_back (selected);
|
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
|
#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;
|
in_command = true;
|
||||||
}
|
}
|
||||||
playlist->clear_changes ();
|
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));
|
_session->add_command(new StatefulDiffCommand (playlist));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
error << string_compose (_("Could not unlink %1"), mrv->region()->name()) << endmsg;
|
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) {
|
for (RegionSelection::iterator i = rs.begin (); i != rs.end(); ++i) {
|
||||||
MidiRegionView* const mrv = dynamic_cast<MidiRegionView*> (*i);
|
MidiRegionView* const mrv = dynamic_cast<MidiRegionView*> (*i);
|
||||||
if (mrv) {
|
if (mrv) {
|
||||||
if (p >= mrv->region()->nt_position() && p <= mrv->region()->nt_last()) {
|
if (p >= mrv->region()->position() && p <= mrv->region()->nt_last()) {
|
||||||
mrv->add_patch_change (mrv->region()->nt_position().distance (p), d.patch ());
|
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 ();
|
std::vector<boost::shared_ptr<Region> >::iterator res = filter.results.begin ();
|
||||||
|
|
||||||
/* first region replaces the old one */
|
/* first region replaces the old one */
|
||||||
playlist->replace_region (arv->region(), *res, (*res)->nt_position());
|
playlist->replace_region (arv->region(), *res, (*res)->position());
|
||||||
++res;
|
++res;
|
||||||
|
|
||||||
/* add the rest */
|
/* add the rest */
|
||||||
while (res != filter.results.end()) {
|
while (res != filter.results.end()) {
|
||||||
playlist->add_region (*res, (*res)->nt_position());
|
playlist->add_region (*res, (*res)->position());
|
||||||
++res;
|
++res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6388,11 +6388,11 @@ Editor::set_fade_length (bool in)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in) {
|
if (in) {
|
||||||
if (pos <= rv->region()->nt_position()) {
|
if (pos <= rv->region()->position()) {
|
||||||
/* can't do it */
|
/* can't do it */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
len = rv->region()->nt_position().distance (pos);
|
len = rv->region()->position().distance (pos);
|
||||||
cmd = _("set fade in length");
|
cmd = _("set fade in length");
|
||||||
} else {
|
} else {
|
||||||
if (pos >= rv->region()->last_sample()) {
|
if (pos >= rv->region()->last_sample()) {
|
||||||
|
|
@ -7065,7 +7065,7 @@ Editor::set_tempo_from_region ()
|
||||||
|
|
||||||
RegionView* rv = rs.front();
|
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
|
void
|
||||||
|
|
@ -7271,7 +7271,7 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
|
||||||
|
|
||||||
timepos_t pos;
|
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 start_sample = r->position_sample();
|
||||||
const samplepos_t end_sample = r->last_sample() + 1;
|
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 ? */
|
/* 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 */
|
/* length = next position - current position */
|
||||||
|
|
||||||
|
|
@ -7339,8 +7339,8 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
|
||||||
/* Add the final region */
|
/* Add the final region */
|
||||||
PropertyList plist;
|
PropertyList plist;
|
||||||
|
|
||||||
plist.add (ARDOUR::Properties::start, r->nt_start() + pos);
|
plist.add (ARDOUR::Properties::start, r->start() + pos);
|
||||||
plist.add (ARDOUR::Properties::length, (r->nt_position() + pos).distance (r->nt_end()));
|
plist.add (ARDOUR::Properties::length, (r->position() + pos).distance (r->end()));
|
||||||
plist.add (ARDOUR::Properties::name, new_name);
|
plist.add (ARDOUR::Properties::name, new_name);
|
||||||
plist.add (ARDOUR::Properties::layer, 0);
|
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
|
||||||
*/
|
*/
|
||||||
RegionFactory::map_add (nr);
|
RegionFactory::map_add (nr);
|
||||||
pl->add_region (nr, r->nt_position() + pos);
|
pl->add_region (nr, r->position() + pos);
|
||||||
|
|
||||||
if (select_new) {
|
if (select_new) {
|
||||||
new_regions.push_front(nr);
|
new_regions.push_front(nr);
|
||||||
|
|
@ -7531,9 +7531,9 @@ Editor::close_region_gaps ()
|
||||||
pl->freeze();
|
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();
|
last_region = (*r)->region();
|
||||||
idx++;
|
idx++;
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -8783,7 +8783,7 @@ Editor::filter_to_unique_midi_region_views (RegionSelection const & ms) const
|
||||||
continue;
|
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) {
|
if (single_region_set.insert (entry).second) {
|
||||||
views.push_back (mrv);
|
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());
|
// 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);
|
snprintf (buf, sizeof (buf), "%03d|%02d|%04d", bbt.bars, bbt.beats, bbt.ticks);
|
||||||
} else {
|
} else {
|
||||||
format_position (timepos_t (region->nt_length ()), buf, sizeof (buf));
|
format_position (timepos_t (region->length ()), buf, sizeof (buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
row[_columns.length] = buf;
|
row[_columns.length] = buf;
|
||||||
|
|
@ -804,10 +804,10 @@ EditorRegions::populate_row_end (boost::shared_ptr<Region> region, TreeModel::Ro
|
||||||
void
|
void
|
||||||
EditorRegions::populate_row_position (boost::shared_ptr<Region> region, TreeModel::Row const& row)
|
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];
|
char buf[16];
|
||||||
format_position (region->nt_position (), buf, sizeof (buf));
|
format_position (region->position (), buf, sizeof (buf));
|
||||||
row[_columns.start] = buf;
|
row[_columns.start] = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -817,7 +817,7 @@ EditorRegions::populate_row_sync (boost::shared_ptr<Region> region, TreeModel::R
|
||||||
#ifndef SHOW_REGION_EXTRAS
|
#ifndef SHOW_REGION_EXTRAS
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
if (region->sync_position () == region->nt_position ()) {
|
if (region->sync_position () == region->position ()) {
|
||||||
row[_columns.sync] = _ ("Start");
|
row[_columns.sync] = _ ("Start");
|
||||||
} else if (region->sync_position () == (region->last_sample ())) {
|
} else if (region->sync_position () == (region->last_sample ())) {
|
||||||
row[_columns.sync] = _ ("End");
|
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 */
|
/* 1. find the last selected regionview in the track that was clicked in */
|
||||||
|
|
||||||
last_pos = 0;
|
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) {
|
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) {
|
||||||
if (&(*x)->get_time_axis_view() == &clicked_regionview->get_time_axis_view()) {
|
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();
|
last_pos = (*x)->region()->nt_last();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*x)->region()->nt_position() < first_pos) {
|
if ((*x)->region()->position() < first_pos) {
|
||||||
first_pos = (*x)->region()->nt_position();
|
first_pos = (*x)->region()->position();
|
||||||
}
|
}
|
||||||
|
|
||||||
same_track = true;
|
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)) {
|
switch (clicked_regionview->region()->coverage (first_pos, last_pos)) {
|
||||||
case Temporal::OverlapNone:
|
case Temporal::OverlapNone:
|
||||||
if (last_pos < clicked_regionview->region()->nt_position()) {
|
if (last_pos < clicked_regionview->region()->position()) {
|
||||||
first_pos = last_pos;
|
first_pos = last_pos;
|
||||||
last_pos = clicked_regionview->region()->nt_last();
|
last_pos = clicked_regionview->region()->nt_last();
|
||||||
} else {
|
} else {
|
||||||
last_pos = first_pos;
|
last_pos = first_pos;
|
||||||
first_pos = clicked_regionview->region()->nt_position();
|
first_pos = clicked_regionview->region()->position();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Temporal::OverlapExternal:
|
case Temporal::OverlapExternal:
|
||||||
if (last_pos < clicked_regionview->region()->nt_position()) {
|
if (last_pos < clicked_regionview->region()->position()) {
|
||||||
first_pos = last_pos;
|
first_pos = last_pos;
|
||||||
last_pos = clicked_regionview->region()->nt_last();
|
last_pos = clicked_regionview->region()->nt_last();
|
||||||
} else {
|
} else {
|
||||||
last_pos = first_pos;
|
last_pos = first_pos;
|
||||||
first_pos = clicked_regionview->region()->nt_position();
|
first_pos = clicked_regionview->region()->position();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Temporal::OverlapInternal:
|
case Temporal::OverlapInternal:
|
||||||
if (last_pos < clicked_regionview->region()->nt_position()) {
|
if (last_pos < clicked_regionview->region()->position()) {
|
||||||
first_pos = last_pos;
|
first_pos = last_pos;
|
||||||
last_pos = clicked_regionview->region()->nt_last();
|
last_pos = clicked_regionview->region()->nt_last();
|
||||||
} else {
|
} else {
|
||||||
last_pos = first_pos;
|
last_pos = first_pos;
|
||||||
first_pos = clicked_regionview->region()->nt_position();
|
first_pos = clicked_regionview->region()->position();
|
||||||
}
|
}
|
||||||
break;
|
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();
|
last_pos = clicked_regionview->region()->nt_last();
|
||||||
|
|
||||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||||
if ((*i)->region()->nt_position() < first_pos) {
|
if ((*i)->region()->position() < first_pos) {
|
||||||
first_pos = (*i)->region()->nt_position();
|
first_pos = (*i)->region()->position();
|
||||||
}
|
}
|
||||||
if ((*i)->region()->nt_end() > last_pos) {
|
if ((*i)->region()->end() > last_pos) {
|
||||||
last_pos = (*i)->region()->nt_last();
|
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);
|
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);
|
cairo_line_to (cr, ((r->region()->position_sample() - _start + r->region()->length_samples())) * _x_scale, y);
|
||||||
} else {
|
} else {
|
||||||
cairo_line_to (cr, 0, y);
|
cairo_line_to (cr, 0, y);
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ Editor::time_stretch (RegionSelection& regions, float fraction)
|
||||||
stretch.run (*i);
|
stretch.run (*i);
|
||||||
|
|
||||||
playlist->replace_region (regions.front()->region(), stretch.results[0],
|
playlist->replace_region (regions.front()->region(), stretch.results[0],
|
||||||
regions.front()->region()->nt_position());
|
regions.front()->region()->position());
|
||||||
midi_playlists_affected.insert (playlist);
|
midi_playlists_affected.insert (playlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,9 +168,9 @@ Editor::time_fx (RegionList& regions, float val, bool pitching)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const timecnt_t oldlen = regions.front()->nt_length();
|
const timecnt_t oldlen = regions.front()->length();
|
||||||
const timecnt_t newlen = regions.front()->nt_length() * val;
|
const timecnt_t newlen = regions.front()->length() * val;
|
||||||
const timepos_t pos = regions.front()->nt_position ();
|
const timepos_t pos = regions.front()->position ();
|
||||||
|
|
||||||
current_timefx = new TimeFXDialog (*this, pitching, oldlen, newlen, pos);
|
current_timefx = new TimeFXDialog (*this, pitching, oldlen, newlen, pos);
|
||||||
current_timefx->regions = regions;
|
current_timefx->regions = regions;
|
||||||
|
|
@ -427,7 +427,7 @@ Editor::do_timefx ()
|
||||||
boost::shared_ptr<Region> region = i->first;
|
boost::shared_ptr<Region> region = i->first;
|
||||||
boost::shared_ptr<Region> new_region = i->second;
|
boost::shared_ptr<Region> new_region = i->second;
|
||||||
boost::shared_ptr<Playlist> playlist = region->playlist();
|
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);
|
PBD::StatefulDiffCommand* cmd = new StatefulDiffCommand (playlist);
|
||||||
_session->add_command (cmd);
|
_session->add_command (cmd);
|
||||||
|
|
|
||||||
|
|
@ -584,7 +584,7 @@ ExportRegionDialog::init_gui ()
|
||||||
void
|
void
|
||||||
ExportRegionDialog::init_components ()
|
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 ());
|
preset_selector.reset (new ExportPresetSelector ());
|
||||||
timespan_selector.reset (new ExportTimespanSelectorSingle (_session, profile_manager, loc_id));
|
timespan_selector.reset (new ExportTimespanSelectorSingle (_session, profile_manager, loc_id));
|
||||||
|
|
|
||||||
|
|
@ -765,8 +765,8 @@ MidiListEditor::redisplay_model ()
|
||||||
TreeModel::Row row;
|
TreeModel::Row row;
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
|
|
||||||
MidiModel::Notes::const_iterator i = m->note_lower_bound (region->nt_start().beats());
|
MidiModel::Notes::const_iterator i = m->note_lower_bound (region->start().beats());
|
||||||
Temporal::Beats end_time = (region->nt_start() + region->nt_length()).beats();
|
Temporal::Beats end_time = (region->start() + region->length()).beats();
|
||||||
|
|
||||||
for (; i != m->notes().end() && (*i)->time() < end_time; ++i) {
|
for (; i != m->notes().end() && (*i)->time() < end_time; ++i) {
|
||||||
row = *(model->append());
|
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());
|
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();
|
p->hide();
|
||||||
} else {
|
} else {
|
||||||
const double x = trackview.editor().time_to_pixel (region_time);
|
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
|
// 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();
|
sysex->hide();
|
||||||
} else {
|
} else {
|
||||||
sysex->show();
|
sysex->show();
|
||||||
|
|
@ -1465,7 +1465,7 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force)
|
||||||
GhostRegion*
|
GhostRegion*
|
||||||
MidiRegionView::add_ghost (TimeAxisView& tv)
|
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);
|
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&tv);
|
||||||
MidiGhostRegion* ghost;
|
MidiGhostRegion* ghost;
|
||||||
|
|
||||||
|
|
@ -1480,7 +1480,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv)
|
||||||
|
|
||||||
ghost->set_colors ();
|
ghost->set_colors ();
|
||||||
ghost->set_height ();
|
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) {
|
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
|
||||||
ghost->add_note(i->second);
|
ghost->add_note(i->second);
|
||||||
|
|
@ -1552,7 +1552,7 @@ MidiRegionView::extend_active_notes()
|
||||||
|
|
||||||
for (unsigned i = 0; i < 128; ++i) {
|
for (unsigned i = 0; i < 128; ++i) {
|
||||||
if (_active_notes[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();
|
const boost::shared_ptr<ARDOUR::MidiRegion> midi_reg = midi_region();
|
||||||
|
|
||||||
/* must compare double explicitly as Beats::operator< rounds to ppqn */
|
/* 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) &&
|
visible = (note->note() >= _current_range_min) &&
|
||||||
(note->note() <= _current_range_max);
|
(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());
|
timepos_t note_end (note->end_time());
|
||||||
|
|
||||||
if (note_end > mr->nt_start() + mr->nt_length()) {
|
if (note_end > mr->start() + mr->length()) {
|
||||||
note_end = mr->nt_start() + mr->nt_length();
|
note_end = mr->start() + mr->length();
|
||||||
}
|
}
|
||||||
|
|
||||||
x1 = std::max(1., trackview.editor().time_to_pixel (note_end)) - 1;
|
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 */
|
/* 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);
|
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();
|
timepos_t region_end = _region->nt_last();
|
||||||
|
|
||||||
if (note_end > region_end) {
|
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);
|
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) {
|
if (patch_change->item().width() < _pixel_width) {
|
||||||
// Show unless patch change is beyond the region bounds
|
// 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();
|
patch_change->hide();
|
||||||
} else {
|
} else {
|
||||||
patch_change->show();
|
patch_change->show();
|
||||||
|
|
@ -2000,7 +2000,7 @@ MidiRegionView::add_patch_change (timecnt_t const & t, Evoral::PatchChange<Tempo
|
||||||
|
|
||||||
c->add (MidiModel::PatchChangePtr (
|
c->add (MidiModel::PatchChangePtr (
|
||||||
new Evoral::PatchChange<Temporal::Beats>
|
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())));
|
patch.channel(), patch.program(), patch.bank())));
|
||||||
|
|
||||||
_model->apply_command (*trackview.session(), c);
|
_model->apply_command (*trackview.session(), c);
|
||||||
|
|
@ -2887,8 +2887,8 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
||||||
*/
|
*/
|
||||||
current_x = 0;
|
current_x = 0;
|
||||||
}
|
}
|
||||||
if (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->nt_length());
|
current_x = trackview.editor().duration_to_pixels (_region->length());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (at_front) {
|
if (at_front) {
|
||||||
|
|
@ -2917,9 +2917,9 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
||||||
|
|
||||||
/* negative beat offsets aren't allowed */
|
/* negative beat offsets aren't allowed */
|
||||||
if (snap_delta_samps > 0) {
|
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) {
|
} 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;
|
sign = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2956,7 +2956,7 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
||||||
|
|
||||||
cursor_set = true;
|
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;
|
current_x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (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->nt_length());
|
current_x = trackview.editor().duration_to_pixels (_region->length());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert snap delta from pixels to beats with sign. */
|
/* 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;
|
int sign = 1;
|
||||||
|
|
||||||
if (snap_delta_samps > 0) {
|
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) {
|
} 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;
|
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);
|
delta = Temporal::Beats::ticks (Temporal::ticks_per_beat / 128);
|
||||||
} else {
|
} else {
|
||||||
/* grab the current grid distance */
|
/* 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;
|
timecnt_t unused;
|
||||||
const timecnt_t distance = trackview.editor().get_nudge_distance (ref_point, 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 {
|
} 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",
|
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,
|
first_time,
|
||||||
last_time,
|
last_time,
|
||||||
duration, pos, _region->nt_position(),
|
duration, pos, _region->position(),
|
||||||
quarter_note));
|
quarter_note));
|
||||||
|
|
||||||
for (int n = 0; n < (int) times; ++n) {
|
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 ();
|
_region->clear_changes ();
|
||||||
/* we probably need to get the snap modifier somehow to make this correct for non-musical use */
|
/* 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));
|
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);
|
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 */
|
/* 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();
|
_ghost_note->hide();
|
||||||
hide_verbose_cursor ();
|
hide_verbose_cursor ();
|
||||||
return;
|
return;
|
||||||
|
|
@ -3895,7 +3895,7 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state)
|
||||||
_ghost_note->show();
|
_ghost_note->show();
|
||||||
|
|
||||||
/* calculate time in beats relative to start of source */
|
/* 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_time (snapped_beats);
|
||||||
_ghost_note->note()->set_length (length);
|
_ghost_note->note()->set_length (length);
|
||||||
|
|
@ -4143,7 +4143,7 @@ MidiRegionView::trim_front_starting ()
|
||||||
void
|
void
|
||||||
MidiRegionView::trim_front_ending ()
|
MidiRegionView::trim_front_ending ()
|
||||||
{
|
{
|
||||||
if (_region->nt_start().negative()) {
|
if (_region->start().negative()) {
|
||||||
/* Trim drag made start time -ve; fix this */
|
/* Trim drag made start time -ve; fix this */
|
||||||
midi_region()->fix_negative_start ();
|
midi_region()->fix_negative_start ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -476,7 +476,7 @@ MidiStreamView::setup_rec_box ()
|
||||||
|
|
||||||
timepos_t start;
|
timepos_t start;
|
||||||
if (rec_regions.size() > 0) {
|
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));
|
+ timepos_t (_trackview.track()->get_captured_samples (rec_regions.size() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -674,7 +674,7 @@ MidiStreamView::resume_updates ()
|
||||||
|
|
||||||
struct RegionPositionSorter {
|
struct RegionPositionSorter {
|
||||||
bool operator() (RegionView* a, RegionView* b) {
|
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 ();
|
list<RegionView*>::const_iterator prev = region_views.begin ();
|
||||||
|
|
||||||
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
prev = i;
|
prev = i;
|
||||||
|
|
@ -702,7 +702,7 @@ MidiStreamView::paste (timepos_t const & pos, const Selection& selection, PasteC
|
||||||
boost::shared_ptr<Region> r = (*prev)->region ();
|
boost::shared_ptr<Region> r = (*prev)->region ();
|
||||||
|
|
||||||
/* If *prev doesn't cover pos, it's no good */
|
/* 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,7 @@ RegionEditor::length_clock_changed ()
|
||||||
in_command = true;
|
in_command = true;
|
||||||
|
|
||||||
_region->clear_changes ();
|
_region->clear_changes ();
|
||||||
_region->trim_end (_region->nt_position() + len.decrement());
|
_region->trim_end (_region->position() + len.decrement());
|
||||||
_session->add_command(new StatefulDiffCommand (_region));
|
_session->add_command(new StatefulDiffCommand (_region));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -344,7 +344,7 @@ RegionEditor::length_clock_changed ()
|
||||||
PublicEditor::instance().commit_reversible_command ();
|
PublicEditor::instance().commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
length_clock.set_duration (_region->nt_length());
|
length_clock.set_duration (_region->length());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -369,15 +369,15 @@ void
|
||||||
RegionEditor::bounds_changed (const PropertyChange& what_changed)
|
RegionEditor::bounds_changed (const PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
if (what_changed.contains (ARDOUR::Properties::position) && what_changed.contains (ARDOUR::Properties::length)) {
|
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);
|
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)) {
|
} 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);
|
end_clock.set (_region->nt_last(), true);
|
||||||
} else if (what_changed.contains (ARDOUR::Properties::length)) {
|
} else if (what_changed.contains (ARDOUR::Properties::length)) {
|
||||||
end_clock.set (_region->nt_last(), true);
|
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)) {
|
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_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)) {
|
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"));
|
PublicEditor::instance().begin_reversible_command (_("change region sync point"));
|
||||||
|
|
||||||
_region->clear_changes ();
|
_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));
|
_session->add_command (new StatefulDiffCommand (_region));
|
||||||
|
|
||||||
PublicEditor::instance().commit_reversible_command ();
|
PublicEditor::instance().commit_reversible_command ();
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ using namespace ARDOUR;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
AudioRegionGainLine::AudioRegionGainLine (const string & name, AudioRegionView& r, ArdourCanvas::Container& parent, boost::shared_ptr<AutomationList> l)
|
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)
|
, rv (r)
|
||||||
{
|
{
|
||||||
// If this isn't true something is horribly wrong, and we'll get catastrophic gain values
|
// 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);
|
interesting_stuff.add (ARDOUR::Properties::position);
|
||||||
|
|
||||||
if (what_changed.contains (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)) {
|
if (what_changed.contains (interesting_stuff)) {
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ RegionSelection::add_to_layer (RegionView * rv)
|
||||||
|
|
||||||
struct RegionSortByTime {
|
struct RegionSortByTime {
|
||||||
bool operator() (const RegionView* a, const RegionView* b) const {
|
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 */
|
/* really, track and position */
|
||||||
|
|
||||||
if (a->get_time_axis_view().order() == b->get_time_axis_view().order()) {
|
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 {
|
} else {
|
||||||
return a->get_time_axis_view().order() < b->get_time_axis_view().order();
|
return a->get_time_axis_view().order() < b->get_time_axis_view().order();
|
||||||
}
|
}
|
||||||
|
|
@ -293,13 +293,13 @@ RegionSelection::start_time () const
|
||||||
return timepos_t ();
|
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) {
|
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 ();
|
return timepos_t ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -313,10 +313,10 @@ RegionSelection::end_time () const
|
||||||
return timepos_t ();
|
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) {
|
for (RegionSelection::const_iterator i = begin(); i != end(); ++i) {
|
||||||
e = max (e, (*i)->region()->nt_end ());
|
e = max (e, (*i)->region()->end ());
|
||||||
}
|
}
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ RegionView::RegionView (ArdourCanvas::Container* parent,
|
||||||
double spu,
|
double spu,
|
||||||
uint32_t basic_color,
|
uint32_t basic_color,
|
||||||
bool automation)
|
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 :
|
(automation ? TimeAxisViewItem::ShowFrame :
|
||||||
TimeAxisViewItem::Visibility ((UIConfiguration::instance().get_show_region_name() ? TimeAxisViewItem::ShowNameText : 0) |
|
TimeAxisViewItem::Visibility ((UIConfiguration::instance().get_show_region_name() ? TimeAxisViewItem::ShowNameText : 0) |
|
||||||
TimeAxisViewItem::ShowNameHighlight| TimeAxisViewItem::ShowFrame)))
|
TimeAxisViewItem::ShowNameHighlight| TimeAxisViewItem::ShowFrame)))
|
||||||
|
|
@ -157,7 +157,7 @@ RegionView::RegionView (ArdourCanvas::Container* parent,
|
||||||
uint32_t basic_color,
|
uint32_t basic_color,
|
||||||
bool recording,
|
bool recording,
|
||||||
TimeAxisViewItem::Visibility visibility)
|
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)
|
, _region (r)
|
||||||
, sync_mark(0)
|
, sync_mark(0)
|
||||||
, sync_line(0)
|
, sync_line(0)
|
||||||
|
|
@ -471,7 +471,7 @@ RegionView::region_resized (const PropertyChange& what_changed)
|
||||||
double unit_length;
|
double unit_length;
|
||||||
|
|
||||||
if (what_changed.contains (ARDOUR::Properties::position)) {
|
if (what_changed.contains (ARDOUR::Properties::position)) {
|
||||||
set_position (_region->nt_position(), 0);
|
set_position (_region->position(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyChange s_and_l;
|
PropertyChange s_and_l;
|
||||||
|
|
@ -480,7 +480,7 @@ RegionView::region_resized (const PropertyChange& what_changed)
|
||||||
|
|
||||||
if (what_changed.contains (s_and_l)) {
|
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;
|
unit_length = _region->length_samples() / samples_per_pixel;
|
||||||
|
|
||||||
|
|
@ -863,7 +863,7 @@ RegionView::region_sync_changed ()
|
||||||
|
|
||||||
} else {
|
} 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 */
|
/* no sync mark - its out of the bounds of the region */
|
||||||
|
|
||||||
|
|
@ -998,7 +998,7 @@ RegionView::update_coverage_frame (LayerDisplay d)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
timepos_t const position = _region->nt_position ();
|
timepos_t const position = _region->position ();
|
||||||
timepos_t t (position);
|
timepos_t t (position);
|
||||||
timepos_t const end = _region->nt_last ();
|
timepos_t const end = _region->nt_last ();
|
||||||
|
|
||||||
|
|
@ -1073,11 +1073,11 @@ RegionView::trim_front (timepos_t const & new_bound, bool no_overlap)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_region->nt_position() == new_bound) {
|
if (_region->position() == new_bound) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
timepos_t const pos = _region->nt_position();
|
timepos_t const pos = _region->position();
|
||||||
|
|
||||||
_region->trim_front (new_bound);
|
_region->trim_front (new_bound);
|
||||||
|
|
||||||
|
|
@ -1088,19 +1088,19 @@ RegionView::trim_front (timepos_t const & new_bound, bool no_overlap)
|
||||||
|
|
||||||
bool regions_touching = false;
|
bool regions_touching = false;
|
||||||
|
|
||||||
if (region_left != 0 && (pos == region_left->nt_end())) {
|
if (region_left != 0 && (pos == region_left->end())) {
|
||||||
regions_touching = true;
|
regions_touching = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only trim region on the left if the first sample has gone beyond the left region's last sample. */
|
/* 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)) {
|
if (region_left != 0 && (region_left->nt_last() > _region->position() || regions_touching)) {
|
||||||
region_left->trim_end (_region->nt_position().decrement());
|
region_left->trim_end (_region->position().decrement());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
region_changed (ARDOUR::bounds_change);
|
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
|
bool
|
||||||
|
|
@ -1121,13 +1121,13 @@ RegionView::trim_end (timepos_t const & new_bound, bool no_overlap)
|
||||||
|
|
||||||
bool regions_touching = false;
|
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;
|
regions_touching = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only trim region on the right if the last sample has gone beyond the right region's first sample. */
|
/* 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)) {
|
if (region_right != 0 && (region_right->position() < _region->nt_last() || regions_touching)) {
|
||||||
region_right->trim_front (_region->nt_end());
|
region_right->trim_front (_region->end());
|
||||||
}
|
}
|
||||||
|
|
||||||
region_changed (ARDOUR::bounds_change);
|
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();
|
PublicEditor& editor = trackview.editor();
|
||||||
/* x is region relative, convert it to global absolute time */
|
/* 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 */
|
/* try a snap in either direction */
|
||||||
timepos_t snapped = session_pos;
|
timepos_t snapped = session_pos;
|
||||||
editor.snap_to (snapped, Temporal::RoundNearest, SnapToAny_Visual, ensure_snap);
|
editor.snap_to (snapped, Temporal::RoundNearest, SnapToAny_Visual, ensure_snap);
|
||||||
|
|
||||||
/* if we went off the beginning of the region, snap forwards */
|
/* if we went off the beginning of the region, snap forwards */
|
||||||
if (snapped < _region->nt_position ()) {
|
if (snapped < _region->position ()) {
|
||||||
snapped = session_pos;
|
snapped = session_pos;
|
||||||
editor.snap_to (snapped, Temporal::RoundUpAlways, SnapToAny_Visual, ensure_snap);
|
editor.snap_to (snapped, Temporal::RoundUpAlways, SnapToAny_Visual, ensure_snap);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ public:
|
||||||
|
|
||||||
struct PositionOrder {
|
struct PositionOrder {
|
||||||
bool operator()(const RegionView* a, const RegionView* b) {
|
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);
|
assert (step_edit_region_view);
|
||||||
|
|
||||||
const timepos_t ep = _editor.get_preferred_edit_position();
|
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) {
|
if (distance_from_start < 0) {
|
||||||
/* this can happen with snap enabled, and the edit point == Playhead. we snap the
|
/* 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;
|
return;
|
||||||
}
|
}
|
||||||
if (beats > 0.0) {
|
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) {
|
} else if (beats < 0.0) {
|
||||||
if (-beats < step_edit_beat_pos) {
|
if (-beats < step_edit_beat_pos) {
|
||||||
step_edit_beat_pos += beats; // its negative, remember
|
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);
|
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
|
#warning NUTEMPO FIXME need way to get bbt from timepos_t
|
||||||
//fpos = fpos.bbt().round_up_to_bar ();
|
//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);
|
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.
|
top-layered region after the start of the region we are recording and make a note of it.
|
||||||
*/
|
*/
|
||||||
if (_layer_display == Stacked) {
|
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 {
|
} else {
|
||||||
_new_rec_layer_time = max_samplepos;
|
_new_rec_layer_time = max_samplepos;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ StripSilenceDialog::StripSilenceDialog (Session* s, list<RegionView*> const & v)
|
||||||
views.push_back (ViewInterval (*r));
|
views.push_back (ViewInterval (*r));
|
||||||
}
|
}
|
||||||
|
|
||||||
_minimum_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()->nt_position());
|
_fade_length->set_is_duration (true, views.front().view->region()->position());
|
||||||
|
|
||||||
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox);
|
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox);
|
||||||
|
|
||||||
|
|
@ -345,13 +345,13 @@ StripSilenceDialog::threshold_changed ()
|
||||||
samplecnt_t
|
samplecnt_t
|
||||||
StripSilenceDialog::minimum_length () const
|
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
|
samplecnt_t
|
||||||
StripSilenceDialog::fade_length () const
|
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
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue