2013-01-16 13:22:15 -05:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2010-2019 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2011-2012 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2011 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2014-2015 Tim Mayberry <mojofunk@gmail.com>
|
|
|
|
* Copyright (C) 2014-2018 Ben Loftis <ben@harrisonconsoles.com>
|
|
|
|
* Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2013-01-16 13:22:15 -05:00
|
|
|
|
2010-03-10 12:31:16 -05:00
|
|
|
#include <gdkmm/pixbuf.h>
|
|
|
|
|
|
|
|
#include "pbd/compose.h"
|
|
|
|
#include "pbd/error.h"
|
2015-04-21 09:18:10 -04:00
|
|
|
#include "pbd/replace_all.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
|
|
|
|
#include "gtkmm2ext/actions.h"
|
2015-10-15 05:24:15 -04:00
|
|
|
#include "gtkmm2ext/utils.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-07-18 09:47:45 -04:00
|
|
|
#include <gtkmm/menu.h>
|
|
|
|
#include <gtkmm/menuitem.h>
|
|
|
|
|
2017-07-16 22:55:52 -04:00
|
|
|
#include "widgets/tearoff.h"
|
2017-07-15 11:38:28 -04:00
|
|
|
#include "widgets/tooltips.h"
|
|
|
|
|
2015-12-23 08:41:54 -05:00
|
|
|
#include "ardour/amp.h"
|
2015-04-21 09:18:10 -04:00
|
|
|
#include "ardour/audioengine.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
#include "ardour/monitor_processor.h"
|
2015-04-21 09:18:10 -04:00
|
|
|
#include "ardour/port.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
#include "ardour/route.h"
|
2016-04-08 16:49:47 -04:00
|
|
|
#include "ardour/solo_isolate_control.h"
|
2014-12-22 22:54:25 -05:00
|
|
|
#include "ardour/user_bundle.h"
|
2015-12-21 06:43:38 -05:00
|
|
|
#include "ardour/plugin_manager.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2016-03-15 16:43:52 -04:00
|
|
|
#include "ardour_ui.h"
|
2010-03-25 12:03:31 -04:00
|
|
|
#include "gui_thread.h"
|
2016-11-10 21:54:50 -05:00
|
|
|
#include "mixer_ui.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
#include "monitor_section.h"
|
2010-03-11 17:51:24 -05:00
|
|
|
#include "public_editor.h"
|
2014-12-25 10:02:00 -05:00
|
|
|
#include "timers.h"
|
2015-01-04 10:58:46 -05:00
|
|
|
#include "ui_config.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
#include "utils.h"
|
|
|
|
|
2016-07-14 14:44:52 -04:00
|
|
|
#include "pbd/i18n.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
|
|
|
|
using namespace ARDOUR;
|
2017-07-15 11:38:28 -04:00
|
|
|
using namespace ArdourWidgets;
|
2014-06-25 15:27:37 -04:00
|
|
|
using namespace ARDOUR_UI_UTILS;
|
2010-03-10 12:31:16 -05:00
|
|
|
using namespace Gtk;
|
|
|
|
using namespace Gtkmm2ext;
|
|
|
|
using namespace PBD;
|
|
|
|
using namespace std;
|
|
|
|
|
2015-01-02 09:44:54 -05:00
|
|
|
#define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
|
2015-04-22 18:23:04 -04:00
|
|
|
|
2019-03-01 10:51:08 -05:00
|
|
|
#define SYNCHRONIZE_TOGGLE_ACTION(action, value) \
|
|
|
|
if (action && action->get_active() != value) { \
|
|
|
|
action->set_active(value); \
|
|
|
|
}
|
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
MonitorSection::MonitorSection ()
|
|
|
|
: RouteUI ((Session*) 0)
|
2014-11-17 19:39:57 -05:00
|
|
|
, _tearoff (0)
|
2017-01-19 09:42:27 -05:00
|
|
|
, channel_table (0)
|
2014-11-17 19:39:57 -05:00
|
|
|
, channel_table_viewport (*channel_table_scroller.get_hadjustment()
|
2016-03-15 12:41:14 -04:00
|
|
|
, *channel_table_scroller.get_vadjustment ())
|
2014-11-17 19:39:57 -05:00
|
|
|
, gain_control (0)
|
|
|
|
, dim_control (0)
|
|
|
|
, solo_boost_control (0)
|
|
|
|
, solo_cut_control (0)
|
|
|
|
, gain_display (0)
|
|
|
|
, dim_display (0)
|
|
|
|
, solo_boost_display (0)
|
|
|
|
, solo_cut_display (0)
|
2023-05-23 22:06:03 -04:00
|
|
|
, _output_button (false)
|
2014-11-17 19:39:57 -05:00
|
|
|
, solo_in_place_button (_("SiP"), ArdourButton::led_default_elements)
|
|
|
|
, afl_button (_("AFL"), ArdourButton::led_default_elements)
|
2011-11-03 17:35:20 -04:00
|
|
|
, pfl_button (_("PFL"), ArdourButton::led_default_elements)
|
2011-10-29 11:54:30 -04:00
|
|
|
, exclusive_solo_button (ArdourButton::led_default_elements)
|
|
|
|
, solo_mute_override_button (ArdourButton::led_default_elements)
|
2015-12-23 08:41:54 -05:00
|
|
|
, toggle_processorbox_button (ArdourButton::default_elements)
|
2011-11-19 12:04:48 -05:00
|
|
|
, _inhibit_solo_model_update (false)
|
2017-05-05 07:31:49 -04:00
|
|
|
, _rr_selection ()
|
2015-12-23 08:41:54 -05:00
|
|
|
, _ui_initialized (false)
|
2010-03-10 12:31:16 -05:00
|
|
|
{
|
2018-12-11 12:25:31 -05:00
|
|
|
/* note that although this a RouteUI, we never called ::set_route() so
|
|
|
|
* we do not need to worry about self-destructing when the Route (the
|
|
|
|
* monitor out) is destroyed.
|
|
|
|
*/
|
2018-12-15 11:58:37 -05:00
|
|
|
|
2014-07-18 09:47:45 -04:00
|
|
|
using namespace Menu_Helpers;
|
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
Glib::RefPtr<Action> act;
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2018-12-10 18:41:59 -05:00
|
|
|
load_bindings ();
|
|
|
|
register_actions ();
|
|
|
|
set_data ("ardour-bindings", bindings);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2017-01-19 09:42:27 -05:00
|
|
|
channel_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
|
|
|
|
|
2018-12-15 11:58:37 -05:00
|
|
|
insert_box = new ProcessorBox (0, boost::bind (&MonitorSection::plugin_selector, this), _rr_selection, 0);
|
2015-12-21 06:43:38 -05:00
|
|
|
insert_box->set_no_show_all ();
|
|
|
|
insert_box->show ();
|
|
|
|
// TODO allow keyboard shortcuts in ProcessorBox
|
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
/* Rude Solo & Solo Isolated */
|
2014-08-01 15:31:18 -04:00
|
|
|
rude_solo_button.set_text (_("Soloing"));
|
2011-10-29 11:54:30 -04:00
|
|
|
rude_solo_button.set_name ("rude solo");
|
2014-11-17 19:39:57 -05:00
|
|
|
rude_solo_button.show ();
|
2010-03-11 09:33:21 -05:00
|
|
|
|
2014-08-01 15:31:18 -04:00
|
|
|
rude_iso_button.set_text (_("Isolated"));
|
2011-10-29 11:54:30 -04:00
|
|
|
rude_iso_button.set_name ("rude isolate");
|
2014-11-17 19:39:57 -05:00
|
|
|
rude_iso_button.show ();
|
2010-05-06 14:40:37 -04:00
|
|
|
|
2014-08-01 15:31:18 -04:00
|
|
|
rude_audition_button.set_text (_("Auditioning"));
|
2011-10-29 11:54:30 -04:00
|
|
|
rude_audition_button.set_name ("rude audition");
|
2014-11-17 19:39:57 -05:00
|
|
|
rude_audition_button.show ();
|
2010-05-04 12:39:03 -04:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
Timers::blink_connect (sigc::mem_fun (*this, &MonitorSection::do_blink));
|
2010-05-04 12:39:03 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
UI::instance()->set_tip (rude_solo_button, _("When active, something is soloed.\nClick to de-solo everything"));
|
2010-03-11 09:33:21 -05:00
|
|
|
|
2014-08-28 11:31:57 -04:00
|
|
|
rude_iso_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_isolate), false);
|
2014-11-17 19:39:57 -05:00
|
|
|
UI::instance()->set_tip (rude_iso_button, _("When active, something is solo-isolated.\nClick to de-isolate everything"));
|
2010-05-06 14:40:37 -04:00
|
|
|
|
2014-08-28 11:31:57 -04:00
|
|
|
rude_audition_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_audition), false);
|
2014-11-17 19:39:57 -05:00
|
|
|
UI::instance()->set_tip (rude_audition_button, _("When active, auditioning is active.\nClick to stop the audition"));
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
/* SIP, AFL, PFL radio */
|
|
|
|
|
2011-11-03 17:35:20 -04:00
|
|
|
solo_in_place_button.set_name ("monitor section solo model");
|
|
|
|
afl_button.set_name ("monitor section solo model");
|
|
|
|
pfl_button.set_name ("monitor section solo model");
|
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
solo_in_place_button.set_led_left (true);
|
|
|
|
afl_button.set_led_left (true);
|
|
|
|
pfl_button.set_led_left (true);
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
solo_in_place_button.show ();
|
|
|
|
afl_button.show ();
|
|
|
|
pfl_button.show ();
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
act = ActionManager::get_action (X_("Solo"), X_("solo-use-in-place"));
|
2015-01-05 00:32:14 -05:00
|
|
|
set_tooltip (solo_in_place_button, _("Solo controls affect solo-in-place"));
|
2014-11-17 19:39:57 -05:00
|
|
|
if (act) {
|
2011-11-03 17:35:20 -04:00
|
|
|
solo_in_place_button.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-11 09:33:21 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
act = ActionManager::get_action (X_("Solo"), X_("solo-use-afl"));
|
2015-01-05 00:32:14 -05:00
|
|
|
set_tooltip (afl_button, _("Solo controls toggle after-fader-listen"));
|
2014-11-17 19:39:57 -05:00
|
|
|
if (act) {
|
2011-11-03 17:35:20 -04:00
|
|
|
afl_button.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-11 09:33:21 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
act = ActionManager::get_action (X_("Solo"), X_("solo-use-pfl"));
|
2015-01-05 00:32:14 -05:00
|
|
|
set_tooltip (pfl_button, _("Solo controls toggle pre-fader-listen"));
|
2014-11-17 19:39:57 -05:00
|
|
|
if (act) {
|
2011-11-03 17:35:20 -04:00
|
|
|
pfl_button.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
/* Solo option buttons */
|
|
|
|
exclusive_solo_button.set_text (_("Excl. Solo"));
|
2016-01-01 07:20:11 -05:00
|
|
|
exclusive_solo_button.set_name (X_("monitor section solo option"));
|
2015-12-19 18:16:42 -05:00
|
|
|
set_tooltip (&exclusive_solo_button, _("Exclusive solo means that only 1 solo is active at a time"));
|
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
act = ActionManager::get_action (X_("Solo"), X_("toggle-exclusive-solo"));
|
2015-12-19 18:16:42 -05:00
|
|
|
if (act) {
|
|
|
|
exclusive_solo_button.set_related_action (act);
|
|
|
|
}
|
|
|
|
|
|
|
|
solo_mute_override_button.set_text (_("Solo » Mute"));
|
2016-01-01 07:20:11 -05:00
|
|
|
solo_mute_override_button.set_name (X_("monitor section solo option"));
|
2015-12-19 18:16:42 -05:00
|
|
|
set_tooltip (&solo_mute_override_button, _("If enabled, solo will override mute\n(a soloed & muted track or bus will be audible)"));
|
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
solo_mute_override_button.set_related_action (ActionManager::get_action (X_("Solo"), X_("toggle-mute-overrides-solo")));
|
2015-12-19 18:16:42 -05:00
|
|
|
|
2015-12-23 08:41:54 -05:00
|
|
|
/* Processor Box hide/shos */
|
|
|
|
toggle_processorbox_button.set_text (_("Processors"));
|
2016-01-01 07:20:11 -05:00
|
|
|
toggle_processorbox_button.set_name (X_("monitor section processors toggle"));
|
2016-02-22 15:01:23 -05:00
|
|
|
set_tooltip (&toggle_processorbox_button, _("Allow one to add monitor effect processors"));
|
2015-12-23 08:41:54 -05:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
proctoggle = ActionManager::get_toggle_action (X_("Monitor"), X_("toggle-monitor-processor-box"));
|
2015-12-23 08:41:54 -05:00
|
|
|
toggle_processorbox_button.set_related_action (proctoggle);
|
2015-12-19 18:16:42 -05:00
|
|
|
|
|
|
|
/* Knobs */
|
|
|
|
Label* solo_boost_label;
|
|
|
|
Label* solo_cut_label;
|
|
|
|
Label* dim_label;
|
|
|
|
|
|
|
|
/* Solo Boost Knob */
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
solo_boost_control = new ArdourKnob ();
|
2016-01-01 07:20:11 -05:00
|
|
|
solo_boost_control->set_name("monitor section knob");
|
2015-12-19 18:16:42 -05:00
|
|
|
solo_boost_control->set_size_request (PX_SCALE(36), PX_SCALE(36));
|
2015-01-05 00:32:14 -05:00
|
|
|
set_tooltip (*solo_boost_control, _("Gain increase for soloed signals (0dB is normal)"));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
solo_boost_display = new ArdourDisplay ();
|
2020-01-12 18:22:39 -05:00
|
|
|
set_tooltip (*solo_boost_display, _("Gain increase for soloed signals (0dB is normal)"));
|
|
|
|
solo_boost_display->set_name("monitor section button");
|
2015-12-19 18:16:42 -05:00
|
|
|
solo_boost_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
|
2015-04-04 20:31:10 -04:00
|
|
|
solo_boost_display->add_controllable_preset(_("0 dB"), 0.0);
|
|
|
|
solo_boost_display->add_controllable_preset(_("3 dB"), 3.0);
|
|
|
|
solo_boost_display->add_controllable_preset(_("6 dB"), 6.0);
|
|
|
|
solo_boost_display->add_controllable_preset(_("10 dB"), 10.0);
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
solo_boost_label = manage (new Label (_("Solo Boost")));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
/* Solo (SiP) cut */
|
|
|
|
|
|
|
|
solo_cut_control = new ArdourKnob ();
|
2016-01-01 07:20:11 -05:00
|
|
|
solo_cut_control->set_name ("monitor section knob");
|
2015-12-19 18:16:42 -05:00
|
|
|
solo_cut_control->set_size_request (PX_SCALE(36), PX_SCALE(36));
|
2015-01-05 00:32:14 -05:00
|
|
|
set_tooltip (*solo_cut_control, _("Gain reduction non-soloed signals\nA value above -inf dB causes \"solo-in-front\""));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
solo_cut_display = new ArdourDisplay ();
|
2020-01-12 18:22:39 -05:00
|
|
|
set_tooltip (*solo_cut_display, _("Gain reduction non-soloed signals\nA value above -inf dB causes \"solo-in-front\""));
|
|
|
|
solo_cut_display->set_name("monitor section button");
|
2015-12-19 18:16:42 -05:00
|
|
|
solo_cut_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
|
2015-04-04 20:31:10 -04:00
|
|
|
solo_cut_display->add_controllable_preset(_("0 dB"), 0.0);
|
|
|
|
solo_cut_display->add_controllable_preset(_("-6 dB"), -6.0);
|
|
|
|
solo_cut_display->add_controllable_preset(_("-12 dB"), -12.0);
|
|
|
|
solo_cut_display->add_controllable_preset(_("-20 dB"), -20.0);
|
|
|
|
solo_cut_display->add_controllable_preset(_("OFF"), -1200.0);
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
solo_cut_label = manage (new Label (_("SiP Cut")));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
/* Dim */
|
|
|
|
|
2015-04-25 11:00:02 -04:00
|
|
|
dim_control = new ArdourKnob (ArdourKnob::default_elements, ArdourKnob::Detent);
|
2016-01-01 07:20:11 -05:00
|
|
|
dim_control->set_name ("monitor section knob");
|
2015-12-19 18:16:42 -05:00
|
|
|
dim_control->set_size_request (PX_SCALE(36), PX_SCALE(36));
|
2015-01-05 00:32:14 -05:00
|
|
|
set_tooltip (*dim_control, _("Gain reduction to use when dimming monitor outputs"));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
dim_display = new ArdourDisplay ();
|
2020-01-12 18:22:39 -05:00
|
|
|
set_tooltip (*dim_display, _("Gain reduction to use when dimming monitor outputs"));
|
|
|
|
dim_display->set_name ("monitor section button");
|
2015-12-19 18:16:42 -05:00
|
|
|
dim_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
|
2015-04-04 20:31:10 -04:00
|
|
|
dim_display->add_controllable_preset(_("0 dB"), 0.0);
|
|
|
|
dim_display->add_controllable_preset(_("-3 dB"), -3.0);
|
|
|
|
dim_display->add_controllable_preset(_("-6 dB"), -6.0);
|
|
|
|
dim_display->add_controllable_preset(_("-12 dB"), -12.0);
|
|
|
|
dim_display->add_controllable_preset(_("-20 dB"), -20.0);
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
dim_label = manage (new Label (_("Dim")));
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
// mute button
|
2014-11-17 19:39:57 -05:00
|
|
|
cut_all_button.set_text (_("Mute"));
|
2016-01-01 07:20:11 -05:00
|
|
|
cut_all_button.set_name ("mute button");
|
2015-12-19 18:16:42 -05:00
|
|
|
cut_all_button.set_size_request (-1, PX_SCALE(30));
|
2014-11-17 19:39:57 -05:00
|
|
|
cut_all_button.show ();
|
2011-10-29 11:54:30 -04:00
|
|
|
|
2019-02-16 15:04:16 -05:00
|
|
|
act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-cut-all"));
|
2014-11-17 19:39:57 -05:00
|
|
|
if (act) {
|
2011-10-29 11:54:30 -04:00
|
|
|
cut_all_button.set_related_action (act);
|
2012-01-17 20:30:44 -05:00
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
// dim button
|
2014-08-01 15:31:18 -04:00
|
|
|
dim_all_button.set_text (_("Dim"));
|
2011-10-29 11:54:30 -04:00
|
|
|
dim_all_button.set_name ("monitor section dim");
|
2015-12-23 08:41:54 -05:00
|
|
|
dim_all_button.set_size_request (-1, PX_SCALE(25));
|
2019-02-16 15:04:16 -05:00
|
|
|
act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-dim-all"));
|
2014-11-17 19:39:57 -05:00
|
|
|
if (act) {
|
2011-10-29 11:54:30 -04:00
|
|
|
dim_all_button.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
// mono button
|
2014-08-01 15:31:18 -04:00
|
|
|
mono_button.set_text (_("Mono"));
|
2011-10-29 11:54:30 -04:00
|
|
|
mono_button.set_name ("monitor section mono");
|
2015-12-23 08:41:54 -05:00
|
|
|
mono_button.set_size_request (-1, PX_SCALE(25));
|
2019-02-16 15:04:16 -05:00
|
|
|
act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-mono"));
|
2014-11-17 19:39:57 -05:00
|
|
|
if (act) {
|
2011-10-29 11:54:30 -04:00
|
|
|
mono_button.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Gain */
|
|
|
|
|
2015-04-25 11:00:02 -04:00
|
|
|
gain_control = new ArdourKnob (ArdourKnob::default_elements, ArdourKnob::Detent);
|
2016-01-01 07:20:11 -05:00
|
|
|
gain_control->set_name("monitor section knob");
|
2015-12-21 06:43:38 -05:00
|
|
|
gain_control->set_size_request (PX_SCALE(60), PX_SCALE(60));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
gain_display = new ArdourDisplay ();
|
2020-01-12 18:22:39 -05:00
|
|
|
gain_display->set_name("monitor section button");
|
2015-12-19 18:16:42 -05:00
|
|
|
gain_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
|
2015-04-04 20:31:10 -04:00
|
|
|
gain_display->add_controllable_preset(_("0 dB"), 0.0);
|
|
|
|
gain_display->add_controllable_preset(_("-3 dB"), -3.0);
|
|
|
|
gain_display->add_controllable_preset(_("-6 dB"), -6.0);
|
|
|
|
gain_display->add_controllable_preset(_("-12 dB"), -12.0);
|
|
|
|
gain_display->add_controllable_preset(_("-20 dB"), -20.0);
|
|
|
|
gain_display->add_controllable_preset(_("-30 dB"), -30.0);
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2015-04-21 09:18:10 -04:00
|
|
|
Label* output_label = manage (new Label (_("Output")));
|
|
|
|
output_label->set_name (X_("MonitorSectionLabel"));
|
|
|
|
|
2011-11-02 09:55:06 -04:00
|
|
|
channel_table_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
2015-04-22 18:23:04 -04:00
|
|
|
channel_table_scroller.set_size_request (-1, PX_SCALE(150));
|
2011-11-02 09:55:06 -04:00
|
|
|
channel_table_scroller.set_shadow_type (Gtk::SHADOW_NONE);
|
|
|
|
channel_table_scroller.show ();
|
2012-04-06 07:18:22 -04:00
|
|
|
channel_table_scroller.add (channel_table_viewport);
|
|
|
|
|
2011-11-02 09:55:06 -04:00
|
|
|
channel_size_group->add_widget (channel_table_header);
|
|
|
|
channel_table_header.resize (1, 5);
|
2014-08-01 15:31:18 -04:00
|
|
|
|
|
|
|
Label* l1 = manage (new Label (X_(" ")));
|
2011-11-02 10:56:58 -04:00
|
|
|
l1->set_name (X_("MonitorSectionLabel"));
|
2014-08-01 15:31:18 -04:00
|
|
|
channel_table_header.attach (*l1, 0, 1, 0, 1, EXPAND|FILL);
|
|
|
|
|
2015-04-04 19:23:55 -04:00
|
|
|
l1 = manage (new Label (_("Mute")));
|
2011-11-02 10:56:58 -04:00
|
|
|
l1->set_name (X_("MonitorSectionLabel"));
|
2014-08-01 15:31:18 -04:00
|
|
|
channel_table_header.attach (*l1, 1, 2, 0, 1, EXPAND|FILL);
|
|
|
|
|
2015-04-04 19:23:55 -04:00
|
|
|
l1 = manage (new Label (_("Dim")));
|
2011-11-02 10:56:58 -04:00
|
|
|
l1->set_name (X_("MonitorSectionLabel"));
|
2014-08-01 15:31:18 -04:00
|
|
|
channel_table_header.attach (*l1, 2, 3, 0, 1, EXPAND|FILL);
|
|
|
|
|
2015-04-04 19:23:55 -04:00
|
|
|
l1 = manage (new Label (_("Solo")));
|
2011-11-02 10:56:58 -04:00
|
|
|
l1->set_name (X_("MonitorSectionLabel"));
|
2014-08-01 15:31:18 -04:00
|
|
|
channel_table_header.attach (*l1, 3, 4, 0, 1, EXPAND|FILL);
|
|
|
|
|
2015-04-04 19:23:55 -04:00
|
|
|
l1 = manage (new Label (_("Inv")));
|
2011-11-02 10:56:58 -04:00
|
|
|
l1->set_name (X_("MonitorSectionLabel"));
|
2014-08-01 15:31:18 -04:00
|
|
|
channel_table_header.attach (*l1, 4, 5, 0, 1, EXPAND|FILL);
|
|
|
|
|
2011-11-02 09:55:06 -04:00
|
|
|
channel_table_header.show ();
|
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* LAYOUT top to bottom
|
|
|
|
*/
|
|
|
|
|
2019-12-10 15:35:03 -05:00
|
|
|
Gtk::Label *top_spacer = manage (new Gtk::Label);
|
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
// solo, iso information
|
|
|
|
HBox* rude_box = manage (new HBox);
|
|
|
|
rude_box->set_spacing (PX_SCALE(4));
|
|
|
|
rude_box->set_homogeneous (true);
|
|
|
|
rude_box->pack_start (rude_solo_button, true, true);
|
|
|
|
rude_box->pack_start (rude_iso_button, true, true);
|
|
|
|
|
|
|
|
// solo options (right align)
|
|
|
|
HBox* tbx1 = manage (new HBox);
|
|
|
|
tbx1->pack_end (exclusive_solo_button, false, false);
|
|
|
|
|
|
|
|
HBox* tbx2 = manage (new HBox);
|
|
|
|
tbx2->pack_end (solo_mute_override_button, false, false);
|
|
|
|
|
2015-12-23 08:41:54 -05:00
|
|
|
HBox* tbx3 = manage (new HBox);
|
|
|
|
tbx3->pack_end (toggle_processorbox_button, false, false);
|
|
|
|
|
2015-12-19 19:11:09 -05:00
|
|
|
HBox* tbx0 = manage (new HBox); // space
|
2015-12-19 18:16:42 -05:00
|
|
|
|
2015-12-19 19:11:09 -05:00
|
|
|
// combined solo mode (Sip, AFL, PFL) & solo options
|
|
|
|
Table *solo_tbl = manage (new Table);
|
|
|
|
solo_tbl->attach (solo_in_place_button, 0, 1, 0, 1, EXPAND|FILL, SHRINK, 0, 2);
|
|
|
|
solo_tbl->attach (pfl_button, 0, 1, 1, 2, EXPAND|FILL, SHRINK, 0, 2);
|
|
|
|
solo_tbl->attach (afl_button, 0, 1, 2, 3, EXPAND|FILL, SHRINK, 0, 2);
|
|
|
|
solo_tbl->attach (*tbx0, 1, 2, 0, 3, EXPAND|FILL, SHRINK, 2, 2);
|
2015-12-23 08:41:54 -05:00
|
|
|
solo_tbl->attach (*tbx1, 2, 3, 0, 1, EXPAND|FILL, SHRINK, 0, 2);
|
|
|
|
solo_tbl->attach (*tbx2, 2, 3, 1, 2, EXPAND|FILL, SHRINK, 0, 2);
|
|
|
|
solo_tbl->attach (*tbx3, 2, 3, 2, 3, EXPAND|FILL, SHRINK, 0, 2);
|
2015-12-19 18:16:42 -05:00
|
|
|
|
|
|
|
// boost, cut, dim volume control
|
|
|
|
Table *level_tbl = manage (new Table);
|
|
|
|
level_tbl->attach (*solo_boost_label, 0, 2, 0, 1, EXPAND|FILL, SHRINK, 1, 2);
|
|
|
|
level_tbl->attach (*solo_boost_control, 0, 2, 1, 2, EXPAND|FILL, SHRINK, 1, 2);
|
|
|
|
level_tbl->attach (*solo_boost_display, 0, 2, 2, 3, EXPAND , SHRINK, 1, 2);
|
|
|
|
|
|
|
|
level_tbl->attach (*solo_cut_label, 2, 4, 0, 1, EXPAND|FILL, SHRINK, 1, 2);
|
|
|
|
level_tbl->attach (*solo_cut_control, 2, 4, 1, 2, EXPAND|FILL, SHRINK, 1, 2);
|
|
|
|
level_tbl->attach (*solo_cut_display, 2, 4, 2, 3, EXPAND , SHRINK, 1, 2);
|
|
|
|
|
|
|
|
level_tbl->attach (*dim_label, 1, 3, 3, 4, EXPAND|FILL, SHRINK, 1, 2);
|
|
|
|
level_tbl->attach (*dim_control, 1, 3, 4, 5, EXPAND|FILL, SHRINK, 1, 2);
|
|
|
|
level_tbl->attach (*dim_display, 1, 3, 5, 6, EXPAND , SHRINK, 1, 2);
|
2011-10-29 16:32:59 -04:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
// mono, dim
|
|
|
|
HBox* mono_dim_box = manage (new HBox);
|
|
|
|
mono_dim_box->set_spacing (PX_SCALE(4));
|
|
|
|
mono_dim_box->set_homogeneous (true);
|
|
|
|
mono_dim_box->pack_start (mono_button, true, true);
|
|
|
|
mono_dim_box->pack_end (dim_all_button, true, true);
|
|
|
|
|
2016-03-15 12:41:14 -04:00
|
|
|
// master gain
|
2015-12-19 18:16:42 -05:00
|
|
|
Label* spin_label = manage (new Label (_("Monitor")));
|
|
|
|
VBox* spin_packer = manage (new VBox);
|
|
|
|
spin_packer->set_spacing (PX_SCALE(2));
|
|
|
|
spin_packer->pack_start (*spin_label, false, false);
|
|
|
|
spin_packer->pack_start (*gain_control, false, false);
|
|
|
|
spin_packer->pack_start (*gain_display, false, false);
|
|
|
|
|
2015-12-23 08:41:54 -05:00
|
|
|
master_packer.pack_start (*spin_packer, true, false);
|
2015-12-19 18:16:42 -05:00
|
|
|
|
2015-12-23 08:41:54 -05:00
|
|
|
// combined gain section (channels, mute, dim)
|
2015-12-19 18:16:42 -05:00
|
|
|
VBox* lower_packer = manage (new VBox);
|
2015-12-23 08:41:54 -05:00
|
|
|
lower_packer->pack_start (channel_table_header, false, false, PX_SCALE(0));
|
|
|
|
lower_packer->pack_start (channel_table_packer, false, false, PX_SCALE(8));
|
|
|
|
lower_packer->pack_start (*mono_dim_box, false, false, PX_SCALE(2));
|
|
|
|
lower_packer->pack_start (cut_all_button, false, false, PX_SCALE(2));
|
2011-10-29 11:54:30 -04:00
|
|
|
|
2016-12-20 21:51:50 -05:00
|
|
|
// calc height of mixer scrollbar
|
|
|
|
int scrollbar_height = 0;
|
|
|
|
{
|
|
|
|
Gtk::Window window (WINDOW_TOPLEVEL);
|
|
|
|
HScrollbar scrollbar;
|
|
|
|
window.add (scrollbar);
|
|
|
|
scrollbar.set_name ("MixerWindow");
|
|
|
|
scrollbar.ensure_style();
|
|
|
|
Gtk::Requisition requisition(scrollbar.size_request ());
|
|
|
|
scrollbar_height = requisition.height;
|
2021-04-03 16:19:33 -04:00
|
|
|
scrollbar_height += 3; // track_display_frame border/shadow
|
2016-12-20 21:51:50 -05:00
|
|
|
}
|
|
|
|
|
2016-03-15 12:41:14 -04:00
|
|
|
// output port select
|
2015-12-19 18:16:42 -05:00
|
|
|
VBox* out_packer = manage (new VBox);
|
|
|
|
out_packer->set_spacing (PX_SCALE(2));
|
|
|
|
out_packer->pack_start (*output_label, false, false);
|
2023-05-23 22:06:03 -04:00
|
|
|
out_packer->pack_start (_output_button, false, false);
|
2015-12-19 18:16:42 -05:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* TOP LEVEL LAYOUT
|
|
|
|
*/
|
2015-12-23 08:41:54 -05:00
|
|
|
vpacker.set_border_width (PX_SCALE(3));
|
2019-12-10 15:35:03 -05:00
|
|
|
vpacker.pack_start (*top_spacer, false, false, PX_SCALE(3));
|
2015-12-23 08:41:54 -05:00
|
|
|
vpacker.pack_start (*rude_box, false, false, PX_SCALE(3));
|
|
|
|
vpacker.pack_start (rude_audition_button, false, false, 0);
|
|
|
|
vpacker.pack_start (*solo_tbl, false, false, PX_SCALE(8));
|
|
|
|
vpacker.pack_start (*insert_box, true, true, PX_SCALE(8));
|
|
|
|
vpacker.pack_start (*level_tbl, false, false, PX_SCALE(8));
|
|
|
|
vpacker.pack_start (*lower_packer, false, false, PX_SCALE(8));
|
|
|
|
vpacker.pack_start (master_packer, false, false, PX_SCALE(10));
|
2016-12-20 21:51:50 -05:00
|
|
|
vpacker.pack_end (*out_packer, false, false,
|
|
|
|
#ifdef MIXBUS
|
2019-04-12 12:29:23 -04:00
|
|
|
scrollbar_height /* no outer frame */
|
2016-12-20 21:51:50 -05:00
|
|
|
#else
|
2019-04-11 20:44:23 -04:00
|
|
|
scrollbar_height + 2 /* frame borders */
|
2016-12-20 21:51:50 -05:00
|
|
|
#endif
|
|
|
|
);
|
2015-12-19 18:16:42 -05:00
|
|
|
|
|
|
|
hpacker.set_spacing (0);
|
2015-12-23 08:41:54 -05:00
|
|
|
hpacker.pack_start (vpacker, true, true);
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2016-03-15 12:41:14 -04:00
|
|
|
add (hpacker);
|
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
gain_control->show_all ();
|
|
|
|
gain_display->show_all ();
|
|
|
|
dim_control->show_all ();
|
|
|
|
dim_display->show_all();
|
|
|
|
solo_boost_control->show_all ();
|
|
|
|
solo_boost_display->show_all();
|
2010-03-19 16:53:22 -04:00
|
|
|
|
2015-12-19 18:16:42 -05:00
|
|
|
mono_dim_box->show ();
|
|
|
|
spin_packer->show ();
|
2015-12-23 08:41:54 -05:00
|
|
|
master_packer.show ();
|
2015-12-19 18:16:42 -05:00
|
|
|
|
|
|
|
rude_box->show();
|
2015-12-19 19:11:09 -05:00
|
|
|
solo_tbl->show_all();
|
2015-12-19 18:16:42 -05:00
|
|
|
level_tbl->show();
|
|
|
|
lower_packer->show ();
|
|
|
|
out_packer->show ();
|
|
|
|
|
2015-12-23 08:41:54 -05:00
|
|
|
vpacker.show ();
|
2014-11-17 19:39:57 -05:00
|
|
|
hpacker.show ();
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
map_state ();
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2016-03-15 12:41:14 -04:00
|
|
|
signal_enter_notify_event().connect (sigc::mem_fun (*this, &MonitorSection::enter_handler));
|
|
|
|
signal_leave_notify_event().connect (sigc::mem_fun (*this, &MonitorSection::leave_handler));
|
2022-01-26 16:29:36 -05:00
|
|
|
set_can_focus ();
|
2016-03-15 12:41:14 -04:00
|
|
|
|
|
|
|
_tearoff = new TearOff (*this);
|
2010-03-11 19:19:46 -05:00
|
|
|
|
2015-12-21 08:38:45 -05:00
|
|
|
if (!UIConfiguration::instance().get_floating_monitor_section()) {
|
|
|
|
/* if torn off, make this a normal window
|
|
|
|
* (default is WINDOW_TYPE_HINT_UTILITY in libs/gtkmm2ext/tearoff.cc)
|
|
|
|
*/
|
|
|
|
_tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
|
|
|
|
}
|
2014-11-17 19:39:57 -05:00
|
|
|
_tearoff->tearoff_window().set_title (X_("Monitor"));
|
2015-09-04 11:49:56 -04:00
|
|
|
_tearoff->tearoff_window().signal_key_press_event().connect (sigc::bind (sigc::ptr_fun (relay_key_press), (Gtk::Window*) &_tearoff->tearoff_window()), false);
|
2010-03-25 12:03:31 -04:00
|
|
|
|
2015-12-27 13:11:07 -05:00
|
|
|
update_processor_box ();
|
2015-12-23 08:41:54 -05:00
|
|
|
_ui_initialized = true;
|
2010-03-25 12:03:31 -04:00
|
|
|
|
2015-04-21 09:18:10 -04:00
|
|
|
/* catch changes that affect us */
|
2014-11-17 19:39:57 -05:00
|
|
|
Config->ParameterChanged.connect (config_connection, invalidator (*this), boost::bind (&MonitorSection::parameter_changed, this, _1), gui_context());
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
MonitorSection::~MonitorSection ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
for (ChannelButtons::iterator i = _channel_buttons.begin(); i != _channel_buttons.end(); ++i) {
|
|
|
|
delete *i;
|
|
|
|
}
|
|
|
|
|
|
|
|
_channel_buttons.clear ();
|
2018-12-16 12:50:29 -05:00
|
|
|
route_connections.drop_connections ();
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2016-03-15 16:44:12 -04:00
|
|
|
delete insert_box; insert_box = 0;
|
|
|
|
delete gain_control; gain_control = 0;
|
|
|
|
delete gain_display; gain_display = 0;
|
|
|
|
delete dim_control; dim_control = 0;
|
|
|
|
delete dim_display; dim_display = 0;
|
|
|
|
delete solo_boost_control; solo_boost_control = 0;
|
|
|
|
delete solo_boost_display; solo_boost_display = 0;
|
|
|
|
delete solo_cut_control; solo_cut_control = 0;
|
|
|
|
delete solo_cut_display; solo_cut_display = 0;
|
|
|
|
delete _tearoff; _tearoff = 0;
|
2017-01-19 09:42:27 -05:00
|
|
|
delete channel_table; channel_table = 0;
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
2016-03-15 12:41:14 -04:00
|
|
|
bool
|
|
|
|
MonitorSection::enter_handler (GdkEventCrossing* ev)
|
|
|
|
{
|
|
|
|
grab_focus ();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
MonitorSection::leave_handler (GdkEventCrossing* ev)
|
|
|
|
{
|
|
|
|
switch (ev->detail) {
|
|
|
|
case GDK_NOTIFY_INFERIOR:
|
|
|
|
return false;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* cancel focus if we're not torn off. With X11 WM's that do
|
|
|
|
* focus-follows-mouse, focus will be taken from us anyway.
|
|
|
|
*/
|
|
|
|
|
|
|
|
Widget* top = get_toplevel();
|
|
|
|
|
2022-01-26 17:08:55 -05:00
|
|
|
if (top->get_is_toplevel() && top != &_tearoff->tearoff_window()) {
|
2016-03-15 12:41:14 -04:00
|
|
|
Window* win = dynamic_cast<Window*> (top);
|
|
|
|
gtk_window_set_focus (win->gobj(), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2015-12-23 08:41:54 -05:00
|
|
|
|
|
|
|
void
|
2015-12-27 13:11:07 -05:00
|
|
|
MonitorSection::update_processor_box ()
|
2015-12-23 08:41:54 -05:00
|
|
|
{
|
2018-12-12 11:12:40 -05:00
|
|
|
bool show_processor_box = proctoggle->get_active ();
|
2015-12-23 08:41:54 -05:00
|
|
|
|
2015-12-27 13:11:07 -05:00
|
|
|
if (count_processors () > 0 && !show_processor_box) {
|
2016-01-01 07:20:11 -05:00
|
|
|
toggle_processorbox_button.set_name (X_("monitor section processors present"));
|
2015-12-23 08:41:54 -05:00
|
|
|
} else {
|
2016-01-01 07:20:11 -05:00
|
|
|
toggle_processorbox_button.set_name (X_("monitor section processors toggle"));
|
2015-12-23 08:41:54 -05:00
|
|
|
}
|
|
|
|
|
2022-01-26 15:21:06 -05:00
|
|
|
if (insert_box->get_visible() == show_processor_box) {
|
2015-12-23 08:41:54 -05:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (show_processor_box) {
|
|
|
|
if (master_packer.get_parent()) {
|
|
|
|
master_packer.get_parent()->remove (master_packer);
|
|
|
|
}
|
|
|
|
insert_box->show();
|
|
|
|
vpacker.pack_start (master_packer, false, false, PX_SCALE(10));
|
|
|
|
} else {
|
|
|
|
if (master_packer.get_parent()) {
|
|
|
|
master_packer.get_parent()->remove (master_packer);
|
|
|
|
}
|
|
|
|
insert_box->hide();
|
|
|
|
vpacker.pack_start (master_packer, true, false, PX_SCALE(10));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-18 22:49:01 -04:00
|
|
|
void
|
|
|
|
MonitorSection::set_session (Session* s)
|
|
|
|
{
|
2016-06-05 15:47:39 -04:00
|
|
|
RouteUI::set_session (s);
|
2018-12-15 11:58:37 -05:00
|
|
|
insert_box->set_session (_session);
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2019-03-01 10:51:08 -05:00
|
|
|
Glib::RefPtr<ActionGroup> global_monitor_actions = ActionManager::get_action_group (X_("Monitor Section"));
|
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
if (_session) {
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
/* These are not actually dependent on the Session, but they
|
|
|
|
* need to be set after construction, not during, and
|
|
|
|
* this is as good a place as any.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ActionManager::get_toggle_action (X_("Solo"), X_("toggle-exclusive-solo"))->set_active (Config->get_exclusive_solo());
|
|
|
|
ActionManager::get_toggle_action (X_("Solo"), X_("toggle-mute-overrides-solo"))->set_active (Config->get_solo_mute_override());
|
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
_route = _session->monitor_out ();
|
2023-05-23 22:06:03 -04:00
|
|
|
_output_button.set_route (_route, this);
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
if (_route) {
|
|
|
|
/* session with monitor section */
|
|
|
|
_monitor = _route->monitor_control ();
|
|
|
|
assign_controllables ();
|
2015-12-21 06:43:38 -05:00
|
|
|
insert_box->set_route (_route);
|
2018-12-16 12:50:29 -05:00
|
|
|
_route->processors_changed.connect (route_connections, invalidator (*this), boost::bind (&MonitorSection::processors_changed, this, _1), gui_context());
|
|
|
|
_route->output()->PortCountChanged.connect (route_connections, invalidator (*this), boost::bind (&MonitorSection::populate_buttons, this), gui_context());
|
|
|
|
_route->DropReferences.connect (route_connections, invalidator (*this), boost::bind (&MonitorSection::drop_route, this), gui_context());
|
2018-12-11 12:25:31 -05:00
|
|
|
|
2015-12-23 08:41:54 -05:00
|
|
|
if (_ui_initialized) {
|
2015-12-27 13:11:07 -05:00
|
|
|
update_processor_box ();
|
2015-12-23 08:41:54 -05:00
|
|
|
}
|
2018-12-11 10:28:47 -05:00
|
|
|
|
2019-03-01 10:51:08 -05:00
|
|
|
SYNCHRONIZE_TOGGLE_ACTION (ActionManager::get_toggle_action (X_("Monitor"), "UseMonitorSection"), true);
|
|
|
|
ActionManager::set_sensitive (global_monitor_actions, true);
|
2018-12-11 10:28:47 -05:00
|
|
|
ActionManager::set_sensitive (monitor_actions, true);
|
|
|
|
ActionManager::set_sensitive (solo_actions, true);
|
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
} else {
|
|
|
|
/* session with no monitor section */
|
2018-12-16 12:50:29 -05:00
|
|
|
route_connections.drop_connections();
|
2014-11-17 19:39:57 -05:00
|
|
|
_monitor.reset ();
|
|
|
|
_route.reset ();
|
2018-12-11 10:28:47 -05:00
|
|
|
|
2019-03-01 10:51:08 -05:00
|
|
|
SYNCHRONIZE_TOGGLE_ACTION (ActionManager::get_toggle_action (X_("Monitor"), "UseMonitorSection"), false);
|
|
|
|
ActionManager::set_sensitive (global_monitor_actions, false);
|
2018-12-11 10:28:47 -05:00
|
|
|
ActionManager::set_sensitive (monitor_actions, false);
|
|
|
|
ActionManager::set_sensitive (solo_actions, true);
|
2019-03-01 10:51:08 -05:00
|
|
|
/* this action needs to always be true in this, so that we can turn it back on */
|
|
|
|
ActionManager::get_toggle_action (X_("Monitor"), X_("UseMonitorSection"))->set_sensitive (true);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2017-01-19 09:42:27 -05:00
|
|
|
populate_buttons ();
|
2019-03-05 18:47:59 -05:00
|
|
|
map_state ();
|
2011-11-02 09:55:06 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
} else {
|
2018-12-11 10:28:47 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
/* no session */
|
2011-02-11 11:14:54 -05:00
|
|
|
|
2018-12-16 12:50:29 -05:00
|
|
|
if (_route) {
|
|
|
|
drop_route ();
|
|
|
|
unassign_controllables ();
|
|
|
|
}
|
2018-12-11 10:28:47 -05:00
|
|
|
|
|
|
|
ActionManager::set_sensitive (monitor_actions, false);
|
|
|
|
ActionManager::set_sensitive (solo_actions, false);
|
2019-03-01 10:51:08 -05:00
|
|
|
ActionManager::set_sensitive (global_monitor_actions, false);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
}
|
|
|
|
|
2018-12-11 12:25:31 -05:00
|
|
|
void
|
|
|
|
MonitorSection::drop_route ()
|
|
|
|
{
|
2023-05-24 01:13:48 -04:00
|
|
|
_output_button.set_route (std::shared_ptr<Route>(), 0);
|
2018-12-16 12:50:29 -05:00
|
|
|
route_connections.drop_connections();
|
2018-12-11 12:25:31 -05:00
|
|
|
_monitor.reset ();
|
|
|
|
_route.reset ();
|
2018-12-16 12:50:29 -05:00
|
|
|
unassign_controllables ();
|
2018-12-11 12:25:31 -05:00
|
|
|
rude_iso_button.unset_active_state ();
|
|
|
|
rude_solo_button.unset_active_state ();
|
|
|
|
}
|
|
|
|
|
2010-03-11 19:19:46 -05:00
|
|
|
MonitorSection::ChannelButtonSet::ChannelButtonSet ()
|
2010-03-11 17:51:24 -05:00
|
|
|
{
|
2016-01-01 07:20:11 -05:00
|
|
|
cut.set_name (X_("mute button"));
|
2014-09-05 20:08:59 -04:00
|
|
|
dim.set_name (X_("monitor section dim"));
|
2016-01-01 07:20:11 -05:00
|
|
|
solo.set_name (X_("solo button"));
|
|
|
|
invert.set_name (X_("invert button"));
|
2014-09-05 20:08:59 -04:00
|
|
|
|
2022-01-26 16:29:36 -05:00
|
|
|
cut.set_can_focus (false);
|
|
|
|
dim.set_can_focus (false);
|
|
|
|
solo.set_can_focus (false);
|
|
|
|
invert.set_can_focus (false);
|
2010-03-11 17:51:24 -05:00
|
|
|
}
|
|
|
|
|
2017-01-19 09:42:27 -05:00
|
|
|
void
|
2010-03-10 12:31:16 -05:00
|
|
|
MonitorSection::populate_buttons ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2017-01-19 09:42:27 -05:00
|
|
|
if (channel_table) {
|
|
|
|
channel_size_group->remove_widget (*channel_table);
|
|
|
|
delete channel_table;
|
|
|
|
}
|
|
|
|
|
|
|
|
channel_table = new Gtk::Table();
|
|
|
|
|
|
|
|
channel_table->set_col_spacings (6);
|
|
|
|
channel_table->set_row_spacings (6);
|
|
|
|
channel_table->set_homogeneous (true);
|
|
|
|
|
|
|
|
channel_size_group->add_widget (*channel_table);
|
|
|
|
channel_table->show ();
|
|
|
|
table_hpacker.pack_start (*channel_table, true, true);
|
|
|
|
|
|
|
|
for (ChannelButtons::iterator i = _channel_buttons.begin(); i != _channel_buttons.end(); ++i) {
|
|
|
|
delete *i;
|
|
|
|
}
|
|
|
|
_channel_buttons.clear ();
|
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
Glib::RefPtr<Action> act;
|
|
|
|
uint32_t nchans = _monitor->output_streams().n_audio();
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2017-01-19 09:42:27 -05:00
|
|
|
channel_table->resize (nchans, 5);
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
const uint32_t row_offset = 0;
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
for (uint32_t i = 0; i < nchans; ++i) {
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
string l;
|
|
|
|
char buf[64];
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
if (nchans == 2) {
|
|
|
|
if (i == 0) {
|
|
|
|
l = "L";
|
|
|
|
} else {
|
|
|
|
l = "R";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
char buf[32];
|
|
|
|
snprintf (buf, sizeof (buf), "%d", i+1);
|
|
|
|
l = buf;
|
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
Label* label = manage (new Label (l));
|
2017-01-19 09:42:27 -05:00
|
|
|
channel_table->attach (*label, 0, 1, i+row_offset, i+row_offset+1, EXPAND|FILL);
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
ChannelButtonSet* cbs = new ChannelButtonSet;
|
2010-03-11 19:19:46 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
_channel_buttons.push_back (cbs);
|
2010-03-11 19:19:46 -05:00
|
|
|
|
2017-01-19 09:42:27 -05:00
|
|
|
channel_table->attach (cbs->cut, 1, 2, i+row_offset, i+row_offset+1, EXPAND|FILL);
|
|
|
|
channel_table->attach (cbs->dim, 2, 3, i+row_offset, i+row_offset+1, EXPAND|FILL);
|
|
|
|
channel_table->attach (cbs->solo, 3, 4, i+row_offset, i+row_offset+1, EXPAND|FILL);
|
|
|
|
channel_table->attach (cbs->invert, 4, 5, i+row_offset, i+row_offset+1, EXPAND|FILL);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2016-01-03 15:44:19 -05:00
|
|
|
snprintf (buf, sizeof (buf), "monitor-cut-%u", i);
|
2014-11-17 19:39:57 -05:00
|
|
|
act = ActionManager::get_action (X_("Monitor"), buf);
|
|
|
|
if (act) {
|
2011-10-29 11:54:30 -04:00
|
|
|
cbs->cut.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2016-01-03 15:44:19 -05:00
|
|
|
snprintf (buf, sizeof (buf), "monitor-dim-%u", i);
|
2014-11-17 19:39:57 -05:00
|
|
|
act = ActionManager::get_action (X_("Monitor"), buf);
|
|
|
|
if (act) {
|
2011-10-29 11:54:30 -04:00
|
|
|
cbs->dim.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2016-01-03 15:44:19 -05:00
|
|
|
snprintf (buf, sizeof (buf), "monitor-solo-%u", i);
|
2014-11-17 19:39:57 -05:00
|
|
|
act = ActionManager::get_action (X_("Monitor"), buf);
|
|
|
|
if (act) {
|
2011-10-29 11:54:30 -04:00
|
|
|
cbs->solo.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2016-01-03 15:44:19 -05:00
|
|
|
snprintf (buf, sizeof (buf), "monitor-invert-%u", i);
|
2014-11-17 19:39:57 -05:00
|
|
|
act = ActionManager::get_action (X_("Monitor"), buf);
|
|
|
|
if (act) {
|
2011-10-29 11:54:30 -04:00
|
|
|
cbs->invert.set_related_action (act);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2017-01-19 09:42:27 -05:00
|
|
|
channel_table->show_all ();
|
|
|
|
|
|
|
|
if (channel_table_scroller.get_parent()) {
|
|
|
|
/* scroller is packed, so remove it */
|
|
|
|
channel_table_packer.remove (channel_table_scroller);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (table_hpacker.get_parent () == &channel_table_packer) {
|
|
|
|
/* this occurs when the table hpacker is directly
|
|
|
|
packed, so remove it.
|
|
|
|
*/
|
|
|
|
channel_table_packer.remove (table_hpacker);
|
|
|
|
} else if (table_hpacker.get_parent()) {
|
|
|
|
channel_table_viewport.remove ();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nchans > 7) {
|
|
|
|
/* put the table into a scrolled window, and then put
|
|
|
|
* that into the channel vpacker, after the table header
|
|
|
|
*/
|
|
|
|
channel_table_viewport.add (table_hpacker);
|
|
|
|
channel_table_packer.pack_start (channel_table_scroller, true, true);
|
|
|
|
channel_table_viewport.show ();
|
|
|
|
channel_table_scroller.show ();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
/* just put the channel table itself into the channel
|
|
|
|
* vpacker, after the table header
|
|
|
|
*/
|
|
|
|
channel_table_packer.pack_start (table_hpacker, true, true);
|
|
|
|
channel_table_scroller.hide ();
|
|
|
|
}
|
|
|
|
table_hpacker.show ();
|
|
|
|
channel_table->show ();
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
2010-05-05 10:09:58 -04:00
|
|
|
void
|
|
|
|
MonitorSection::toggle_exclusive_solo ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-05-05 10:09:58 -04:00
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
Config->set_exclusive_solo (ActionManager::get_toggle_action (X_("Solo"), "toggle-exclusive-solo")->get_active());
|
2010-05-05 10:09:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::toggle_mute_overrides_solo ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-05-05 10:09:58 -04:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Solo"), "toggle-mute-overrides-solo");
|
|
|
|
Config->set_solo_mute_override (tact->get_active());
|
2010-05-05 10:09:58 -04:00
|
|
|
}
|
|
|
|
|
2010-03-10 12:31:16 -05:00
|
|
|
void
|
|
|
|
MonitorSection::dim_all ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2019-02-16 03:13:21 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor Section"), "monitor-dim-all");
|
2018-12-12 11:12:40 -05:00
|
|
|
_monitor->set_dim_all (tact->get_active());
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::cut_all ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2019-02-16 03:13:21 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor Section"), "monitor-cut-all");
|
2018-12-12 11:12:40 -05:00
|
|
|
_monitor->set_cut_all (tact->get_active());
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
2010-03-11 09:33:21 -05:00
|
|
|
void
|
|
|
|
MonitorSection::mono ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2019-02-16 03:13:21 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor Section"), "monitor-mono");
|
2018-12-12 11:12:40 -05:00
|
|
|
_monitor->set_mono (tact->get_active());
|
2010-03-11 09:33:21 -05:00
|
|
|
}
|
|
|
|
|
2010-03-10 12:31:16 -05:00
|
|
|
void
|
|
|
|
MonitorSection::cut_channel (uint32_t chn)
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
char buf[64];
|
|
|
|
snprintf (buf, sizeof (buf), "monitor-cut-%u", chn);
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor"), buf);
|
|
|
|
_monitor->set_cut (chn, tact->get_active());
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::dim_channel (uint32_t chn)
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
char buf[64];
|
|
|
|
snprintf (buf, sizeof (buf), "monitor-dim-%u", chn);
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor"), buf);
|
|
|
|
_monitor->set_dim (chn, tact->get_active());
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::solo_channel (uint32_t chn)
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
char buf[64];
|
|
|
|
snprintf (buf, sizeof (buf), "monitor-solo-%u", chn);
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor"), buf);
|
|
|
|
_monitor->set_solo (chn, tact->get_active());
|
2010-03-10 12:31:16 -05:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::invert_channel (uint32_t chn)
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
char buf[64];
|
|
|
|
snprintf (buf, sizeof (buf), "monitor-invert-%u", chn);
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor"), buf);
|
|
|
|
_monitor->set_polarity (chn, tact->get_active());
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::register_actions ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
string action_name;
|
|
|
|
string action_descr;
|
|
|
|
Glib::RefPtr<Action> act;
|
2015-10-26 14:35:06 -04:00
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
/* ...will get sensitized if a mon-session is added */
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
monitor_actions = ActionManager::create_action_group (bindings, X_("Monitor"));
|
|
|
|
solo_actions = ActionManager::create_action_group (bindings, X_("Monitor"));
|
2010-05-05 10:09:58 -04:00
|
|
|
|
2019-02-16 03:13:21 -05:00
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
ActionManager::register_toggle_action (monitor_actions, X_("UseMonitorSection"), _("Use Monitor Section"), sigc::mem_fun(*this, &MonitorSection::toggle_use_monitor_section));
|
2019-02-16 03:13:21 -05:00
|
|
|
|
|
|
|
/* these are global monitor actions that invoke MonitorSectioncode. Do
|
|
|
|
* not create local versions (i.e. as part of "monitor_actions")
|
|
|
|
* because then we can end up with two different bindings (one global,
|
|
|
|
* one local to the monitor section) for the same action.
|
|
|
|
*/
|
|
|
|
|
|
|
|
Glib::RefPtr<ActionGroup> global_monitor_actions = ActionManager::get_action_group (X_("Monitor Section"));
|
|
|
|
|
|
|
|
ActionManager::register_toggle_action (global_monitor_actions, "monitor-mono", _("Mono"), sigc::mem_fun (*this, &MonitorSection::mono));
|
|
|
|
ActionManager::register_toggle_action (global_monitor_actions, "monitor-cut-all", _("Mute"), sigc::mem_fun (*this, &MonitorSection::cut_all));
|
|
|
|
ActionManager::register_toggle_action (global_monitor_actions, "monitor-dim-all", _("Dim"), sigc::mem_fun (*this, &MonitorSection::dim_all));
|
2010-05-05 10:09:58 -04:00
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
ActionManager::register_toggle_action (monitor_actions, "toggle-monitor-processor-box", _("Toggle Monitor Section Processor Box"),
|
|
|
|
sigc::mem_fun (*this, &MonitorSection::update_processor_box));
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-05-05 10:09:58 -04:00
|
|
|
|
2016-01-03 15:44:19 -05:00
|
|
|
for (uint32_t chn = 0; chn < 16; ++chn) {
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
action_name = string_compose (X_("monitor-cut-%1"), chn);
|
|
|
|
action_descr = string_compose (_("Cut monitor channel %1"), chn);
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(),
|
2018-12-11 10:28:47 -05:00
|
|
|
sigc::bind (sigc::mem_fun (*this, &MonitorSection::cut_channel), chn));
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
action_name = string_compose (X_("monitor-dim-%1"), chn);
|
|
|
|
action_descr = string_compose (_("Dim monitor channel %1"), chn);
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(),
|
2018-12-11 10:28:47 -05:00
|
|
|
sigc::bind (sigc::mem_fun (*this, &MonitorSection::dim_channel), chn));
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
action_name = string_compose (X_("monitor-solo-%1"), chn);
|
|
|
|
action_descr = string_compose (_("Solo monitor channel %1"), chn);
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(),
|
2018-12-11 10:28:47 -05:00
|
|
|
sigc::bind (sigc::mem_fun (*this, &MonitorSection::solo_channel), chn));
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
action_name = string_compose (X_("monitor-invert-%1"), chn);
|
|
|
|
action_descr = string_compose (_("Invert monitor channel %1"), chn);
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(),
|
2018-12-11 10:28:47 -05:00
|
|
|
sigc::bind (sigc::mem_fun (*this, &MonitorSection::invert_channel), chn));
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-11 09:33:21 -05:00
|
|
|
|
2018-12-11 05:06:26 -05:00
|
|
|
solo_actions = ActionManager::create_action_group (bindings, X_("Solo"));
|
2014-11-17 19:39:57 -05:00
|
|
|
RadioAction::Group solo_group;
|
2010-03-11 09:33:21 -05:00
|
|
|
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::register_radio_action (solo_actions, solo_group, "solo-use-in-place", _("In-place solo"),
|
2018-12-11 10:28:47 -05:00
|
|
|
sigc::mem_fun (*this, &MonitorSection::solo_use_in_place));
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::register_radio_action (solo_actions, solo_group, "solo-use-afl", _("After Fade Listen (AFL) solo"),
|
2018-12-11 10:28:47 -05:00
|
|
|
sigc::mem_fun (*this, &MonitorSection::solo_use_afl));
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::register_radio_action (solo_actions, solo_group, "solo-use-pfl", _("Pre Fade Listen (PFL) solo"),
|
2018-12-11 10:28:47 -05:00
|
|
|
sigc::mem_fun (*this, &MonitorSection::solo_use_pfl));
|
2016-01-07 19:31:20 -05:00
|
|
|
|
2018-12-11 10:28:47 -05:00
|
|
|
ActionManager::register_toggle_action (solo_actions, "toggle-exclusive-solo", _("Toggle exclusive solo mode"),
|
|
|
|
sigc::mem_fun (*this, &MonitorSection::toggle_exclusive_solo));
|
|
|
|
ActionManager::register_toggle_action (solo_actions, "toggle-mute-overrides-solo", _("Toggle mute overrides solo mode"),
|
|
|
|
sigc::mem_fun (*this, &MonitorSection::toggle_mute_overrides_solo));
|
2016-01-07 19:31:20 -05:00
|
|
|
}
|
|
|
|
|
2010-03-11 09:33:21 -05:00
|
|
|
void
|
|
|
|
MonitorSection::solo_use_in_place ()
|
|
|
|
{
|
|
|
|
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
2014-11-17 19:39:57 -05:00
|
|
|
once for the item that became inactive and once for the one that became
|
|
|
|
active.
|
|
|
|
*/
|
2010-03-11 09:33:21 -05:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<RadioAction> ract = ActionManager::get_radio_action (X_("Solo"), X_("solo-use-in-place"));
|
|
|
|
if (!ract->get_active ()) {
|
|
|
|
/* We are turning SiP off, which means that AFL or PFL will be turned on
|
|
|
|
shortly; don't update the solo model in the mean time, as if the currently
|
|
|
|
configured listen position is not the one that is about to be turned on,
|
|
|
|
things will go wrong.
|
|
|
|
*/
|
|
|
|
_inhibit_solo_model_update = true;
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2018-12-12 11:12:40 -05:00
|
|
|
Config->set_solo_control_is_listen_control (!ract->get_active());
|
|
|
|
_inhibit_solo_model_update = false;
|
2010-03-11 09:33:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::solo_use_afl ()
|
|
|
|
{
|
|
|
|
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
2014-11-17 19:39:57 -05:00
|
|
|
once for the item that became inactive and once for the one that became
|
|
|
|
active.
|
|
|
|
*/
|
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<RadioAction> ract = ActionManager::get_radio_action (X_("Solo"), X_("solo-use-afl"));
|
|
|
|
if (ract->get_active()) {
|
|
|
|
Config->set_solo_control_is_listen_control (true);
|
|
|
|
Config->set_listen_position (AfterFaderListen);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-11 09:33:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::solo_use_pfl ()
|
|
|
|
{
|
|
|
|
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
2014-11-19 13:14:26 -05:00
|
|
|
once for the item that became inactive and once for the one that became
|
|
|
|
active.
|
|
|
|
*/
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<RadioAction> ract = ActionManager::get_radio_action (X_("Solo"), X_("solo-use-pfl"));
|
|
|
|
if (ract->get_active()) {
|
|
|
|
Config->set_solo_control_is_listen_control (true);
|
|
|
|
Config->set_listen_position (PreFaderListen);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-03-25 12:03:31 -04:00
|
|
|
MonitorSection::update_solo_model ()
|
2010-03-10 12:31:16 -05:00
|
|
|
{
|
2011-11-19 12:04:48 -05:00
|
|
|
if (_inhibit_solo_model_update) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-11 09:33:21 -05:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
const char* action_name = 0;
|
2018-12-12 11:12:40 -05:00
|
|
|
Glib::RefPtr<RadioAction> ract;
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
if (Config->get_solo_control_is_listen_control()) {
|
2010-03-11 09:33:21 -05:00
|
|
|
switch (Config->get_listen_position()) {
|
2014-11-17 19:39:57 -05:00
|
|
|
case AfterFaderListen:
|
|
|
|
action_name = X_("solo-use-afl");
|
|
|
|
break;
|
|
|
|
case PreFaderListen:
|
|
|
|
action_name = X_("solo-use-pfl");
|
|
|
|
break;
|
2010-03-11 09:33:21 -05:00
|
|
|
}
|
2014-11-17 19:39:57 -05:00
|
|
|
} else {
|
|
|
|
action_name = X_("solo-use-in-place");
|
|
|
|
}
|
2010-03-25 12:03:31 -04:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
ract = ActionManager::get_radio_action (X_("Solo"), action_name);
|
2011-11-03 22:46:59 -04:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
/* because these are radio buttons, one of them will be
|
|
|
|
active no matter what. to trigger a change in the
|
|
|
|
action so that the view picks it up, toggle it.
|
|
|
|
*/
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2018-12-12 11:12:40 -05:00
|
|
|
if (ract->get_active()) {
|
|
|
|
ract->set_active (false);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2018-12-12 11:12:40 -05:00
|
|
|
|
|
|
|
ract->set_active (true);
|
2010-03-25 12:03:31 -04:00
|
|
|
}
|
2010-03-11 19:19:46 -05:00
|
|
|
|
2010-03-25 12:03:31 -04:00
|
|
|
void
|
|
|
|
MonitorSection::map_state ()
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (!_route || !_monitor) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
update_solo_model ();
|
|
|
|
|
2018-12-03 19:55:52 -05:00
|
|
|
Glib::RefPtr<Action> act;
|
|
|
|
Glib::RefPtr<ToggleAction> tact;
|
|
|
|
|
2019-03-05 18:47:59 -05:00
|
|
|
tact = ActionManager::get_toggle_action (X_("Monitor Section"), "monitor-cut-all");
|
2018-12-12 11:12:40 -05:00
|
|
|
tact->set_active (_monitor->cut_all());
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2019-03-05 18:47:59 -05:00
|
|
|
tact = ActionManager::get_toggle_action (X_("Monitor Section"), "monitor-dim-all");
|
2018-12-12 11:12:40 -05:00
|
|
|
tact->set_active (_monitor->dim_all());
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2019-03-05 18:47:59 -05:00
|
|
|
tact = ActionManager::get_toggle_action (X_("Monitor Section"), "monitor-mono");
|
2018-12-12 11:12:40 -05:00
|
|
|
tact->set_active (_monitor->mono());
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
uint32_t nchans = _monitor->output_streams().n_audio();
|
|
|
|
|
|
|
|
assert (nchans == _channel_buttons.size ());
|
|
|
|
|
|
|
|
for (uint32_t n = 0; n < nchans; ++n) {
|
|
|
|
|
|
|
|
char action_name[32];
|
|
|
|
|
|
|
|
snprintf (action_name, sizeof (action_name), "monitor-cut-%u", n);
|
2018-12-12 11:12:40 -05:00
|
|
|
tact = ActionManager::get_toggle_action (X_("Monitor"), action_name);
|
|
|
|
tact->set_active (_monitor->cut (n));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
snprintf (action_name, sizeof (action_name), "monitor-dim-%u", n);
|
2018-12-12 11:12:40 -05:00
|
|
|
tact = ActionManager::get_toggle_action (X_("Monitor"), action_name);
|
|
|
|
tact->set_active (_monitor->dimmed (n));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
snprintf (action_name, sizeof (action_name), "monitor-solo-%u", n);
|
2018-12-12 11:12:40 -05:00
|
|
|
tact = ActionManager::get_toggle_action (X_("Monitor"), action_name);
|
|
|
|
tact->set_active (_monitor->soloed (n));
|
2014-11-17 19:39:57 -05:00
|
|
|
|
|
|
|
snprintf (action_name, sizeof (action_name), "monitor-invert-%u", n);
|
2018-12-12 11:12:40 -05:00
|
|
|
tact = ActionManager::get_toggle_action (X_("Monitor"), action_name);
|
|
|
|
tact->set_active (_monitor->inverted (n));
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-11 09:33:21 -05:00
|
|
|
}
|
|
|
|
|
2010-05-04 12:39:03 -04:00
|
|
|
void
|
|
|
|
MonitorSection::do_blink (bool onoff)
|
|
|
|
{
|
2017-03-26 15:42:01 -04:00
|
|
|
if (!UIConfiguration::instance().get_blink_alert_indicators ()) {
|
|
|
|
onoff = true;
|
|
|
|
}
|
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
solo_blink (onoff);
|
|
|
|
audition_blink (onoff);
|
2010-05-04 12:39:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::audition_blink (bool onoff)
|
|
|
|
{
|
|
|
|
if (_session == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_session->is_auditioning()) {
|
2012-02-07 12:43:55 -05:00
|
|
|
rude_audition_button.set_active (onoff);
|
2010-05-04 12:39:03 -04:00
|
|
|
} else {
|
2012-02-07 12:43:55 -05:00
|
|
|
rude_audition_button.set_active (false);
|
2010-05-04 12:39:03 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-11 09:33:21 -05:00
|
|
|
void
|
|
|
|
MonitorSection::solo_blink (bool onoff)
|
|
|
|
{
|
|
|
|
if (_session == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_session->soloing() || _session->listening()) {
|
2012-02-07 12:43:55 -05:00
|
|
|
rude_solo_button.set_active (onoff);
|
2010-05-06 14:40:37 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
if (_session->soloing()) {
|
2011-10-29 11:54:30 -04:00
|
|
|
if (_session->solo_isolated()) {
|
2015-04-13 09:02:25 -04:00
|
|
|
rude_iso_button.set_active (onoff);
|
|
|
|
} else {
|
2012-02-07 12:43:55 -05:00
|
|
|
rude_iso_button.set_active (false);
|
2011-10-29 11:54:30 -04:00
|
|
|
}
|
2012-02-07 12:43:55 -05:00
|
|
|
}
|
2010-05-06 14:40:37 -04:00
|
|
|
|
2010-03-11 09:33:21 -05:00
|
|
|
} else {
|
2012-02-07 12:43:55 -05:00
|
|
|
rude_solo_button.set_active (false);
|
2014-11-17 19:39:57 -05:00
|
|
|
rude_iso_button.set_active (false);
|
2010-03-11 09:33:21 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-06 14:40:37 -04:00
|
|
|
bool
|
2010-11-13 00:14:48 -05:00
|
|
|
MonitorSection::cancel_isolate (GdkEventButton*)
|
2010-05-06 14:40:37 -04:00
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (_session) {
|
2023-04-07 17:33:13 -04:00
|
|
|
std::shared_ptr<RouteList const> rl (_session->get_routes ());
|
2016-05-27 16:13:10 -04:00
|
|
|
_session->set_controls (route_list_to_control_list (rl, &Stripable::solo_isolate_control), 0.0, Controllable::NoGroup);
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-05-06 14:40:37 -04:00
|
|
|
|
2014-11-17 19:39:57 -05:00
|
|
|
return true;
|
2010-05-06 14:40:37 -04:00
|
|
|
}
|
|
|
|
|
2010-05-04 12:39:03 -04:00
|
|
|
bool
|
2010-11-13 00:14:48 -05:00
|
|
|
MonitorSection::cancel_audition (GdkEventButton*)
|
2010-05-04 12:39:03 -04:00
|
|
|
{
|
|
|
|
if (_session) {
|
|
|
|
_session->cancel_audition();
|
|
|
|
}
|
2014-11-17 19:39:57 -05:00
|
|
|
return true;
|
2010-05-04 12:39:03 -04:00
|
|
|
}
|
|
|
|
|
2010-03-25 12:03:31 -04:00
|
|
|
void
|
|
|
|
MonitorSection::parameter_changed (std::string name)
|
|
|
|
{
|
2014-11-17 19:39:57 -05:00
|
|
|
if (name == "solo-control-is-listen-control") {
|
|
|
|
update_solo_model ();
|
2011-11-03 17:35:20 -04:00
|
|
|
} else if (name == "listen-position") {
|
2014-11-17 19:39:57 -05:00
|
|
|
update_solo_model ();
|
2014-11-17 21:49:20 -05:00
|
|
|
} else if (name == "solo-mute-override") {
|
2018-12-11 10:28:47 -05:00
|
|
|
SYNCHRONIZE_TOGGLE_ACTION (ActionManager::get_toggle_action (X_("Solo"), "toggle-mute-overrides-solo"), Config->get_solo_mute_override ());
|
2014-11-17 21:49:20 -05:00
|
|
|
} else if (name == "exclusive-solo") {
|
2018-12-11 10:28:47 -05:00
|
|
|
SYNCHRONIZE_TOGGLE_ACTION (ActionManager::get_toggle_action (X_("Solo"), "toggle-exclusive-solo"), Config->get_exclusive_solo ());
|
2014-11-17 19:39:57 -05:00
|
|
|
}
|
2010-03-25 12:03:31 -04:00
|
|
|
}
|
2010-04-06 12:57:35 -04:00
|
|
|
|
|
|
|
void
|
2018-12-16 12:50:29 -05:00
|
|
|
MonitorSection::unassign_controllables ()
|
2010-04-06 12:57:35 -04:00
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Controllable> none;
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2018-12-16 12:50:29 -05:00
|
|
|
solo_cut_control->set_controllable (none);
|
|
|
|
solo_cut_display->set_controllable (none);
|
|
|
|
gain_control->set_controllable (none);
|
|
|
|
gain_display->set_controllable (none);
|
|
|
|
cut_all_button.set_controllable (none);
|
|
|
|
dim_all_button.set_controllable (none);
|
|
|
|
mono_button.set_controllable (none);
|
|
|
|
dim_control->set_controllable (none);
|
|
|
|
dim_display->set_controllable (none);
|
|
|
|
solo_boost_control->set_controllable (none);
|
|
|
|
solo_boost_display->set_controllable (none);
|
|
|
|
}
|
2014-11-17 19:39:57 -05:00
|
|
|
|
2018-12-16 12:50:29 -05:00
|
|
|
void
|
|
|
|
MonitorSection::assign_controllables ()
|
|
|
|
{
|
|
|
|
assert (_session);
|
|
|
|
assert (_route);
|
|
|
|
assert (_monitor);
|
|
|
|
|
|
|
|
solo_cut_control->set_controllable (_session->solo_cut_control());
|
|
|
|
solo_cut_display->set_controllable (_session->solo_cut_control());
|
|
|
|
|
|
|
|
gain_control->set_controllable (_route->gain_control());
|
|
|
|
gain_display->set_controllable (_route->gain_control());
|
|
|
|
cut_all_button.set_controllable (_monitor->cut_control());
|
|
|
|
cut_all_button.watch ();
|
|
|
|
dim_all_button.set_controllable (_monitor->dim_control());
|
|
|
|
dim_all_button.watch ();
|
|
|
|
mono_button.set_controllable (_monitor->mono_control());
|
|
|
|
mono_button.watch ();
|
|
|
|
dim_control->set_controllable (_monitor->dim_level_control ());
|
|
|
|
dim_display->set_controllable (_monitor->dim_level_control ());
|
|
|
|
solo_boost_control->set_controllable (_monitor->solo_boost_control ());
|
|
|
|
solo_boost_display->set_controllable (_monitor->solo_boost_control ());
|
2010-04-06 12:57:35 -04:00
|
|
|
}
|
2011-07-06 20:37:13 -04:00
|
|
|
|
|
|
|
string
|
|
|
|
MonitorSection::state_id() const
|
|
|
|
{
|
|
|
|
return "monitor-section";
|
|
|
|
}
|
2015-04-21 09:18:10 -04:00
|
|
|
|
2015-08-10 14:31:59 -04:00
|
|
|
void
|
|
|
|
MonitorSection::load_bindings ()
|
|
|
|
{
|
2018-12-10 08:33:31 -05:00
|
|
|
bindings = Bindings::get_bindings (X_("Monitor Section"));
|
2015-08-10 14:31:59 -04:00
|
|
|
}
|
|
|
|
|
2015-12-23 08:41:54 -05:00
|
|
|
void
|
2023-02-16 18:33:28 -05:00
|
|
|
MonitorSection::help_count_processors (std::weak_ptr<Processor> p, uint32_t* cnt) const
|
2015-12-23 08:41:54 -05:00
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Processor> processor (p.lock ());
|
2015-12-23 08:41:54 -05:00
|
|
|
if (!processor || !processor->display_to_user()) {
|
|
|
|
return;
|
|
|
|
}
|
2023-02-16 18:33:28 -05:00
|
|
|
if (std::dynamic_pointer_cast<Amp>(processor)) {
|
2015-12-23 08:41:54 -05:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
++(*cnt);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
MonitorSection::count_processors ()
|
|
|
|
{
|
|
|
|
uint32_t processor_count = 0;
|
|
|
|
if (_route) {
|
|
|
|
_route->foreach_processor (sigc::bind (sigc::mem_fun (*this, &MonitorSection::help_count_processors), &processor_count));
|
|
|
|
}
|
|
|
|
return processor_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MonitorSection::processors_changed (ARDOUR::RouteProcessorChange)
|
|
|
|
{
|
2015-12-27 13:11:07 -05:00
|
|
|
update_processor_box ();
|
2015-12-23 08:41:54 -05:00
|
|
|
}
|
2016-06-05 20:50:40 -04:00
|
|
|
|
2019-05-24 18:12:55 -04:00
|
|
|
PluginSelector*
|
|
|
|
MonitorSection::plugin_selector ()
|
|
|
|
{
|
|
|
|
return Mixer_UI::instance()->plugin_selector ();
|
|
|
|
}
|
|
|
|
|
2016-11-10 21:54:50 -05:00
|
|
|
void
|
2018-12-11 10:28:47 -05:00
|
|
|
MonitorSection::use_others_actions ()
|
2016-11-10 21:54:50 -05:00
|
|
|
{
|
2018-12-11 10:28:47 -05:00
|
|
|
rude_solo_button.set_related_action (ActionManager::get_action (X_("Main"), X_("cancel-solo")));
|
2016-11-10 21:54:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2018-12-11 10:28:47 -05:00
|
|
|
MonitorSection::toggle_use_monitor_section ()
|
2016-11-10 21:54:50 -05:00
|
|
|
{
|
2018-12-11 10:28:47 -05:00
|
|
|
if (!_session) {
|
2016-11-10 21:54:50 -05:00
|
|
|
return;
|
|
|
|
}
|
2019-03-01 10:51:08 -05:00
|
|
|
bool want_ms = ActionManager::get_toggle_action (X_("Monitor"), "UseMonitorSection")->get_active();
|
|
|
|
bool have_ms = Config->get_use_monitor_bus ();
|
2018-12-11 10:28:47 -05:00
|
|
|
|
2019-03-01 10:51:08 -05:00
|
|
|
if (want_ms == have_ms) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (want_ms) {
|
|
|
|
Config->set_use_monitor_bus (true);
|
|
|
|
ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleMonitorSection"))->set_active (true);
|
|
|
|
} else {
|
|
|
|
Config->set_use_monitor_bus (false);
|
|
|
|
}
|
2016-11-10 21:54:50 -05:00
|
|
|
}
|