2008-01-10 16:20:59 -05:00
|
|
|
#ifndef __gtk2_ardour_auplugin_ui_h__
|
|
|
|
#define __gtk2_ardour_auplugin_ui_h__
|
2006-08-12 15:43:09 -04:00
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
#include <AudioUnit/AudioUnit.h>
|
2006-08-12 15:43:09 -04:00
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
/* fix up stupid apple macros */
|
2006-08-12 15:43:09 -04:00
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
#undef check
|
|
|
|
#undef require
|
|
|
|
#undef verify
|
2006-08-12 15:43:09 -04:00
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include "plugin_ui.h"
|
2006-08-12 15:43:09 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class AUPlugin;
|
|
|
|
class PluginInsert;
|
2007-06-27 16:23:48 -04:00
|
|
|
class IOProcessor;
|
2006-08-12 15:43:09 -04:00
|
|
|
}
|
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
class AUPluginUI : public PlugUIBase, public Gtk::VBox
|
2006-08-12 15:43:09 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
AUPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>);
|
|
|
|
~AUPluginUI ();
|
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
gint get_preferred_height () { return prefheight; }
|
|
|
|
gint get_preferred_width () { return prefwidth; }
|
|
|
|
bool start_updating(GdkEventAny*);
|
|
|
|
bool stop_updating(GdkEventAny*);
|
|
|
|
|
|
|
|
virtual void activate ();
|
|
|
|
virtual void deactivate ();
|
|
|
|
|
|
|
|
void on_realize ();
|
|
|
|
void on_show ();
|
|
|
|
|
|
|
|
OSStatus carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event);
|
|
|
|
|
2006-08-12 15:43:09 -04:00
|
|
|
private:
|
|
|
|
WindowRef wr;
|
|
|
|
boost::shared_ptr<ARDOUR::AUPlugin> au;
|
2008-01-10 16:20:59 -05:00
|
|
|
int prefheight;
|
|
|
|
int prefwidth;
|
|
|
|
|
|
|
|
/* Cocoa */
|
|
|
|
|
|
|
|
NSWindow* cocoa_window;
|
|
|
|
NSScrollView* scroll_view;
|
|
|
|
NSView* au_view;
|
|
|
|
|
|
|
|
/* Carbon */
|
|
|
|
|
|
|
|
NSWindow* cocoa_parent;
|
|
|
|
ComponentDescription carbon_descriptor;
|
|
|
|
AudioUnitCarbonView editView;
|
|
|
|
WindowRef carbon_window;
|
|
|
|
EventHandlerRef carbon_event_handler;
|
|
|
|
bool carbon_parented;
|
|
|
|
bool cocoa_parented;
|
|
|
|
|
|
|
|
void test_view_support (bool&, bool&);
|
|
|
|
bool test_cocoa_view_support ();
|
|
|
|
bool test_carbon_view_support ();
|
|
|
|
int create_carbon_view (bool generic);
|
|
|
|
int create_cocoa_view ();
|
|
|
|
|
|
|
|
int parent_carbon_window ();
|
|
|
|
int parent_cocoa_window ();
|
|
|
|
NSWindow* get_nswindow();
|
2006-08-12 15:43:09 -04:00
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
bool plugin_class_valid (Class pluginClass);
|
2006-08-12 15:43:09 -04:00
|
|
|
};
|
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
#endif /* __gtk2_ardour_auplugin_ui_h__ */
|