diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-29 15:54:30 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-29 15:54:30 +0000 |
commit | bde8437387ccd5bfd86d641d15444f76532b5e2b (patch) | |
tree | add3dc5a9cf3dec8c7164dadc6d7924532ff900c /gtk2_ardour/ardour_button.h | |
parent | d7b685cc5fa0b87e2c5569d97772605759daa586 (diff) |
make ArdourButtons be MIDI-learnable; tweaks to ArdourButton design and implementation; use ArdourButtons (all gray for now) in the Monitor section.
git-svn-id: svn://localhost/ardour2/branches/3.0@10338 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_button.h')
-rw-r--r-- | gtk2_ardour/ardour_button.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h index 1bf5aaac19..7f4884d6a7 100644 --- a/gtk2_ardour/ardour_button.h +++ b/gtk2_ardour/ardour_button.h @@ -22,11 +22,14 @@ #include <stdint.h> -#include <gtkmm/activatable.h> +#include <gtkmm/action.h> + +#include "pbd/signals.h" +#include "gtkmm2ext/binding_proxy.h" #include "cairo_widget.h" -class ArdourButton : public CairoWidget, Gtk::Activatable +class ArdourButton : public CairoWidget { public: enum Element { @@ -39,6 +42,7 @@ class ArdourButton : public CairoWidget, Gtk::Activatable static Element default_elements; static Element led_default_elements; + static Element just_led_default_elements; ArdourButton (Element e = default_elements); virtual ~ArdourButton (); @@ -57,6 +61,12 @@ class ArdourButton : public CairoWidget, Gtk::Activatable sigc::signal<void> signal_led_clicked; + boost::shared_ptr<PBD::Controllable> get_controllable() { return binding_proxy.get_controllable(); } + void set_controllable (boost::shared_ptr<PBD::Controllable> c); + void watch (); + + void set_related_action (Glib::RefPtr<Gtk::Action>); + protected: void render (cairo_t *); void on_size_request (Gtk::Requisition* req); @@ -64,10 +74,15 @@ class ArdourButton : public CairoWidget, Gtk::Activatable bool on_button_press_event (GdkEventButton*); bool on_button_release_event (GdkEventButton*); + void controllable_changed (); + PBD::ScopedConnection watch_connection; + private: Glib::RefPtr<Pango::Layout> _layout; std::string _text; Element _elements; + BindingProxy binding_proxy; + bool _act_on_release; int _text_width; int _text_height; @@ -96,6 +111,10 @@ class ArdourButton : public CairoWidget, Gtk::Activatable void set_colors (); void color_handler (); void state_handler (); + + Glib::RefPtr<Gtk::Action> _action; + void action_activated (); + void action_toggled (); }; #endif /* __gtk2_ardour_ardour_button_h__ */ |