reset_region_scale_amplitude is redundant with reset_region_gain

This commit is contained in:
Ben Loftis 2022-05-03 23:43:22 -05:00
parent 62fd8ecd35
commit 764aa75f09
4 changed files with 1 additions and 38 deletions

View File

@ -1362,7 +1362,6 @@ private:
void reverse_region ();
void strip_region_silence ();
void normalize_region ();
void reset_region_scale_amplitude ();
void adjust_region_gain (bool up);
void reset_region_gain ();
void quantize_region ();

View File

@ -1882,7 +1882,6 @@ Editor::register_region_actions ()
register_region_action (_region_actions, RegionActionTarget (SelectedRegions), "spectral-analyze-region", _("Spectral Analysis..."), sigc::mem_fun (*this, &Editor::spectral_analyze_region_selection));
register_region_action (_region_actions, RegionActionTarget (SelectedRegions|EnteredRegions), "reset-region-gain-envelopes", _("Reset Envelope"), sigc::mem_fun (*this, &Editor::reset_region_gain_envelopes));
register_region_action (_region_actions, RegionActionTarget (SelectedRegions|EnteredRegions), "reset-region-scale-amplitude", _("Reset Gain"), sigc::mem_fun (*this, &Editor::reset_region_scale_amplitude));
register_toggle_region_action (_region_actions, RegionActionTarget (SelectedRegions|EnteredRegions), "toggle-region-gain-envelope-active", _("Envelope Active"), sigc::mem_fun (*this, &Editor::toggle_gain_envelope_active));

View File

@ -5688,41 +5688,6 @@ Editor::normalize_region ()
}
}
void
Editor::reset_region_scale_amplitude ()
{
if (!_session) {
return;
}
RegionSelection rs = get_regions_from_selection_and_entered ();
if (rs.empty()) {
return;
}
bool in_command = false;
for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*r);
if (!arv)
continue;
arv->region()->clear_changes ();
arv->audio_region()->set_scale_amplitude (1.0f);
if(!in_command) {
begin_reversible_command ("reset gain");
in_command = true;
}
_session->add_command (new StatefulDiffCommand (arv->region()));
}
if (in_command) {
commit_reversible_command ();
}
}
void
Editor::adjust_region_gain (bool up)
{

View File

@ -1576,7 +1576,7 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing)
}
if (!have_non_unity_scale_amplitude || !have_audio) {
_region_actions->get_action("reset-region-scale-amplitude")->set_sensitive (false);
_region_actions->get_action("reset-region-gain")->set_sensitive (false);
}
Glib::RefPtr<ToggleAction> a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-lock"));