summaryrefslogtreecommitdiff
path: root/gtk2_ardour/panner2d.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-11-26 17:43:03 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-11-26 17:43:03 +0000
commit553cf2982c4905c5a08f305ce2772beaa8c50324 (patch)
treed23a7bad787a2d5bc1a909a14e9869fcfb405ae8 /gtk2_ardour/panner2d.h
parent1539ac1b9661f0c0bb313d8f0d9a72b6dc95aaf1 (diff)
one step closer to working vbap panning
git-svn-id: svn://localhost/ardour2/branches/3.0@8091 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/panner2d.h')
-rw-r--r--gtk2_ardour/panner2d.h67
1 files changed, 29 insertions, 38 deletions
diff --git a/gtk2_ardour/panner2d.h b/gtk2_ardour/panner2d.h
index fe8305343e..e1572c11b2 100644
--- a/gtk2_ardour/panner2d.h
+++ b/gtk2_ardour/panner2d.h
@@ -32,6 +32,8 @@
#include <gtkmm/spinbutton.h>
#include <gtkmm/adjustment.h>
+#include "pbd/cartesian.h"
+
namespace ARDOUR {
class Panner;
}
@@ -53,22 +55,21 @@ class Panner2d : public Gtk::DrawingArea
Panner2d (boost::shared_ptr<ARDOUR::Panner>, int32_t height);
~Panner2d ();
- void allow_x_motion(bool);
- void allow_y_motion(bool);
void allow_target_motion (bool);
- int add_target (float x, float y);
- int add_puck (const char* text, float x, float y);
- void move_puck (int, float x, float y);
+ int add_target (const PBD::AngularVector&);
+ int add_puck (const char* text, const PBD::AngularVector&);
+ void move_puck (int which, const PBD::AngularVector&);
void reset (uint32_t n_inputs);
- Gtk::Adjustment& azimuth (uint32_t which);
-
boost::shared_ptr<ARDOUR::Panner> get_panner() const { return panner; }
sigc::signal<void,int> PuckMoved;
sigc::signal<void,int> TargetMoved;
+ void cart_to_gtk (PBD::CartesianVector&) const;
+ void gtk_to_cart (PBD::CartesianVector&) const;
+
protected:
bool on_expose_event (GdkEventExpose *);
bool on_button_press_event (GdkEventButton *);
@@ -79,25 +80,23 @@ class Panner2d : public Gtk::DrawingArea
private:
class Target {
public:
- Gtk::Adjustment x;
- Gtk::Adjustment y;
- Gtk::Adjustment azimuth;
- bool visible;
- std::string text;
-
- Target (float xa, float ya, const char* txt = 0);
- ~Target ();
-
- void set_text (const char*);
- void set_selected (bool yn) {
- _selected = yn;
- }
- bool selected() const {
- return _selected;
- }
-
+ PBD::AngularVector position;
+ bool visible;
+ std::string text;
+
+ Target (const PBD::AngularVector&, const char* txt = 0);
+ ~Target ();
+
+ void set_text (const char*);
+ void set_selected (bool yn) {
+ _selected = yn;
+ }
+ bool selected() const {
+ return _selected;
+ }
+
private:
- bool _selected;
+ bool _selected;
};
boost::shared_ptr<ARDOUR::Panner> panner;
@@ -108,14 +107,12 @@ class Panner2d : public Gtk::DrawingArea
Targets pucks;
Target *drag_target;
- int drag_x;
- int drag_y;
+ int drag_x;
+ int drag_y;
int drag_index;
- bool allow_x;
- bool allow_y;
- bool allow_target;
- int width;
- int height;
+ bool allow_target;
+ int width;
+ int height;
bool bypassflag;
@@ -133,12 +130,6 @@ class Panner2d : public Gtk::DrawingArea
PBD::ScopedConnection state_connection;
PBD::ScopedConnection change_connection;
- /* cartesian coordinates in GTK units ; return azimuth & elevation in degrees */
- void cart_to_azi_ele (double x, double y, double& azi, double& eli);
-
- /* azimuth & elevation in degrees; return cartesian coordinates in GTK units */
- void azi_ele_to_cart (double azi, double eli, double& x, double& y);
-
/* cartesian coordinates in GTK units ; adjust to same but on a circle of radius 1.0
and centered in the middle of our area
*/