summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-07-10 08:17:22 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-07-10 08:17:22 -0400
commit07e0f785f80eb7b57a05c091dc454d4e4d0cce88 (patch)
treea2a2610b6b1dc17dd497fe8e50c063ef42d7dfc4 /gtk2_ardour/route_time_axis.cc
parent0622a0cc3068a06d328119e90b7d9c5f5a84df32 (diff)
add "fade range" operation, bound to alt-f at present by default
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 77fb0815bc..36b2cdb2e9 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -1385,6 +1385,41 @@ RouteTimeAxisView::find_next_region_boundary (framepos_t pos, int32_t dir)
}
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)
{
boost::shared_ptr<Playlist> what_we_got;