new GUI preference item for showing only 1 plugin GUI at a time. Disabled by default

This commit is contained in:
Paul Davis 2021-12-05 11:07:27 -07:00
parent 96b21c4824
commit c7b70c6318
4 changed files with 26 additions and 0 deletions

View File

@ -90,6 +90,7 @@ extern VST3PluginUI* create_mac_vst3_gui (boost::shared_ptr<ARDOUR::PluginInsert
#include "plugin_presets_ui.h"
#include "timers.h"
#include "new_plugin_preset_dialog.h"
#include "ui_config.h"
#include "pbd/i18n.h"
@ -101,6 +102,7 @@ using namespace PBD;
using namespace Gtkmm2ext;
using namespace Gtk;
PluginUIWindow* PluginUIWindow::the_plugin_window = 0;
PluginUIWindow::PluginUIWindow (
boost::shared_ptr<PluginInsert> insert,
@ -198,11 +200,22 @@ PluginUIWindow::~PluginUIWindow ()
cerr << "PluginWindow deleted for " << this << endl;
#endif
delete _pluginui;
if (the_plugin_window == this) {
the_plugin_window = 0;
}
}
void
PluginUIWindow::on_show ()
{
if (UIConfiguration::instance().get_one_plugin_window_only()) {
if (the_plugin_window) {
the_plugin_window->hide ();
}
the_plugin_window = this;
}
set_role("plugin_ui");
if (_pluginui) {

View File

@ -383,6 +383,8 @@ private:
bool create_audiounit_editor (boost::shared_ptr<ARDOUR::PluginInsert>);
bool create_lv2_editor (boost::shared_ptr<ARDOUR::PluginInsert>);
bool create_vst3_editor (boost::shared_ptr<ARDOUR::PluginInsert>);
static PluginUIWindow* the_plugin_window;
};
#ifdef MACVST_SUPPORT

View File

@ -3803,6 +3803,16 @@ These settings will only take effect after %1 is restarted.\n\
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"));
bo = new BoolOption (
"one-plugin-window-only",
_("Show only one plugin window at a time"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_one_plugin_window_only),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_one_plugin_window_only)
);
add_option (_("Plugins"), bo);
Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
_("<b>When enabled</b> at most one plugin GUI window be on-screen at a time. When disabled, the number of visible plugin GUI windows is unlimited"));
#if (defined WINDOWS_VST_SUPPORT || defined MACVST_SUPPORT || defined LXVST_SUPPORT || defined VST3_SUPPORT)
add_option (_("Plugins/VST"), new OptionEditorHeading (_("VST")));
#if 0

View File

@ -133,3 +133,4 @@ UI_CONFIG_VARIABLE (bool, grid_follows_internal, "grid-follows-internal", false)
UI_CONFIG_VARIABLE (bool, show_region_name, "show-region-name", true)
UI_CONFIG_VARIABLE (int, time_axis_name_ellipsize_mode, "time-axis-name-ellipsize-mode", 0)
UI_CONFIG_VARIABLE (bool, show_triggers_inline, "show-triggers-inline", false)
UI_CONFIG_VARIABLE (bool, one_plugin_window_only, "one-plugin-window-only", false)