gint x, y;
float fx, fy;
+ if (layout == 0) {
+ layout = create_pango_layout ("");
+ layout->set_font_description (get_style()->get_font());
+ }
+
/* redraw the background */
get_window()->draw_rectangle (get_style()->get_bg_gc(get_state()),
for (Targets::iterator i = pucks.begin(); i != pucks.end(); ++i) {
Target* puck = i->second;
- Pango::Layout layout = new Pango::Layout(get_window()->create_pango_layout());
if (puck->visible) {
/* redraw puck */
x, y,
8, 8,
0, 360 * 64);
- layout.set_text(puck->text);
- //get_window()->draw_text (get_style()->get_font(),
- // get_style()->get_fg_gc(Gtk::STATE_NORMAL),
- // x + 6, y + 6,
- // puck->text,
- // puck->textlen);
- // GTK2FIX : needs a pango layout
+
+ layout->set_text (puck->text);
+
+ get_window()->draw_layout (get_style()->get_fg_gc (STATE_NORMAL), x+6, y+6, layout);
}
}
ARDOUR::Panner& panner;
Gtk::Menu* context_menu;
Gtk::CheckMenuItem* bypass_menu_item;
+ Glib::RefPtr<Pango::Layout> layout;
typedef std::map<int,Target *> Targets;
Targets targets;
Glib::RefPtr<Gtk::TreeSelection> aselection;
Gtk::TreeView added_list;
- void column_clicked (int column, GtkCList* clist);
-
#ifdef VST_SUPPORT
// page 2
struct VstColumns : public Gtk::TreeModel::ColumnRecord {
}
void
-PluginUI::control_combo_changed (GdkEventAny* ignored, ControlUI* cui)
+PluginUI::control_combo_changed (ControlUI* cui)
{
if (!cui->ignore_change) {
string value = cui->combo->get_active_text();
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &PluginUIWindow::plugin_going_away), ignored));
- _pluginui->stop_updating();
+ _pluginui->stop_updating(0);
delete_when_idle (this);
}
bypass_button.set_active (!r->active());
}
-void
-PluginUI::start_updating ()
+bool
+PluginUI::start_updating (GdkEventAny* ignored)
{
if (output_controls.size() > 0 ) {
screen_update_connection.disconnect();
screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect
(mem_fun(*this, &PluginUI::output_update));
}
+ return false;
}
-void
-PluginUI::stop_updating ()
+bool
+PluginUI::stop_updating (GdkEventAny* ignored)
{
if (output_controls.size() > 0 ) {
screen_update_connection.disconnect();
}
+ return false;
}
void
prompter.show_all();
switch (prompter.run ()) {
- case GTK_RESPONSE_ACCEPT:
+ case Gtk::RESPONSE_ACCEPT:
string name;
class PixmapButton;
}
-class PlugUIBase : public sigc::trackable
+class PlugUIBase : public virtual sigc::trackable
{
public:
PlugUIBase (ARDOUR::PluginInsert&);
virtual ~PlugUIBase() {}
virtual gint get_preferred_height () = 0;
- virtual void start_updating() = 0;
- virtual void stop_updating() = 0;
+ virtual bool start_updating(GdkEventAny*) = 0;
+ virtual bool stop_updating(GdkEventAny*) = 0;
protected:
ARDOUR::PluginInsert& insert;
gint get_preferred_height () { return prefheight; }
- void start_updating();
- void stop_updating();
+ bool start_updating(GdkEventAny*);
+ bool stop_updating(GdkEventAny*);
private:
ARDOUR::AudioEngine &engine;
void parameter_changed (uint32_t, float, ControlUI* cui);
void update_control_display (ControlUI* cui);
void control_port_toggled (ControlUI* cui);
- void control_combo_changed (GdkEventAny* ignored, ControlUI* cui);
+ void control_combo_changed (ControlUI* cui);
void redirect_active_changed (ARDOUR::Redirect*, void*);
~VSTPluginUI ();
gint get_preferred_height ();
- void start_updating() {}
- void stop_updating() {}
+ bool start_updating(GdkEventAny*) {}
+ bool stop_updating(GdkEventAny*) {}
int package (Gtk::Window&);
#include <ardour/plugin_state.h>
#include <ardour/cycles.h>
-#include <list>
#include <vector>
#include <set>
#include <map>
using std::string;
using std::vector;
-using std::list;
using std::set;
using std::map;
virtual bool save_preset(string name) = 0;
virtual bool load_preset (const string preset_label);
- virtual list<string> get_presets();
+ virtual std::vector<std::string> get_presets();
virtual bool has_editor() const = 0;
return buf;
}
-list<string>
+vector<string>
Plugin::get_presets()
{
- list<string> labels;
+ vector<string> labels;
lrdf_uris* set_uris = lrdf_get_setting_uris(unique_id());
if (set_uris) {
lrdf_free_uris(set_uris);
}
- labels.unique();
+ // GTK2FIX find an equivalent way to do this with a vector (needed by GUI apis)
+ // labels.unique();
return labels;
}