add "fade range" operation, bound to alt-f at present by default

This commit is contained in:
Paul Davis 2014-07-10 08:17:22 -04:00
parent 0622a0cc30
commit 07e0f785f8
7 changed files with 59 additions and 0 deletions

View file

@ -1384,6 +1384,41 @@ RouteTimeAxisView::find_next_region_boundary (framepos_t pos, int32_t dir)
return -1;
}
void
RouteTimeAxisView::fade_range (TimeSelection& selection)
{
boost::shared_ptr<Playlist> what_we_got;
boost::shared_ptr<Track> tr = track ();
boost::shared_ptr<Playlist> playlist;
if (tr == 0) {
/* route is a bus, not a track */
return;
}
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_owned_changes ();
playlist->fade_range (time);
vector<Command*> cmds;
playlist->rdiff (cmds);
_session->add_commands (cmds);
_session->add_command (new StatefulDiffCommand (playlist));
}
void
RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
{