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>
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.
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.
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.
22 #ifndef __gtk_ardour_stereo_panner_h__
23 #define __gtk_ardour_stereo_panner_h__
25 #include "pbd/signals.h"
26 #include "widgets/binding_proxy.h"
27 #include "panner_interface.h"
41 class StereoPanner : public PannerInterface
44 StereoPanner (boost::shared_ptr<ARDOUR::PannerShell>);
47 boost::shared_ptr<PBD::Controllable> get_position_controllable() const { return position_control; }
48 boost::shared_ptr<PBD::Controllable> get_width_controllable() const { return width_control; }
50 sigc::signal<void> StartPositionGesture;
51 sigc::signal<void> StopPositionGesture;
52 sigc::signal<void> StartWidthGesture;
53 sigc::signal<void> StopWidthGesture;
56 bool on_expose_event (GdkEventExpose*);
57 bool on_button_press_event (GdkEventButton*);
58 bool on_button_release_event (GdkEventButton*);
59 bool on_motion_notify_event (GdkEventMotion*);
60 bool on_scroll_event (GdkEventScroll*);
61 bool on_key_press_event (GdkEventKey*);
63 boost::weak_ptr<PBD::Controllable> proxy_controllable () const
65 return boost::weak_ptr<PBD::Controllable> (position_binder.get_controllable());
69 PannerEditor* editor ();
70 boost::shared_ptr<ARDOUR::PannerShell> _panner_shell;
72 boost::shared_ptr<PBD::Controllable> position_control;
73 boost::shared_ptr<PBD::Controllable> width_control;
74 PBD::ScopedConnectionList panvalue_connections;
75 PBD::ScopedConnectionList panshell_connections;
76 bool dragging_position;
81 double accumulated_delta;
84 ArdourWidgets::BindingProxy position_binder;
85 ArdourWidgets::BindingProxy width_binder;
105 static Pango::AttrList panner_font_attributes;
106 static bool have_font;
108 static ColorScheme colors[3];
109 static void set_colors ();
110 static bool have_colors;
111 void color_handler ();
112 void bypass_handler ();
113 void pannable_handler ();
116 #endif /* __gtk_ardour_stereo_panner_h__ */