2nd stage of denormal handling (from trunk); fix to avoid FLAC support when using...
[ardour.git] / gtk2_ardour / ardour_ui_ed.cc
index 37e23cdf6e8ced25bd7a587341b7f48e1dd32696..0e54e6253ebca68011eaaa07988d1c72f5db72af 100644 (file)
@@ -24,6 +24,7 @@
 */
 
 #include <pbd/pathscanner.h>
+#include <pbd/fpu.h>
 
 #include <glibmm/miscutils.h>
 
@@ -413,11 +414,23 @@ ARDOUR_UI::install_actions ()
        RadioAction::Group denormal_group;
 
        ActionManager::register_toggle_action (option_actions, X_("DenormalProtection"), _("Use DC bias"), mem_fun (*this, &ARDOUR_UI::toggle_denormal_protection));
+       
+       FPU fpu;
 
        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_radio_action (option_actions, denormal_group, X_("DenormalFTZ"), _("Use FlushToZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalFTZ));
+       if (!fpu.has_flush_to_zero()) {
+               act->set_sensitive (false);
+       }
+       act = ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalDAZ"), _("Use DenormalsAreZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalDAZ));
+       if (!fpu.has_denormals_are_zero()) {
+               act->set_sensitive (false);
+       }
+       act = ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalFTZDAZ"), _("Use FlushToZero & DenormalsAreZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalFTZDAZ));
+       if (!fpu.has_flush_to_zero() || !fpu.has_denormals_are_zero()) {
+               act->set_sensitive (false);
+       }
 
        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);