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