move 2 plugin options to plugin tab of preferences
[ardour.git] / gtk2_ardour / rc_option_editor.cc
index 736a1ab8b596437cc5b5942fcb3300471a05a9f3..df11828059bfa18a231d03b98472189211325916 100644 (file)
@@ -374,7 +374,7 @@ public:
                  _insert_note_button_adjustment (3, 1, 5),
                  _insert_note_button_spin (_insert_note_button_adjustment)
        {
-               const Glib::ustring restart_msg = _("\nChanges to this setting will only persist after your project has been saved.");
+               const std::string restart_msg = _("\nChanges to this setting will only persist after your project has been saved.");
                /* internationalize and prepare for use with combos */
 
                vector<string> dumb;
@@ -667,9 +667,9 @@ public:
                set_popdown_strings (_snap_modifier_combo, dumb);
                _snap_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::snap_modifier_chosen));
 #ifdef __APPLE__
-               Glib::ustring mod_str = string_compose (X_("%1-%2"), Keyboard::level4_modifier_name (), Keyboard::tertiary_modifier_name ());
+               std::string mod_str = string_compose (X_("%1-%2"), Keyboard::level4_modifier_name (), Keyboard::tertiary_modifier_name ());
 #else
-               Glib::ustring mod_str = Keyboard::secondary_modifier_name();
+               std::string mod_str = Keyboard::secondary_modifier_name();
 #endif
                Gtkmm2ext::UI::instance()->set_tip (_snap_modifier_combo,
                                                    (string_compose (_("<b>Recommended Setting: %1</b>%2"), mod_str, restart_msg)));
@@ -1028,8 +1028,8 @@ public:
                Label* l = manage (new Label (_("GUI and Font scaling:")));
                l->set_name ("OptionsLabel");
 
-                const Glib::ustring dflt = _("Default");
-                const Glib::ustring empty = X_(""); // despite gtk-doc saying so, NULL does not work as reference
+               const std::string dflt = _("Default");
+               const std::string empty = X_(""); // despite gtk-doc saying so, NULL does not work as reference
 
                _dpi_slider.set_name("FontScaleSlider");
                _dpi_slider.set_update_policy (UPDATE_DISCONTINUOUS);
@@ -1718,6 +1718,72 @@ private:
        Button _xjadeo_browse_button;
 };
 
+class ColumVisibilityOption : public Option
+{
+       public:
+       ColumVisibilityOption (string id, string name, uint32_t n_col, sigc::slot<uint32_t> get, sigc::slot<bool, uint32_t> set)
+               : Option (id, name)
+               , _heading (name)
+               , _n_col (n_col)
+               , _get (get)
+               , _set (set)
+       {
+               cb = (CheckButton**) malloc (sizeof (CheckButton*) * n_col);
+               for (uint32_t i = 0; i < n_col; ++i) {
+                       CheckButton* col = manage (new CheckButton (string_compose (_("Column %1"), i + 1)));
+                       col->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &ColumVisibilityOption::column_toggled), i));
+                       _hbox.pack_start (*col);
+                       cb[i] = col;
+               }
+               parameter_changed (id);
+       }
+
+       ~ColumVisibilityOption () {
+               free (cb);
+       }
+
+       Gtk::Widget& tip_widget() { return _hbox; }
+
+       void set_state_from_config ()
+       {
+               uint32_t c = _get();
+               for (uint32_t i = 0; i < _n_col; ++i) {
+                       bool en = (c & (1<<i)) ? true : false;
+                       if (cb[i]->get_active () != en) {
+                               cb[i]->set_active (en);
+                       }
+               }
+       }
+
+       void add_to_page (OptionEditorPage* p)
+       {
+               _heading.add_to_page (p);
+               add_widget_to_page (p, &_hbox);
+       }
+       private:
+
+       void column_toggled (int b) {
+               uint32_t c = _get();
+               uint32_t cc = c;
+               if (cb[b]->get_active ()) {
+                       c |= (1<<b);
+               } else {
+                       c &= ~(1<<b);
+               }
+               if (cc != c) {
+                       _set (c);
+               }
+       }
+
+       HBox _hbox;
+       OptionEditorHeading _heading;
+
+       CheckButton** cb;
+       uint32_t _n_col;
+       sigc::slot<uint32_t> _get;
+       sigc::slot<bool, uint32_t> _set;
+};
+
 
 /** A class which allows control of visibility of some editor components usign
  *  a VisibilityGroup.  The caller should pass in a `dummy' VisibilityGroup
@@ -1787,6 +1853,9 @@ RCOptionEditor::RCOptionEditor ()
         , _rc_config (Config)
        , _mixer_strip_visibility ("mixer-element-visibility")
 {
+
+       UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &RCOptionEditor::parameter_changed));
+
        /* MISC */
 
         uint32_t hwcpus = hardware_concurrency ();
