add "fade range" operation, bound to alt-f at present by default
This commit is contained in:
parent
0622a0cc30
commit
07e0f785f8
@ -1385,6 +1385,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||
void set_fade_in_active (bool);
|
||||
void set_fade_out_active (bool);
|
||||
|
||||
void fade_range ();
|
||||
|
||||
std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
|
||||
|
||||
bool _dragging_playhead;
|
||||
|
@ -336,6 +336,8 @@ Editor::register_actions ()
|
||||
reg_sens (editor_actions, "editor-copy", _("Copy"), sigc::mem_fun(*this, &Editor::copy));
|
||||
reg_sens (editor_actions, "editor-paste", _("Paste"), sigc::mem_fun(*this, &Editor::keyboard_paste));
|
||||
|
||||
reg_sens (editor_actions, "editor-fade-range", _("Fade Range Selection"), sigc::mem_fun(*this, &Editor::fade_range));
|
||||
|
||||
reg_sens (editor_actions, "set-tempo-from-edit-range", _("Set Tempo from Edit Range = Bar"), sigc::mem_fun(*this, &Editor::use_range_as_bar));
|
||||
|
||||
toggle_reg_sens (editor_actions, "toggle-log-window", _("Log"),
|
||||
|
@ -5260,6 +5260,22 @@ Editor::toggle_solo_isolate ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Editor::fade_range ()
|
||||
{
|
||||
TrackViewList ts = selection->tracks.filter_to_unique_playlists ();
|
||||
|
||||
begin_reversible_command (_("fade range"));
|
||||
|
||||
for (TrackViewList::iterator i = ts.begin(); i != ts.end(); ++i) {
|
||||
(*i)->fade_range (selection->time);
|
||||
}
|
||||
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Editor::set_fade_length (bool in)
|
||||
{
|
||||
|
@ -190,6 +190,7 @@ This mode provides many different operations on both regions and control points,
|
||||
@select|Editor/select-all-in-punch-range|<@PRIMARY@>d|select all in punch range
|
||||
@vis|Editor/fit-tracks|f|fit tracks vertically
|
||||
@trans|Editor/toggle-follow-playhead|<@PRIMARY@>f|toggle playhead tracking
|
||||
@trans|Editor/editor-fade-range|<@SECONDARY@>f|fade range selection
|
||||
@trans|Transport/ToggleFollowEdits|<@TERTIARY@>f|toggle playhead follows edits
|
||||
@wvis|Common/ToggleMaximalEditor|<@PRIMARY@><@SECONDARY@>f|maximise editor space
|
||||
@wvis|Common/ToggleMaximalMixer|F12|maximise mixer space
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -104,6 +104,7 @@ public:
|
||||
void uncombine_regions ();
|
||||
void uncombine_region (RegionView*);
|
||||
void toggle_automation_track (const Evoral::Parameter& param);
|
||||
void fade_range (TimeSelection&);
|
||||
|
||||
/* The editor calls these when mapping an operation across multiple tracks */
|
||||
void use_new_playlist (bool prompt, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
|
||||
|
@ -167,6 +167,8 @@ class TimeAxisView : public virtual AxisView
|
||||
virtual void set_selected_regionviews (RegionSelection&) {}
|
||||
virtual void set_selected_points (PointSelection&) {}
|
||||
|
||||
virtual void fade_range (TimeSelection&) {}
|
||||
|
||||
virtual boost::shared_ptr<ARDOUR::Region> find_next_region (framepos_t /*pos*/, ARDOUR::RegionPoint, int32_t /*dir*/) {
|
||||
return boost::shared_ptr<ARDOUR::Region> ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user