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-02-16 17:43:18 -05:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
#include <Carbon/Carbon.h>
|
2008-02-01 22:57:35 -05:00
|
|
|
#include <AudioUnit/AudioUnitCarbonView.h>
|
2008-01-10 16:20:59 -05:00
|
|
|
#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>
|
2008-02-16 17:43:18 -05:00
|
|
|
#include <gtkmm/combobox.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/label.h>
|
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
#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*);
|
|
|
|
|
2008-04-11 10:06:50 -04:00
|
|
|
void activate ();
|
|
|
|
void deactivate ();
|
|
|
|
|
2008-02-16 17:43:18 -05:00
|
|
|
void lower_box_realized ();
|
2008-01-10 16:20:59 -05:00
|
|
|
void on_realize ();
|
|
|
|
void on_show ();
|
2008-01-19 00:06:33 -05:00
|
|
|
void on_hide ();
|
|
|
|
bool on_map_event (GdkEventAny*);
|
|
|
|
bool on_focus_in_event (GdkEventFocus*);
|
|
|
|
bool on_focus_out_event (GdkEventFocus*);
|
2008-01-10 16:20:59 -05:00
|
|
|
|
|
|
|
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;
|
2008-04-11 10:06:50 -04:00
|
|
|
|
2008-02-16 17:43:18 -05:00
|
|
|
Gtk::HBox top_box;
|
|
|
|
Gtk::EventBox low_box;
|
|
|
|
Gtk::VBox vpacker;
|
|
|
|
Gtk::Label automation_mode_label;
|
|
|
|
Gtk::ComboBoxText automation_mode_selector;
|
|
|
|
Gtk::Label preset_label;
|
|
|
|
|
|
|
|
static std::vector<std::string> automation_mode_strings;
|
2008-01-10 16:20:59 -05:00
|
|
|
|
|
|
|
/* Cocoa */
|
|
|
|
|
|
|
|
NSWindow* cocoa_window;
|
|
|
|
NSView* au_view;
|
|
|
|
|
|
|
|
/* Carbon */
|
|
|
|
|
|
|
|
NSWindow* cocoa_parent;
|
|
|
|
ComponentDescription carbon_descriptor;
|
|
|
|
AudioUnitCarbonView editView;
|
|
|
|
WindowRef carbon_window;
|
|
|
|
EventHandlerRef carbon_event_handler;
|
2008-01-19 00:06:33 -05:00
|
|
|
bool _activating_from_app;
|
2008-04-11 10:06:50 -04:00
|
|
|
NSView* packView;
|
2008-01-10 16:20:59 -05:00
|
|
|
|
|
|
|
bool test_cocoa_view_support ();
|
|
|
|
bool test_carbon_view_support ();
|
2008-02-16 17:43:18 -05:00
|
|
|
int create_carbon_view ();
|
2008-01-10 16:20:59 -05:00
|
|
|
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__ */
|