2010-11-30 15:22:43 -05:00
|
|
|
/*
|
|
|
|
Copyright (C) 2010 Paul Davis
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __gtk_ardour_stereo_panner_h__
|
|
|
|
#define __gtk_ardour_stereo_panner_h__
|
|
|
|
|
|
|
|
#include "pbd/signals.h"
|
2010-12-30 15:17:44 -05:00
|
|
|
#include "gtkmm2ext/binding_proxy.h"
|
2011-12-26 09:05:19 -05:00
|
|
|
#include "panner_interface.h"
|
2010-12-30 15:17:44 -05:00
|
|
|
|
2010-11-30 15:22:43 -05:00
|
|
|
namespace PBD {
|
|
|
|
class Controllable;
|
|
|
|
}
|
|
|
|
|
2011-06-01 13:00:29 -04:00
|
|
|
namespace ARDOUR {
|
2011-01-26 20:31:03 -05:00
|
|
|
class Panner;
|
|
|
|
}
|
|
|
|
|
2011-12-26 09:05:19 -05:00
|
|
|
class StereoPanner : public PannerInterface
|
2010-11-30 15:22:43 -05:00
|
|
|
{
|
|
|
|
public:
|
2011-01-26 20:31:03 -05:00
|
|
|
StereoPanner (boost::shared_ptr<ARDOUR::Panner>);
|
2010-11-30 15:22:43 -05:00
|
|
|
~StereoPanner ();
|
|
|
|
|
2011-01-07 17:18:53 -05:00
|
|
|
sigc::signal<void> StartPositionGesture;
|
|
|
|
sigc::signal<void> StopPositionGesture;
|
|
|
|
sigc::signal<void> StartWidthGesture;
|
|
|
|
sigc::signal<void> StopWidthGesture;
|
|
|
|
|
2010-11-30 15:22:43 -05:00
|
|
|
protected:
|
|
|
|
bool on_expose_event (GdkEventExpose*);
|
|
|
|
bool on_button_press_event (GdkEventButton*);
|
|
|
|
bool on_button_release_event (GdkEventButton*);
|
|
|
|
bool on_motion_notify_event (GdkEventMotion*);
|
2010-12-01 16:24:57 -05:00
|
|
|
bool on_scroll_event (GdkEventScroll*);
|
2010-12-01 18:29:44 -05:00
|
|
|
bool on_key_press_event (GdkEventKey*);
|
2010-11-30 15:22:43 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
boost::shared_ptr<PBD::Controllable> position_control;
|
|
|
|
boost::shared_ptr<PBD::Controllable> width_control;
|
|
|
|
PBD::ScopedConnectionList connections;
|
|
|
|
bool dragging;
|
|
|
|
bool dragging_position;
|
2010-12-29 22:14:13 -05:00
|
|
|
bool dragging_left;
|
|
|
|
bool dragging_right;
|
2010-11-30 15:22:43 -05:00
|
|
|
int drag_start_x;
|
|
|
|
int last_drag_x;
|
2010-12-29 22:14:13 -05:00
|
|
|
double accumulated_delta;
|
2010-12-30 14:32:33 -05:00
|
|
|
bool detented;
|
2010-12-01 11:12:04 -05:00
|
|
|
|
2010-12-30 15:17:44 -05:00
|
|
|
BindingProxy position_binder;
|
|
|
|
BindingProxy width_binder;
|
|
|
|
|
2010-12-30 09:37:40 -05:00
|
|
|
void set_drag_data ();
|
|
|
|
|
2011-06-01 13:00:29 -04:00
|
|
|
struct ColorScheme {
|
2010-12-02 10:51:42 -05:00
|
|
|
uint32_t outline;
|
|
|
|
uint32_t fill;
|
|
|
|
uint32_t text;
|
|
|
|
uint32_t background;
|
2011-01-07 12:36:01 -05:00
|
|
|
uint32_t rule;
|
2010-12-02 10:51:42 -05:00
|
|
|
};
|
|
|
|
|
2011-06-01 13:00:29 -04:00
|
|
|
enum State {
|
2010-12-02 10:51:42 -05:00
|
|
|
Normal,
|
|
|
|
Mono,
|
|
|
|
Inverted
|
|
|
|
};
|
|
|
|
|
|
|
|
static ColorScheme colors[3];
|
|
|
|
static void set_colors ();
|
|
|
|
static bool have_colors;
|
2011-12-26 09:05:19 -05:00
|
|
|
void color_handler ();
|
2010-11-30 15:22:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __gtk_ardour_stereo_panner_h__ */
|