Foldback gui: Added hide and show

- New menu item in view menu
- Foldback strip has hide button
- Adding a new foldback bus sets show
- setting is saved and restored
This commit is contained in:
Len Ovens 2019-09-11 16:36:05 -07:00
parent 729cd0e2b3
commit da88e9d34c
6 changed files with 74 additions and 4 deletions

View File

@ -41,7 +41,7 @@
<menuitem action='monitor-dim-all'/>
<menuitem action='monitor-mono'/>
</menu>
<menu name='Metadata' action='Metadata'>
<menuitem action='EditMetadata'/>
<menuitem action='ImportMetadata'/>
@ -536,6 +536,7 @@
#endif
<menuitem action='ToggleVCAPane'/>
<menuitem action='ToggleMonitorSection'/>
<menuitem action='ToggleFoldbackStrip'/>
</menu>
<menu action = 'WindowMenu'>

View File

@ -4464,6 +4464,7 @@ ARDOUR_UI::add_route_dialog_response (int r)
break;
case AddRouteDialog::FoldbackBus:
session_add_foldback_bus (input_chan.n_audio(), count, name_template);
ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleFoldbackStrip"))->set_active (true);
break;
}
}

View File

@ -321,17 +321,23 @@ FoldbackStrip::init ()
_previous_button.set_name ("mixer strip button");
_previous_button.set_icon (ArdourIcon::NudgeLeft);
_previous_button.set_tweaks (ArdourButton::Square);
UI::instance()->set_tip (&_previous_button, _("previous foldback bus"), "");
UI::instance()->set_tip (&_previous_button, _("Previous foldback bus"), "");
_previous_button.set_sensitive (false);
_next_button.set_name ("mixer strip button");
_next_button.set_icon (ArdourIcon::NudgeRight);
_next_button.set_tweaks (ArdourButton::Square);
UI::instance()->set_tip (&_next_button, _("next foldback bus"), "");
UI::instance()->set_tip (&_next_button, _("Next foldback bus"), "");
_next_button.set_sensitive (false);
_hide_button.set_name ("mixer strip button");
_hide_button.set_icon (ArdourIcon::CloseCross);
_hide_button.set_tweaks (ArdourButton::Square);
set_tooltip (&_hide_button, _("Hide Foldback strip"));
prev_next_box.pack_start (_previous_button, false, true);
prev_next_box.pack_end (_next_button, false, true);
prev_next_box.pack_start (_next_button, false, true);
prev_next_box.pack_end (_hide_button, false, true);
name_button.set_name ("mixer strip button");
name_button.set_text_ellipsize (Pango::ELLIPSIZE_END);
@ -443,6 +449,7 @@ FoldbackStrip::init ()
name_button.signal_button_press_event().connect (sigc::mem_fun(*this, &FoldbackStrip::name_button_button_press), false);
_previous_button.signal_button_press_event().connect (sigc::mem_fun (*this, &FoldbackStrip::previous_button_button_press), false);
_next_button.signal_button_press_event().connect (sigc::mem_fun (*this, &FoldbackStrip::next_button_button_press), false);
_hide_button.signal_clicked.connect (sigc::mem_fun(*this, &FoldbackStrip::hide_clicked));
_show_sends_button.signal_button_press_event().connect (sigc::mem_fun(*this, &FoldbackStrip::show_sends_press), false);
send_scroller.signal_button_press_event().connect (sigc::mem_fun (*this, &FoldbackStrip::send_button_press_event));
_comment_button.signal_clicked.connect (sigc::mem_fun (*this, &RouteUI::toggle_comment_editor));
@ -584,6 +591,7 @@ FoldbackStrip::set_route (boost::shared_ptr<Route> rt)
prev_next_changed ();
_previous_button.show();
_next_button.show();
_hide_button.show();
prev_next_box.show ();
name_button.show();
send_display.show ();
@ -1301,6 +1309,14 @@ FoldbackStrip::prev_next_changed ()
}
}
void
FoldbackStrip::hide_clicked()
{
_hide_button.set_sensitive(false);
ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleFoldbackStrip"))->set_active (false);
_hide_button.set_sensitive(true);
}
gboolean
FoldbackStrip::show_sends_press (GdkEventButton* ev)
{

View File

@ -212,10 +212,12 @@ private:
ArdourWidgets::ArdourButton _show_sends_button;
ArdourWidgets::ArdourButton _previous_button;
ArdourWidgets::ArdourButton _next_button;
ArdourWidgets::ArdourButton _hide_button;
ArdourWidgets::ArdourButton _comment_button;
ArdourWidgets::ArdourKnob* fb_level_control;
void setup_comment_button ();
void hide_clicked();
gint output_press (GdkEventButton *);
gint output_release (GdkEventButton *);

View File

@ -115,6 +115,7 @@ Mixer_UI::Mixer_UI ()
, track_menu (0)
, _plugin_selector (0)
, foldback_strip (0)
, _show_foldback_strip (true)
, _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide)
, _spill_scroll_position (0)
, ignore_reorder (false)
@ -612,6 +613,7 @@ Mixer_UI::add_stripables (StripableList& slist)
}
if (route->is_foldbackbus ()) {
if (foldback_strip) {
// last strip created is shown
foldback_strip->set_route (route);
} else {
foldback_strip = new FoldbackStrip (*this, _session, route);
@ -620,6 +622,13 @@ Mixer_UI::add_stripables (StripableList& slist)
out_packer.reorder_child (*foldback_strip, 0);
foldback_strip->set_packed (true);
}
/* config from last run is set before there are any foldback strips
* this takes that setting and applies it after at least one foldback
* strip exists */
bool yn = _show_foldback_strip;
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
act->set_active(!yn);
act->set_active(yn);
continue;
}
@ -2069,6 +2078,28 @@ Mixer_UI::showhide_monitor_section (bool yn)
}
}
void
Mixer_UI::toggle_foldback_strip ()
{
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
showhide_foldback_strip (act->get_active());
}
void
Mixer_UI::showhide_foldback_strip (bool yn)
{
_show_foldback_strip = yn;
if (foldback_strip) {
if (yn) {
foldback_strip->show();
} else {
foldback_strip->hide();
}
}
}
void
Mixer_UI::toggle_vcas ()
{
@ -2330,6 +2361,15 @@ Mixer_UI::set_state (const XMLNode& node, int version)
act->set_active (yn);
}
yn = true;
node.get_property ("foldback-strip-visible", yn);
{
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleFoldbackStrip"));
/* do it twice to force the change */
act->set_active (!yn);
act->set_active (yn);
}
yn = true;
node.get_property ("show-vca-pane", yn);
{
@ -2444,6 +2484,9 @@ Mixer_UI::get_state ()
act = ActionManager::get_toggle_action ("Mixer", "ToggleMonitorSection");
node->set_property ("monitor-section-visible", act->get_active ());
act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
node->set_property ("foldback-strip-visible", act->get_active ());
act = ActionManager::get_toggle_action ("Mixer", "ToggleVCAPane");
node->set_property ("show-vca-pane", act->get_active ());
@ -3357,6 +3400,9 @@ Mixer_UI::register_actions ()
#endif
ActionManager::register_toggle_action (group, X_("ToggleMonitorSection"), _("Mixer: Show Monitor Section"), sigc::mem_fun (*this, &Mixer_UI::toggle_monitor_section));
ActionManager::register_toggle_action (group, X_("ToggleFoldbackStrip"), _("Mixer: Show Foldback Strip"), sigc::mem_fun (*this, &Mixer_UI::toggle_foldback_strip));
}
void

View File

@ -145,6 +145,9 @@ public:
void toggle_monitor_section ();
void showhide_monitor_section (bool);
void toggle_foldback_strip ();
void showhide_foldback_strip (bool);
void toggle_vcas ();
void showhide_vcas (bool on);
@ -305,6 +308,7 @@ private:
MonitorSection _monitor_section;
PluginSelector *_plugin_selector;
FoldbackStrip * foldback_strip;
bool _show_foldback_strip;
void stripable_property_changed (const PBD::PropertyChange& what_changed, boost::weak_ptr<ARDOUR::Stripable> ws);
void route_group_property_changed (ARDOUR::RouteGroup *, const PBD::PropertyChange &);