@@ -2147,14 +2216,6 @@ RCOptionEditor::RCOptionEditor ()
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_draggable_playhead)
                     ));
 
-       add_option (_("Editor"),
-            new BoolOption (
-                    "show-track-meters",
-                    _("Show meters on tracks in the editor"),
-                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_track_meters),
-                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_track_meters)
-                    ));
-
        add_option (_("Editor"),
             new BoolOption (
                     "show-editor-meter",
@@ -2357,8 +2418,8 @@ if (!Profile->get_mixbus()) {
                     sigc::mem_fun (*_rc_config, &RCConfiguration::set_tape_machine_mode)
                     ));
 
-if (!Profile->get_mixbus()) {
        add_option (_("Audio"), new OptionEditorHeading (_("Connection of tracks and busses")));
+if (!Profile->get_mixbus()) {
 
        add_option (_("Audio"),
                    new BoolOption (
@@ -2392,6 +2453,18 @@ if (!Profile->get_mixbus()) {
        oac->add (ManualConnect, _("manually"));
 
        add_option (_("Audio"), oac);
+
+       bo = new BoolOption (
+                       "strict-io",
+                       _("Use 'Strict-I/O' for new tracks or Busses"),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::get_strict_io),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::set_strict_io)
+                       );
+
+       add_option (_("Audio"), bo);
+       Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
+                       _("With strict-i/o enabled, Effect Processors will not modify the number of channels on a track. The number of output channels will always match the number of input channels."));
+
 }  // !mixbus
 
        add_option (_("Audio"), new OptionEditorHeading (_("Denormals")));
@@ -2443,24 +2516,6 @@ if (!Profile->get_mixbus()) {
 
        add_option (_("Audio"), dm);
 
-       add_option (_("Audio"), new OptionEditorHeading (_("Plugins")));
-
-       add_option (_("Audio"),
-            new BoolOption (
-                    "plugins-stop-with-transport",
-                    _("Silence plugins when the transport is stopped"),
-                    sigc::mem_fun (*_rc_config, &RCConfiguration::get_plugins_stop_with_transport),
-                    sigc::mem_fun (*_rc_config, &RCConfiguration::set_plugins_stop_with_transport)
-                    ));
-
-       add_option (_("Audio"),
-            new BoolOption (
-                    "new-plugins-active",
-                    _("Make new plugins active"),
-                    sigc::mem_fun (*_rc_config, &RCConfiguration::get_new_plugins_active),
-                    sigc::mem_fun (*_rc_config, &RCConfiguration::set_new_plugins_active)
-                    ));
-
        add_option (_("Audio"), new OptionEditorHeading (_("Regions")));
 
        add_option (_("Audio"),
@@ -2594,8 +2649,9 @@ if (!Profile->get_mixbus()) {
                     sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_main_outs)
                     ));
 
-       add_option (_("Solo & mute"), new OptionEditorHeading (_("Send Routing")));
 
+if (!ARDOUR::Profile->get_mixbus()) {
+       add_option (_("Solo & mute"), new OptionEditorHeading (_("Send Routing")));
        add_option (_("Solo & mute"),
             new BoolOption (
                     "link-send-and-route-panner",
@@ -2603,6 +2659,7 @@ if (!Profile->get_mixbus()) {
                     sigc::mem_fun (*_rc_config, &RCConfiguration::get_link_send_and_route_panner),
                     sigc::mem_fun (*_rc_config, &RCConfiguration::set_link_send_and_route_panner)
                     ));
+}
 
        add_option (_("MIDI"), new OptionEditorHeading (_("MIDI Preferences")));
 
@@ -2775,23 +2832,10 @@ if (!Profile->get_mixbus()) {
 
        add_option (_("Control Surfaces"), new ControlSurfacesOptions);
 
-       ComboOption<RemoteModel>* rm = new ComboOption<RemoteModel> (
-               "remote-model",
-               _("Control surface remote ID"),
-               sigc::mem_fun (*_rc_config, &RCConfiguration::get_remote_model),
-               sigc::mem_fun (*_rc_config, &RCConfiguration::set_remote_model)
-               );
-
-       rm->add (UserOrdered, _("assigned by user"));
-       rm->add (MixerOrdered, _("follows order of mixer"));
-
-       add_option (_("Control Surfaces"), rm);
-
        /* VIDEO Timeline */
        add_option (_("Video"), new VideoTimelineOptions (_rc_config));
 
 #if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT || defined AUDIOUNIT_SUPPORT)
-       add_option (_("Plugins"), new OptionEditorHeading (_("General")));
 
        add_option (_("Plugins"),
                        new RcActionButton (_("Scan for Plugins"),
@@ -2807,8 +2851,31 @@ if (!Profile->get_mixbus()) {
        Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
                        _("<b>When enabled</b> a popup window showing plugin scan progress is displayed for indexing (cache load) and discovery (detect new plugins)"));
 
+
 #endif
 
+       add_option (_("Plugins"), new OptionEditorHeading (_("General")));
+
+       bo = new BoolOption (
+               "plugins-stop-with-transport",
+               _("Silence plugins when the transport is stopped"),
+               sigc::mem_fun (*_rc_config, &RCConfiguration::get_plugins_stop_with_transport),
+               sigc::mem_fun (*_rc_config, &RCConfiguration::set_plugins_stop_with_transport)
+               );
+       add_option (_("Plugins"), bo);
+       Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
+                                           _("<b>When enabled</b> plugins will be reset at transport stop. When disabled plugins will be left unchanged at transport stop.\n\nThis mostly affects plugins with a \"tail\" like Reverbs."));
+
+       bo = new BoolOption (
+               "new-plugins-active",
+                       _("Make new plugins active"),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::get_new_plugins_active),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::set_new_plugins_active)
+                       );
+       add_option (_("Plugins"), bo);
+       Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
+                                           _("<b>When enabled</b> plugins will be activated when they are added to tracks/busses. When disabled plugins will be left inactive when they are added to tracks/busses"));
+
 #if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT)
        add_option (_("Plugins"), new OptionEditorHeading (_("VST")));
 
@@ -2905,8 +2972,8 @@ if (!Profile->get_mixbus()) {
             new BoolOption (
                     "open-gui-after-adding-plugin",
                     _("Automatically open the plugin GUI when adding a new plugin"),
-                    sigc::mem_fun (*_rc_config, &RCConfiguration::get_open_gui_after_adding_plugin),
-                    sigc::mem_fun (*_rc_config, &RCConfiguration::set_open_gui_after_adding_plugin)
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_open_gui_after_adding_plugin),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_open_gui_after_adding_plugin)
                     ));
 
 #ifdef LV2_SUPPORT
