2 Copyright (C) 2004 Paul Davis
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef _WIDGETS_BAR_CONTROLLER_H_
20 #define _WIDGETS_BAR_CONTROLLER_H_
22 #include <gtkmm/alignment.h>
25 #include "widgets/binding_proxy.h"
26 #include "widgets/slider_controller.h"
27 #include "widgets/visibility.h"
29 namespace ArdourWidgets {
31 class LIBWIDGETS_API BarController : public Gtk::Alignment
34 BarController (Gtk::Adjustment& adj, boost::shared_ptr<PBD::Controllable>);
36 virtual ~BarController ();
38 void set_sensitive (bool yn);
40 ArdourFader::Tweaks tweaks() const { return _slider.tweaks (); }
41 void set_tweaks (ArdourFader::Tweaks t) { _slider.set_tweaks (t);}
43 sigc::signal<void> StartGesture;
44 sigc::signal<void> StopGesture;
46 /* export this to allow direct connection to button events */
47 Gtk::Widget& event_widget() { return _slider; }
49 /** Emitted when the adjustment spinner is activated or deactivated;
50 * the parameter is true on activation, false on deactivation.
52 sigc::signal<void, bool> SpinnerActive;
55 bool on_button_press_event (GdkEventButton*);
56 bool on_button_release_event (GdkEventButton*);
57 void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
59 virtual std::string get_label (double& /*x*/) {
64 HSliderController _slider;
65 bool entry_focus_out (GdkEventFocus*);
66 void entry_activated ();
67 void before_expose ();
69 gint switch_to_bar ();
70 gint switch_to_spinner ();
73 bool _switch_on_release;
76 void passtrhu_gesture_start() { StartGesture (); }
77 void passtrhu_gesture_stop() { StopGesture (); }
83 #endif // __gtkmm2ext_bar_controller_h__