Ardour  9.0-pre0-439-ga53b99b307
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 #pragma once
23 
24 #include "pbd/signals.h"
25 #include "widgets/binding_proxy.h"
26 #include "panner_interface.h"
27 
28 namespace ARDOUR {
29  class PannerShell;
30 }
31 
32 namespace PBD {
33  class Controllable;
34 }
35 
36 namespace ARDOUR {
37  class Panner;
38 }
39 
41 {
42 public:
43  StereoPanner (std::shared_ptr<ARDOUR::PannerShell>);
45 
46  std::shared_ptr<PBD::Controllable> get_position_controllable() const { return position_control; }
47  std::shared_ptr<PBD::Controllable> get_width_controllable() const { return width_control; }
48 
49  sigc::signal<void> StartPositionGesture;
50  sigc::signal<void> StopPositionGesture;
51  sigc::signal<void> StartWidthGesture;
52  sigc::signal<void> StopWidthGesture;
53 
54 protected:
61 
62  std::weak_ptr<PBD::Controllable> proxy_controllable () const
63  {
64  return std::weak_ptr<PBD::Controllable> (position_binder.get_controllable());
65  }
66 
67 private:
69  std::shared_ptr<ARDOUR::PannerShell> _panner_shell;
70 
71  std::shared_ptr<PBD::Controllable> position_control;
72  std::shared_ptr<PBD::Controllable> width_control;
81  bool detented;
82 
85 
86  void set_tooltip ();
87 
88  struct ColorScheme {
89  uint32_t outline;
90  uint32_t fill;
91  uint32_t text;
92  uint32_t background;
93  uint32_t rule;
94  };
95 
96  enum State {
99  Inverted
100  };
101 
102  bool _dragging;
103 
104  static Pango::AttrList panner_font_attributes;
105  static bool have_font;
106 
107  static ColorScheme colors[3];
108  static uint32_t colors_send_bg;
109  static uint32_t colors_send_pan;
110  static void set_colors ();
111  static bool have_colors;
112  void color_handler ();
113  void bypass_handler ();
115 };
116 
std::shared_ptr< PBD::Controllable > get_controllable() const
Definition: binding_proxy.h:54
std::shared_ptr< PBD::Controllable > position_control
Definition: stereo_panner.h:71
PBD::ScopedConnectionList panshell_connections
Definition: stereo_panner.h:74
static uint32_t colors_send_bg
bool dragging_right
Definition: stereo_panner.h:77
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:51
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:80
PBD::ScopedConnectionList panvalue_connections
Definition: stereo_panner.h:73
ArdourWidgets::BindingProxy position_binder
Definition: stereo_panner.h:83
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:50
bool on_scroll_event(GdkEventScroll *)
This is a default handler for the signal signal_scroll_event().
sigc::signal< void > StartPositionGesture
Definition: stereo_panner.h:49
void bypass_handler()
std::shared_ptr< PBD::Controllable > width_control
Definition: stereo_panner.h:72
std::shared_ptr< ARDOUR::PannerShell > _panner_shell
Definition: stereo_panner.h:69
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:62
bool dragging_position
Definition: stereo_panner.h:75
PannerEditor * editor()
static ColorScheme colors[3]
sigc::signal< void > StopWidthGesture
Definition: stereo_panner.h:52
StereoPanner(std::shared_ptr< ARDOUR::PannerShell >)
static uint32_t colors_send_pan
void pannable_handler()
bool dragging_left
Definition: stereo_panner.h:76
ArdourWidgets::BindingProxy width_binder
Definition: stereo_panner.h:84
void color_handler()
std::shared_ptr< PBD::Controllable > get_width_controllable() const
Definition: stereo_panner.h:47
void set_tooltip()
static bool have_font
std::shared_ptr< PBD::Controllable > get_position_controllable() const
Definition: stereo_panner.h:46
std::shared_ptr< PBD::Controllable > Controllable
Definition: console1.h:80
Definition: axis_view.h:42