X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fautomation_controller.h;h=ac87ee300f068827e47146bb86f4631b2278b501;hb=df28a71252f4593c65ec03611586dfc8a62a834f;hp=f9e8ab4ce3f55973b5867b2e4c17721cad058192;hpb=eb296b2c957f574334fae2aefd8b863cf7631769;p=ardour.git diff --git a/gtk2_ardour/automation_controller.h b/gtk2_ardour/automation_controller.h index f9e8ab4ce3..ac87ee300f 100644 --- a/gtk2_ardour/automation_controller.h +++ b/gtk2_ardour/automation_controller.h @@ -1,6 +1,6 @@ /* - Copyright (C) 2007 Paul Davis - Author: Dave Robillard + Copyright (C) 2007 Paul Davis + Author: David Robillard 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 @@ -21,9 +21,20 @@ #ifndef __ardour_gtk_automation_controller_h__ #define __ardour_gtk_automation_controller_h__ +#ifdef YES +#undef YES +#endif +#ifdef NO +#undef NO +#endif + #include -#include -#include + +#include + +#include "pbd/signals.h" +#include "evoral/Parameter.hpp" +#include "widgets/barcontroller.h" namespace ARDOUR { class Session; @@ -31,31 +42,67 @@ namespace ARDOUR { class AutomationControl; } +namespace Gtk { + class Adjustment; + class Widget; +} + +class AutomationBarController : public ArdourWidgets::BarController { +public: + AutomationBarController(boost::shared_ptr ac, + Gtk::Adjustment* adj); + ~AutomationBarController(); +private: + std::string get_label (double&); + boost::shared_ptr _controllable; +}; -class AutomationController : public Gtkmm2ext::BarController { +/** A BarController which displays the value and allows control of an AutomationControl */ +class AutomationController : public Gtk::Alignment { public: - static boost::shared_ptr create( - ARDOUR::Session& s, - boost::shared_ptr al, - boost::shared_ptr ac); + static boost::shared_ptr create ( + const Evoral::Parameter& param, + const ARDOUR::ParameterDescriptor& desc, + boost::shared_ptr ac, + bool use_knob = false); ~AutomationController(); - + boost::shared_ptr controllable() { return _controllable; } - - void update_label(char* label, int label_len); - void display_effective_value(); + + void disable_vertical_scroll(); + + Gtk::Adjustment* adjustment() { return _adjustment; } + Gtk::Widget* widget() { return _widget; } + + void display_effective_value (); + void automation_state_changed (); void value_adjusted(); + void stop_updating (); + private: - AutomationController(boost::shared_ptr ac, Gtk::Adjustment* adj); + AutomationController (boost::shared_ptr ac, + Gtk::Adjustment* adj, + bool use_knob); + void start_touch(); void end_touch(); + bool button_press(GdkEventButton*); + bool button_release(GdkEventButton*); - bool _ignore_change; + void run_note_select_dialog(); + void set_ratio(double ratio); + void set_freq_beats(double beats); + bool on_button_release(GdkEventButton* ev); + + Gtk::Widget* _widget; boost::shared_ptr _controllable; Gtk::Adjustment* _adjustment; sigc::connection _screen_update_connection; + PBD::ScopedConnectionList _changed_connections; + bool _ignore_change; + bool _grabbed; };