mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
use correct (RCConfig-based) name for MIDI port in generic MIDI control stuff; make monitor section track configuration params that apply to it; add use-monitor-bus option to rc option editor
git-svn-id: svn://localhost/ardour2/branches/3.0@6797 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
f1b0f30cd5
commit
ac5bbf4b99
5 changed files with 63 additions and 40 deletions
|
|
@ -159,21 +159,6 @@ ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuff
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static bool
|
|
||||||
null_crossing (GdkEventCrossing* /* ignored */)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
block_prelight (Gtk::Widget& w)
|
|
||||||
{
|
|
||||||
w.signal_enter_notify_event().connect (sigc::ptr_fun (null_crossing), false);
|
|
||||||
w.signal_leave_notify_event().connect (sigc::ptr_fun (null_crossing), false);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XMLNode*
|
XMLNode*
|
||||||
ARDOUR_UI::tearoff_settings (const char* name) const
|
ARDOUR_UI::tearoff_settings (const char* name) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include "ardour/utils.h"
|
#include "ardour/utils.h"
|
||||||
|
|
||||||
#include "ardour_ui.h"
|
#include "ardour_ui.h"
|
||||||
|
#include "gui_thread.h"
|
||||||
#include "monitor_section.h"
|
#include "monitor_section.h"
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
@ -252,6 +253,10 @@ MonitorSection::MonitorSection (Session* s)
|
||||||
_tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
|
_tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
|
||||||
_tearoff->tearoff_window().set_title (X_("Monitor"));
|
_tearoff->tearoff_window().set_title (X_("Monitor"));
|
||||||
_tearoff->tearoff_window().signal_key_press_event().connect (sigc::ptr_fun (forward_key_press), false);
|
_tearoff->tearoff_window().signal_key_press_event().connect (sigc::ptr_fun (forward_key_press), false);
|
||||||
|
|
||||||
|
/* catch changes that affect us */
|
||||||
|
|
||||||
|
Config->ParameterChanged.connect (config_connection, ui_bind (&MonitorSection::parameter_changed, this, _1), gui_context());
|
||||||
}
|
}
|
||||||
|
|
||||||
MonitorSection::~MonitorSection ()
|
MonitorSection::~MonitorSection ()
|
||||||
|
|
@ -722,6 +727,34 @@ MonitorSection::linear_gain_printer (SpinButton* button)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MonitorSection::update_solo_model ()
|
||||||
|
{
|
||||||
|
const char* action_name;
|
||||||
|
Glib::RefPtr<Action> act;
|
||||||
|
|
||||||
|
if (Config->get_solo_control_is_listen_control()) {
|
||||||
|
switch (Config->get_listen_position()) {
|
||||||
|
case AfterFaderListen:
|
||||||
|
action_name = X_("solo-use-afl");
|
||||||
|
break;
|
||||||
|
case PreFaderListen:
|
||||||
|
action_name = X_("solo-use-pfl");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
action_name = X_("solo-use-in-place");
|
||||||
|
}
|
||||||
|
|
||||||
|
act = ActionManager::get_action (X_("Solo"), action_name);
|
||||||
|
if (act) {
|
||||||
|
Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic (act);
|
||||||
|
if (ract) {
|
||||||
|
ract->set_active (true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MonitorSection::map_state ()
|
MonitorSection::map_state ()
|
||||||
{
|
{
|
||||||
|
|
@ -733,30 +766,9 @@ MonitorSection::map_state ()
|
||||||
dim_control->get_adjustment()->set_value (_monitor->dim_level());
|
dim_control->get_adjustment()->set_value (_monitor->dim_level());
|
||||||
solo_boost_control->get_adjustment()->set_value (_monitor->solo_boost_level());
|
solo_boost_control->get_adjustment()->set_value (_monitor->solo_boost_level());
|
||||||
|
|
||||||
const char *action_name;
|
|
||||||
|
|
||||||
if (Config->get_solo_control_is_listen_control()) {
|
|
||||||
switch (Config->get_listen_position()) {
|
|
||||||
case AfterFaderListen:
|
|
||||||
action_name = X_("solo-use-afl");
|
|
||||||
break;
|
|
||||||
case PreFaderListen:
|
|
||||||
action_name = X_("solo-use-afl");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
action_name = X_("solo-use-in-place");
|
|
||||||
}
|
|
||||||
|
|
||||||
Glib::RefPtr<Action> act;
|
Glib::RefPtr<Action> act;
|
||||||
|
|
||||||
act = ActionManager::get_action (X_("Solo"), action_name);
|
update_solo_model ();
|
||||||
if (act) {
|
|
||||||
Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic (act);
|
|
||||||
if (ract) {
|
|
||||||
ract->set_active (true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
act = ActionManager::get_action (X_("Monitor"), "monitor-cut-all");
|
act = ActionManager::get_action (X_("Monitor"), "monitor-cut-all");
|
||||||
if (act) {
|
if (act) {
|
||||||
|
|
@ -871,3 +883,14 @@ MonitorSection::solo_cut_changed ()
|
||||||
{
|
{
|
||||||
Config->set_solo_mute_gain (slider_position_to_gain (solo_cut_adjustment.get_value()));
|
Config->set_solo_mute_gain (slider_position_to_gain (solo_cut_adjustment.get_value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MonitorSection::parameter_changed (std::string name)
|
||||||
|
{
|
||||||
|
if (name == "solo-control-is-listen-control" ||
|
||||||
|
name == "listen-position") {
|
||||||
|
update_solo_model ();
|
||||||
|
} else if (name == "solo-mute-gain") {
|
||||||
|
solo_cut_adjustment.set_value (gain_to_slider_position (Config->get_solo_mute_gain()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -117,4 +117,8 @@ class MonitorSection : public RouteUI
|
||||||
void solo_blink (bool);
|
void solo_blink (bool);
|
||||||
bool cancel_solo (GdkEventButton*);
|
bool cancel_solo (GdkEventButton*);
|
||||||
void solo_cut_changed ();
|
void solo_cut_changed ();
|
||||||
|
void update_solo_model ();
|
||||||
|
void parameter_changed (std::string);
|
||||||
|
|
||||||
|
PBD::ScopedConnection config_connection;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1205,6 +1205,14 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
|
|
||||||
add_option (_("Audio"), new OptionEditorHeading (_("Monitoring")));
|
add_option (_("Audio"), new OptionEditorHeading (_("Monitoring")));
|
||||||
|
|
||||||
|
add_option (_("Audio"),
|
||||||
|
new BoolOption (
|
||||||
|
"use-monitor-bus",
|
||||||
|
_("Use a monitor bus (allows AFL/PFL and more control)"),
|
||||||
|
sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_monitor_bus),
|
||||||
|
sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_monitor_bus)
|
||||||
|
));
|
||||||
|
|
||||||
ComboOption<MonitorModel>* mm = new ComboOption<MonitorModel> (
|
ComboOption<MonitorModel>* mm = new ComboOption<MonitorModel> (
|
||||||
"monitoring-model",
|
"monitoring-model",
|
||||||
_("Monitoring handled by"),
|
_("Monitoring handled by"),
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/route.h"
|
#include "ardour/route.h"
|
||||||
#include "ardour/midi_ui.h"
|
#include "ardour/midi_ui.h"
|
||||||
|
#include "ardour/rc_configuration.h"
|
||||||
|
|
||||||
#include "generic_midi_control_protocol.h"
|
#include "generic_midi_control_protocol.h"
|
||||||
#include "midicontrollable.h"
|
#include "midicontrollable.h"
|
||||||
|
|
@ -61,10 +62,12 @@ GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s)
|
||||||
the name is defined in ardour.rc which is likely not internationalized.
|
the name is defined in ardour.rc which is likely not internationalized.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_port = mm->port (X_("control"));
|
_port = mm->port (Config->get_midi_port_name());
|
||||||
|
|
||||||
if (_port == 0) {
|
if (_port == 0) {
|
||||||
error << _("no MIDI port named \"control\" exists - generic MIDI control disabled") << endmsg;
|
error << string_compose (_("no MIDI port named \"%1\" exists - generic MIDI control disabled"),
|
||||||
|
Config->get_midi_port_name())
|
||||||
|
<< endmsg;
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue