Ardour  9.0-pre0-582-g084a23a80d
barcontroller.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 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_BAR_CONTROLLER_H_
21 #define _WIDGETS_BAR_CONTROLLER_H_
22 
23 #include <gtkmm/alignment.h>
24 #include <cairo.h>
25 
26 #include "widgets/binding_proxy.h"
28 #include "widgets/visibility.h"
29 
30 namespace ArdourWidgets {
31 
33 {
34 public:
35  BarController (Gtk::Adjustment& adj, std::shared_ptr<PBD::Controllable>);
36 
37  virtual ~BarController ();
38 
39  void set_sensitive (bool yn);
40  void set_digits (guint d) { _slider.get_spin_button().set_digits (d); }
41 
42  ArdourFader::Tweaks tweaks() const { return _slider.tweaks (); }
43  void set_tweaks (ArdourFader::Tweaks t) { _slider.set_tweaks (t);}
44 
45  sigc::signal<void,int> StartGesture;
46  sigc::signal<void,int> StopGesture;
47 
48  /* export this to allow direct connection to button events */
49  Gtk::Widget& event_widget() { return _slider; }
50 
54  sigc::signal<void, bool> SpinnerActive;
55 
56 protected:
59  void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
60 
61  virtual std::string get_label (double& /*x*/) {
62  return "";
63  }
64 
65 private:
68  void entry_activated ();
69  void before_expose ();
70 
71  gint switch_to_bar ();
73 
74  bool _switching;
76 
77  void passtrhu_gesture_start (int state) { StartGesture (state); }
78  void passtrhu_gesture_stop (int state) { StopGesture (state); }
79 };
80 
81 
82 }; /* namespace */
83 
84 #endif // __gtkmm2ext_bar_controller_h__
ArdourFader::Tweaks tweaks() const
Definition: barcontroller.h:42
void passtrhu_gesture_start(int state)
Definition: barcontroller.h:77
BarController(Gtk::Adjustment &adj, std::shared_ptr< PBD::Controllable >)
sigc::signal< void, int > StopGesture
Definition: barcontroller.h:46
void set_tweaks(ArdourFader::Tweaks t)
Definition: barcontroller.h:43
void on_style_changed(const Glib::RefPtr< Gtk::Style > &)
bool entry_focus_out(GdkEventFocus *)
Gtk::Widget & event_widget()
Definition: barcontroller.h:49
void passtrhu_gesture_stop(int state)
Definition: barcontroller.h:78
bool on_button_release_event(GdkEventButton *)
This is a default handler for the signal signal_button_release_event().
bool on_button_press_event(GdkEventButton *)
This is a default handler for the signal signal_button_press_event().
HSliderController _slider
Definition: barcontroller.h:66
sigc::signal< void, int > StartGesture
Definition: barcontroller.h:45
virtual std::string get_label(double &)
Definition: barcontroller.h:61
sigc::signal< void, bool > SpinnerActive
Definition: barcontroller.h:54
#define LIBWIDGETS_API