mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
remove all notion of per-track speed
This commit is contained in:
parent
871904b648
commit
f6489b0b10
19 changed files with 69 additions and 348 deletions
|
|
@ -4758,8 +4758,7 @@ Editor::get_regions_at (RegionSelection& rs, framepos_t where, const TrackViewLi
|
||||||
|
|
||||||
if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
|
if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
|
||||||
|
|
||||||
boost::shared_ptr<RegionList> regions = pl->regions_at (
|
boost::shared_ptr<RegionList> regions = pl->regions_at (where);
|
||||||
(framepos_t) floor ( (double) where * tr->speed()));
|
|
||||||
|
|
||||||
for (RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
|
for (RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
|
||||||
RegionView* rv = rtv->view()->find_view (*i);
|
RegionView* rv = rtv->view()->find_view (*i);
|
||||||
|
|
@ -4791,8 +4790,7 @@ Editor::get_regions_after (RegionSelection& rs, framepos_t where, const TrackVie
|
||||||
|
|
||||||
if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
|
if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
|
||||||
|
|
||||||
boost::shared_ptr<RegionList> regions = pl->regions_touched (
|
boost::shared_ptr<RegionList> regions = pl->regions_touched (where, max_framepos);
|
||||||
(framepos_t) floor ( (double)where * tr->speed()), max_framepos);
|
|
||||||
|
|
||||||
for (RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
|
for (RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1426,14 +1426,7 @@ RegionMoveDrag::RegionMoveDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p,
|
||||||
_copy (c)
|
_copy (c)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Drags, "New RegionMoveDrag\n");
|
DEBUG_TRACE (DEBUG::Drags, "New RegionMoveDrag\n");
|
||||||
|
_last_frame_position = _primary->region()->position();
|
||||||
double speed = 1;
|
|
||||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (&_primary->get_time_axis_view ());
|
|
||||||
if (rtv && rtv->is_track()) {
|
|
||||||
speed = rtv->track()->speed ();
|
|
||||||
}
|
|
||||||
|
|
||||||
_last_frame_position = static_cast<framepos_t> (_primary->region()->position() / speed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2196,17 +2189,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*)
|
||||||
{
|
{
|
||||||
double speed = 1.0;
|
framepos_t const region_start = _primary->region()->position();
|
||||||
TimeAxisView* tvp = &_primary->get_time_axis_view ();
|
framepos_t const region_end = _primary->region()->last_frame();
|
||||||
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
|
framecnt_t const region_length = _primary->region()->length();
|
||||||
|
|
||||||
if (tv && tv->is_track()) {
|
|
||||||
speed = tv->track()->speed();
|
|
||||||
}
|
|
||||||
|
|
||||||
framepos_t const region_start = (framepos_t) (_primary->region()->position() / speed);
|
|
||||||
framepos_t const region_end = (framepos_t) (_primary->region()->last_frame() / speed);
|
|
||||||
framecnt_t const region_length = (framecnt_t) (_primary->region()->length() / speed);
|
|
||||||
|
|
||||||
framepos_t const pf = adjusted_current_frame (event);
|
framepos_t const pf = adjusted_current_frame (event);
|
||||||
|
|
||||||
|
|
@ -2264,17 +2249,9 @@ void
|
||||||
TrimDrag::motion (GdkEvent* event, bool first_move)
|
TrimDrag::motion (GdkEvent* event, bool first_move)
|
||||||
{
|
{
|
||||||
RegionView* rv = _primary;
|
RegionView* rv = _primary;
|
||||||
|
|
||||||
double speed = 1.0;
|
|
||||||
TimeAxisView* tvp = &_primary->get_time_axis_view ();
|
|
||||||
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
|
|
||||||
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
|
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
|
||||||
frameoffset_t frame_delta = 0;
|
frameoffset_t frame_delta = 0;
|
||||||
|
|
||||||
if (tv && tv->is_track()) {
|
|
||||||
speed = tv->track()->speed();
|
|
||||||
}
|
|
||||||
|
|
||||||
framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame () + _pointer_frame_offset;
|
framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame () + _pointer_frame_offset;
|
||||||
|
|
||||||
if (first_move) {
|
if (first_move) {
|
||||||
|
|
@ -2404,10 +2381,10 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
||||||
|
|
||||||
switch (_operation) {
|
switch (_operation) {
|
||||||
case StartTrim:
|
case StartTrim:
|
||||||
show_verbose_cursor_time ((framepos_t) (rv->region()->position() / speed));
|
show_verbose_cursor_time (rv->region()->position());
|
||||||
break;
|
break;
|
||||||
case EndTrim:
|
case EndTrim:
|
||||||
show_verbose_cursor_time ((framepos_t) (rv->region()->last_frame() / speed));
|
show_verbose_cursor_time (rv->region()->last_frame());
|
||||||
break;
|
break;
|
||||||
case ContentsTrim:
|
case ContentsTrim:
|
||||||
// show_verbose_cursor_time (frame_delta);
|
// show_verbose_cursor_time (frame_delta);
|
||||||
|
|
|
||||||
|
|
@ -1991,28 +1991,21 @@ Editor::region_view_item_click (AudioRegionView& rv, GdkEventButton* event)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (Keyboard::modifier_state_contains (event->state, Keyboard::PrimaryModifier)) {
|
if (Keyboard::modifier_state_contains (event->state, Keyboard::PrimaryModifier)) {
|
||||||
TimeAxisView* tv = &rv.get_time_axis_view();
|
|
||||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tv);
|
|
||||||
double speed = 1.0;
|
|
||||||
if (rtv && rtv->is_track()) {
|
|
||||||
speed = rtv->track()->speed();
|
|
||||||
}
|
|
||||||
|
|
||||||
framepos_t where = get_preferred_edit_position();
|
framepos_t where = get_preferred_edit_position();
|
||||||
|
|
||||||
if (where >= 0) {
|
if (where >= 0) {
|
||||||
|
|
||||||
if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
|
if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
|
||||||
|
|
||||||
align_region (rv.region(), SyncPoint, (framepos_t) (where * speed));
|
align_region (rv.region(), SyncPoint, where);
|
||||||
|
|
||||||
} else if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
|
} else if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
|
||||||
|
|
||||||
align_region (rv.region(), End, (framepos_t) (where * speed));
|
align_region (rv.region(), End, where);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
align_region (rv.region(), Start, (framepos_t) (where * speed));
|
align_region (rv.region(), Start, where);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2188,11 +2181,10 @@ Editor::mouse_brush_insert_region (RegionView* rv, framepos_t pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<Playlist> playlist = rtv->playlist();
|
boost::shared_ptr<Playlist> playlist = rtv->playlist();
|
||||||
double speed = rtv->track()->speed();
|
|
||||||
|
|
||||||
playlist->clear_changes ();
|
playlist->clear_changes ();
|
||||||
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region(), true));
|
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region(), true));
|
||||||
playlist->add_region (new_region, (framepos_t) (pos * speed));
|
playlist->add_region (new_region, pos);
|
||||||
_session->add_command (new StatefulDiffCommand (playlist));
|
_session->add_command (new StatefulDiffCommand (playlist));
|
||||||
|
|
||||||
// playlist is frozen, so we have to update manually XXX this is disgusting
|
// playlist is frozen, so we have to update manually XXX this is disgusting
|
||||||
|
|
|
||||||
|
|
@ -737,17 +737,6 @@ Editor::build_region_boundary_cache ()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float speed = 1.0f;
|
|
||||||
RouteTimeAxisView *rtav;
|
|
||||||
|
|
||||||
if (ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0 ) {
|
|
||||||
if (rtav->track() != 0) {
|
|
||||||
speed = rtav->track()->speed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rpos = track_frame_to_session_frame (rpos, speed);
|
|
||||||
|
|
||||||
if (rpos < lpos) {
|
if (rpos < lpos) {
|
||||||
lpos = rpos;
|
lpos = rpos;
|
||||||
}
|
}
|
||||||
|
|
@ -785,24 +774,12 @@ Editor::find_next_region (framepos_t frame, RegionPoint point, int32_t dir, Trac
|
||||||
boost::shared_ptr<Region> ret;
|
boost::shared_ptr<Region> ret;
|
||||||
framepos_t rpos = 0;
|
framepos_t rpos = 0;
|
||||||
|
|
||||||
float track_speed;
|
|
||||||
framepos_t track_frame;
|
|
||||||
RouteTimeAxisView *rtav;
|
|
||||||
|
|
||||||
for (i = tracks.begin(); i != tracks.end(); ++i) {
|
for (i = tracks.begin(); i != tracks.end(); ++i) {
|
||||||
|
|
||||||
framecnt_t distance;
|
framecnt_t distance;
|
||||||
boost::shared_ptr<Region> r;
|
boost::shared_ptr<Region> r;
|
||||||
|
|
||||||
track_speed = 1.0f;
|
if ((r = (*i)->find_next_region (frame, point, dir)) == 0) {
|
||||||
if ( (rtav = dynamic_cast<RouteTimeAxisView*>(*i)) != 0 ) {
|
|
||||||
if (rtav->track()!=0)
|
|
||||||
track_speed = rtav->track()->speed();
|
|
||||||
}
|
|
||||||
|
|
||||||
track_frame = session_frame_to_track_frame(frame, track_speed);
|
|
||||||
|
|
||||||
if ((r = (*i)->find_next_region (track_frame, point, dir)) == 0) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -820,9 +797,6 @@ Editor::find_next_region (framepos_t frame, RegionPoint point, int32_t dir, Trac
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// rpos is a "track frame", converting it to "_session frame"
|
|
||||||
rpos = track_frame_to_session_frame(rpos, track_speed);
|
|
||||||
|
|
||||||
if (rpos > frame) {
|
if (rpos > frame) {
|
||||||
distance = rpos - frame;
|
distance = rpos - frame;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -990,17 +964,6 @@ Editor::cursor_to_region_point (EditorCursor* cursor, RegionPoint point, int32_t
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float speed = 1.0f;
|
|
||||||
RouteTimeAxisView *rtav;
|
|
||||||
|
|
||||||
if ( ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0 ) {
|
|
||||||
if (rtav->track() != 0) {
|
|
||||||
speed = rtav->track()->speed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pos = track_frame_to_session_frame(pos, speed);
|
|
||||||
|
|
||||||
if (cursor == playhead_cursor) {
|
if (cursor == playhead_cursor) {
|
||||||
_session->request_locate (pos);
|
_session->request_locate (pos);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1181,17 +1144,6 @@ Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float speed = 1.0f;
|
|
||||||
RouteTimeAxisView *rtav;
|
|
||||||
|
|
||||||
if (ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0) {
|
|
||||||
if (rtav->track() != 0) {
|
|
||||||
speed = rtav->track()->speed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pos = track_frame_to_session_frame(pos, speed);
|
|
||||||
|
|
||||||
loc->move_to (pos);
|
loc->move_to (pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2866,9 +2818,6 @@ Editor::separate_regions_between (const TimeSelection& ts)
|
||||||
|
|
||||||
/* XXX need to consider musical time selections here at some point */
|
/* XXX need to consider musical time selections here at some point */
|
||||||
|
|
||||||
double speed = rtv->track()->speed();
|
|
||||||
|
|
||||||
|
|
||||||
for (list<AudioRange>::const_iterator t = ts.begin(); t != ts.end(); ++t) {
|
for (list<AudioRange>::const_iterator t = ts.begin(); t != ts.end(); ++t) {
|
||||||
|
|
||||||
sigc::connection c = rtv->view()->RegionViewAdded.connect (
|
sigc::connection c = rtv->view()->RegionViewAdded.connect (
|
||||||
|
|
@ -2876,8 +2825,7 @@ Editor::separate_regions_between (const TimeSelection& ts)
|
||||||
|
|
||||||
latest_regionviews.clear ();
|
latest_regionviews.clear ();
|
||||||
|
|
||||||
playlist->partition ((framepos_t)((*t).start * speed),
|
playlist->partition ((*t).start, (*t).end, false);
|
||||||
(framepos_t)((*t).end * speed), false);
|
|
||||||
|
|
||||||
c.disconnect ();
|
c.disconnect ();
|
||||||
|
|
||||||
|
|
@ -3551,19 +3499,8 @@ Editor::trim_region_to_location (const Location& loc, const char* str)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float speed = 1.0;
|
|
||||||
framepos_t start;
|
|
||||||
framepos_t end;
|
|
||||||
|
|
||||||
if (tav->track() != 0) {
|
|
||||||
speed = tav->track()->speed();
|
|
||||||
}
|
|
||||||
|
|
||||||
start = session_frame_to_track_frame (loc.start(), speed);
|
|
||||||
end = session_frame_to_track_frame (loc.end(), speed);
|
|
||||||
|
|
||||||
rv->region()->clear_changes ();
|
rv->region()->clear_changes ();
|
||||||
rv->region()->trim_to (start, (end - start));
|
rv->region()->trim_to (loc.start(), (loc.end() - loc.start()));
|
||||||
_session->add_command(new StatefulDiffCommand (rv->region()));
|
_session->add_command(new StatefulDiffCommand (rv->region()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3605,13 +3542,6 @@ Editor::trim_to_region(bool forward)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float speed = 1.0;
|
|
||||||
|
|
||||||
if (atav->track() != 0) {
|
|
||||||
speed = atav->track()->speed();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
boost::shared_ptr<Region> region = arv->region();
|
boost::shared_ptr<Region> region = arv->region();
|
||||||
boost::shared_ptr<Playlist> playlist (region->playlist());
|
boost::shared_ptr<Playlist> playlist (region->playlist());
|
||||||
|
|
||||||
|
|
@ -3625,18 +3555,18 @@ Editor::trim_to_region(bool forward)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
region->trim_end((framepos_t) ( (next_region->first_frame() - 1) * speed));
|
region->trim_end (next_region->first_frame() - 1);
|
||||||
arv->region_changed (PropertyChange (ARDOUR::Properties::length));
|
arv->region_changed (PropertyChange (ARDOUR::Properties::length));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
next_region = playlist->find_next_region (region->first_frame(), Start, 0);
|
next_region = playlist->find_next_region (region->first_frame(), Start, 0);
|
||||||
|
|
||||||
if(!next_region){
|
if (!next_region){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
region->trim_front((framepos_t) ((next_region->last_frame() + 1) * speed));
|
region->trim_front(next_region->last_frame() + 1);
|
||||||
|
|
||||||
arv->region_changed (ARDOUR::bounds_change);
|
arv->region_changed (ARDOUR::bounds_change);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -847,12 +847,9 @@ RegionView::trim_front (framepos_t new_bound, bool no_overlap)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
|
|
||||||
double const speed = rtv.track()->speed ();
|
|
||||||
|
|
||||||
framepos_t const pre_trim_first_frame = _region->first_frame();
|
framepos_t const pre_trim_first_frame = _region->first_frame();
|
||||||
|
|
||||||
_region->trim_front ((framepos_t) (new_bound * speed));
|
_region->trim_front (new_bound);
|
||||||
|
|
||||||
if (no_overlap) {
|
if (no_overlap) {
|
||||||
// Get the next region on the left of this region and shrink/expand it.
|
// Get the next region on the left of this region and shrink/expand it.
|
||||||
|
|
@ -883,12 +880,9 @@ RegionView::trim_end (framepos_t new_bound, bool no_overlap)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
|
|
||||||
double const speed = rtv.track()->speed ();
|
|
||||||
|
|
||||||
framepos_t const pre_trim_last_frame = _region->last_frame();
|
framepos_t const pre_trim_last_frame = _region->last_frame();
|
||||||
|
|
||||||
_region->trim_end ((framepos_t) (new_bound * speed));
|
_region->trim_end (new_bound);
|
||||||
|
|
||||||
if (no_overlap) {
|
if (no_overlap) {
|
||||||
// Get the next region on the right of this region and shrink/expand it.
|
// Get the next region on the right of this region and shrink/expand it.
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,6 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
|
||||||
}
|
}
|
||||||
|
|
||||||
track()->FreezeChange.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::map_frozen, this), gui_context());
|
track()->FreezeChange.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::map_frozen, this), gui_context());
|
||||||
track()->SpeedChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::speed_changed, this), gui_context());
|
|
||||||
|
|
||||||
/* pick up the correct freeze state */
|
/* pick up the correct freeze state */
|
||||||
map_frozen ();
|
map_frozen ();
|
||||||
|
|
@ -1047,17 +1046,11 @@ RouteTimeAxisView::reset_samples_per_pixel ()
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::set_samples_per_pixel (double fpp)
|
RouteTimeAxisView::set_samples_per_pixel (double fpp)
|
||||||
{
|
{
|
||||||
double speed = 1.0;
|
|
||||||
|
|
||||||
if (track()) {
|
|
||||||
speed = track()->speed();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_view) {
|
if (_view) {
|
||||||
_view->set_samples_per_pixel (fpp * speed);
|
_view->set_samples_per_pixel (fpp);
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeAxisView::set_samples_per_pixel (fpp * speed);
|
TimeAxisView::set_samples_per_pixel (fpp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1272,12 +1265,6 @@ RouteTimeAxisView::clear_playlist ()
|
||||||
_editor.clear_playlist (pl);
|
_editor.clear_playlist (pl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
RouteTimeAxisView::speed_changed ()
|
|
||||||
{
|
|
||||||
Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&RouteTimeAxisView::reset_samples_per_pixel, this));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::update_diskstream_display ()
|
RouteTimeAxisView::update_diskstream_display ()
|
||||||
{
|
{
|
||||||
|
|
@ -1353,24 +1340,15 @@ RouteTimeAxisView::set_selected_regionviews (RegionSelection& regions)
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results, bool within)
|
RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results, bool within)
|
||||||
{
|
{
|
||||||
double speed = 1.0;
|
|
||||||
|
|
||||||
if (track() != 0) {
|
|
||||||
speed = track()->speed();
|
|
||||||
}
|
|
||||||
|
|
||||||
framepos_t const start_adjusted = session_frame_to_track_frame(start, speed);
|
|
||||||
framepos_t const end_adjusted = session_frame_to_track_frame(end, speed);
|
|
||||||
|
|
||||||
if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) {
|
if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) {
|
||||||
_view->get_selectables (start_adjusted, end_adjusted, top, bot, results, within);
|
_view->get_selectables (start, end, top, bot, results, within);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pick up visible automation tracks */
|
/* pick up visible automation tracks */
|
||||||
|
|
||||||
for (Children::iterator i = children.begin(); i != children.end(); ++i) {
|
for (Children::iterator i = children.begin(); i != children.end(); ++i) {
|
||||||
if (!(*i)->hidden()) {
|
if (!(*i)->hidden()) {
|
||||||
(*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results, within);
|
(*i)->get_selectables (start, end, top, bot, results, within);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1482,19 +1460,10 @@ RouteTimeAxisView::fade_range (TimeSelection& selection)
|
||||||
|
|
||||||
playlist = tr->playlist();
|
playlist = tr->playlist();
|
||||||
|
|
||||||
TimeSelection time (selection);
|
|
||||||
float const speed = tr->speed();
|
|
||||||
if (speed != 1.0f) {
|
|
||||||
for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
|
|
||||||
(*i).start = session_frame_to_track_frame((*i).start, speed);
|
|
||||||
(*i).end = session_frame_to_track_frame((*i).end, speed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
playlist->clear_changes ();
|
playlist->clear_changes ();
|
||||||
playlist->clear_owned_changes ();
|
playlist->clear_owned_changes ();
|
||||||
|
|
||||||
playlist->fade_range (time);
|
playlist->fade_range (selection);
|
||||||
|
|
||||||
vector<Command*> cmds;
|
vector<Command*> cmds;
|
||||||
playlist->rdiff (cmds);
|
playlist->rdiff (cmds);
|
||||||
|
|
@ -1517,23 +1486,14 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
|
||||||
|
|
||||||
playlist = tr->playlist();
|
playlist = tr->playlist();
|
||||||
|
|
||||||
TimeSelection time (selection.time);
|
|
||||||
float const speed = tr->speed();
|
|
||||||
if (speed != 1.0f) {
|
|
||||||
for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
|
|
||||||
(*i).start = session_frame_to_track_frame((*i).start, speed);
|
|
||||||
(*i).end = session_frame_to_track_frame((*i).end, speed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
playlist->clear_changes ();
|
playlist->clear_changes ();
|
||||||
playlist->clear_owned_changes ();
|
playlist->clear_owned_changes ();
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case Delete:
|
case Delete:
|
||||||
if (playlist->cut (time) != 0) {
|
if (playlist->cut (selection.time) != 0) {
|
||||||
if (Config->get_edit_mode() == Ripple)
|
if (Config->get_edit_mode() == Ripple)
|
||||||
playlist->ripple(time.start(), -time.length(), NULL);
|
playlist->ripple(selection.time.start(), -selection.time.length(), NULL);
|
||||||
// no need to exclude any regions from rippling here
|
// no need to exclude any regions from rippling here
|
||||||
|
|
||||||
vector<Command*> cmds;
|
vector<Command*> cmds;
|
||||||
|
|
@ -1545,10 +1505,10 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Cut:
|
case Cut:
|
||||||
if ((what_we_got = playlist->cut (time)) != 0) {
|
if ((what_we_got = playlist->cut (selection.time)) != 0) {
|
||||||
_editor.get_cut_buffer().add (what_we_got);
|
_editor.get_cut_buffer().add (what_we_got);
|
||||||
if (Config->get_edit_mode() == Ripple)
|
if (Config->get_edit_mode() == Ripple)
|
||||||
playlist->ripple(time.start(), -time.length(), NULL);
|
playlist->ripple(selection.time.start(), -selection.time.length(), NULL);
|
||||||
// no need to exclude any regions from rippling here
|
// no need to exclude any regions from rippling here
|
||||||
|
|
||||||
vector<Command*> cmds;
|
vector<Command*> cmds;
|
||||||
|
|
@ -1559,15 +1519,15 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Copy:
|
case Copy:
|
||||||
if ((what_we_got = playlist->copy (time)) != 0) {
|
if ((what_we_got = playlist->copy (selection.time)) != 0) {
|
||||||
_editor.get_cut_buffer().add (what_we_got);
|
_editor.get_cut_buffer().add (what_we_got);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Clear:
|
case Clear:
|
||||||
if ((what_we_got = playlist->cut (time)) != 0) {
|
if ((what_we_got = playlist->cut (selection.time)) != 0) {
|
||||||
if (Config->get_edit_mode() == Ripple)
|
if (Config->get_edit_mode() == Ripple)
|
||||||
playlist->ripple(time.start(), -time.length(), NULL);
|
playlist->ripple(selection.time.start(), -selection.time.length(), NULL);
|
||||||
// no need to exclude any regions from rippling here
|
// no need to exclude any regions from rippling here
|
||||||
|
|
||||||
vector<Command*> cmds;
|
vector<Command*> cmds;
|
||||||
|
|
@ -1598,11 +1558,6 @@ RouteTimeAxisView::paste (framepos_t pos, const Selection& selection, PasteConte
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("paste to %1\n", pos));
|
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("paste to %1\n", pos));
|
||||||
|
|
||||||
if (track()->speed() != 1.0f) {
|
|
||||||
pos = session_frame_to_track_frame (pos, track()->speed());
|
|
||||||
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("modified paste to %1\n", pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add multi-paste offset if applicable */
|
/* add multi-paste offset if applicable */
|
||||||
std::pair<framepos_t, framepos_t> extent = (*p)->get_extent();
|
std::pair<framepos_t, framepos_t> extent = (*p)->get_extent();
|
||||||
const framecnt_t duration = extent.second - extent.first;
|
const framecnt_t duration = extent.second - extent.first;
|
||||||
|
|
|
||||||
|
|
@ -114,8 +114,6 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream
|
||||||
bool hidden() const { return _flags & Hidden; }
|
bool hidden() const { return _flags & Hidden; }
|
||||||
bool recordable() const { return _flags & Recordable; }
|
bool recordable() const { return _flags & Recordable; }
|
||||||
bool non_layered() const { return _flags & NonLayered; }
|
bool non_layered() const { return _flags & NonLayered; }
|
||||||
bool reversed() const { return _actual_speed < 0.0f; }
|
|
||||||
double speed() const { return _visible_speed; }
|
|
||||||
|
|
||||||
virtual void punch_in() {}
|
virtual void punch_in() {}
|
||||||
virtual void punch_out() {}
|
virtual void punch_out() {}
|
||||||
|
|
@ -176,7 +174,6 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream
|
||||||
}
|
}
|
||||||
|
|
||||||
PBD::Signal0<void> RecordEnableChanged;
|
PBD::Signal0<void> RecordEnableChanged;
|
||||||
PBD::Signal0<void> SpeedChanged;
|
|
||||||
PBD::Signal0<void> ReverseChanged;
|
PBD::Signal0<void> ReverseChanged;
|
||||||
/* Emitted when this diskstream is set to use a different playlist */
|
/* Emitted when this diskstream is set to use a different playlist */
|
||||||
PBD::Signal0<void> PlaylistChanged;
|
PBD::Signal0<void> PlaylistChanged;
|
||||||
|
|
@ -248,7 +245,7 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream
|
||||||
|
|
||||||
virtual void allocate_temporary_buffers () = 0;
|
virtual void allocate_temporary_buffers () = 0;
|
||||||
|
|
||||||
virtual bool realtime_set_speed (double, bool global_change);
|
virtual bool realtime_set_speed (double);
|
||||||
|
|
||||||
std::list<boost::shared_ptr<Source> > _last_capture_sources;
|
std::list<boost::shared_ptr<Source> > _last_capture_sources;
|
||||||
|
|
||||||
|
|
@ -287,8 +284,6 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream
|
||||||
boost::shared_ptr<Playlist> _playlist;
|
boost::shared_ptr<Playlist> _playlist;
|
||||||
|
|
||||||
mutable gint _record_enabled;
|
mutable gint _record_enabled;
|
||||||
double _visible_speed;
|
|
||||||
double _actual_speed;
|
|
||||||
/* items needed for speed change logic */
|
/* items needed for speed change logic */
|
||||||
bool _buffer_reallocation_required;
|
bool _buffer_reallocation_required;
|
||||||
bool _seek_required;
|
bool _seek_required;
|
||||||
|
|
@ -317,9 +312,7 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream
|
||||||
IOChange input_change_pending;
|
IOChange input_change_pending;
|
||||||
framecnt_t wrap_buffer_size;
|
framecnt_t wrap_buffer_size;
|
||||||
framecnt_t speed_buffer_size;
|
framecnt_t speed_buffer_size;
|
||||||
|
bool _reversed;
|
||||||
double _speed;
|
|
||||||
double _target_speed;
|
|
||||||
|
|
||||||
/** The next frame position that we should be reading from in our playlist */
|
/** The next frame position that we should be reading from in our playlist */
|
||||||
framepos_t file_frame;
|
framepos_t file_frame;
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,9 @@ public:
|
||||||
virtual framecnt_t get_captured_frames (uint32_t n = 0) const = 0;
|
virtual framecnt_t get_captured_frames (uint32_t n = 0) const = 0;
|
||||||
virtual int set_loop (Location *) = 0;
|
virtual int set_loop (Location *) = 0;
|
||||||
virtual void transport_looped (framepos_t) = 0;
|
virtual void transport_looped (framepos_t) = 0;
|
||||||
virtual bool realtime_set_speed (double, bool) = 0;
|
virtual bool realtime_set_speed (double) = 0;
|
||||||
virtual void transport_stopped_wallclock (struct tm &, time_t, bool) = 0;
|
virtual void transport_stopped_wallclock (struct tm &, time_t, bool) = 0;
|
||||||
virtual bool pending_overwrite () const = 0;
|
virtual bool pending_overwrite () const = 0;
|
||||||
virtual double speed () const = 0;
|
|
||||||
virtual void prepare_to_stop (framepos_t,framepos_t) = 0;
|
virtual void prepare_to_stop (framepos_t,framepos_t) = 0;
|
||||||
virtual void set_slaved (bool) = 0;
|
virtual void set_slaved (bool) = 0;
|
||||||
virtual ChanCount n_channels () = 0;
|
virtual ChanCount n_channels () = 0;
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,6 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
|
||||||
void request_overwrite_buffer (Track *);
|
void request_overwrite_buffer (Track *);
|
||||||
void adjust_playback_buffering();
|
void adjust_playback_buffering();
|
||||||
void adjust_capture_buffering();
|
void adjust_capture_buffering();
|
||||||
void request_track_speed (Track *, double speed);
|
|
||||||
void request_input_change_handling ();
|
void request_input_change_handling ();
|
||||||
|
|
||||||
bool locate_pending() const { return static_cast<bool>(post_transport_work()&PostTransportLocate); }
|
bool locate_pending() const { return static_cast<bool>(post_transport_work()&PostTransportLocate); }
|
||||||
|
|
@ -1339,7 +1338,6 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
|
||||||
void locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false, bool with_mmc=true);
|
void locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false, bool with_mmc=true);
|
||||||
void start_locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false);
|
void start_locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false);
|
||||||
void force_locate (framepos_t frame, bool with_roll = false);
|
void force_locate (framepos_t frame, bool with_roll = false);
|
||||||
void set_track_speed (Track *, double speed);
|
|
||||||
void set_transport_speed (double speed, framepos_t destination_frame, bool abort = false, bool clear_state = false, bool as_default = false);
|
void set_transport_speed (double speed, framepos_t destination_frame, bool abort = false, bool clear_state = false, bool as_default = false);
|
||||||
void stop_transport (bool abort = false, bool clear_state = false);
|
void stop_transport (bool abort = false, bool clear_state = false);
|
||||||
void start_transport ();
|
void start_transport ();
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ class LIBARDOUR_API SessionEvent {
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
SetTransportSpeed,
|
SetTransportSpeed,
|
||||||
SetTrackSpeed,
|
|
||||||
Locate,
|
Locate,
|
||||||
LocateRoll,
|
LocateRoll,
|
||||||
LocateRollLocate,
|
LocateRollLocate,
|
||||||
|
|
|
||||||
|
|
@ -139,10 +139,9 @@ class LIBARDOUR_API Track : public Route, public PublicDiskstream
|
||||||
framecnt_t get_captured_frames (uint32_t n = 0) const;
|
framecnt_t get_captured_frames (uint32_t n = 0) const;
|
||||||
int set_loop (Location *);
|
int set_loop (Location *);
|
||||||
void transport_looped (framepos_t);
|
void transport_looped (framepos_t);
|
||||||
bool realtime_set_speed (double, bool);
|
bool realtime_set_speed (double);
|
||||||
void transport_stopped_wallclock (struct tm &, time_t, bool);
|
void transport_stopped_wallclock (struct tm &, time_t, bool);
|
||||||
bool pending_overwrite () const;
|
bool pending_overwrite () const;
|
||||||
double speed () const;
|
|
||||||
void prepare_to_stop (framepos_t, framepos_t);
|
void prepare_to_stop (framepos_t, framepos_t);
|
||||||
void set_slaved (bool);
|
void set_slaved (bool);
|
||||||
ChanCount n_channels ();
|
ChanCount n_channels ();
|
||||||
|
|
@ -165,7 +164,6 @@ class LIBARDOUR_API Track : public Route, public PublicDiskstream
|
||||||
/* Emitted when our diskstream is set to use a different playlist */
|
/* Emitted when our diskstream is set to use a different playlist */
|
||||||
PBD::Signal0<void> PlaylistChanged;
|
PBD::Signal0<void> PlaylistChanged;
|
||||||
PBD::Signal0<void> RecordEnableChanged;
|
PBD::Signal0<void> RecordEnableChanged;
|
||||||
PBD::Signal0<void> SpeedChanged;
|
|
||||||
PBD::Signal0<void> AlignmentStyleChanged;
|
PBD::Signal0<void> AlignmentStyleChanged;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -227,7 +225,6 @@ private:
|
||||||
|
|
||||||
void diskstream_playlist_changed ();
|
void diskstream_playlist_changed ();
|
||||||
void diskstream_record_enable_changed ();
|
void diskstream_record_enable_changed ();
|
||||||
void diskstream_speed_changed ();
|
|
||||||
void diskstream_alignment_style_changed ();
|
void diskstream_alignment_style_changed ();
|
||||||
void parameter_changed (std::string const & p);
|
void parameter_changed (std::string const & p);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -670,19 +670,6 @@ LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformSh
|
||||||
LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::VUMeterStandard& sf);
|
LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::VUMeterStandard& sf);
|
||||||
LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::MeterLineUp& sf);
|
LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::MeterLineUp& sf);
|
||||||
|
|
||||||
|
|
||||||
static inline ARDOUR::framepos_t
|
|
||||||
session_frame_to_track_frame (ARDOUR::framepos_t session_frame, double speed)
|
|
||||||
{
|
|
||||||
return (ARDOUR::framepos_t) ((long double) session_frame * (long double) speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ARDOUR::framepos_t
|
|
||||||
track_frame_to_session_frame (ARDOUR::framepos_t track_frame, double speed)
|
|
||||||
{
|
|
||||||
return (ARDOUR::framepos_t) ((long double) track_frame / (long double) speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* for now, break the rules and use "using" to make this "global" */
|
/* for now, break the rules and use "using" to make this "global" */
|
||||||
|
|
||||||
using ARDOUR::framepos_t;
|
using ARDOUR::framepos_t;
|
||||||
|
|
|
||||||
|
|
@ -192,23 +192,13 @@ AudioDiskstream::non_realtime_input_change ()
|
||||||
|
|
||||||
/* now refill channel buffers */
|
/* now refill channel buffers */
|
||||||
|
|
||||||
if (speed() != 1.0f || speed() != -1.0f) {
|
seek (_session.transport_frame());
|
||||||
seek ((framepos_t) (_session.transport_frame() * (double) speed()));
|
|
||||||
} else {
|
|
||||||
seek (_session.transport_frame());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioDiskstream::non_realtime_locate (framepos_t location)
|
AudioDiskstream::non_realtime_locate (framepos_t location)
|
||||||
{
|
{
|
||||||
/* now refill channel buffers */
|
seek (location);
|
||||||
|
|
||||||
if (speed() != 1.0f || speed() != -1.0f) {
|
|
||||||
seek ((framepos_t) (location * (double) speed()));
|
|
||||||
} else {
|
|
||||||
seek (location);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -586,10 +576,10 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
|
||||||
|
|
||||||
framecnt_t necessary_samples;
|
framecnt_t necessary_samples;
|
||||||
|
|
||||||
/* no varispeed playback if we're recording, because the output .... TBD */
|
/* no reverse of varispeed playback if we're recording, because the output .... TBD */
|
||||||
|
|
||||||
if (rec_nframes == 0 && _actual_speed != 1.0f) {
|
if (rec_nframes == 0 && _session.transport_speed() != 1.0f) {
|
||||||
necessary_samples = (framecnt_t) ceil ((nframes * fabs (_actual_speed))) + 2;
|
necessary_samples = (framecnt_t) ceil ((nframes * fabs (_session.transport_speed()))) + 2;
|
||||||
} else {
|
} else {
|
||||||
necessary_samples = nframes;
|
necessary_samples = nframes;
|
||||||
}
|
}
|
||||||
|
|
@ -649,9 +639,9 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rec_nframes == 0 && _actual_speed != 1.0f && _actual_speed != -1.0f) {
|
if (rec_nframes == 0 && fabs (_session.transport_speed()) != 1.0f) {
|
||||||
|
|
||||||
interpolation.set_speed (_target_speed);
|
interpolation.set_speed (fabs (_session.transport_speed()));
|
||||||
|
|
||||||
int channel = 0;
|
int channel = 0;
|
||||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++channel) {
|
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++channel) {
|
||||||
|
|
@ -666,8 +656,6 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
|
||||||
} else {
|
} else {
|
||||||
playback_distance = nframes;
|
playback_distance = nframes;
|
||||||
}
|
}
|
||||||
|
|
||||||
_speed = _target_speed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_disk_signal) {
|
if (need_disk_signal) {
|
||||||
|
|
@ -720,8 +708,8 @@ AudioDiskstream::calculate_playback_distance (pframes_t nframes)
|
||||||
|
|
||||||
if (record_enabled()) {
|
if (record_enabled()) {
|
||||||
playback_distance = nframes;
|
playback_distance = nframes;
|
||||||
} else if (_actual_speed != 1.0f && _actual_speed != -1.0f) {
|
} else if (fabs (_session.transport_speed()) != 1.0) {
|
||||||
interpolation.set_speed (_target_speed);
|
interpolation.set_speed (fabs (_session.transport_speed()));
|
||||||
boost::shared_ptr<ChannelList> c = channels.reader();
|
boost::shared_ptr<ChannelList> c = channels.reader();
|
||||||
int channel = 0;
|
int channel = 0;
|
||||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++channel) {
|
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++channel) {
|
||||||
|
|
@ -731,7 +719,7 @@ AudioDiskstream::calculate_playback_distance (pframes_t nframes)
|
||||||
playback_distance = nframes;
|
playback_distance = nframes;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_actual_speed < 0.0) {
|
if (_session.transport_speed() < 0.0) {
|
||||||
return -playback_distance;
|
return -playback_distance;
|
||||||
} else {
|
} else {
|
||||||
return playback_distance;
|
return playback_distance;
|
||||||
|
|
@ -751,7 +739,7 @@ AudioDiskstream::commit (framecnt_t playback_distance)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_actual_speed < 0.0) {
|
if (_session.transport_speed() < 0.0) {
|
||||||
playback_sample -= playback_distance;
|
playback_sample -= playback_distance;
|
||||||
} else {
|
} else {
|
||||||
playback_sample += playback_distance;
|
playback_sample += playback_distance;
|
||||||
|
|
@ -821,7 +809,7 @@ AudioDiskstream::overwrite_existing_buffers ()
|
||||||
Sample* mixdown_buffer;
|
Sample* mixdown_buffer;
|
||||||
float* gain_buffer;
|
float* gain_buffer;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
bool reversed = (_visible_speed * _session.transport_speed()) < 0.0f;
|
bool reversed = _session.transport_speed() < 0.0;
|
||||||
|
|
||||||
overwrite_queued = false;
|
overwrite_queued = false;
|
||||||
|
|
||||||
|
|
@ -1074,7 +1062,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
framecnt_t to_read;
|
framecnt_t to_read;
|
||||||
RingBufferNPT<Sample>::rw_vector vector;
|
RingBufferNPT<Sample>::rw_vector vector;
|
||||||
bool const reversed = (_visible_speed * _session.transport_speed()) < 0.0f;
|
bool const reversed = _session.transport_speed() < 0.0f;
|
||||||
framecnt_t total_space;
|
framecnt_t total_space;
|
||||||
framecnt_t zero_fill;
|
framecnt_t zero_fill;
|
||||||
uint32_t chan_n;
|
uint32_t chan_n;
|
||||||
|
|
@ -1121,7 +1109,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
|
||||||
the playback buffer is empty.
|
the playback buffer is empty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((total_space < disk_read_chunk_frames) && fabs (_actual_speed) < 2.0f) {
|
if ((total_space < disk_read_chunk_frames) && fabs (_session.transport_speed()) < 2.0f) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2026,7 +2014,7 @@ AudioDiskstream::allocate_temporary_buffers ()
|
||||||
when slaving to MTC, Timecode etc.
|
when slaving to MTC, Timecode etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
double const sp = max (fabsf (_actual_speed), 1.2f);
|
double const sp = max (fabsf (_session.transport_speed()), 1.2f);
|
||||||
framecnt_t required_wrap_size = (framecnt_t) ceil (_session.get_block_size() * sp) + 2;
|
framecnt_t required_wrap_size = (framecnt_t) ceil (_session.get_block_size() * sp) + 2;
|
||||||
|
|
||||||
if (required_wrap_size > wrap_buffer_size) {
|
if (required_wrap_size > wrap_buffer_size) {
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,6 @@ Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
|
||||||
, i_am_the_modifier (0)
|
, i_am_the_modifier (0)
|
||||||
, _track (0)
|
, _track (0)
|
||||||
, _record_enabled (0)
|
, _record_enabled (0)
|
||||||
, _visible_speed (1.0f)
|
|
||||||
, _actual_speed (1.0f)
|
|
||||||
, _buffer_reallocation_required (false)
|
, _buffer_reallocation_required (false)
|
||||||
, _seek_required (false)
|
, _seek_required (false)
|
||||||
, capture_start_frame (0)
|
, capture_start_frame (0)
|
||||||
|
|
@ -87,8 +85,6 @@ Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
|
||||||
, overwrite_queued (false)
|
, overwrite_queued (false)
|
||||||
, wrap_buffer_size (0)
|
, wrap_buffer_size (0)
|
||||||
, speed_buffer_size (0)
|
, speed_buffer_size (0)
|
||||||
, _speed (1.0)
|
|
||||||
, _target_speed (_speed)
|
|
||||||
, file_frame (0)
|
, file_frame (0)
|
||||||
, playback_sample (0)
|
, playback_sample (0)
|
||||||
, in_set_state (false)
|
, in_set_state (false)
|
||||||
|
|
@ -102,8 +98,6 @@ Diskstream::Diskstream (Session& sess, const XMLNode& /*node*/)
|
||||||
, i_am_the_modifier (0)
|
, i_am_the_modifier (0)
|
||||||
, _track (0)
|
, _track (0)
|
||||||
, _record_enabled (0)
|
, _record_enabled (0)
|
||||||
, _visible_speed (1.0f)
|
|
||||||
, _actual_speed (1.0f)
|
|
||||||
, _buffer_reallocation_required (false)
|
, _buffer_reallocation_required (false)
|
||||||
, _seek_required (false)
|
, _seek_required (false)
|
||||||
, capture_start_frame (0)
|
, capture_start_frame (0)
|
||||||
|
|
@ -125,8 +119,6 @@ Diskstream::Diskstream (Session& sess, const XMLNode& /*node*/)
|
||||||
, overwrite_queued (false)
|
, overwrite_queued (false)
|
||||||
, wrap_buffer_size (0)
|
, wrap_buffer_size (0)
|
||||||
, speed_buffer_size (0)
|
, speed_buffer_size (0)
|
||||||
, _speed (1.0)
|
|
||||||
, _target_speed (_speed)
|
|
||||||
, file_frame (0)
|
, file_frame (0)
|
||||||
, playback_sample (0)
|
, playback_sample (0)
|
||||||
, in_set_state (false)
|
, in_set_state (false)
|
||||||
|
|
@ -195,46 +187,18 @@ Diskstream::non_realtime_set_speed ()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_seek_required) {
|
if (_seek_required) {
|
||||||
if (speed() != 1.0f || speed() != -1.0f) {
|
seek (_session.transport_frame(), true);
|
||||||
seek ((framepos_t) (_session.transport_frame() * (double) speed()), true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
seek (_session.transport_frame(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
_seek_required = false;
|
_seek_required = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Diskstream::realtime_set_speed (double sp, bool global)
|
Diskstream::realtime_set_speed (double new_speed)
|
||||||
{
|
{
|
||||||
bool changed = false;
|
framecnt_t required_wrap_size = (framecnt_t) ceil (_session.get_block_size() * fabs (new_speed)) + 2;
|
||||||
double new_speed = sp * _session.transport_speed();
|
|
||||||
|
|
||||||
if (_visible_speed != sp) {
|
if (required_wrap_size > wrap_buffer_size) {
|
||||||
_visible_speed = sp;
|
_buffer_reallocation_required = true;
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (new_speed != _actual_speed) {
|
|
||||||
|
|
||||||
framecnt_t required_wrap_size = (framecnt_t) ceil (_session.get_block_size() *
|
|
||||||
fabs (new_speed)) + 2;
|
|
||||||
|
|
||||||
if (required_wrap_size > wrap_buffer_size) {
|
|
||||||
_buffer_reallocation_required = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_actual_speed = new_speed;
|
|
||||||
_target_speed = fabs(_actual_speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed) {
|
|
||||||
if (!global) {
|
|
||||||
_seek_required = true;
|
|
||||||
}
|
|
||||||
SpeedChanged (); /* EMIT SIGNAL */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return _buffer_reallocation_required || _seek_required;
|
return _buffer_reallocation_required || _seek_required;
|
||||||
|
|
@ -465,8 +429,6 @@ Diskstream::get_state ()
|
||||||
node->add_property("name", _name);
|
node->add_property("name", _name);
|
||||||
id().print (buf, sizeof (buf));
|
id().print (buf, sizeof (buf));
|
||||||
node->add_property("id", buf);
|
node->add_property("id", buf);
|
||||||
snprintf (buf, sizeof(buf), "%f", _visible_speed);
|
|
||||||
node->add_property ("speed", buf);
|
|
||||||
node->add_property ("capture-alignment", enum_2_string (_alignment_choice));
|
node->add_property ("capture-alignment", enum_2_string (_alignment_choice));
|
||||||
|
|
||||||
if (_extra_xml) {
|
if (_extra_xml) {
|
||||||
|
|
@ -509,14 +471,6 @@ Diskstream::set_state (const XMLNode& node, int /*version*/)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((prop = node.property ("speed")) != 0) {
|
|
||||||
double sp = atof (prop->value().c_str());
|
|
||||||
|
|
||||||
if (realtime_set_speed (sp, false)) {
|
|
||||||
non_realtime_set_speed ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,6 @@ setup_enum_writer ()
|
||||||
REGISTER (_Session_RecordState);
|
REGISTER (_Session_RecordState);
|
||||||
|
|
||||||
REGISTER_CLASS_ENUM (SessionEvent, SetTransportSpeed);
|
REGISTER_CLASS_ENUM (SessionEvent, SetTransportSpeed);
|
||||||
REGISTER_CLASS_ENUM (SessionEvent, SetTrackSpeed);
|
|
||||||
REGISTER_CLASS_ENUM (SessionEvent, Locate);
|
REGISTER_CLASS_ENUM (SessionEvent, Locate);
|
||||||
REGISTER_CLASS_ENUM (SessionEvent, LocateRoll);
|
REGISTER_CLASS_ENUM (SessionEvent, LocateRoll);
|
||||||
REGISTER_CLASS_ENUM (SessionEvent, LocateRollLocate);
|
REGISTER_CLASS_ENUM (SessionEvent, LocateRollLocate);
|
||||||
|
|
|
||||||
|
|
@ -199,12 +199,7 @@ MidiDiskstream::non_realtime_input_change ()
|
||||||
|
|
||||||
/* now refill channel buffers */
|
/* now refill channel buffers */
|
||||||
|
|
||||||
if (speed() != 1.0f || speed() != -1.0f) {
|
seek (_session.transport_frame());
|
||||||
seek ((framepos_t) (_session.transport_frame() * (double) speed()));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
seek (_session.transport_frame());
|
|
||||||
}
|
|
||||||
|
|
||||||
g_atomic_int_set(const_cast<gint*> (&_frames_pending_write), 0);
|
g_atomic_int_set(const_cast<gint*> (&_frames_pending_write), 0);
|
||||||
g_atomic_int_set(const_cast<gint*> (&_num_captured_loops), 0);
|
g_atomic_int_set(const_cast<gint*> (&_num_captured_loops), 0);
|
||||||
|
|
@ -545,7 +540,7 @@ MidiDiskstream::calculate_playback_distance (pframes_t nframes)
|
||||||
|
|
||||||
/* XXX: should be doing varispeed stuff once it's implemented in ::process() above */
|
/* XXX: should be doing varispeed stuff once it's implemented in ::process() above */
|
||||||
|
|
||||||
if (_actual_speed < 0.0) {
|
if (_session.transport_speed() < 0.0) {
|
||||||
return -playback_distance;
|
return -playback_distance;
|
||||||
} else {
|
} else {
|
||||||
return playback_distance;
|
return playback_distance;
|
||||||
|
|
@ -557,7 +552,7 @@ MidiDiskstream::commit (framecnt_t playback_distance)
|
||||||
{
|
{
|
||||||
bool need_butler = false;
|
bool need_butler = false;
|
||||||
|
|
||||||
if (_actual_speed < 0.0) {
|
if (_session.transport_speed() < 0.0) {
|
||||||
playback_sample -= playback_distance;
|
playback_sample -= playback_distance;
|
||||||
} else {
|
} else {
|
||||||
playback_sample += playback_distance;
|
playback_sample += playback_distance;
|
||||||
|
|
@ -768,7 +763,7 @@ MidiDiskstream::do_refill ()
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
size_t write_space = _playback_buf->write_space();
|
size_t write_space = _playback_buf->write_space();
|
||||||
bool reversed = (_visible_speed * _session.transport_speed()) < 0.0f;
|
bool reversed = _session.transport_speed() < 0.0f;
|
||||||
|
|
||||||
if (write_space == 0) {
|
if (write_space == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -1125,10 +1125,6 @@ Session::process_event (SessionEvent* ev)
|
||||||
overwrite_some_buffers (static_cast<Track*>(ev->ptr));
|
overwrite_some_buffers (static_cast<Track*>(ev->ptr));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SessionEvent::SetTrackSpeed:
|
|
||||||
set_track_speed (static_cast<Track*> (ev->ptr), ev->speed);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SessionEvent::SetSyncSource:
|
case SessionEvent::SetSyncSource:
|
||||||
DEBUG_TRACE (DEBUG::Slave, "seen request for new slave\n");
|
DEBUG_TRACE (DEBUG::Slave, "seen request for new slave\n");
|
||||||
use_sync_source (ev->slave);
|
use_sync_source (ev->slave);
|
||||||
|
|
|
||||||
|
|
@ -128,14 +128,6 @@ Session::request_transport_speed_nonzero (double speed, bool as_default)
|
||||||
request_transport_speed (speed, as_default);
|
request_transport_speed (speed, as_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Session::request_track_speed (Track* tr, double speed)
|
|
||||||
{
|
|
||||||
SessionEvent* ev = new SessionEvent (SessionEvent::SetTrackSpeed, SessionEvent::Add, SessionEvent::Immediate, 0, speed);
|
|
||||||
ev->set_ptr (tr);
|
|
||||||
queue_event (ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::request_stop (bool abort, bool clear_state)
|
Session::request_stop (bool abort, bool clear_state)
|
||||||
{
|
{
|
||||||
|
|
@ -319,7 +311,7 @@ Session::butler_transport_work ()
|
||||||
finished = true;
|
finished = true;
|
||||||
ptw = post_transport_work();
|
ptw = post_transport_work();
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler transport work, todo = %1\n", enum_2_string (ptw)));
|
DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler transport work, todo = %1 PH=%2 @ %3\n", enum_2_string (ptw), _transport_frame, g_get_monotonic_time()));
|
||||||
|
|
||||||
if (ptw & PostTransportAdjustPlaybackBuffering) {
|
if (ptw & PostTransportAdjustPlaybackBuffering) {
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
||||||
|
|
@ -446,6 +438,7 @@ void
|
||||||
Session::non_realtime_locate ()
|
Session::non_realtime_locate ()
|
||||||
{
|
{
|
||||||
boost::shared_ptr<RouteList> rl = routes.reader();
|
boost::shared_ptr<RouteList> rl = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||||
(*i)->non_realtime_locate (_transport_frame);
|
(*i)->non_realtime_locate (_transport_frame);
|
||||||
}
|
}
|
||||||
|
|
@ -1224,7 +1217,7 @@ Session::set_transport_speed (double speed, framepos_t destination_frame, bool a
|
||||||
boost::shared_ptr<RouteList> rl = routes.reader();
|
boost::shared_ptr<RouteList> rl = routes.reader();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||||
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
||||||
if (tr && tr->realtime_set_speed (tr->speed(), true)) {
|
if (tr && tr->realtime_set_speed (_transport_speed)) {
|
||||||
todo = PostTransportWork (todo | PostTransportSpeed);
|
todo = PostTransportWork (todo | PostTransportSpeed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1362,7 +1355,7 @@ Session::start_transport ()
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||||
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
tr->realtime_set_speed (tr->speed(), true);
|
tr->realtime_set_speed (_transport_speed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1456,7 +1449,7 @@ Session::use_sync_source (Slave* new_slave)
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||||
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
||||||
if (tr && !tr->hidden()) {
|
if (tr && !tr->hidden()) {
|
||||||
if (tr->realtime_set_speed (tr->speed(), true)) {
|
if (tr->realtime_set_speed (_transport_speed)) {
|
||||||
non_rt_required = true;
|
non_rt_required = true;
|
||||||
}
|
}
|
||||||
tr->set_slaved (_slave != 0);
|
tr->set_slaved (_slave != 0);
|
||||||
|
|
@ -1548,16 +1541,6 @@ Session::switch_to_sync_source (SyncSource src)
|
||||||
request_sync_source (new_slave);
|
request_sync_source (new_slave);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Session::set_track_speed (Track* track, double speed)
|
|
||||||
{
|
|
||||||
if (track->realtime_set_speed (speed, false)) {
|
|
||||||
add_post_transport_work (PostTransportSpeed);
|
|
||||||
_butler->schedule_transport_work ();
|
|
||||||
set_dirty ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::unset_play_range ()
|
Session::unset_play_range ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -558,7 +558,6 @@ Track::set_diskstream (boost::shared_ptr<Diskstream> ds)
|
||||||
ds->PlaylistChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_playlist_changed, this));
|
ds->PlaylistChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_playlist_changed, this));
|
||||||
diskstream_playlist_changed ();
|
diskstream_playlist_changed ();
|
||||||
ds->RecordEnableChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_record_enable_changed, this));
|
ds->RecordEnableChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_record_enable_changed, this));
|
||||||
ds->SpeedChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_speed_changed, this));
|
|
||||||
ds->AlignmentStyleChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_alignment_style_changed, this));
|
ds->AlignmentStyleChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_alignment_style_changed, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -574,12 +573,6 @@ Track::diskstream_record_enable_changed ()
|
||||||
RecordEnableChanged (); /* EMIT SIGNAL */
|
RecordEnableChanged (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Track::diskstream_speed_changed ()
|
|
||||||
{
|
|
||||||
SpeedChanged (); /* EMIT SIGNAL */
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Track::diskstream_alignment_style_changed ()
|
Track::diskstream_alignment_style_changed ()
|
||||||
{
|
{
|
||||||
|
|
@ -738,9 +731,9 @@ Track::transport_looped (framepos_t p)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Track::realtime_set_speed (double s, bool g)
|
Track::realtime_set_speed (double s)
|
||||||
{
|
{
|
||||||
return _diskstream->realtime_set_speed (s, g);
|
return _diskstream->realtime_set_speed (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -755,12 +748,6 @@ Track::pending_overwrite () const
|
||||||
return _diskstream->pending_overwrite ();
|
return _diskstream->pending_overwrite ();
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
|
||||||
Track::speed () const
|
|
||||||
{
|
|
||||||
return _diskstream->speed ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Track::prepare_to_stop (framepos_t t, framepos_t a)
|
Track::prepare_to_stop (framepos_t t, framepos_t a)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue