use new action map API instead of ActionManager::get_action
[ardour.git] / gtk2_ardour / lxvst_plugin_ui.h
old mode 100755 (executable)
new mode 100644 (file)
index fc46ede..115db62
@@ -1,16 +1,27 @@
-#ifndef __lxvst_plugin_ui_h__
-#define __lxvst_plugin_ui_h__
+/*
+    Copyright (C) 2012 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
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-#include <vector>
-#include <map>
-#include <list>
+*/
 
-#include <sigc++/signal.h>
-#include <gtkmm/widget.h>
+#ifndef __lxvst_plugin_ui_h__
+#define __lxvst_plugin_ui_h__
 
-#include <ardour_dialog.h>
-#include <ardour/types.h>
-#include "plugin_ui.h"
+#include "pbd/signals.h"
+#include "vst_plugin_ui.h"
 
 #ifdef LXVST_SUPPORT
 
@@ -19,49 +30,26 @@ namespace ARDOUR {
        class LXVSTPlugin;
 }
 
-class LXVSTPluginUI : public PlugUIBase, public Gtk::VBox
+class LXVSTPluginUI : public VSTPluginUI
 {
-  public:
-       LXVSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::LXVSTPlugin>);
+public:
+       LXVSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::VSTPlugin>);
        ~LXVSTPluginUI ();
 
-       gint get_preferred_height ();
-       gint get_preferred_width ();
-       bool start_updating(GdkEventAny*);
-       bool stop_updating(GdkEventAny*);
+       int get_preferred_height ();
+
+       bool start_updating (GdkEventAny*) { return false; }
+       bool stop_updating (GdkEventAny*) { return false; }
 
        int package (Gtk::Window&);
        void forward_key_event (GdkEventKey *);
-       bool non_gtk_gui() const { return true; }
-
-  private:
-       boost::shared_ptr<ARDOUR::LXVSTPlugin>  lxvst;
-       Gtk::Socket socket;
-       Gtk::HBox   preset_box;
-       Gtk::VBox   vpacker;
-       
-       sigc::connection _screen_update_connection;
-       
-       bool configure_handler (GdkEventConfigure*, Gtk::Socket*);
-       void save_plugin_setting ();
-
-       struct PresetModelColumns : public Gtk::TreeModel::ColumnRecord {
-           PresetModelColumns() { 
-                   add (name);
-                   add (number);
-           }
-           Gtk::TreeModelColumn<Glib::ustring> name;
-           Gtk::TreeModelColumn<int> number;
-       };
-
-       PresetModelColumns preset_columns;
-       Glib::RefPtr<Gtk::ListStore> preset_model;
-       Gtk::ComboBox lxvst_preset_combo;
-
-       void create_preset_store ();
-       void preset_chosen ();
-       void preset_selected ();
-       void resize_callback();
+       bool non_gtk_gui () const { return true; }
+
+private:
+       void resize_callback ();
+       int get_XID ();
+
+       PBD::ScopedConnection _resize_connection;
 };
 
 #endif //LXVST_SUPPORT