Ardour  9.0-pre0-582-g084a23a80d
slider_controller.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef _WIDGETS_SLIDER_CONTROLLER_H_
21 #define _WIDGETS_SLIDER_CONTROLLER_H_
22 
23 #ifdef interface
24 #undef interface
25 #endif
26 
27 #include <memory>
28 
29 #include <gtkmm/adjustment.h>
30 #include <gtkmm/spinbutton.h>
31 
32 #include "widgets/fader_widget.h"
33 #include "widgets/ardour_fader.h"
34 #include "widgets/binding_proxy.h"
35 #include "widgets/visibility.h"
36 
37 namespace PBD {
38  class Controllable;
39 }
40 
41 namespace ArdourWidgets {
42 
44 {
45 public:
46  SliderController (Gtk::Adjustment* adj, std::shared_ptr<PBD::Controllable> mc, int orien);
47 
48  virtual ~SliderController () {}
49 
50  Gtk::SpinButton& get_spin_button () { assert(_ctrl); return _spin; }
51  void set_controllable (std::shared_ptr<PBD::Controllable> c) { _binding_proxy.set_controllable (c); }
52 
53 protected:
57  void ctrl_adjusted();
58  void spin_adjusted();
59 
61  std::shared_ptr<PBD::Controllable> _ctrl;
67 };
68 
70 {
71 public:
72  VSliderController (Gtk::Adjustment *adj, std::shared_ptr<PBD::Controllable> mc, int, int);
73 };
74 
76 {
77 public:
78  HSliderController (Gtk::Adjustment *adj, std::shared_ptr<PBD::Controllable> mc, int, int);
79 };
80 
81 }; /* namespace */
82 
83 #endif
HSliderController(Gtk::Adjustment *adj, std::shared_ptr< PBD::Controllable > mc, int, int)
std::shared_ptr< PBD::Controllable > _ctrl
bool on_leave_notify_event(GdkEventCrossing *ev)
This is a default handler for the signal signal_leave_notify_event().
SliderController(Gtk::Adjustment *adj, std::shared_ptr< PBD::Controllable > mc, int orien)
bool on_button_press_event(GdkEventButton *ev)
This is a default handler for the signal signal_button_press_event().
Gtk::SpinButton & get_spin_button()
void set_controllable(std::shared_ptr< PBD::Controllable > c)
bool on_enter_notify_event(GdkEventCrossing *ev)
This is a default handler for the signal signal_enter_notify_event().
VSliderController(Gtk::Adjustment *adj, std::shared_ptr< PBD::Controllable > mc, int, int)
std::shared_ptr< PBD::Controllable > Controllable
Definition: console1.h:80
Definition: axis_view.h:42
#define LIBWIDGETS_API