diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-06-23 23:16:01 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-06-23 23:16:01 +0000 |
commit | b10ace15cd23d4cfb999626711b8afc9acc85e04 (patch) | |
tree | 07ded8ec1e40cc462961845087ff80b96fdabd4d | |
parent | acaf05db1dd1dee9bcd7d1be4258c00837b90267 (diff) |
make solo-in-front controllable. a few tweaks left to do.
git-svn-id: svn://localhost/ardour2/branches/3.0@5266 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/rc_option_editor.cc | 62 | ||||
-rw-r--r-- | libs/ardour/ardour/rc_configuration_vars.h | 2 | ||||
-rw-r--r-- | libs/ardour/delivery.cc | 38 |
3 files changed, 82 insertions, 20 deletions
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index ded7ab5cf2..6e2d4cbbf5 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -2,9 +2,11 @@ #include <gtkmm/stock.h> #include <gtkmm/scale.h> #include <gtkmm2ext/utils.h> +#include <gtkmm2ext/slider_controller.h> #include "pbd/fpu.h" #include "midi++/manager.h" #include "midi++/factory.h" +#include "ardour/dB.h" #include "ardour/rc_configuration.h" #include "ardour/control_protocol_manager.h" #include "control_protocol/control_protocol.h" @@ -753,6 +755,64 @@ private: HScale _dpi_slider; }; +class SoloMuteOptions : public OptionEditorBox +{ +public: + SoloMuteOptions (RCConfiguration* c) : + _rc_config (c), + // 0.781787 is the value needed for gain to be set to 0. + _db_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1) + + { + if ((pix = ::get_icon ("fader_belt_h")) == 0) { + throw failed_constructor(); + } + + _db_slider = manage (new HSliderController (pix, + &_db_adjustment, + false)); + + + _db_adjustment.set_value (gain_to_slider_position (_rc_config->get_solo_mute_gain ())); + + Label* l = manage (new Label (_("Solo-in-front gain cut:"))); + l->set_name ("OptionsLabel"); + + HBox* h = manage (new HBox); + h->set_spacing (4); + h->pack_start (*l, false, false); + h->pack_start (*_db_slider, true, true); + + _box->pack_start (*h, false, false); + + _db_adjustment.signal_value_changed().connect (mem_fun (*this, &SoloMuteOptions::db_changed)); + } + + void parameter_changed (string const & p) + { + if (p == "solo-mute-gain") { + _db_adjustment.set_value (gain_to_slider_position (_rc_config->get_solo_mute_gain())); + } + } + + void set_state_from_config () + { + parameter_changed ("solo-mute-gain"); + } + +private: + + void db_changed () + { + _rc_config->set_solo_mute_gain (slider_position_to_gain (_db_adjustment.get_value())); + } + + RCConfiguration* _rc_config; + Adjustment _db_adjustment; + Gtkmm2ext::HSliderController* _db_slider; + Glib::RefPtr<Gdk::Pixbuf> pix; +}; + class ControlSurfacesOptions : public OptionEditorBox { @@ -1089,6 +1149,8 @@ RCOptionEditor::RCOptionEditor () mem_fun (*_rc_config, &RCConfiguration::set_solo_model) ); + add_option (_("Audio"), new SoloMuteOptions (_rc_config)); + sm->add (SoloInPlace, _("in place")); sm->add (SoloAFL, _("post-fader listen via monitor bus")); sm->add (SoloPFL, _("pre-fader listen via monitor bus")); diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index b156513a2d..20b9c85f0e 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -84,7 +84,7 @@ CONFIG_VARIABLE (bool, all_safe, "all-safe", false) CONFIG_VARIABLE (bool, show_solo_mutes, "show-solo-mutes", false) CONFIG_VARIABLE (bool, solo_mute_override, "solo-mute-override", false) CONFIG_VARIABLE (bool, tape_machine_mode, "tape-machine-mode", false) -CONFIG_VARIABLE (gain_t, solo_mute_gain, "solo_mute-gain", 0.0) +CONFIG_VARIABLE (gain_t, solo_mute_gain, "solo-mute-gain", 0.0) /* click */ diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 1b1f62c4b2..8a13a4b047 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -399,30 +399,30 @@ Delivery::target_gain () } gain_t desired_gain; - MuteMaster::MutePoint mp; - - switch (_role) { - case Main: - mp = MuteMaster::Main; - break; - case Listen: - mp = MuteMaster::Listen; - break; - case Send: - case Insert: - if (_placement == PreFader) { - mp = MuteMaster::PreFader; - } else { - mp = MuteMaster::PostFader; - } - break; - } - if (_solo_level) { desired_gain = 1.0; } else { + MuteMaster::MutePoint mp; + + switch (_role) { + case Main: + mp = MuteMaster::Main; + break; + case Listen: + mp = MuteMaster::Listen; + break; + case Send: + case Insert: + if (_placement == PreFader) { + mp = MuteMaster::PreFader; + } else { + mp = MuteMaster::PostFader; + } + break; + } + if (_solo_isolated) { /* ... but we are isolated from all that nonsense */ |