2 Copyright (C) 1998-2006 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_SLIDER_CONTROLLER_H_
20 #define _WIDGETS_SLIDER_CONTROLLER_H_
26 #include <boost/shared_ptr.hpp>
28 #include <gtkmm/adjustment.h>
29 #include <gtkmm/spinbutton.h>
31 #include "widgets/ardour_fader.h"
32 #include "widgets/binding_proxy.h"
33 #include "widgets/visibility.h"
39 namespace ArdourWidgets {
41 class LIBWIDGETS_API SliderController : public ArdourWidgets::ArdourFader
44 SliderController (Gtk::Adjustment* adj, boost::shared_ptr<PBD::Controllable> mc, int orientation, int, int);
46 virtual ~SliderController () {}
48 Gtk::SpinButton& get_spin_button () { assert(_ctrl); return _spin; }
49 void set_controllable (boost::shared_ptr<PBD::Controllable> c) { _binding_proxy.set_controllable (c); }
52 bool on_button_press_event (GdkEventButton *ev);
53 bool on_enter_notify_event (GdkEventCrossing* ev);
54 bool on_leave_notify_event (GdkEventCrossing* ev);
58 BindingProxy _binding_proxy;
59 boost::shared_ptr<PBD::Controllable> _ctrl;
60 Gtk::Adjustment *_ctrl_adj;
61 Gtk::Adjustment _spin_adj;
62 Gtk::SpinButton _spin;
67 class LIBWIDGETS_API VSliderController : public SliderController
70 VSliderController (Gtk::Adjustment *adj, boost::shared_ptr<PBD::Controllable> mc, int, int);
73 class LIBWIDGETS_API HSliderController : public SliderController
76 HSliderController (Gtk::Adjustment *adj, boost::shared_ptr<PBD::Controllable> mc, int, int);