summaryrefslogtreecommitdiff
path: root/gtk2_ardour/plugin_ui.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-18 05:00:44 +0000
committerDavid Robillard <d@drobilla.net>2011-05-18 05:00:44 +0000
commit041c8821438b2c6a83e1513fa2aedf7bbb8cbffd (patch)
tree9202118e6255d689b9c89a4767cd7da864d865a7 /gtk2_ardour/plugin_ui.cc
parent424b3479de067375d28bb867aafe33316dd0ce17 (diff)
Add 'controls' item to plugin insert context menu to always show Ardour generated controls for plugin, even if the plugin has a GUI. In particular, this gives you UI access to presets and the other handy stuff ardour sticks at the top, for inherently broken external UIs which don't allow Ardour to add such things.
Fix crash related to scale points when showing plugin UIs. Fix packing of scrolled generic plugin UI so the controls expand (rather than leaving a ton of wasted empty space and using unnecessary scroll bars). git-svn-id: svn://localhost/ardour2/branches/3.0@9551 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/plugin_ui.cc')
-rw-r--r--gtk2_ardour/plugin_ui.cc73
1 files changed, 39 insertions, 34 deletions
diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc
index 76764f8a5c..1e54344a83 100644
--- a/gtk2_ardour/plugin_ui.cc
+++ b/gtk2_ardour/plugin_ui.cc
@@ -77,17 +77,23 @@ using namespace PBD;
using namespace Gtkmm2ext;
using namespace Gtk;
-PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert> insert, bool scrollable)
+PluginUIWindow::PluginUIWindow (
+ Gtk::Window* win,
+ boost::shared_ptr<PluginInsert> insert,
+ bool scrollable,
+ bool editor)
: parent (win)
- , was_visible (false)
- , _keyboard_focused (false)
+ , was_visible (false)
+ , _keyboard_focused (false)
{
bool have_gui = false;
Label* label = manage (new Label());
label->set_markup ("<b>THIS IS THE PLUGIN UI</b>");
- if (insert->plugin()->has_editor()) {
+ std::cout << "SHOW UI " << insert->plugin()->unique_id()
+ << " editor: " << editor << std::endl;
+ if (editor && insert->plugin()->has_editor()) {
switch (insert->type()) {
case ARDOUR::VST:
have_gui = create_vst_editor (insert);
@@ -119,8 +125,7 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert
}
if (!have_gui) {
-
- GenericPluginUI* pu = new GenericPluginUI (insert, scrollable);
+ GenericPluginUI* pu = new GenericPluginUI (insert, scrollable);
_pluginui = pu;
_pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
@@ -281,7 +286,7 @@ PluginUIWindow::create_audiounit_editor (boost::shared_ptr<PluginInsert>)
#else
VBox* box;
_pluginui = create_au_gui (insert, &box);
- _pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
+ _pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
add (*box);
Application::instance()->ActivationChanged.connect (mem_fun (*this, &PluginUIWindow::app_activated));
@@ -347,32 +352,32 @@ PluginUIWindow::on_key_press_event (GdkEventKey* event)
{
if (_keyboard_focused) {
if (_pluginui) {
- if (_pluginui->non_gtk_gui()) {
- _pluginui->forward_key_event (event);
- } else {
- return relay_key_press (event, this);
- }
+ if (_pluginui->non_gtk_gui()) {
+ _pluginui->forward_key_event (event);
+ } else {
+ return relay_key_press (event, this);
+ }
}
return true;
} else {
- /* for us to be getting key press events, there really
- MUST be a _pluginui, but just to be safe, check ...
- */
-
- if (_pluginui) {
- if (_pluginui->non_gtk_gui()) {
- /* pass editor window as the window for the event
- to be handled in, not this one, because there are
- no widgets in this window that we want to have
- key focus.
- */
- return relay_key_press (event, &PublicEditor::instance());
- } else {
- return relay_key_press (event, this);
- }
- } else {
- return false;
- }
+ /* for us to be getting key press events, there really
+ MUST be a _pluginui, but just to be safe, check ...
+ */
+
+ if (_pluginui) {
+ if (_pluginui->non_gtk_gui()) {
+ /* pass editor window as the window for the event
+ to be handled in, not this one, because there are
+ no widgets in this window that we want to have
+ key focus.
+ */
+ return relay_key_press (event, &PublicEditor::instance());
+ } else {
+ return relay_key_press (event, this);
+ }
+ } else {
+ return false;
+ }
}
}
@@ -381,10 +386,10 @@ PluginUIWindow::on_key_release_event (GdkEventKey *event)
{
if (_keyboard_focused) {
if (_pluginui) {
- if (_pluginui->non_gtk_gui()) {
- _pluginui->forward_key_event (event);
- }
- return true;
+ if (_pluginui->non_gtk_gui()) {
+ _pluginui->forward_key_event (event);
+ }
+ return true;
}
return false;
} else {