diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-06-01 02:27:21 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-06-01 02:27:21 +0000 |
commit | 38ed75ff979e72e73a759c350cd8b1e64e2ed18c (patch) | |
tree | b714920f5b4017499c0a949c85ef52b7a593e016 /gtk2_ardour | |
parent | 0f2f4d8efc7f3e1144c6f51fd17c1ab309056c3e (diff) |
merge denormal handling work from 2.0-ongoing
git-svn-id: svn://localhost/ardour2/trunk@1937 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour.menus | 16 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_options.cc | 77 | ||||
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/route_ui.cc | 24 | ||||
-rw-r--r-- | gtk2_ardour/route_ui.h | 4 |
7 files changed, 133 insertions, 5 deletions
diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus index 3f9c900422..0faa3ea60b 100644 --- a/gtk2_ardour/ardour.menus +++ b/gtk2_ardour/ardour.menus @@ -340,7 +340,15 @@ <menuitem action='LayerLaterHigher'/> <menuitem action='LayerMoveAddHigher'/> <menuitem action='LayerAddHigher'/> - </menu> + </menu> + <menu name='Denormals' action='Denormals'> + <menuitem action='DenormalProtection'/> + <separator/> + <menuitem action='DenormalNone'/> + <menuitem action='DenormalFTZ'/> + <menuitem action='DenormalDAZ'/> + <menuitem action='DenormalFTZDAZ'/> + </menu> <separator/> <menuitem action='SendMTC'/> <menuitem action='SendMMC'/> @@ -357,10 +365,8 @@ <menuitem action='StopRecordingOnXrun'/> <menuitem action='StopTransportAtEndOfSession'/> <menuitem action='GainReduceFastTransport'/> - <separator/> - <menuitem action='PrimaryClockDeltaEditCursor'/> - <menuitem action='SecondaryClockDeltaEditCursor'/> - <separator/> + <menuitem action='PrimaryClockDeltaEditCursor'/> + <menuitem action='SecondaryClockDeltaEditCursor'/> </menu> <menu name='Help' action='Help'> <menuitem action='About'/> diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 5b165589e1..fc4114554c 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -669,11 +669,14 @@ class ARDOUR_UI : public Gtkmm2ext::UI void toggle_use_osc (); + void toggle_denormal_protection (); + void set_input_auto_connect (ARDOUR::AutoConnectOption); void set_output_auto_connect (ARDOUR::AutoConnectOption); void set_solo_model (ARDOUR::SoloModel); void set_monitor_model (ARDOUR::MonitorModel); void set_remote_model (ARDOUR::RemoteModel); + void set_denormal_model (ARDOUR::DenormalModel); void toggle_StopPluginsWithTransport(); void toggle_DoNotRunPluginsWhileRecording(); @@ -692,6 +695,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI void mtc_port_changed (); void map_solo_model (); void map_monitor_model (); + void map_denormal_model (); void map_remote_model (); void map_file_header_format (); void map_file_data_format (); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 3463c20648..af3032c2b0 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -94,6 +94,7 @@ ARDOUR_UI::install_actions () ActionManager::register_action (main_actions, X_("Metering"), _("Metering")); ActionManager::register_action (main_actions, X_("MeteringFallOffRate"), _("Fall off rate")); ActionManager::register_action (main_actions, X_("MeteringHoldTime"), _("Hold Time")); + ActionManager::register_action (main_actions, X_("Denormals"), _("Denormal Handling")); /* the real actions */ @@ -416,6 +417,15 @@ ARDOUR_UI::install_actions () ActionManager::register_toggle_action (option_actions, X_("PrimaryClockDeltaEditCursor"), _("Primary Clock delta to edit cursor"), mem_fun (*this, &ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor)); ActionManager::register_toggle_action (option_actions, X_("SecondaryClockDeltaEditCursor"), _("Secondary Clock delta to edit cursor"), mem_fun (*this, &ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor)); + RadioAction::Group denormal_group; + + ActionManager::register_toggle_action (option_actions, X_("DenormalProtection"), _("Use DC bias"), mem_fun (*this, &ARDOUR_UI::toggle_denormal_protection)); + + ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalNone"), _("No processor handling"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalNone)); + ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalFTZ"), _("Use FlushToZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalFTZ)); + ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalDAZ"), _("Use DenormalsAreZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalDAZ)); + ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalFTZDAZ"), _("Use FlushToZero & DenormalsAreZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalFTZDAZ)); + act = ActionManager::register_toggle_action (option_actions, X_("DoNotRunPluginsWhileRecording"), _("Do not run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index d456e30146..813c615d39 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -76,6 +76,12 @@ ARDOUR_UI::toggle_send_midi_feedback () } void +ARDOUR_UI::toggle_denormal_protection () +{ + ActionManager::toggle_config_state ("options", "DenormalProtection", &Configuration::set_denormal_protection, &Configuration::get_denormal_protection); +} + +void ARDOUR_UI::set_native_file_header_format (HeaderFormat hf) { const char *action = 0; @@ -293,6 +299,45 @@ ARDOUR_UI::set_monitor_model (MonitorModel model) } void +ARDOUR_UI::set_denormal_model (DenormalModel model) +{ + const char* action = 0; + + switch (model) { + case DenormalNone: + action = X_("DenormalNone"); + break; + + case DenormalFTZ: + action = X_("DenormalFTZ"); + break; + + case DenormalDAZ: + action = X_("DenormalDAZ"); + break; + + case DenormalFTZDAZ: + action = X_("DenormalFTZDAZ"); + break; + + default: + fatal << string_compose (_("programming error: unknown denormal model in ARDOUR_UI::set_denormal_model: %1"), model) << endmsg; + /*NOTREACHED*/ + } + + Glib::RefPtr<Action> act = ActionManager::get_action ("options", action); + + if (act) { + Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act); + + if (ract && ract->get_active() && Config->get_denormal_model() != model) { + Config->set_denormal_model (model); + } + } + +} + +void ARDOUR_UI::toggle_auto_input () { ActionManager::toggle_config_state ("Transport", "ToggleAutoInput", &Configuration::set_auto_input, &Configuration::get_auto_input); @@ -529,6 +574,36 @@ ARDOUR_UI::map_monitor_model () } void +ARDOUR_UI::map_denormal_model () +{ + const char* on = 0; + + switch (Config->get_denormal_model()) { + case DenormalNone: + on = X_("DenormalNone"); + break; + case DenormalFTZ: + on = X_("DenormalFTZ"); + break; + case DenormalDAZ: + on = X_("DenormalDAZ"); + break; + case DenormalFTZDAZ: + on = X_("DenormalFTZDAZ"); + break; + } + + Glib::RefPtr<Action> act = ActionManager::get_action ("options", on); + if (act) { + Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act); + + if (tact && !tact->get_active()) { + tact->set_active (true); + } + } +} + +void ARDOUR_UI::map_remote_model () { const char* on = 0; @@ -917,6 +992,8 @@ ARDOUR_UI::parameter_changed (const char* parameter_name) ActionManager::map_some_state ("options", "StopTransportAtEndOfSession", &Configuration::get_stop_at_session_end); } else if (PARAM_IS ("monitoring-model")) { map_monitor_model (); + } else if (PARAM_IS ("denormal-model")) { + map_denormal_model (); } else if (PARAM_IS ("remote-model")) { map_remote_model (); } else if (PARAM_IS ("use-video-sync")) { diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 9225fa6b12..1e007cac4c 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -984,6 +984,9 @@ MixerStrip::build_route_ops_menu () items.push_back (CheckMenuElem (_("Invert Polarity"), mem_fun (*this, &RouteUI::toggle_polarity))); polarity_menu_item = dynamic_cast<CheckMenuItem *> (&items.back()); polarity_menu_item->set_active (_route->phase_invert()); + items.push_back (CheckMenuElem (_("Protect against denormals"), mem_fun (*this, &RouteUI::toggle_denormal_protection))); + denormal_menu_item = dynamic_cast<CheckMenuItem *> (&items.back()); + denormal_menu_item->set_active (_route->denormal_protection()); build_remote_control_menu (); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 303d05dc86..b33cb13a0d 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -65,6 +65,8 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, co wait_for_release = false; route_active_menu_item = 0; was_solo_safe = false; + polarity_menu_item = 0; + denormal_menu_item = 0; if (set_color_from_route()) { set_color (unique_random_color()); @@ -879,6 +881,28 @@ RouteUI::polarity_changed () } void +RouteUI::toggle_denormal_protection () +{ + if (denormal_menu_item) { + + bool x; + + ENSURE_GUI_THREAD(mem_fun (*this, &RouteUI::toggle_denormal_protection)); + + if ((x = denormal_menu_item->get_active()) != _route->denormal_protection()) { + _route->set_denormal_protection (x, this); + } + } +} + +void +RouteUI::denormal_protection_changed () +{ + /* no signal for this yet */ +} + + +void RouteUI::solo_safe_toggle(void* src, Gtk::CheckMenuItem* check) { bool yn = _route->solo_safe (); diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index 20cd6f1f28..ceb6cf09cc 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -145,6 +145,10 @@ class RouteUI : public virtual AxisView void toggle_polarity (); virtual void polarity_changed (); + Gtk::CheckMenuItem *denormal_menu_item; + void toggle_denormal_protection(); + virtual void denormal_protection_changed (); + void disconnect_input (); void disconnect_output (); |