Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
22 
23 #include <memory>
24 
25 #include "pbd/signals.h"
26 
27 #include "widgets/binding_proxy.h"
28 
29 #include "panner_interface.h"
30 
31 namespace ARDOUR {
32  class PannerShell;
33 }
34 
35 namespace PBD {
36  class Controllable;
37 }
38 
40 {
41 public:
42  MonoPanner (std::shared_ptr<ARDOUR::PannerShell>);
44 
45  std::shared_ptr<PBD::Controllable> get_controllable() const { return position_control; }
46 
47  sigc::signal<void> StartGesture;
48  sigc::signal<void> StopGesture;
49 
50 protected:
57 
58  std::weak_ptr<PBD::Controllable> proxy_controllable () const
59  {
60  return std::weak_ptr<PBD::Controllable> (position_binder.get_controllable());
61  }
62 
63 private:
65  std::shared_ptr<ARDOUR::PannerShell> _panner_shell;
66 
67  std::shared_ptr<PBD::Controllable> position_control;
73  bool detented;
74 
76 
77  void set_tooltip ();
78 
79  struct ColorScheme {
80  uint32_t outline;
81  uint32_t fill;
82  uint32_t text;
83  uint32_t background;
84  uint32_t pos_outline;
85  uint32_t pos_fill;
86  uint32_t send_bg;
87  uint32_t send_pan;
88  };
89 
90  bool _dragging;
91 
92  static Pango::AttrList panner_font_attributes;
93  static bool have_font;
94 
96  static void set_colors ();
97  static bool have_colors;
98  void color_handler ();
99  void bypass_handler ();
101 };
102 
std::shared_ptr< PBD::Controllable > get_controllable() const
Definition: binding_proxy.h:54
bool detented
Definition: mono_panner.h:73
sigc::signal< void > StopGesture
Definition: mono_panner.h:48
static Pango::AttrList panner_font_attributes
Definition: mono_panner.h:92
static bool have_colors
Definition: mono_panner.h:97
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:68
MonoPanner(std::shared_ptr< ARDOUR::PannerShell >)
int drag_start_x
Definition: mono_panner.h:70
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:72
ArdourWidgets::BindingProxy position_binder
Definition: mono_panner.h:75
std::shared_ptr< PBD::Controllable > get_controllable() const
Definition: mono_panner.h:45
int last_drag_x
Definition: mono_panner.h:71
void set_tooltip()
bool _dragging
Definition: mono_panner.h:90
void bypass_handler()
void color_handler()
PBD::ScopedConnectionList panshell_connections
Definition: mono_panner.h:69
sigc::signal< void > StartGesture
Definition: mono_panner.h:47
bool on_scroll_event(GdkEventScroll *)
This is a default handler for the signal signal_scroll_event().
static ColorScheme colors
Definition: mono_panner.h:95
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:58
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:65
void pannable_handler()
static bool have_font
Definition: mono_panner.h:93
std::shared_ptr< PBD::Controllable > position_control
Definition: mono_panner.h:67
std::shared_ptr< PBD::Controllable > Controllable
Definition: console1.h:80
Definition: axis_view.h:42