2005-09-25 14:42:24 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2002 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 __ardour_panner_2d_h__
|
|
|
|
#define __ardour_panner_2d_h__
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <map>
|
2008-12-13 10:18:32 -05:00
|
|
|
#include <vector>
|
2005-11-28 23:41:15 -05:00
|
|
|
|
|
|
|
#include <glibmm/refptr.h>
|
|
|
|
#include <gtkmm/drawingarea.h>
|
2008-12-13 10:18:32 -05:00
|
|
|
#include <gtkmm/window.h>
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
#include <gtkmm/adjustment.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 12:43:03 -05:00
|
|
|
#include "pbd/cartesian.h"
|
|
|
|
|
2011-02-17 14:47:53 -05:00
|
|
|
#include "ardour_dialog.h"
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
namespace ARDOUR {
|
|
|
|
class Panner;
|
|
|
|
}
|
|
|
|
|
2005-11-28 23:41:15 -05:00
|
|
|
namespace Gtk {
|
|
|
|
class Menu;
|
|
|
|
class CheckMenuItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Pango {
|
|
|
|
class Layout;
|
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
class Panner2dWindow;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
class Panner2d : public Gtk::DrawingArea
|
|
|
|
{
|
|
|
|
public:
|
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of
processors. There are definitely regressions here, but there's also
a lot of things fixed. It's far too much work to let diverge anymore
regardless, so here it is.
The basic model is: A route has a fixed set of input channels (matching
its JACK input ports and diskstream). The first processor takes this
as input. The next processor is configured using the first processor's
output as input, and is allowed to choose whatever output it wants
given that input... and so on, and so on. Finally, the last processor's
requested output is used to set up the panner and create whatever Jack
ports are needed to output the data.
All 'special' internal processors (meter, fader, amp, insert, send) are
currently transparent: they read any input, and return the same set
of channels back (unmodified, except for amp).
User visible changes:
* LV2 Instrument support (tracks with both MIDI and audio channels)
* MIDI in/out plugin support
* Generic plugin replication (for MIDI plugins, MIDI/audio plugins)
* Movable meter point
Known Bugs:
* Things seem to get weird on loaded sessions
* Output delivery is sketchy
* 2.0 session loading was probably already broken...
but it's definitely broken now :)
Please test this and file bugs if you have any time...
git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07 02:30:50 -04:00
|
|
|
Panner2d (boost::shared_ptr<ARDOUR::Panner>, int32_t height);
|
2005-09-25 14:42:24 -04:00
|
|
|
~Panner2d ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void allow_target_motion (bool);
|
|
|
|
|
2011-03-01 16:52:59 -05:00
|
|
|
int add_speaker (const PBD::AngularVector&);
|
|
|
|
int add_signal (const char* text, const PBD::AngularVector&);
|
|
|
|
void move_signal (int which, const PBD::AngularVector&);
|
2005-09-25 14:42:24 -04:00
|
|
|
void reset (uint32_t n_inputs);
|
|
|
|
|
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of
processors. There are definitely regressions here, but there's also
a lot of things fixed. It's far too much work to let diverge anymore
regardless, so here it is.
The basic model is: A route has a fixed set of input channels (matching
its JACK input ports and diskstream). The first processor takes this
as input. The next processor is configured using the first processor's
output as input, and is allowed to choose whatever output it wants
given that input... and so on, and so on. Finally, the last processor's
requested output is used to set up the panner and create whatever Jack
ports are needed to output the data.
All 'special' internal processors (meter, fader, amp, insert, send) are
currently transparent: they read any input, and return the same set
of channels back (unmodified, except for amp).
User visible changes:
* LV2 Instrument support (tracks with both MIDI and audio channels)
* MIDI in/out plugin support
* Generic plugin replication (for MIDI plugins, MIDI/audio plugins)
* Movable meter point
Known Bugs:
* Things seem to get weird on loaded sessions
* Output delivery is sketchy
* 2.0 session loading was probably already broken...
but it's definitely broken now :)
Please test this and file bugs if you have any time...
git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07 02:30:50 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Panner> get_panner() const { return panner; }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::signal<void,int> PuckMoved;
|
|
|
|
sigc::signal<void,int> TargetMoved;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
void cart_to_gtk (PBD::CartesianVector&) const;
|
|
|
|
void gtk_to_cart (PBD::CartesianVector&) const;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
protected:
|
2005-09-25 23:13:13 -04:00
|
|
|
bool on_expose_event (GdkEventExpose *);
|
|
|
|
bool on_button_press_event (GdkEventButton *);
|
|
|
|
bool on_button_release_event (GdkEventButton *);
|
|
|
|
bool on_motion_notify_event (GdkEventMotion *);
|
2011-02-22 16:55:25 -05:00
|
|
|
bool on_scroll_event (GdkEventScroll *);
|
2006-06-20 14:50:38 -04:00
|
|
|
void on_size_allocate (Gtk::Allocation& alloc);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
private:
|
2010-11-23 11:38:17 -05:00
|
|
|
class Target {
|
2010-11-26 14:57:03 -05:00
|
|
|
public:
|
|
|
|
PBD::AngularVector position;
|
|
|
|
bool visible;
|
|
|
|
std::string text;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
Target (const PBD::AngularVector&, const char* txt = 0);
|
|
|
|
~Target ();
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
void set_text (const char*);
|
|
|
|
void set_selected (bool yn) {
|
|
|
|
_selected = yn;
|
|
|
|
}
|
|
|
|
bool selected() const {
|
|
|
|
return _selected;
|
|
|
|
}
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
private:
|
|
|
|
bool _selected;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of
processors. There are definitely regressions here, but there's also
a lot of things fixed. It's far too much work to let diverge anymore
regardless, so here it is.
The basic model is: A route has a fixed set of input channels (matching
its JACK input ports and diskstream). The first processor takes this
as input. The next processor is configured using the first processor's
output as input, and is allowed to choose whatever output it wants
given that input... and so on, and so on. Finally, the last processor's
requested output is used to set up the panner and create whatever Jack
ports are needed to output the data.
All 'special' internal processors (meter, fader, amp, insert, send) are
currently transparent: they read any input, and return the same set
of channels back (unmodified, except for amp).
User visible changes:
* LV2 Instrument support (tracks with both MIDI and audio channels)
* MIDI in/out plugin support
* Generic plugin replication (for MIDI plugins, MIDI/audio plugins)
* Movable meter point
Known Bugs:
* Things seem to get weird on loaded sessions
* Output delivery is sketchy
* 2.0 session loading was probably already broken...
but it's definitely broken now :)
Please test this and file bugs if you have any time...
git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07 02:30:50 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Panner> panner;
|
2005-11-24 22:36:42 -05:00
|
|
|
Glib::RefPtr<Pango::Layout> layout;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-08-07 19:30:37 -04:00
|
|
|
typedef std::vector<Target*> Targets;
|
2011-03-01 16:52:59 -05:00
|
|
|
Targets speakers;
|
|
|
|
Targets signals;
|
2011-02-23 23:28:48 -05:00
|
|
|
Target position;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Target *drag_target;
|
2010-11-26 12:43:03 -05:00
|
|
|
int drag_x;
|
|
|
|
int drag_y;
|
2011-03-01 16:52:59 -05:00
|
|
|
bool allow_speaker_motion;
|
2010-11-26 12:43:03 -05:00
|
|
|
int width;
|
|
|
|
int height;
|
2011-03-01 16:52:59 -05:00
|
|
|
double radius;
|
|
|
|
double border;
|
|
|
|
double hoffset;
|
|
|
|
double voffset;
|
2011-02-24 22:20:47 -05:00
|
|
|
double last_width;
|
2011-03-01 16:52:59 -05:00
|
|
|
bool did_move;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
gint compute_x (float);
|
|
|
|
gint compute_y (float);
|
|
|
|
|
2011-03-01 16:52:59 -05:00
|
|
|
Target *find_closest_object (gdouble x, gdouble y, bool& is_signal);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
gint handle_motion (gint, gint, GdkModifierType);
|
|
|
|
|
|
|
|
void toggle_bypass ();
|
|
|
|
void handle_state_change ();
|
2008-12-13 10:18:32 -05:00
|
|
|
void handle_position_change ();
|
2011-03-01 16:52:59 -05:00
|
|
|
void label_signals ();
|
2009-12-19 15:26:31 -05:00
|
|
|
|
2011-02-17 15:15:26 -05:00
|
|
|
PBD::ScopedConnectionList connections;
|
2010-11-23 11:38:17 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* 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);
|
2008-12-13 10:18:32 -05:00
|
|
|
};
|
|
|
|
|
2011-02-17 14:47:53 -05:00
|
|
|
class Panner2dWindow : public ArdourDialog
|
2008-12-13 10:18:32 -05:00
|
|
|
{
|
|
|
|
public:
|
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of
processors. There are definitely regressions here, but there's also
a lot of things fixed. It's far too much work to let diverge anymore
regardless, so here it is.
The basic model is: A route has a fixed set of input channels (matching
its JACK input ports and diskstream). The first processor takes this
as input. The next processor is configured using the first processor's
output as input, and is allowed to choose whatever output it wants
given that input... and so on, and so on. Finally, the last processor's
requested output is used to set up the panner and create whatever Jack
ports are needed to output the data.
All 'special' internal processors (meter, fader, amp, insert, send) are
currently transparent: they read any input, and return the same set
of channels back (unmodified, except for amp).
User visible changes:
* LV2 Instrument support (tracks with both MIDI and audio channels)
* MIDI in/out plugin support
* Generic plugin replication (for MIDI plugins, MIDI/audio plugins)
* Movable meter point
Known Bugs:
* Things seem to get weird on loaded sessions
* Output delivery is sketchy
* 2.0 session loading was probably already broken...
but it's definitely broken now :)
Please test this and file bugs if you have any time...
git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07 02:30:50 -04:00
|
|
|
Panner2dWindow (boost::shared_ptr<ARDOUR::Panner>, int32_t height, uint32_t inputs);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
void reset (uint32_t n_inputs);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Panner2d widget;
|
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
Gtk::HBox hpacker;
|
|
|
|
Gtk::VBox button_box;
|
2008-12-13 10:18:32 -05:00
|
|
|
Gtk::ToggleButton bypass_button;
|
2010-11-26 14:57:03 -05:00
|
|
|
Gtk::VBox spinner_box;
|
|
|
|
Gtk::VBox left_side;
|
2008-12-13 10:18:32 -05:00
|
|
|
|
|
|
|
std::vector<Gtk::SpinButton*> spinners;
|
2011-02-22 15:49:04 -05:00
|
|
|
|
|
|
|
void bypass_toggled ();
|
2011-02-23 23:28:48 -05:00
|
|
|
bool on_key_press_event (GdkEventKey*);
|
|
|
|
bool on_key_release_event (GdkEventKey*);
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_panner_2d_h__ */
|