mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Prototype region comp by muting layers
This commit is contained in:
parent
4b4cd5710f
commit
53aa6576e8
4 changed files with 69 additions and 0 deletions
|
|
@ -1626,6 +1626,7 @@ private:
|
|||
void set_playhead_cursor ();
|
||||
|
||||
void toggle_region_mute ();
|
||||
void region_mute_comp ();
|
||||
|
||||
void initialize_canvas ();
|
||||
|
||||
|
|
|
|||
|
|
@ -8647,6 +8647,71 @@ Editor::toggle_region_mute ()
|
|||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::region_mute_comp ()
|
||||
{
|
||||
if (_ignore_region_action) {
|
||||
return;
|
||||
}
|
||||
|
||||
RegionSelection rs = selection->regions;
|
||||
|
||||
if (rs.empty ()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (rs.size() > 1) {
|
||||
begin_reversible_command (_("mute/comp regions"));
|
||||
} else {
|
||||
begin_reversible_command (_("mute/comp region"));
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
|
||||
/* unmute selected region(s),
|
||||
* mute other regions in the playlist at the same position
|
||||
*/
|
||||
for (auto const& region_view : rs) {
|
||||
|
||||
std::shared_ptr<Region> r = region_view->region ();
|
||||
std::shared_ptr<Playlist> p = r->playlist ();
|
||||
|
||||
if (r->muted ()) {
|
||||
r->clear_changes ();
|
||||
r->set_muted (false);
|
||||
_session->add_command (new StatefulDiffCommand (r));
|
||||
changed = true;
|
||||
}
|
||||
|
||||
/* p->get_equivalent_regions (r, equivalent_regions); with Config->get_region_equivalence () == Exact */
|
||||
vector<std::shared_ptr<Region>> equivalent_regions;
|
||||
std::shared_ptr<RegionList> rl = p->region_list ();
|
||||
for (auto const& ri : *rl) {
|
||||
if (ri->exact_equivalent (r)) {
|
||||
equivalent_regions.push_back (ri);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto const& ri: equivalent_regions) {
|
||||
if (r == ri) {
|
||||
continue;
|
||||
}
|
||||
if (!ri->muted ()) {
|
||||
ri->clear_changes ();
|
||||
ri->set_muted (true);
|
||||
_session->add_command (new StatefulDiffCommand (ri));
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
commit_reversible_command ();
|
||||
} else {
|
||||
abort_reversible_command ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::combine_regions ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1031,6 +1031,8 @@ LuaInstance::register_classes (lua_State* L, bool sandbox)
|
|||
//.addFunction ("get_preferred_edit_position", &PublicEditor::get_preferred_edit_position)
|
||||
//.addFunction ("split_regions_at", &PublicEditor::split_regions_at)
|
||||
|
||||
.addFunction ("region_mute_comp", &PublicEditor::region_mute_comp)
|
||||
|
||||
.addFunction ("get_paste_offset", &PublicEditor::get_paste_offset)
|
||||
|
||||
.addFunction ("toggle_ruler_video", &PublicEditor::toggle_ruler_video)
|
||||
|
|
|
|||
|
|
@ -300,6 +300,7 @@ public:
|
|||
virtual void maximise_editing_space () = 0;
|
||||
virtual void restore_editing_space () = 0;
|
||||
virtual void toggle_meter_updating() = 0;
|
||||
virtual void region_mute_comp () = 0;
|
||||
virtual void split_regions_at (Temporal::timepos_t const &, RegionSelection&) = 0;
|
||||
virtual void split_region_at_points (std::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false) = 0;
|
||||
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue