add back MIDI Learn for stereo panner

git-svn-id: svn://localhost/ardour2/branches/3.0@8394 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-12-30 20:17:44 +00:00
parent f151d8231d
commit d6314e3253
2 changed files with 20 additions and 0 deletions

View File

@ -67,6 +67,8 @@ StereoPanner::StereoPanner (boost::shared_ptr<PBD::Controllable> position, boost
, detented (false)
, drag_data_window (0)
, drag_data_label (0)
, position_binder (position)
, width_binder (width)
{
if (!have_colors) {
set_colors ();
@ -294,6 +296,19 @@ StereoPanner::on_button_press_event (GdkEventButton* ev)
accumulated_delta = 0;
detented = false;
/* Let the binding proxies get first crack at the press event
*/
if (ev->y < 20) {
if (position_binder.button_press_handler (ev)) {
return true;
}
} else {
if (width_binder.button_press_handler (ev)) {
return true;
}
}
if (ev->button != 1) {
return false;
}

View File

@ -25,6 +25,8 @@
#include <gtkmm/drawingarea.h>
#include <boost/shared_ptr.hpp>
#include "gtkmm2ext/binding_proxy.h"
namespace PBD {
class Controllable;
}
@ -62,6 +64,9 @@ class StereoPanner : public Gtk::DrawingArea
Gtk::Window* drag_data_window;
Gtk::Label* drag_data_label;
BindingProxy position_binder;
BindingProxy width_binder;
void value_change ();
void set_drag_data ();
void set_tooltip ();