mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-10 23:46:20 +01:00
make region gain line visibility global, not per-region
git-svn-id: svn://localhost/ardour2/branches/3.0@11492 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
020e4a89dc
commit
b02e95f201
8 changed files with 34 additions and 79 deletions
|
|
@ -263,7 +263,6 @@
|
|||
<menuitem action='boost-region-gain'/>
|
||||
<menuitem action='cut-region-gain'/>
|
||||
<menuitem action='reset-region-gain-envelopes'/>
|
||||
<menuitem action='toggle-region-gain-envelope-visible'/>
|
||||
<menuitem action='toggle-region-gain-envelope-active'/>
|
||||
</menu>
|
||||
<menu action='RegionMenuPosition'>
|
||||
|
|
@ -653,7 +652,6 @@
|
|||
<menuitem action='boost-region-gain'/>
|
||||
<menuitem action='cut-region-gain'/>
|
||||
<menuitem action='reset-region-gain-envelopes'/>
|
||||
<menuitem action='toggle-region-gain-envelope-visible'/>
|
||||
<menuitem action='toggle-region-gain-envelope-active'/>
|
||||
</menu>
|
||||
<menu action='RegionMenuFades'>
|
||||
|
|
|
|||
|
|
@ -138,12 +138,6 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
store_flags ();
|
||||
}
|
||||
|
||||
/* make envelope visible if it has anything interesting in it */
|
||||
boost::shared_ptr<AutomationList> env = audio_region()->envelope ();
|
||||
if (env->size() > 2 || (env->size() == 2 && env->front()->value != env->back()->value)) {
|
||||
_flags |= EnvelopeVisible;
|
||||
}
|
||||
|
||||
compute_colors (basic_color);
|
||||
|
||||
create_waves ();
|
||||
|
|
@ -189,10 +183,10 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
gain_line = new AudioRegionGainLine (line_name, *this, *group, audio_region()->envelope());
|
||||
}
|
||||
|
||||
if (!(_flags & EnvelopeVisible)) {
|
||||
gain_line->hide ();
|
||||
} else {
|
||||
if (Config->get_show_region_gain()) {
|
||||
gain_line->show ();
|
||||
} else {
|
||||
gain_line->hide ();
|
||||
}
|
||||
|
||||
gain_line->reset ();
|
||||
|
|
@ -489,7 +483,7 @@ AudioRegionView::set_height (gdouble height)
|
|||
if ((height/wcnt) < NAME_HIGHLIGHT_THRESH) {
|
||||
gain_line->hide ();
|
||||
} else {
|
||||
if (_flags & EnvelopeVisible) {
|
||||
if (Config->get_show_region_gain ()) {
|
||||
gain_line->show ();
|
||||
}
|
||||
}
|
||||
|
|
@ -805,7 +799,7 @@ AudioRegionView::temporarily_hide_envelope ()
|
|||
void
|
||||
AudioRegionView::unhide_envelope ()
|
||||
{
|
||||
if (gain_line && (_flags & EnvelopeVisible)) {
|
||||
if (gain_line) {
|
||||
gain_line->show ();
|
||||
}
|
||||
}
|
||||
|
|
@ -813,15 +807,12 @@ AudioRegionView::unhide_envelope ()
|
|||
void
|
||||
AudioRegionView::set_envelope_visible (bool yn)
|
||||
{
|
||||
if (gain_line && ((_flags & EnvelopeVisible) != yn)) {
|
||||
if (gain_line) {
|
||||
if (yn) {
|
||||
gain_line->show ();
|
||||
_flags |= EnvelopeVisible;
|
||||
} else {
|
||||
gain_line->hide ();
|
||||
_flags &= ~EnvelopeVisible;
|
||||
}
|
||||
store_flags ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1041,7 +1032,6 @@ AudioRegionView::store_flags()
|
|||
XMLNode *node = new XMLNode ("GUI");
|
||||
|
||||
node->add_property ("waveform-visible", (_flags & WaveformVisible) ? "yes" : "no");
|
||||
node->add_property ("envelope-visible", (_flags & EnvelopeVisible) ? "yes" : "no");
|
||||
node->add_property ("waveform-rectified", (_flags & WaveformRectified) ? "yes" : "no");
|
||||
node->add_property ("waveform-logscaled", (_flags & WaveformLogScaled) ? "yes" : "no");
|
||||
|
||||
|
|
@ -1059,12 +1049,6 @@ AudioRegionView::set_flags (XMLNode* node)
|
|||
}
|
||||
}
|
||||
|
||||
if ((prop = node->property ("envelope-visible")) != 0) {
|
||||
if (string_is_affirmative (prop->value())) {
|
||||
_flags |= EnvelopeVisible;
|
||||
}
|
||||
}
|
||||
|
||||
if ((prop = node->property ("waveform-rectified")) != 0) {
|
||||
if (string_is_affirmative (prop->value())) {
|
||||
_flags |= WaveformRectified;
|
||||
|
|
@ -1181,7 +1165,7 @@ AudioRegionView::entered (bool internal_editing)
|
|||
trackview.editor().set_current_trimmable (_region);
|
||||
trackview.editor().set_current_movable (_region);
|
||||
|
||||
if (gain_line && _flags & EnvelopeVisible) {
|
||||
if (gain_line && Config->get_show_region_gain ()) {
|
||||
gain_line->show_all_control_points ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ class AudioRegionView : public RegionView
|
|||
bool waveform_rectified() const { return _flags & WaveformRectified; }
|
||||
bool waveform_logscaled() const { return _flags & WaveformLogScaled; }
|
||||
bool waveform_visible() const { return _flags & WaveformVisible; }
|
||||
bool envelope_visible() const { return _flags & EnvelopeVisible; }
|
||||
|
||||
void add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event);
|
||||
void remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event);
|
||||
|
|
@ -126,7 +125,6 @@ class AudioRegionView : public RegionView
|
|||
*/
|
||||
|
||||
enum Flags {
|
||||
EnvelopeVisible = 0x1,
|
||||
WaveformVisible = 0x4,
|
||||
WaveformRectified = 0x8,
|
||||
WaveformLogScaled = 0x10,
|
||||
|
|
|
|||
|
|
@ -1967,7 +1967,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
gint left_automation_track ();
|
||||
|
||||
void reset_canvas_action_sensitivity (bool);
|
||||
void toggle_gain_envelope_visibility ();
|
||||
void set_gain_envelope_visibility (bool);
|
||||
void set_region_gain_visibility (RegionView*, bool);
|
||||
void toggle_gain_envelope_active ();
|
||||
void reset_region_gain_envelopes ();
|
||||
|
||||
|
|
|
|||
|
|
@ -1484,6 +1484,8 @@ Editor::parameter_changed (std::string p)
|
|||
tact->set_active (s);
|
||||
}
|
||||
}
|
||||
} else if (p == "show-region-gain") {
|
||||
set_gain_envelope_visibility (Config->get_show_region_gain ());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1684,13 +1686,6 @@ Editor::register_region_actions ()
|
|||
|
||||
reg_sens (_region_actions, "reset-region-scale-amplitude", _("Reset Gain"), sigc::mem_fun (*this, &Editor::reset_region_scale_amplitude));
|
||||
|
||||
toggle_reg_sens (
|
||||
_region_actions,
|
||||
"toggle-region-gain-envelope-visible",
|
||||
_("Envelope Visible"),
|
||||
sigc::mem_fun (*this, &Editor::toggle_gain_envelope_visibility)
|
||||
);
|
||||
|
||||
toggle_reg_sens (
|
||||
_region_actions,
|
||||
"toggle-region-gain-envelope-active",
|
||||
|
|
|
|||
|
|
@ -4723,30 +4723,27 @@ Editor::reset_region_gain_envelopes ()
|
|||
}
|
||||
|
||||
void
|
||||
Editor::toggle_gain_envelope_visibility ()
|
||||
Editor::set_region_gain_visibility (RegionView* rv, bool yn)
|
||||
{
|
||||
if (_ignore_region_action) {
|
||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (rv);
|
||||
if (arv) {
|
||||
arv->set_envelope_visible (yn);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_gain_envelope_visibility (bool yn)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
}
|
||||
|
||||
RegionSelection rs = get_regions_from_selection_and_entered ();
|
||||
|
||||
if (!_session || rs.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_session->begin_reversible_command (_("region gain envelope visible"));
|
||||
|
||||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||
if (arv) {
|
||||
arv->region()->clear_changes ();
|
||||
arv->set_envelope_visible (!arv->envelope_visible());
|
||||
_session->add_command (new StatefulDiffCommand (arv->region()));
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
AudioTimeAxisView* v = dynamic_cast<AudioTimeAxisView*>(*i);
|
||||
if (v) {
|
||||
v->audio_view()->foreach_regionview (sigc::bind (sigc::mem_fun (this, &Editor::set_region_gain_visibility), yn));
|
||||
}
|
||||
}
|
||||
|
||||
_session->commit_reversible_command ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1071,8 +1071,6 @@ Editor::sensitize_the_right_region_actions ()
|
|||
bool have_opaque = false;
|
||||
bool have_non_opaque = false;
|
||||
bool have_not_at_natural_position = false;
|
||||
bool have_envelope_visible = false;
|
||||
bool have_envelope_invisible = false;
|
||||
bool have_envelope_active = false;
|
||||
bool have_envelope_inactive = false;
|
||||
bool have_non_unity_scale_amplitude = false;
|
||||
|
|
@ -1127,24 +1125,6 @@ Editor::sensitize_the_right_region_actions ()
|
|||
}
|
||||
|
||||
if (ar) {
|
||||
/* its a bit unfortunate that "envelope visible" is a view-only
|
||||
property. we have to find the regionview to able to check
|
||||
its current setting.
|
||||
*/
|
||||
|
||||
have_envelope_invisible = false;
|
||||
|
||||
if (*i) {
|
||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (*i);
|
||||
if (arv) {
|
||||
if (arv->envelope_visible()) {
|
||||
have_envelope_visible = true;
|
||||
} else {
|
||||
have_envelope_invisible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ar->envelope_active()) {
|
||||
have_envelope_active = true;
|
||||
} else {
|
||||
|
|
@ -1205,12 +1185,6 @@ Editor::sensitize_the_right_region_actions ()
|
|||
|
||||
if (have_audio) {
|
||||
|
||||
if (have_envelope_visible && !have_envelope_invisible) {
|
||||
Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-gain-envelope-visible"))->set_active ();
|
||||
} else if (have_envelope_visible && have_envelope_invisible) {
|
||||
// _region_actions->get_action("toggle-region-gain-envelope-visible")->set_inconsistent ();
|
||||
}
|
||||
|
||||
if (have_envelope_active && !have_envelope_inactive) {
|
||||
Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-gain-envelope-active"))->set_active ();
|
||||
} else if (have_envelope_active && have_envelope_inactive) {
|
||||
|
|
|
|||
|
|
@ -1055,6 +1055,14 @@ RCOptionEditor::RCOptionEditor ()
|
|||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms)
|
||||
));
|
||||
|
||||
add_option (_("Editor"),
|
||||
new BoolOption (
|
||||
"show-region-gain-envelopes",
|
||||
_("Show gain envelopes in audio regions"),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_region_gain),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_region_gain)
|
||||
));
|
||||
|
||||
ComboOption<WaveformScale>* wfs = new ComboOption<WaveformScale> (
|
||||
"waveform-scale",
|
||||
_("Waveform scale"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue