/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#ifndef __ardour_plugin_ui_h__
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/label.h>
#include <gtkmm/menu.h>
-#include <gtkmm/adjustment.h>
#include <gtkmm/togglebutton.h>
#include <gtkmm/socket.h>
#include <gtkmm/comboboxtext.h>
#include <ardour_dialog.h>
#include <ardour/types.h>
+#include "latency_gui.h"
+#include "automation_controller.h"
+
namespace ARDOUR {
- class AudioEngine;
class PluginInsert;
class Plugin;
class VSTPlugin;
- class Redirect;
+ class IOProcessor;
+ class AUPlugin;
}
-namespace MIDI {
+namespace PBD {
class Controllable;
}
class PlugUIBase : public virtual sigc::trackable
{
public:
- PlugUIBase (ARDOUR::PluginInsert&);
+ PlugUIBase (boost::shared_ptr<ARDOUR::PluginInsert>, nframes64_t sample_rate, nframes64_t period_size);
virtual ~PlugUIBase() {}
virtual gint get_preferred_height () = 0;
virtual bool stop_updating(GdkEventAny*) = 0;
protected:
- ARDOUR::PluginInsert& insert;
- ARDOUR::Plugin& plugin;
+ boost::shared_ptr<ARDOUR::PluginInsert> insert;
+ boost::shared_ptr<ARDOUR::Plugin> plugin;
Gtk::ComboBoxText combo;
Gtk::Button save_button;
Gtk::ToggleButton bypass_button;
+ LatencyGUI latency_gui;
void setting_selected();
void save_plugin_setting (void);
void bypass_toggled();
};
-class PluginUI : public PlugUIBase, public Gtk::VBox
+class LadspaPluginUI : public PlugUIBase, public Gtk::VBox
{
public:
- PluginUI (ARDOUR::AudioEngine &, ARDOUR::PluginInsert& plug, bool scrollable=false);
- ~PluginUI ();
+ LadspaPluginUI (boost::shared_ptr<ARDOUR::PluginInsert> plug, nframes64_t sample_rate, nframes64_t period_size, bool scrollable = false);
+ ~LadspaPluginUI ();
gint get_preferred_height () { return prefheight; }
bool stop_updating(GdkEventAny*);
private:
- ARDOUR::AudioEngine &engine;
Gtk::HBox settings_box;
Gtk::HBox hpacker;
static const int32_t initial_output_rows = 1;
static const int32_t initial_output_cols = 4;
+ /* FIXME: Unify with AutomationController */
struct ControlUI : public Gtk::HBox {
- uint32_t port_index;
+ boost::shared_ptr<ARDOUR::AutomationControl> control;
+
+ ARDOUR::Parameter parameter() { return control->parameter(); }
/* input */
- Gtk::Adjustment* adjustment;
Gtk::ComboBoxText* combo;
std::map<string, float>* combo_map;
Gtk::ToggleButton* button;
- Gtkmm2ext::BarController* control;
+ boost::shared_ptr<AutomationController> controller;
Gtkmm2ext::ClickBox* clickbox;
Gtk::Label label;
bool logarithmic;
sigc::connection screen_update_connection;
void output_update();
- void build (ARDOUR::AudioEngine &);
- ControlUI* build_control_ui (ARDOUR::AudioEngine &, guint32 port_index, MIDI::Controllable *);
+ void build ();
+ ControlUI* build_control_ui (guint32 port_index, boost::shared_ptr<ARDOUR::AutomationControl>);
std::vector<string> setup_scale_values(guint32 port_index, ControlUI* cui);
- void control_adjustment_changed (ControlUI* cui);
- void parameter_changed (uint32_t, float, ControlUI* cui);
+ void parameter_changed (ControlUI* cui);
void update_control_display (ControlUI* cui);
void control_port_toggled (ControlUI* cui);
void control_combo_changed (ControlUI* cui);
- void redirect_active_changed (ARDOUR::Redirect*, void*);
+ void processor_active_changed (boost::weak_ptr<ARDOUR::Processor>);
void astate_clicked (ControlUI*, uint32_t parameter);
void automation_state_changed (ControlUI*);
class PluginUIWindow : public ArdourDialog
{
public:
- PluginUIWindow (ARDOUR::AudioEngine &, ARDOUR::PluginInsert& insert, bool scrollable=false);
+ PluginUIWindow (boost::shared_ptr<ARDOUR::PluginInsert> insert, nframes64_t sample_rate, nframes64_t period_size, bool scrollable = false);
~PluginUIWindow ();
PlugUIBase& pluginui() { return *_pluginui; }
void resize_preferred();
+
+ virtual bool on_key_press_event (GdkEventKey*);
+ virtual bool on_key_release_event (GdkEventKey*);
private:
PlugUIBase* _pluginui;
- void plugin_going_away (ARDOUR::Redirect*);
+ void plugin_going_away ();
};
-
#ifdef VST_SUPPORT
class VSTPluginUI : public PlugUIBase, public Gtk::VBox
{
public:
- VSTPluginUI (ARDOUR::PluginInsert&, ARDOUR::VSTPlugin&);
+ VSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::VSTPlugin>, nframes64_t sample_rate, nframes64_t period_size);
~VSTPluginUI ();
gint get_preferred_height ();
int package (Gtk::Window&);
private:
- ARDOUR::VSTPlugin& vst;
+ boost::shared_ptr<ARDOUR::VSTPlugin> vst;
Gtk::Socket socket;
Gtk::HBox preset_box;
Gtk::VBox vpacker;
- gboolean configure_handler (GdkEventConfigure*, Gtk::Socket*);
+ bool configure_handler (GdkEventConfigure*, Gtk::Socket*);
void save_plugin_setting ();
};
-#endif
+#endif // VST_SUPPORT
#endif /* __ardour_plugin_ui_h__ */