@@ -2914,18 +2981,39 @@ if (!Profile->get_mixbus()) {
             new BoolOption (
                     "show-inline-display-by-default",
                     _("Show Plugin Inline Display on Mixerstrip by default"),
-                    sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_inline_display_by_default),
-                    sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_inline_display_by_default)
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_inline_display_by_default),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_inline_display_by_default)
                     ));
 
        _plugin_prefer_inline = new BoolOption (
                        "prefer-inline-over-gui",
                        _("Don't automatically open the plugin GUI when the plugin has an inline display mode"),
-                       sigc::mem_fun (*_rc_config, &RCConfiguration::get_prefer_inline_over_gui),
-                       sigc::mem_fun (*_rc_config, &RCConfiguration::set_prefer_inline_over_gui)
+                       sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_prefer_inline_over_gui),
+                       sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_prefer_inline_over_gui)
                        );
        add_option (_("Plugins"), _plugin_prefer_inline);
 #endif
+
+       add_option (_("Plugins"), new OptionEditorHeading (_("Instrument")));
+
+       bo = new BoolOption (
+                       "ask-replace-instrument",
+                       _("Ask to replace existing instrument plugin"),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::get_ask_replace_instrument),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::set_ask_replace_instrument)
+                       );
+       add_option (_("Plugins"), bo);
+
+       bo = new BoolOption (
+                       "ask-setup_instrument",
+                       _("Interactively configure instrument plugins on insert"),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::get_ask_setup_instrument),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::set_ask_setup_instrument)
+                       );
+       add_option (_("Plugins"), bo);
+       Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
+                       _("<b>When enabled</b> show a dialog to select instrument channel configuration before adding a multichannel plugin."));
+
 #endif
 
        /* INTERFACE */
