+
+ vst->LoadPresetProgram.connect (_program_connection, invalidator (*this), boost::bind (&MacVSTPluginUI::set_program, this), gui_context());
+
+ _ns_view = [[NSView new] retain];
+
+ AEffect* plugin = _vst->state()->plugin;
+ plugin->dispatcher (plugin, effEditOpen, 0, 0, _ns_view, 0.0f);
+ _idle_connection = Glib::signal_idle().connect (sigc::mem_fun (*this, &MacVSTPluginUI::idle));
+
+ _resize_notifier = [[ResizeNotificationObject alloc] initWithPluginUI:this];
+ [[NSNotificationCenter defaultCenter] addObserver:_resize_notifier
+ selector:@selector(viewResized:) name:NSViewFrameDidChangeNotification
+ object:_ns_view];
+
+ NSArray* subviews = [_ns_view subviews];
+ assert ([subviews count] < 2);
+ for (unsigned long i = 0; i < [subviews count]; ++i) {
+ NSView* subview = [subviews objectAtIndex:i];
+ [[NSNotificationCenter defaultCenter] addObserver:_resize_notifier
+ selector:@selector(viewResized:) name:NSViewFrameDidChangeNotification
+ object:subview];
+ }