From 1b2b21169c78fcc02759e4556c4d582f605490d4 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 23 Nov 2010 16:38:17 +0000 Subject: semi-functioning vbap panning, still not done git-svn-id: svn://localhost/ardour2/branches/3.0@8074 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/panner2d.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'gtk2_ardour/panner2d.h') diff --git a/gtk2_ardour/panner2d.h b/gtk2_ardour/panner2d.h index 5825faf80a..fe8305343e 100644 --- a/gtk2_ardour/panner2d.h +++ b/gtk2_ardour/panner2d.h @@ -77,17 +77,27 @@ class Panner2d : public Gtk::DrawingArea void on_size_allocate (Gtk::Allocation& alloc); private: - struct Target { + class Target { + public: Gtk::Adjustment x; Gtk::Adjustment y; Gtk::Adjustment azimuth; bool visible; - char* text; + 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; + } + + private: + bool _selected; }; boost::shared_ptr panner; @@ -101,7 +111,6 @@ class Panner2d : public Gtk::DrawingArea int drag_x; int drag_y; int drag_index; - bool drag_is_puck; bool allow_x; bool allow_y; bool allow_target; @@ -113,7 +122,7 @@ class Panner2d : public Gtk::DrawingArea gint compute_x (float); gint compute_y (float); - Target *find_closest_object (gdouble x, gdouble y, int& which, bool& is_puck) const; + Target *find_closest_object (gdouble x, gdouble y, int& which) const; gint handle_motion (gint, gint, GdkModifierType); @@ -123,6 +132,17 @@ 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 + */ + void clamp_to_circle (double& x, double& y); }; class Panner2dWindow : public Gtk::Window -- cgit v1.2.3