@@ -2963,7 +3051,6 @@ if (!Profile->get_mixbus()) {
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_widget_prelight)
                     ));
 
-#ifdef TOOLTIPS_GOT_FIXED
        add_option (S_("Preferences|GUI"),
             new BoolOption (
                     "use-tooltips",
@@ -2971,7 +3058,6 @@ if (!Profile->get_mixbus()) {
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_use_tooltips),
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_use_tooltips)
                     ));
-#endif
 
        add_option (S_("Preferences|GUI"),
             new BoolOption (
@@ -3036,6 +3122,7 @@ if (!ARDOUR::Profile->get_mixbus()) {
        _mixer_strip_visibility.add (0, X_("SoloIsoLock"), _("Solo Iso / Lock"));
        _mixer_strip_visibility.add (0, X_("Output"), _("Output"));
        _mixer_strip_visibility.add (0, X_("Comments"), _("Comments"));
+       _mixer_strip_visibility.add (0, X_("VCA"), _("VCA Assigns"));
 
        add_option (
                S_("Preferences|GUI"),
@@ -3055,6 +3142,14 @@ if (!ARDOUR::Profile->get_mixbus()) {
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_default_narrow_ms)
                     ));
 
+       add_option (S_("Preferences|GUI"),
+                       new ColumVisibilityOption (
+                               "action-table-columns", _("Action Script Button Visibility"), 3,
+                               sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_action_table_columns),
+                               sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_action_table_columns)
+                               )
+                       );
+
        add_option (S_("Preferences|Metering"), new OptionEditorHeading (_("Metering")));
 
        ComboOption<float>* mht = new ComboOption<float> (
@@ -3204,6 +3299,34 @@ if (!ARDOUR::Profile->get_mixbus()) {
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_style_led)
                     ));
 
+       add_option (S_("Preferences|Metering"), new OptionEditorHeading (_("Editor Meters")));
+
+       add_option (S_("Preferences|Metering"),
+            new BoolOption (
+                    "show-track-meters",
+                    _("Show meters on tracks in the editor"),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_track_meters),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_track_meters)
+                    ));
+
+       add_option (S_("Preferences|Metering"),
+            new BoolOption (
+                    "editor-stereo-only-meters",
+                    _("Show at most stereo meters in the track-header"),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_editor_stereo_only_meters),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_editor_stereo_only_meters)
+                    ));
+
+       add_option (S_("Preferences|Metering"), new OptionEditorHeading (_("Post Export Analysis")));
+
+       add_option (S_("Preferences|Metering"),
+            new BoolOption (
+                    "save-export-analysis-image",
+                    _("Save loudness analysis as image file"),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_save_export_analysis_image),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_save_export_analysis_image)
+                    ));
+
        /* and now the theme manager */
 
        ThemeManager* tm = manage (new ThemeManager);
@@ -3252,7 +3375,7 @@ RCOptionEditor::parameter_changed (string const & p)
                _ltc_volume_slider->set_sensitive (s);
        } else if (p == "open-gui-after-adding-plugin" || p == "show-inline-display-by-default") {
 #ifdef LV2_SUPPORT
-               _plugin_prefer_inline->set_sensitive (Config->get_open_gui_after_adding_plugin() && Config->get_show_inline_display_by_default());
+               _plugin_prefer_inline->set_sensitive (UIConfiguration::instance().get_open_gui_after_adding_plugin() && UIConfiguration::instance().get_show_inline_display_by_default());
 #endif
        }
 }