mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 05:36:31 +01:00
"sequence regions" operation (remove space between selected regions) added, c/o Thomas Brand
This commit is contained in:
parent
1c84289254
commit
e08ec37f69
4 changed files with 60 additions and 0 deletions
|
|
@ -290,6 +290,7 @@
|
||||||
<menuitem action='nudge-backward'/>
|
<menuitem action='nudge-backward'/>
|
||||||
<menuitem action='nudge-forward-by-capture-offset'/>
|
<menuitem action='nudge-forward-by-capture-offset'/>
|
||||||
<menuitem action='nudge-backward-by-capture-offset'/>
|
<menuitem action='nudge-backward-by-capture-offset'/>
|
||||||
|
<menuitem action='sequence-regions'/>
|
||||||
</menu>
|
</menu>
|
||||||
<menu action='RegionMenuTrim'>
|
<menu action='RegionMenuTrim'>
|
||||||
<menuitem action='trim-front'/>
|
<menuitem action='trim-front'/>
|
||||||
|
|
@ -648,6 +649,7 @@
|
||||||
<menuitem action='nudge-backward'/>
|
<menuitem action='nudge-backward'/>
|
||||||
<menuitem action='nudge-forward-by-capture-offset'/>
|
<menuitem action='nudge-forward-by-capture-offset'/>
|
||||||
<menuitem action='nudge-backward-by-capture-offset'/>
|
<menuitem action='nudge-backward-by-capture-offset'/>
|
||||||
|
<menuitem action='sequence-regions'/>
|
||||||
</menu>
|
</menu>
|
||||||
<menu action='RegionMenuTrim'>
|
<menu action='RegionMenuTrim'>
|
||||||
<menuitem action='trim-front'/>
|
<menuitem action='trim-front'/>
|
||||||
|
|
|
||||||
|
|
@ -328,6 +328,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
void nudge_forward_capture_offset ();
|
void nudge_forward_capture_offset ();
|
||||||
void nudge_backward_capture_offset ();
|
void nudge_backward_capture_offset ();
|
||||||
|
|
||||||
|
void sequence_regions ();
|
||||||
|
|
||||||
/* playhead/screen stuff */
|
/* playhead/screen stuff */
|
||||||
|
|
||||||
void set_stationary_playhead (bool yn);
|
void set_stationary_playhead (bool yn);
|
||||||
|
|
|
||||||
|
|
@ -1893,6 +1893,8 @@ Editor::register_region_actions ()
|
||||||
reg_sens (_region_actions, "nudge-forward", _("Nudge Later"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_forward), false, false));
|
reg_sens (_region_actions, "nudge-forward", _("Nudge Later"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_forward), false, false));
|
||||||
reg_sens (_region_actions, "nudge-backward", _("Nudge Earlier"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_backward), false, false));
|
reg_sens (_region_actions, "nudge-backward", _("Nudge Earlier"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_backward), false, false));
|
||||||
|
|
||||||
|
reg_sens (_region_actions, "sequence-regions", _("Sequence Regions"), sigc::mem_fun (*this, &Editor::sequence_regions));
|
||||||
|
|
||||||
reg_sens (
|
reg_sens (
|
||||||
_region_actions,
|
_region_actions,
|
||||||
"nudge-forward-by-capture-offset",
|
"nudge-forward-by-capture-offset",
|
||||||
|
|
|
||||||
|
|
@ -514,6 +514,60 @@ Editor::nudge_backward_capture_offset ()
|
||||||
commit_reversible_command ();
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct RegionSelectionPositionSorter {
|
||||||
|
bool operator() (RegionView* a, RegionView* b) {
|
||||||
|
return a->region()->position() < b->region()->position();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::sequence_regions ()
|
||||||
|
{
|
||||||
|
framepos_t r_end;
|
||||||
|
framepos_t r_end_prev;
|
||||||
|
|
||||||
|
int iCount=0;
|
||||||
|
|
||||||
|
if (!_session) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegionSelection rs = get_regions_from_selection_and_entered ();
|
||||||
|
rs.sort(RegionSelectionPositionSorter());
|
||||||
|
|
||||||
|
if (!rs.empty()) {
|
||||||
|
|
||||||
|
begin_reversible_command (_("sequence regions"));
|
||||||
|
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||||
|
boost::shared_ptr<Region> r ((*i)->region());
|
||||||
|
|
||||||
|
r->clear_changes();
|
||||||
|
|
||||||
|
if(r->locked())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(r->position_locked())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(iCount>0)
|
||||||
|
{
|
||||||
|
r_end_prev=r_end;
|
||||||
|
r->set_position(r_end_prev);
|
||||||
|
}
|
||||||
|
|
||||||
|
_session->add_command (new StatefulDiffCommand (r));
|
||||||
|
|
||||||
|
r_end=r->position() + r->length();
|
||||||
|
|
||||||
|
iCount++;
|
||||||
|
}
|
||||||
|
commit_reversible_command ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* DISPLAY MOTION */
|
/* DISPLAY MOTION */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue