X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fplugin_ui.h;h=3b374298acc8ab9ef94f3186f8a864d28d8dfcd1;hb=1b561446b8c4c0f1b682ec04cb44c5f53672c5fc;hp=d07b287e6a68541aa5b7a518f44fbf09165ec982;hpb=b382ad8b22d308629900ce2e7a9556bd57547861;p=ardour.git diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index d07b287e6a..3b374298ac 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -30,28 +30,29 @@ #include -#include +#include #include -#include +#include #include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include +#include #include +#include +#include +#include #include "ardour/types.h" #include "ardour/plugin.h" #include "ardour/variant.h" -#include "ardour_button.h" -#include "ardour_dropdown.h" -#include "ardour_spinner.h" +#include "widgets/ardour_button.h" +#include "widgets/ardour_dropdown.h" +#include "widgets/ardour_spinner.h" + #include "ardour_window.h" #include "automation_controller.h" @@ -69,21 +70,19 @@ namespace PBD { class Controllable; } -namespace Gtkmm2ext { - class HSliderController; - class BarController; +namespace ArdourWidgets { class ClickBox; class FastMeter; - class PixmapButton; } class LatencyGUI; class ArdourWindow; class PluginEqGui; +class VSTPluginUI; class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionList { - public: +public: PlugUIBase (boost::shared_ptr); virtual ~PlugUIBase(); @@ -106,30 +105,32 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL virtual void forward_key_event (GdkEventKey*) {} virtual void grab_focus () {} - virtual bool non_gtk_gui() const { return false; } + virtual bool non_gtk_gui() const { return false; } sigc::signal KeyboardFocused; - protected: +protected: boost::shared_ptr insert; boost::shared_ptr plugin; /* UI elements that can subclasses can add to their widgets */ /** a ComboBoxText which lists presets and manages their selection */ - ArdourDropdown _preset_combo; + ArdourWidgets::ArdourDropdown _preset_combo; /** a label which has a * in if the current settings are different from the preset being shown */ Gtk::Label _preset_modified; /** a button to add a preset */ - ArdourButton add_button; + ArdourWidgets::ArdourButton add_button; /** a button to save the current settings as a new user preset */ - ArdourButton save_button; + ArdourWidgets::ArdourButton save_button; /** a button to delete the current preset (if it is a user one) */ - ArdourButton delete_button; + ArdourWidgets::ArdourButton delete_button; /** a button to delete the reset the plugin params */ - ArdourButton reset_button; + ArdourWidgets::ArdourButton reset_button; /** a button to bypass the plugin */ - ArdourButton bypass_button; + ArdourWidgets::ArdourButton bypass_button; + /** and self-explaining button :) */ + ArdourWidgets::ArdourButton pin_management_button; /** a button to acquire keyboard focus */ Gtk::EventBox focus_button; /** an expander containing the plugin description */ @@ -137,15 +138,15 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL /** an expander containing the plugin analysis graph */ Gtk::Expander plugin_analysis_expander; /** a button which, when clicked, opens the latency GUI */ - ArdourButton latency_button; + ArdourWidgets::ArdourButton latency_button; /** a button which sets all controls' automation setting to Manual */ - ArdourButton automation_manual_all_button; + ArdourWidgets::ArdourButton automation_manual_all_button; /** a button which sets all controls' automation setting to Play */ - ArdourButton automation_play_all_button; - /** a button which sets all controls' automation setting to Write */ - ArdourButton automation_write_all_button; + ArdourWidgets::ArdourButton automation_play_all_button; + /** a button which sets all controls' automation setting to Write */ + ArdourWidgets::ArdourButton automation_write_all_button; /** a button which sets all controls' automation setting to Touch */ - ArdourButton automation_touch_all_button; + ArdourWidgets::ArdourButton automation_touch_all_button; void set_latency_label (); @@ -153,7 +154,6 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL ArdourWindow* latency_dialog; PluginEqGui* eqgui; - Gtk::Requisition pre_eq_size; Gtk::Image* focus_out_image; Gtk::Image* focus_in_image; @@ -164,6 +164,7 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL void save_plugin_setting (); void delete_plugin_setting (); void reset_plugin_parameters (); + void manage_pins (); bool focus_toggled(GdkEventButton*); bool bypass_button_release(GdkEventButton*); void toggle_description (); @@ -183,7 +184,7 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL class GenericPluginUI : public PlugUIBase, public Gtk::VBox { - public: +public: GenericPluginUI (boost::shared_ptr plug, bool scrollable=false); ~GenericPluginUI (); @@ -193,7 +194,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox bool start_updating(GdkEventAny*); bool stop_updating(GdkEventAny*); - private: +private: Gtk::VBox main_contents; Gtk::HBox settings_box; Gtk::HBox hpacker; @@ -203,21 +204,12 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox bool is_scrollable; struct MeterInfo { - Gtkmm2ext::FastMeter *meter; - - float min; - float max; - bool min_unbound; - bool max_unbound; + ArdourWidgets::FastMeter* meter; bool packed; MeterInfo () { meter = 0; packed = false; - min = 1.0e10; - max = -1.0e10; - min_unbound = false; - max_unbound = false; } }; @@ -234,17 +226,18 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox boost::shared_ptr scale_points; boost::shared_ptr controller; - ArdourButton automate_button; + ArdourWidgets::ArdourButton automate_button; Gtk::Label label; - Gtk::ComboBoxText* combo; - Gtkmm2ext::ClickBox* clickbox; + ArdourWidgets::ArdourDropdown* combo; + ArdourWidgets::ClickBox* clickbox; Gtk::FileChooserButton* file_button; - ArdourSpinner* spin_box; + ArdourWidgets::ArdourSpinner* spin_box; bool button; bool update_pending; bool ignore_change; + /* output */ Gtk::EventBox* display; @@ -260,12 +253,18 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox /* layout */ Gtk::Table* knobtable; int x0, x1, y0, y1; + + bool short_autostate; // modify with set_short_autostate below }; - std::vector input_controls; + void set_short_autostate(ControlUI* cui, bool value); + + std::vector input_controls; // workaround for preset load std::vector input_controls_with_automation; std::vector output_controls; + sigc::connection screen_update_connection; + void output_update(); void build (); @@ -281,29 +280,32 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox void ui_parameter_changed (ControlUI* cui); void update_control_display (ControlUI* cui); - void control_combo_changed (ControlUI* cui); + void update_input_displays (); // workaround for preset load + void control_combo_changed (ControlUI* cui, float value); - void astate_clicked (ControlUI*); + bool astate_button_event (GdkEventButton* ev, ControlUI*); void automation_state_changed (ControlUI*); void set_automation_state (ARDOUR::AutoState state, ControlUI* cui); void set_all_automation (ARDOUR::AutoState state); + void knob_size_request(Gtk::Requisition* req, ControlUI* cui); + /* XXX: remove */ void print_parameter (char *buf, uint32_t len, uint32_t param); bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *); bool midinote_printer(char* buf, Gtk::Adjustment &, ControlUI *); - void set_property (const ARDOUR::ParameterDescriptor& desc, - Gtk::FileChooserButton* widget); - void property_changed (uint32_t key, const ARDOUR::Variant& value); + typedef std::map FilePathControls; + FilePathControls _filepath_controls; + void set_path_property (const ARDOUR::ParameterDescriptor& desc, + Gtk::FileChooserButton* widget); + void path_property_changed (uint32_t key, const ARDOUR::Variant& value); - typedef std::map PropertyControls; - PropertyControls _property_controls; }; class PluginUIWindow : public ArdourWindow { - public: +public: PluginUIWindow (boost::shared_ptr insert, bool scrollable=false, bool editor=true); @@ -321,7 +323,7 @@ class PluginUIWindow : public ArdourWindow void on_show (); void on_hide (); - private: +private: std::string _title; PlugUIBase* _pluginui; PBD::ScopedConnection death_connection; @@ -330,8 +332,8 @@ class PluginUIWindow : public ArdourWindow bool was_visible; bool _keyboard_focused; #ifdef AUDIOUNIT_SUPPORT - int pre_deactivate_x; - int pre_deactivate_y; + int pre_deactivate_x; + int pre_deactivate_y; #endif void keyboard_focused (bool yn); @@ -341,10 +343,18 @@ class PluginUIWindow : public ArdourWindow bool create_windows_vst_editor (boost::shared_ptr); bool create_lxvst_editor(boost::shared_ptr); + bool create_mac_vst_editor(boost::shared_ptr); bool create_audiounit_editor (boost::shared_ptr); bool create_lv2_editor (boost::shared_ptr); }; +#ifdef MACVST_SUPPORT +/* this function has to be in a .mm file + * because MacVSTPluginUI has Cocoa members + */ +extern VSTPluginUI* create_mac_vst_gui (boost::shared_ptr); +#endif + #ifdef AUDIOUNIT_SUPPORT /* this function has to be in a .mm file */ extern PlugUIBase* create_au_gui (boost::shared_ptr, Gtk::VBox**);