allow to show/hide Monitor Section
This commit is contained in:
parent
d9eb5e00c5
commit
ffde3968ec
|
@ -505,6 +505,7 @@
|
|||
<menuitem action='show-editor-mixer'/>
|
||||
<menuitem action='show-editor-list'/>
|
||||
<menuitem action='ToggleMixerList'/>
|
||||
<menuitem action='ToggleMonitorSection'/>
|
||||
<menuitem action='ToggleMeasureVisibility'/>
|
||||
<menuitem action='ToggleSummary'/>
|
||||
<menuitem action='ToggleGroupTabs'/>
|
||||
|
|
|
@ -203,6 +203,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
void toggle_editing_space();
|
||||
void toggle_mixer_space();
|
||||
void toggle_mixer_list();
|
||||
void toggle_monitor_section_visibility ();
|
||||
void toggle_keep_tearoffs();
|
||||
|
||||
static PublicEditor* _instance;
|
||||
|
|
|
@ -597,3 +597,14 @@ ARDOUR_UI::toggle_mixer_list()
|
|||
mixer->show_mixer_list (tact->get_active());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_monitor_section_visibility ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMonitorSection");
|
||||
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
mixer->show_monitor_section (tact->get_active());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,6 +218,9 @@ ARDOUR_UI::install_actions ()
|
|||
act = ActionManager::register_toggle_action (common_actions, X_("ToggleMixerList"), _("Toggle Mixer List"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_list));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_toggle_action (common_actions, X_("ToggleMonitorSection"), _("Toggle Monitor Section Visibility"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_monitor_section_visibility));
|
||||
act->set_sensitive (false);
|
||||
|
||||
if (Profile->get_mixbus())
|
||||
ActionManager::register_action (common_actions, X_("show-ui-prefs"), _("Show more UI preferences"), sigc::mem_fun (*this, &ARDOUR_UI::show_ui_prefs));
|
||||
|
||||
|
|
|
@ -257,6 +257,7 @@
|
|||
<ColorAlias name="midi device: led active" alias="color 17"/>
|
||||
<ColorAlias name="midi frame base" alias="color 87"/>
|
||||
<ColorAlias name="midi input button: fill active" alias="color 48"/>
|
||||
<ColorAlias name="monitor section button: fill active" alias="color 42"/>
|
||||
<ColorAlias name="midi input button: led active" alias="color 4"/>
|
||||
<ColorAlias name="midi meter color0" alias="color 52"/>
|
||||
<ColorAlias name="midi meter color1" alias="color 53"/>
|
||||
|
|
|
@ -96,6 +96,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, bool in_mixer)
|
|||
, mute_solo_table (1, 2)
|
||||
, bottom_button_table (1, 3)
|
||||
, meter_point_button (_("pre"))
|
||||
, monitor_section_button (0)
|
||||
, midi_input_enable_button (0)
|
||||
, _comment_button (_("Comments"))
|
||||
, trim_control (ArdourKnob::default_elements, ArdourKnob::Flags (ArdourKnob::Detent | ArdourKnob::ArcToZero))
|
||||
|
@ -126,6 +127,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt
|
|||
, mute_solo_table (1, 2)
|
||||
, bottom_button_table (1, 3)
|
||||
, meter_point_button (_("pre"))
|
||||
, monitor_section_button (0)
|
||||
, midi_input_enable_button (0)
|
||||
, _comment_button (_("Comments"))
|
||||
, trim_control (ArdourKnob::default_elements, ArdourKnob::Flags (ArdourKnob::Detent | ArdourKnob::ArcToZero))
|
||||
|
@ -491,13 +493,23 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
|
|||
}
|
||||
|
||||
if (route()->is_master()) {
|
||||
mute_solo_table.attach (*mute_button, 0, 2, 0, 1);
|
||||
solo_button->hide ();
|
||||
mute_button->show ();
|
||||
rec_mon_table.hide ();
|
||||
if (solo_iso_table.get_parent()) {
|
||||
solo_iso_table.get_parent()->remove(solo_iso_table);
|
||||
}
|
||||
if (monitor_section_button == 0) {
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMonitorSection");
|
||||
monitor_section_button = manage (new ArdourButton);
|
||||
monitor_section_button->set_name ("monitor section button");
|
||||
monitor_section_button->set_related_action (act);
|
||||
set_tooltip (monitor_section_button, _("Show/Hide Monitoring Section"));
|
||||
mute_solo_table.attach (*monitor_section_button, 1, 2, 0, 1);
|
||||
monitor_section_button->show();
|
||||
monitor_section_button->unset_flags (Gtk::CAN_FOCUS);
|
||||
}
|
||||
parameter_changed ("use-monitor-bus");
|
||||
} else {
|
||||
bottom_button_table.attach (group_button, 1, 2, 0, 1);
|
||||
mute_solo_table.attach (*mute_button, 0, 1, 0, 1);
|
||||
|
@ -2076,6 +2088,9 @@ MixerStrip::set_button_names ()
|
|||
mute_button->set_text (_("Mute"));
|
||||
monitor_input_button->set_text (_("In"));
|
||||
monitor_disk_button->set_text (_("Disk"));
|
||||
if (monitor_section_button) {
|
||||
monitor_section_button->set_text (_("Mon"));
|
||||
}
|
||||
|
||||
if (_route && _route->solo_safe()) {
|
||||
solo_button->set_visual_state (Gtkmm2ext::VisualState (solo_button->visual_state() | Gtkmm2ext::Insensitive));
|
||||
|
@ -2102,6 +2117,9 @@ MixerStrip::set_button_names ()
|
|||
mute_button->set_text (S_("Mute|M"));
|
||||
monitor_input_button->set_text (S_("MonitorInput|I"));
|
||||
monitor_disk_button->set_text (S_("MonitorDisk|D"));
|
||||
if (monitor_section_button) {
|
||||
monitor_section_button->set_text (S_("Mon|O"));
|
||||
}
|
||||
|
||||
if (_route && _route->solo_safe()) {
|
||||
solo_button->set_visual_state (Gtkmm2ext::VisualState (solo_button->visual_state() | Gtkmm2ext::Insensitive));
|
||||
|
@ -2199,6 +2217,25 @@ MixerStrip::parameter_changed (string p)
|
|||
else if (p == "track-name-number") {
|
||||
name_changed ();
|
||||
}
|
||||
else if (p == "use-monitor-bus") {
|
||||
if (monitor_section_button) {
|
||||
if (mute_button->get_parent()) {
|
||||
mute_button->get_parent()->remove(*mute_button);
|
||||
}
|
||||
if (monitor_section_button->get_parent()) {
|
||||
monitor_section_button->get_parent()->remove(*monitor_section_button);
|
||||
}
|
||||
if (_session->monitor_out()) {
|
||||
mute_solo_table.attach (*mute_button, 0, 1, 0, 1);
|
||||
mute_solo_table.attach (*monitor_section_button, 1, 2, 0, 1);
|
||||
mute_button->show();
|
||||
monitor_section_button->show();
|
||||
} else {
|
||||
mute_solo_table.attach (*mute_button, 0, 2, 0, 1);
|
||||
mute_button->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Called to decide whether the solo isolate / solo lock button visibility should
|
||||
|
|
|
@ -184,6 +184,8 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
|
|||
ArdourButton input_button;
|
||||
ArdourButton output_button;
|
||||
|
||||
ArdourButton* monitor_section_button;
|
||||
|
||||
void input_button_resized (Gtk::Allocation&);
|
||||
void output_button_resized (Gtk::Allocation&);
|
||||
|
||||
|
|
|
@ -259,6 +259,7 @@ Mixer_UI::Mixer_UI ()
|
|||
Mixer_UI::~Mixer_UI ()
|
||||
{
|
||||
if (_monitor_section) {
|
||||
monitor_section_detached ();
|
||||
delete _monitor_section;
|
||||
}
|
||||
delete _plugin_selector;
|
||||
|
@ -364,6 +365,11 @@ Mixer_UI::add_strips (RouteList& routes)
|
|||
_monitor_section->set_session (_session);
|
||||
_monitor_section->tearoff().show_all ();
|
||||
|
||||
_monitor_section->tearoff().Detach.connect (sigc::mem_fun(*this, &Mixer_UI::monitor_section_detached));
|
||||
_monitor_section->tearoff().Attach.connect (sigc::mem_fun(*this, &Mixer_UI::monitor_section_attached));
|
||||
|
||||
monitor_section_attached ();
|
||||
|
||||
route->DropReferences.connect (*this, invalidator(*this), boost::bind (&Mixer_UI::monitor_section_going_away, this), gui_context());
|
||||
|
||||
/* no regular strip shown for control out */
|
||||
|
@ -803,9 +809,11 @@ Mixer_UI::session_going_away ()
|
|||
delete (*i);
|
||||
}
|
||||
|
||||
if (_monitor_section) {
|
||||
_monitor_section->tearoff().hide_visible ();
|
||||
}
|
||||
if (_monitor_section) {
|
||||
_monitor_section->tearoff().hide_visible ();
|
||||
}
|
||||
|
||||
monitor_section_detached ();
|
||||
|
||||
strips.clear ();
|
||||
|
||||
|
@ -1447,6 +1455,22 @@ Mixer_UI::show_mixer_list (bool yn)
|
|||
_show_mixer_list = yn;
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::show_monitor_section (bool yn)
|
||||
{
|
||||
if (!monitor_section()) {
|
||||
return;
|
||||
}
|
||||
if (monitor_section()->tearoff().torn_off()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (yn) {
|
||||
monitor_section()->tearoff().show();
|
||||
} else {
|
||||
monitor_section()->tearoff().hide();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::route_group_name_edit (const std::string& path, const std::string& new_text)
|
||||
|
@ -1881,6 +1905,10 @@ Mixer_UI::parameter_changed (string const & p)
|
|||
}
|
||||
} else if (p == "remote-model") {
|
||||
reset_remote_control_ids ();
|
||||
} else if (p == "use-monitor-bus") {
|
||||
if (!_session->monitor_out()) {
|
||||
monitor_section_detached ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2026,6 +2054,7 @@ void
|
|||
Mixer_UI::monitor_section_going_away ()
|
||||
{
|
||||
if (_monitor_section) {
|
||||
monitor_section_detached ();
|
||||
out_packer.remove (_monitor_section->tearoff());
|
||||
_monitor_section->set_session (0);
|
||||
}
|
||||
|
@ -2074,3 +2103,19 @@ Mixer_UI::restore_mixer_space ()
|
|||
|
||||
_maximised = false;
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::monitor_section_attached ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMonitorSection");
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
act->set_sensitive (true);
|
||||
tact->set_active ();
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::monitor_section_detached ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMonitorSection");
|
||||
act->set_sensitive (false);
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
|
|||
int set_state (const XMLNode& );
|
||||
|
||||
void show_mixer_list (bool yn);
|
||||
void show_monitor_section (bool);
|
||||
|
||||
void show_window ();
|
||||
bool hide_window (GdkEventAny *ev);
|
||||
|
@ -293,6 +294,9 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
|
|||
|
||||
void monitor_section_going_away ();
|
||||
|
||||
void monitor_section_attached ();
|
||||
void monitor_section_detached ();
|
||||
|
||||
/// true if we are in fullscreen mode
|
||||
bool _maximised;
|
||||
|
||||
|
|
Loading…
Reference in New Issue