Ardour  8.12
stereo_panner.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2015 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2011-2012 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2011-2014 David Robillard <d@drobilla.net>
5  * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #ifndef __gtk_ardour_stereo_panner_h__
23 #define __gtk_ardour_stereo_panner_h__
24 
25 #include "pbd/signals.h"
26 #include "widgets/binding_proxy.h"
27 #include "panner_interface.h"
28 
29 namespace ARDOUR {
30  class PannerShell;
31 }
32 
33 namespace PBD {
34  class Controllable;
35 }
36 
37 namespace ARDOUR {
38  class Panner;
39 }
40 
42 {
43 public:
44  StereoPanner (std::shared_ptr<ARDOUR::PannerShell>);
46 
47  std::shared_ptr<PBD::Controllable> get_position_controllable() const { return position_control; }
48  std::shared_ptr<PBD::Controllable> get_width_controllable() const { return width_control; }
49 
50  sigc::signal<void> StartPositionGesture;
51  sigc::signal<void> StopPositionGesture;
52  sigc::signal<void> StartWidthGesture;
53  sigc::signal<void> StopWidthGesture;
54 
55 protected:
62 
63  std::weak_ptr<PBD::Controllable> proxy_controllable () const
64  {
65  return std::weak_ptr<PBD::Controllable> (position_binder.get_controllable());
66  }
67 
68 private:
70  std::shared_ptr<ARDOUR::PannerShell> _panner_shell;
71 
72  std::shared_ptr<PBD::Controllable> position_control;
73  std::shared_ptr<PBD::Controllable> width_control;
82  bool detented;
83 
86 
87  void set_tooltip ();
88 
89  struct ColorScheme {
90  uint32_t outline;
91  uint32_t fill;
92  uint32_t text;
93  uint32_t background;
94  uint32_t rule;
95  };
96 
97  enum State {
100  Inverted
101  };
102 
103  bool _dragging;
104 
105  static Pango::AttrList panner_font_attributes;
106  static bool have_font;
107 
108  static ColorScheme colors[3];
109  static uint32_t colors_send_bg;
110  static uint32_t colors_send_pan;
111  static void set_colors ();
112  static bool have_colors;
113  void color_handler ();
114  void bypass_handler ();
116 };
117 
118 #endif /* __gtk_ardour_stereo_panner_h__ */
std::shared_ptr< PBD::Controllable > get_controllable() const
Definition: binding_proxy.h:52
std::shared_ptr< PBD::Controllable > position_control
Definition: stereo_panner.h:72
PBD::ScopedConnectionList panshell_connections
Definition: stereo_panner.h:75
static uint32_t colors_send_bg
bool dragging_right
Definition: stereo_panner.h:78
bool on_button_release_event(GdkEventButton *)
This is a default handler for the signal signal_button_release_event().
sigc::signal< void > StartWidthGesture
Definition: stereo_panner.h:52
bool on_expose_event(GdkEventExpose *)
This is a default handler for the signal signal_expose_event().
static Pango::AttrList panner_font_attributes
bool on_button_press_event(GdkEventButton *)
This is a default handler for the signal signal_button_press_event().
double accumulated_delta
Definition: stereo_panner.h:81
PBD::ScopedConnectionList panvalue_connections
Definition: stereo_panner.h:74
ArdourWidgets::BindingProxy position_binder
Definition: stereo_panner.h:84
static bool have_colors
bool on_key_press_event(GdkEventKey *)
This is a default handler for the signal signal_key_press_event().
sigc::signal< void > StopPositionGesture
Definition: stereo_panner.h:51
bool on_scroll_event(GdkEventScroll *)
This is a default handler for the signal signal_scroll_event().
sigc::signal< void > StartPositionGesture
Definition: stereo_panner.h:50
void bypass_handler()
std::shared_ptr< PBD::Controllable > width_control
Definition: stereo_panner.h:73
std::shared_ptr< ARDOUR::PannerShell > _panner_shell
Definition: stereo_panner.h:70
static void set_colors()
bool on_motion_notify_event(GdkEventMotion *)
This is a default handler for the signal signal_motion_notify_event().
std::weak_ptr< PBD::Controllable > proxy_controllable() const
Definition: stereo_panner.h:63
bool dragging_position
Definition: stereo_panner.h:76
PannerEditor * editor()
static ColorScheme colors[3]
sigc::signal< void > StopWidthGesture
Definition: stereo_panner.h:53
StereoPanner(std::shared_ptr< ARDOUR::PannerShell >)
static uint32_t colors_send_pan
void pannable_handler()
bool dragging_left
Definition: stereo_panner.h:77
ArdourWidgets::BindingProxy width_binder
Definition: stereo_panner.h:85
void color_handler()
std::shared_ptr< PBD::Controllable > get_width_controllable() const
Definition: stereo_panner.h:48
void set_tooltip()
static bool have_font
std::shared_ptr< PBD::Controllable > get_position_controllable() const
Definition: stereo_panner.h:47
std::shared_ptr< PBD::Controllable > Controllable
Definition: console1.h:80
Definition: axis_view.h:42