"sequence regions" operation (remove space between selected regions) added, c/o Thomas Brand
This commit is contained in:
parent
1b989a93c2
commit
38125d60c9
|
@ -288,6 +288,7 @@
|
|||
<menuitem action='nudge-backward'/>
|
||||
<menuitem action='nudge-forward-by-capture-offset'/>
|
||||
<menuitem action='nudge-backward-by-capture-offset'/>
|
||||
<menuitem action='sequence-regions'/>
|
||||
</menu>
|
||||
<menu action='RegionMenuTrim'>
|
||||
<menuitem action='trim-front'/>
|
||||
|
@ -647,6 +648,7 @@
|
|||
<menuitem action='nudge-backward'/>
|
||||
<menuitem action='nudge-forward-by-capture-offset'/>
|
||||
<menuitem action='nudge-backward-by-capture-offset'/>
|
||||
<menuitem action='sequence-regions'/>
|
||||
</menu>
|
||||
<menu action='RegionMenuTrim'>
|
||||
<menuitem action='trim-front'/>
|
||||
|
|
|
@ -319,6 +319,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
void nudge_forward_capture_offset ();
|
||||
void nudge_backward_capture_offset ();
|
||||
|
||||
void sequence_regions ();
|
||||
|
||||
/* playhead/screen stuff */
|
||||
|
||||
void set_stationary_playhead (bool yn);
|
||||
|
|
|
@ -1897,6 +1897,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-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 (
|
||||
_region_actions,
|
||||
"nudge-forward-by-capture-offset",
|
||||
|
|
|
@ -512,6 +512,60 @@ Editor::nudge_backward_capture_offset ()
|
|||
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 */
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue
Block a user