2 #define Marker FuckYouAppleAndYourLackOfNameSpaces
4 #include <gtkmm/button.h>
5 #include <gdk/gdkquartz.h>
7 #include "pbd/convert.h"
10 #include "ardour/audio_unit.h"
11 #include "ardour/debug.h"
12 #include "ardour/plugin_insert.h"
14 #undef check // stupid gtk, stupid apple
16 #include <gtkmm2ext/utils.h>
18 #include "au_pluginui.h"
19 #include "gui_thread.h"
21 #include "CAAudioUnit.h"
22 #include "CAComponent.h"
24 #import <AudioUnit/AUCocoaUIView.h>
25 #import <CoreAudioKit/AUGenericView.h>
31 #include "public_editor.h"
35 #define ArdourCloseComponent CloseComponent
37 #define ArdourCloseComponent AudioComponentInstanceDispose
39 using namespace ARDOUR;
41 using namespace Gtkmm2ext;
45 vector<string> AUPluginUI::automation_mode_strings;
47 static const gchar* _automation_mode_strings[] = {
56 dump_view_tree (NSView* view, int depth, int maxdepth)
58 NSArray* subviews = [view subviews];
59 unsigned long cnt = [subviews count];
61 for (int d = 0; d < depth; d++) {
64 NSRect frame = [view frame];
65 cerr << " view @ " << frame.origin.x << ", " << frame.origin.y
66 << ' ' << frame.size.width << " x " << frame.size.height
69 if (depth >= maxdepth) {
72 for (unsigned long i = 0; i < cnt; ++i) {
73 NSView* subview = [subviews objectAtIndex:i];
74 dump_view_tree (subview, depth+1, maxdepth);
78 @implementation NotificationObject
80 - (NotificationObject*) initWithPluginUI: (AUPluginUI*) apluginui andCocoaParent: (NSWindow*) cp andTopLevelParent: (NSWindow*) tlp
82 self = [ super init ];
85 plugin_ui = apluginui;
86 top_level_parent = tlp;
91 [[NSNotificationCenter defaultCenter]
93 selector:@selector(cocoaParentActivationHandler:)
94 name:NSWindowDidBecomeMainNotification
97 [[NSNotificationCenter defaultCenter]
99 selector:@selector(cocoaParentBecameKeyHandler:)
100 name:NSWindowDidBecomeKeyNotification
108 - (void)cocoaParentActivationHandler:(NSNotification *)notification
110 NSWindow* notification_window = (NSWindow *)[notification object];
112 if (top_level_parent == notification_window || cocoa_parent == notification_window) {
113 if ([notification_window isMainWindow]) {
114 plugin_ui->activate();
116 plugin_ui->deactivate();
121 - (void)cocoaParentBecameKeyHandler:(NSNotification *)notification
123 NSWindow* notification_window = (NSWindow *)[notification object];
125 if (top_level_parent == notification_window || cocoa_parent == notification_window) {
126 if ([notification_window isKeyWindow]) {
127 plugin_ui->activate();
129 plugin_ui->deactivate();
134 - (void)auViewResized:(NSNotification *)notification
136 (void) notification; // stop complaints about unusued argument
137 plugin_ui->cocoa_view_resized();
142 AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
143 : PlugUIBase (insert)
144 , automation_mode_label (_("Automation"))
145 , preset_label (_("Presets"))
156 if (automation_mode_strings.empty()) {
157 automation_mode_strings = I18N (_automation_mode_strings);
160 set_popdown_strings (automation_mode_selector, automation_mode_strings);
161 automation_mode_selector.set_active_text (automation_mode_strings.front());
163 if ((au = boost::dynamic_pointer_cast<AUPlugin> (insert->plugin())) == 0) {
164 error << _("unknown type of editor-supplying plugin (note: no AudioUnit support in this version of ardour)") << endmsg;
165 throw failed_constructor ();
168 /* stuff some stuff into the top of the window */
170 HBox* smaller_hbox = manage (new HBox);
172 smaller_hbox->set_spacing (6);
173 smaller_hbox->pack_start (preset_label, false, false, 4);
174 smaller_hbox->pack_start (_preset_modified, false, false);
175 smaller_hbox->pack_start (_preset_combo, false, false);
176 smaller_hbox->pack_start (add_button, false, false);
178 /* Ardour does not currently allow to overwrite existing presets
179 * see save_property_list() in audio_unit.cc
181 smaller_hbox->pack_start (save_button, false, false);
184 /* one day these might be useful with an AU plugin, but not yet */
185 smaller_hbox->pack_start (automation_mode_label, false, false);
186 smaller_hbox->pack_start (automation_mode_selector, false, false);
188 smaller_hbox->pack_start (reset_button, false, false);
189 smaller_hbox->pack_start (bypass_button, false, true);
191 VBox* v1_box = manage (new VBox);
192 VBox* v2_box = manage (new VBox);
194 v1_box->pack_start (*smaller_hbox, false, true);
195 v2_box->pack_start (focus_button, false, true);
197 top_box.set_homogeneous (false);
198 top_box.set_spacing (6);
199 top_box.set_border_width (6);
201 top_box.pack_end (*v2_box, false, false);
202 top_box.pack_end (*v1_box, false, false);
205 pack_start (top_box, false, false);
206 pack_start (low_box, true, true);
208 preset_label.show ();
209 _preset_combo.show ();
210 automation_mode_label.show ();
211 automation_mode_selector.show ();
212 bypass_button.show ();
220 _activating_from_app = false;
227 /* prefer cocoa, fall back to cocoa, but use carbon if its there */
229 if (test_cocoa_view_support()) {
230 create_cocoa_view ();
232 } else if (test_carbon_view_support()) {
233 create_carbon_view ();
236 create_cocoa_view ();
239 low_box.add_events (Gdk::VISIBILITY_NOTIFY_MASK | Gdk::EXPOSURE_MASK);
241 low_box.signal_realize().connect (mem_fun (this, &AUPluginUI::lower_box_realized));
242 low_box.signal_visibility_notify_event ().connect (mem_fun (this, &AUPluginUI::lower_box_visibility_notify));
244 low_box.signal_size_request ().connect (mem_fun (this, &AUPluginUI::lower_box_size_request));
245 low_box.signal_size_allocate ().connect (mem_fun (this, &AUPluginUI::lower_box_size_allocate));
246 low_box.signal_map ().connect (mem_fun (this, &AUPluginUI::lower_box_map));
247 low_box.signal_unmap ().connect (mem_fun (this, &AUPluginUI::lower_box_unmap));
248 low_box.signal_expose_event ().connect (mem_fun (this, &AUPluginUI::lower_box_expose));
252 AUPluginUI::~AUPluginUI ()
255 [[NSNotificationCenter defaultCenter] removeObserver:_notify];
259 NSWindow* win = get_nswindow();
260 [win removeChildWindow:cocoa_parent];
265 /* not parented, just overlaid on top of our window */
266 DisposeWindow (carbon_window);
271 ArdourCloseComponent (editView);
275 /* remove whatever we packed into low_box so that GTK doesn't
279 [au_view removeFromSuperview];
284 AUPluginUI::test_carbon_view_support ()
289 carbon_descriptor.componentType = kAudioUnitCarbonViewComponentType;
290 carbon_descriptor.componentSubType = 'gnrc';
291 carbon_descriptor.componentManufacturer = 'appl';
292 carbon_descriptor.componentFlags = 0;
293 carbon_descriptor.componentFlagsMask = 0;
297 // ask the AU for its first editor component
299 err = AudioUnitGetPropertyInfo(*au->get_au(), kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, 0, &propertySize, NULL);
301 int nEditors = propertySize / sizeof(ComponentDescription);
302 ComponentDescription *editors = new ComponentDescription[nEditors];
303 err = AudioUnitGetProperty(*au->get_au(), kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, 0, editors, &propertySize);
305 // just pick the first one for now
306 carbon_descriptor = editors[0];
319 AUPluginUI::test_cocoa_view_support ()
322 Boolean isWritable = 0;
323 OSStatus err = AudioUnitGetPropertyInfo(*au->get_au(),
324 kAudioUnitProperty_CocoaUI, kAudioUnitScope_Global,
325 0, &dataSize, &isWritable);
327 return dataSize > 0 && err == noErr;
331 AUPluginUI::plugin_class_valid (Class pluginClass)
333 if([pluginClass conformsToProtocol: @protocol(AUCocoaUIBase)]) {
334 if([pluginClass instancesRespondToSelector: @selector(interfaceVersion)] &&
335 [pluginClass instancesRespondToSelector: @selector(uiViewForAudioUnit:withSize:)]) {
343 AUPluginUI::create_cocoa_view ()
345 bool wasAbleToLoadCustomView = false;
346 AudioUnitCocoaViewInfo* cocoaViewInfo = NULL;
347 UInt32 numberOfClasses = 0;
350 NSString* factoryClassName = 0;
351 NSURL* CocoaViewBundlePath = NULL;
353 OSStatus result = AudioUnitGetPropertyInfo (*au->get_au(),
354 kAudioUnitProperty_CocoaUI,
355 kAudioUnitScope_Global,
360 numberOfClasses = (dataSize - sizeof(CFURLRef)) / sizeof(CFStringRef);
362 // Does view have custom Cocoa UI?
364 if ((result == noErr) && (numberOfClasses > 0) ) {
366 DEBUG_TRACE(DEBUG::AudioUnits,
367 string_compose ( "based on %1, there are %2 cocoa UI classes\n", dataSize, numberOfClasses));
369 cocoaViewInfo = (AudioUnitCocoaViewInfo *)malloc(dataSize);
371 if(AudioUnitGetProperty(*au->get_au(),
372 kAudioUnitProperty_CocoaUI,
373 kAudioUnitScope_Global,
376 &dataSize) == noErr) {
378 CocoaViewBundlePath = (NSURL *)cocoaViewInfo->mCocoaAUViewBundleLocation;
380 // we only take the first view in this example.
381 factoryClassName = (NSString *)cocoaViewInfo->mCocoaAUViewClass[0];
383 DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("the factory name is %1 bundle is %2\n",
384 [factoryClassName UTF8String], CocoaViewBundlePath));
388 DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("No cocoaUI property cocoaViewInfo = %1\n", cocoaViewInfo));
390 if (cocoaViewInfo != NULL) {
391 free (cocoaViewInfo);
392 cocoaViewInfo = NULL;
397 // [A] Show custom UI if view has it
399 if (CocoaViewBundlePath && factoryClassName) {
400 NSBundle *viewBundle = [NSBundle bundleWithPath:[CocoaViewBundlePath path]];
402 DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("tried to create bundle, result = %1\n", viewBundle));
404 if (viewBundle == NULL) {
405 error << _("AUPluginUI: error loading AU view's bundle") << endmsg;
408 Class factoryClass = [viewBundle classNamed:factoryClassName];
409 DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("tried to create factory class, result = %1\n", factoryClass));
411 error << _("AUPluginUI: error getting AU view's factory class from bundle") << endmsg;
415 // make sure 'factoryClass' implements the AUCocoaUIBase protocol
416 if (!plugin_class_valid (factoryClass)) {
417 error << _("AUPluginUI: U view's factory class does not properly implement the AUCocoaUIBase protocol") << endmsg;
422 #if 0 // TODO: release when destoying the UI -- Test workaround for IK Multimedia crash
424 /* 0 Philharmonik 2 0x000000011df4ebd4 IK::Products::STShell::GUIData::SetListener(IK::Products::STShell::GUIDataListener*) + 4
425 1 Philharmonik 2 0x000000011df4a4f8 IK::Products::STShell::GUI::CloseWindow() + 24
426 2 com.ikmultimedia.audiounit.Philharmonik2 0x00000001164cef3a -[Philharmonik2CocoaView dealloc] + 26
427 3 libobjc.A.dylib 0x00007fff8f63a89c objc_object::sidetable_release(bool) + 236
428 4 libobjc.A.dylib 0x00007fff8f620e8f (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 575
429 5 com.apple.CoreFoundation 0x00007fff8500f6f2 _CFAutoreleasePoolPop + 50
430 6 com.apple.Foundation 0x00007fff81729832 -[NSAutoreleasePool drain] + 153
431 7 libgdk-quartz-2.0.0.dylib 0x00000001068c5bac gdk_event_prepare + 140
432 8 libglib-2.0.0.dylib 0x0000000106255085 g_main_context_prepare + 405
433 9 libglib-2.0.0.dylib 0x0000000106255977 g_main_context_iterate + 119
434 10 libglib-2.0.0.dylib 0x0000000106255c75 g_main_loop_run + 261
435 11 libgtk-quartz-2.0.0.dylib 0x0000000106472dd0 gtk_main + 176
436 12 libgtkmm2ext.dylib 0x000000010374191d Gtkmm2ext::UI::run(Receiver&) + 385
437 13 Ardour.bin 0x000000010054b424 main + 1914
438 14 Ardour.bin 0x00000001000309bc start + 52
440 id factory = [[[factoryClass alloc] init] autorelease];
442 id factory = [[factoryClass alloc] init];
444 if (factory == NULL) {
445 error << _("AUPluginUI: Could not create an instance of the AU view factory") << endmsg;
449 DEBUG_TRACE (DEBUG::AudioUnits, "got a factory instance\n");
452 au_view = [factory uiViewForAudioUnit:*au->get_au() withSize:NSZeroSize];
454 DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("view created @ %1\n", au_view));
457 [CocoaViewBundlePath release];
460 for (i = 0; i < numberOfClasses; i++)
461 CFRelease(cocoaViewInfo->mCocoaAUViewClass[i]);
463 free (cocoaViewInfo);
465 wasAbleToLoadCustomView = true;
469 if (!wasAbleToLoadCustomView) {
470 // load generic Cocoa view
471 DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("Loading generic view using %1 -> %2\n", au,
473 au_view = [[AUGenericView alloc] initWithAudioUnit:*au->get_au()];
474 DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("view created @ %1\n", au_view));
475 [(AUGenericView *)au_view setShowsExpertParameters:1];
478 // Get the initial size of the new AU View's frame
479 NSRect frame = [au_view frame];
480 min_width = req_width = CGRectGetWidth(NSRectToCGRect(frame));
481 min_height = req_height = CGRectGetHeight(NSRectToCGRect(frame));
482 resizable = [au_view autoresizingMask];
484 low_box.queue_resize ();
490 AUPluginUI::cocoa_view_resized ()
492 if (!mapped || alo_width == 0 || alo_height == 0 || !resizable) {
495 /* check for self-resizing plugins (e.g expand settings in AUSampler)
496 * if the widget expands it moves its y-offset (cocoa y-axis points towards the top)
498 NSRect new_au_frame = [au_view frame];
500 //float dx = last_au_frame.origin.x - new_au_frame.origin.x;
501 float dy = last_au_frame.origin.y - new_au_frame.origin.y;
504 if (req_width < min_width) req_width = min_width;
505 if (req_height < min_height) req_height = min_height;
507 last_au_frame = new_au_frame;
508 low_box.queue_resize ();
512 AUPluginUI::create_carbon_view ()
516 ControlRef root_control;
518 Component editComponent = FindNextComponent(NULL, &carbon_descriptor);
520 OpenAComponent(editComponent, &editView);
522 error << _("AU Carbon view: cannot open AU Component") << endmsg;
526 Rect r = { 100, 100, 100, 100 };
527 WindowAttributes attr = WindowAttributes (kWindowStandardHandlerAttribute |
528 kWindowCompositingAttribute|
529 kWindowNoShadowAttribute|
530 kWindowNoTitleBarAttribute);
532 if ((err = CreateNewWindow(kUtilityWindowClass, attr, &r, &carbon_window)) != noErr) {
533 error << string_compose (_("AUPluginUI: cannot create carbon window (err: %1)"), err) << endmsg;
534 ArdourCloseComponent (editView);
538 if ((err = GetRootControl(carbon_window, &root_control)) != noErr) {
539 error << string_compose (_("AUPlugin: cannot get root control of carbon window (err: %1)"), err) << endmsg;
540 DisposeWindow (carbon_window);
541 ArdourCloseComponent (editView);
546 Float32Point location = { 0.0, 0.0 };
547 Float32Point size = { 0.0, 0.0 } ;
549 if ((err = AudioUnitCarbonViewCreate (editView, *au->get_au(), carbon_window, root_control, &location, &size, &viewPane)) != noErr) {
550 error << string_compose (_("AUPluginUI: cannot create carbon plugin view (err: %1)"), err) << endmsg;
551 DisposeWindow (carbon_window);
552 ArdourCloseComponent (editView);
559 GetControlBounds(viewPane, &bounds);
560 size.x = bounds.right-bounds.left;
561 size.y = bounds.bottom-bounds.top;
563 req_width = (int) (size.x + 0.5);
564 req_height = (int) (size.y + 0.5);
566 SizeWindow (carbon_window, req_width, req_height, true);
567 low_box.set_size_request (req_width, req_height);
571 error << _("AU Carbon GUI is not supported.") << endmsg;
577 AUPluginUI::get_nswindow ()
579 Gtk::Container* toplevel = get_toplevel();
581 if (!toplevel || !toplevel->is_toplevel()) {
582 error << _("AUPluginUI: no top level window!") << endmsg;
586 NSWindow* true_parent = gdk_quartz_window_get_nswindow (toplevel->get_window()->gobj());
589 error << _("AUPluginUI: no top level window!") << endmsg;
597 AUPluginUI::activate ()
600 ActivateWindow (carbon_window, TRUE);
605 AUPluginUI::deactivate ()
608 ActivateWindow (carbon_window, FALSE);
613 AUPluginUI::parent_carbon_window ()
616 NSWindow* win = get_nswindow ();
617 Rect windowStructureBoundsRect;
623 /* figure out where the cocoa parent window is in carbon-coordinate space, which
624 differs from both cocoa-coordinate space and GTK-coordinate space
627 GetWindowBounds((WindowRef) [win windowRef], kWindowStructureRgn, &windowStructureBoundsRect);
629 /* compute how tall the title bar is, because we have to offset the position of the carbon window
633 NSRect content_frame = [NSWindow contentRectForFrameRect:[win frame] styleMask:[win styleMask]];
634 NSRect wm_frame = [NSWindow frameRectForContentRect:content_frame styleMask:[win styleMask]];
636 int titlebar_height = wm_frame.size.height - content_frame.size.height;
638 int packing_extra = 6; // this is the total vertical packing in our top level window
640 /* move into position, based on parent window position */
641 MoveWindow (carbon_window,
642 windowStructureBoundsRect.left,
643 windowStructureBoundsRect.top + titlebar_height + top_box.get_height() + packing_extra,
645 ShowWindow (carbon_window);
647 // create the cocoa window for the carbon one and make it visible
648 cocoa_parent = [[NSWindow alloc] initWithWindowRef: carbon_window];
650 SetWindowActivationScope (carbon_window, kWindowActivationScopeNone);
652 _notify = [ [NotificationObject alloc] initWithPluginUI:this andCocoaParent:cocoa_parent andTopLevelParent:win ];
654 [win addChildWindow:cocoa_parent ordered:NSWindowAbove];
655 [win setAutodisplay:1]; // turn of GTK stuff for this window
664 AUPluginUI::parent_cocoa_window ()
666 NSWindow* win = get_nswindow ();
672 //[win setAutodisplay:1]; // turn off GTK stuff for this window
674 NSView* view = gdk_quartz_window_get_nsview (low_box.get_window()->gobj());
675 [view addSubview:au_view];
678 gtk_widget_translate_coordinates(
679 GTK_WIDGET(low_box.gobj()),
680 GTK_WIDGET(low_box.get_parent()->gobj()),
682 [au_view setFrame:NSMakeRect(xx, yy, req_width, req_height)];
684 last_au_frame = [au_view frame];
685 // watch for size changes of the view
686 _notify = [ [NotificationObject alloc] initWithPluginUI:this andCocoaParent:NULL andTopLevelParent:win ];
688 [[NSNotificationCenter defaultCenter] addObserver:_notify
689 selector:@selector(auViewResized:) name:NSViewFrameDidChangeNotification
696 AUPluginUI::grab_focus()
699 [au_view becomeFirstResponder];
703 AUPluginUI::forward_key_event (GdkEventKey* ev)
705 NSEvent* nsevent = gdk_quartz_event_get_nsevent ((GdkEvent*)ev);
707 if (au_view && nsevent) {
709 /* filter on nsevent type here because GDK massages FlagsChanged
710 messages into GDK_KEY_{PRESS,RELEASE} but Cocoa won't
711 handle a FlagsChanged message as a keyDown or keyUp
714 if ([nsevent type] == NSKeyDown) {
715 [[[au_view window] firstResponder] keyDown:nsevent];
716 } else if ([nsevent type] == NSKeyUp) {
717 [[[au_view window] firstResponder] keyUp:nsevent];
718 } else if ([nsevent type] == NSFlagsChanged) {
719 [[[au_view window] firstResponder] flagsChanged:nsevent];
725 AUPluginUI::on_realize ()
729 /* our windows should not have that resize indicator */
731 NSWindow* win = get_nswindow ();
733 [win setShowsResizeIndicator:0];
738 AUPluginUI::lower_box_realized ()
741 parent_cocoa_window ();
742 } else if (carbon_window) {
743 parent_carbon_window ();
748 AUPluginUI::lower_box_visibility_notify (GdkEventVisibility* ev)
751 if (carbon_window && ev->state != GDK_VISIBILITY_UNOBSCURED) {
752 ShowWindow (carbon_window);
753 ActivateWindow (carbon_window, TRUE);
761 AUPluginUI::update_view_size ()
763 if (!mapped || alo_width == 0 || alo_height == 0) {
767 gtk_widget_translate_coordinates(
768 GTK_WIDGET(low_box.gobj()),
769 GTK_WIDGET(low_box.get_parent()->gobj()),
772 [[NSNotificationCenter defaultCenter] removeObserver:_notify
773 name:NSViewFrameDidChangeNotification
777 xx += (alo_width - req_width) * .5;
778 [au_view setFrame:NSMakeRect(xx, yy, req_width, req_height)];
780 /* this mitigates issues with plugins that resize themselves
781 * depending on visible options (e.g AUSampler)
782 * since the OSX y-axis points upwards, the plugin adjusts its
783 * own y-offset if the view expands to the bottom to accomodate
784 * subviews inside the main view.
786 [au_view setAutoresizesSubviews:0];
787 [au_view setFrame:NSMakeRect(xx, yy, alo_width, alo_height)];
788 [au_view setAutoresizesSubviews:1];
789 [au_view setNeedsDisplay:1];
792 last_au_frame = [au_view frame];
794 [[NSNotificationCenter defaultCenter]
796 selector:@selector(auViewResized:) name:NSViewFrameDidChangeNotification
801 AUPluginUI::lower_box_map ()
804 [au_view setHidden:0];
809 AUPluginUI::lower_box_unmap ()
812 [au_view setHidden:1];
816 AUPluginUI::lower_box_size_request (GtkRequisition* requisition)
818 requisition->width = req_width;
819 requisition->height = req_height;
823 AUPluginUI::lower_box_size_allocate (Gtk::Allocation& allocation)
825 alo_width = allocation.get_width ();
826 alo_height = allocation.get_height ();
831 AUPluginUI::lower_box_expose (GdkEventExpose* event)
833 #if 0 // AU view magically redraws by itself
834 [au_view drawRect:NSMakeRect(event->area.x,
837 event->area.height)];
839 /* hack to keep ardour responsive
840 * some UIs (e.g Addictive Drums) completely hog the CPU
848 AUPluginUI::on_window_hide ()
852 HideWindow (carbon_window);
853 ActivateWindow (carbon_window, FALSE);
859 NSArray* wins = [NSApp windows];
860 for (uint32_t i = 0; i < [wins count]; i++) {
861 id win = [wins objectAtIndex:i];
867 AUPluginUI::on_window_show (const string& /*title*/)
869 /* this is idempotent so just call it every time we show the window */
871 gtk_widget_realize (GTK_WIDGET(low_box.gobj()));
877 ShowWindow (carbon_window);
878 ActivateWindow (carbon_window, TRUE);
886 AUPluginUI::start_updating (GdkEventAny*)
892 AUPluginUI::stop_updating (GdkEventAny*)
898 create_au_gui (boost::shared_ptr<PluginInsert> plugin_insert, VBox** box)
900 AUPluginUI* aup = new AUPluginUI (plugin_insert);