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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
#include <climits>
|
2008-12-13 10:18:32 -05:00
|
|
|
#include <string.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
#include <cairo.h>
|
2005-11-28 23:41:15 -05:00
|
|
|
#include <gtkmm/menu.h>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/error.h"
|
2010-11-23 11:38:17 -05:00
|
|
|
#include "pbd/cartesian.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/panner.h"
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm2ext/gtk_ui.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "panner2d.h"
|
|
|
|
#include "keyboard.h"
|
|
|
|
#include "gui_thread.h"
|
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace Gtk;
|
|
|
|
using namespace ARDOUR;
|
2006-06-21 19:01:03 -04:00
|
|
|
using namespace PBD;
|
2009-12-04 17:51:32 -05:00
|
|
|
using Gtkmm2ext::Keyboard;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 12:43:03 -05:00
|
|
|
Panner2d::Target::Target (const AngularVector& a, const char *txt)
|
|
|
|
: position (a)
|
2010-11-23 11:38:17 -05:00
|
|
|
, text (txt)
|
2010-11-26 14:57:03 -05:00
|
|
|
, _selected (false)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Panner2d::Target::~Target ()
|
2009-10-14 12:10:01 -04:00
|
|
|
{
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
void
|
|
|
|
Panner2d::Target::set_text (const char* txt)
|
|
|
|
{
|
2010-11-23 11:38:17 -05:00
|
|
|
text = txt;
|
2008-12-13 10:18:32 -05: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
|
|
|
Panner2d::Panner2d (boost::shared_ptr<Panner> p, int32_t h)
|
2007-02-27 12:22:47 -05:00
|
|
|
: panner (p), width (0), height (h)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-03-30 11:18:43 -04:00
|
|
|
panner->StateChanged.connect (state_connection, invalidator (*this), boost::bind (&Panner2d::handle_state_change, this), gui_context());
|
|
|
|
panner->Changed.connect (change_connection, invalidator (*this), boost::bind (&Panner2d::handle_position_change, this), gui_context());
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
drag_target = 0;
|
2005-09-25 16:33:00 -04:00
|
|
|
set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Panner2d::~Panner2d()
|
|
|
|
{
|
|
|
|
for (Targets::iterator i = targets.begin(); i != targets.end(); ++i) {
|
2010-08-07 19:30:37 -04:00
|
|
|
delete *i;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Panner2d::reset (uint32_t n_inputs)
|
|
|
|
{
|
2008-12-13 10:18:32 -05:00
|
|
|
Targets::size_type existing_pucks = pucks.size();
|
|
|
|
|
|
|
|
/* pucks */
|
|
|
|
|
|
|
|
while (pucks.size() < n_inputs) {
|
2010-11-26 12:43:03 -05:00
|
|
|
add_puck ("", AngularVector());
|
2008-12-13 10:18:32 -05:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-08-07 19:30:37 -04:00
|
|
|
if (pucks.size() > n_inputs) {
|
|
|
|
for (uint32_t i = pucks.size(); i < n_inputs; ++i) {
|
|
|
|
delete pucks[i];
|
|
|
|
}
|
2008-12-13 10:18:32 -05:00
|
|
|
|
2010-08-07 19:30:37 -04:00
|
|
|
pucks.resize (n_inputs);
|
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
for (Targets::iterator x = pucks.begin(); x != pucks.end(); ++x) {
|
2010-08-07 19:30:37 -04:00
|
|
|
(*x)->visible = false;
|
2008-12-13 10:18:32 -05:00
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
switch (n_inputs) {
|
|
|
|
case 0:
|
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
case 1:
|
2008-12-13 10:18:32 -05:00
|
|
|
pucks[0]->set_text ("");
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
case 2:
|
2008-12-13 10:18:32 -05:00
|
|
|
pucks[0]->set_text ("R");
|
|
|
|
pucks[1]->set_text ("L");
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
default:
|
|
|
|
for (uint32_t i = 0; i < n_inputs; ++i) {
|
|
|
|
char buf[64];
|
2010-11-23 11:38:17 -05:00
|
|
|
snprintf (buf, sizeof (buf), "%" PRIu32, i + 1);
|
2008-12-13 10:18:32 -05:00
|
|
|
pucks[i]->set_text (buf);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-05-01 21:33:25 -04:00
|
|
|
for (uint32_t i = existing_pucks; i < n_inputs; ++i) {
|
2010-11-26 12:43:03 -05:00
|
|
|
pucks[i]->position = panner->streampanner (i).get_position ();
|
2010-05-01 21:33:25 -04:00
|
|
|
pucks[i]->visible = true;
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/* add all outputs */
|
2009-10-14 12:10:01 -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
|
|
|
while (targets.size() < panner->nouts()) {
|
2010-11-26 12:43:03 -05:00
|
|
|
add_target (AngularVector());
|
2008-12-13 10:18:32 -05:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-08-07 19:30:37 -04:00
|
|
|
if (targets.size() > panner->nouts()) {
|
|
|
|
for (uint32_t i = panner->nouts(); i < targets.size(); ++i) {
|
|
|
|
delete targets[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
targets.resize (panner->nouts ());
|
2008-12-13 10:18:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
for (Targets::iterator x = targets.begin(); x != targets.end(); ++x) {
|
2010-08-07 19:30:37 -04:00
|
|
|
(*x)->visible = false;
|
2008-12-13 10:18:32 -05: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
|
|
|
for (uint32_t n = 0; n < panner->nouts(); ++n) {
|
2008-12-13 10:18:32 -05:00
|
|
|
char buf[16];
|
|
|
|
|
|
|
|
snprintf (buf, sizeof (buf), "%d", n+1);
|
|
|
|
targets[n]->set_text (buf);
|
2010-11-26 12:43:03 -05:00
|
|
|
targets[n]->position = panner->output(n).position;
|
2008-12-13 10:18:32 -05:00
|
|
|
targets[n]->visible = true;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
queue_draw ();
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2006-06-20 14:50:38 -04:00
|
|
|
Panner2d::on_size_allocate (Gtk::Allocation& alloc)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-10-06 00:59:20 -04:00
|
|
|
width = alloc.get_width();
|
|
|
|
height = alloc.get_height();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
if (height > 100) {
|
|
|
|
width -= 20;
|
|
|
|
height -= 20;
|
|
|
|
}
|
|
|
|
|
2005-09-25 22:48:59 -04:00
|
|
|
DrawingArea::on_size_allocate (alloc);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2010-11-26 12:43:03 -05:00
|
|
|
Panner2d::add_puck (const char* text, const AngularVector& a)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-11-26 12:43:03 -05:00
|
|
|
Target* puck = new Target (a, text);
|
2010-08-07 19:30:37 -04:00
|
|
|
pucks.push_back (puck);
|
2005-09-25 14:42:24 -04:00
|
|
|
puck->visible = true;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2010-11-26 12:43:03 -05:00
|
|
|
Panner2d::add_target (const AngularVector& a)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-11-26 12:43:03 -05:00
|
|
|
Target* target = new Target (a, "");
|
2010-08-07 19:30:37 -04:00
|
|
|
targets.push_back (target);
|
2005-09-25 14:42:24 -04:00
|
|
|
target->visible = true;
|
|
|
|
queue_draw ();
|
|
|
|
|
2010-08-07 19:30:37 -04:00
|
|
|
return targets.size() - 1;
|
2009-10-14 12:10:01 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
Panner2d::handle_state_change ()
|
|
|
|
{
|
2009-12-11 18:29:48 -05:00
|
|
|
ENSURE_GUI_THREAD (*this, &Panner2d::handle_state_change)
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
queue_draw ();
|
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
void
|
|
|
|
Panner2d::handle_position_change ()
|
|
|
|
{
|
|
|
|
uint32_t n;
|
2009-12-11 18:29:48 -05:00
|
|
|
ENSURE_GUI_THREAD (*this, &Panner2d::handle_position_change)
|
2008-12-13 10:18:32 -05:00
|
|
|
|
|
|
|
for (n = 0; n < pucks.size(); ++n) {
|
2010-11-26 12:43:03 -05:00
|
|
|
pucks[n]->position = panner->streampanner(n).get_position ();
|
2008-12-13 10:18:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
for (n = 0; n < targets.size(); ++n) {
|
2010-11-26 14:57:03 -05:00
|
|
|
targets[n]->position = panner->output(n).position;
|
2008-12-13 10:18:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
queue_draw ();
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2010-11-26 12:43:03 -05:00
|
|
|
Panner2d::move_puck (int which, const AngularVector& a)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-08-07 19:30:37 -04:00
|
|
|
if (which >= int (targets.size())) {
|
|
|
|
return;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2010-08-07 19:30:37 -04:00
|
|
|
|
2010-11-26 12:43:03 -05:00
|
|
|
targets[which]->position = a;
|
2010-08-07 19:30:37 -04:00
|
|
|
queue_draw ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Panner2d::Target *
|
2010-11-23 11:38:17 -05:00
|
|
|
Panner2d::find_closest_object (gdouble x, gdouble y, int& which) const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
Target *closest = 0;
|
|
|
|
Target *candidate;
|
|
|
|
float distance;
|
|
|
|
float best_distance = FLT_MAX;
|
|
|
|
int pwhich;
|
|
|
|
|
|
|
|
which = 0;
|
|
|
|
pwhich = 0;
|
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
cerr << "@ " << x << ", " << y << endl;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
for (Targets::const_iterator i = pucks.begin(); i != pucks.end(); ++i, ++pwhich) {
|
2010-08-07 19:30:37 -04:00
|
|
|
candidate = *i;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
CartesianVector c;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
candidate->position.cartesian (c);
|
|
|
|
cart_to_gtk (c);
|
2010-11-26 12:43:03 -05:00
|
|
|
|
|
|
|
distance = sqrt ((c.x - x) * (c.x - x) +
|
2010-11-26 14:57:03 -05:00
|
|
|
(c.y - y) * (c.y - y));
|
2008-12-13 10:18:32 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
cerr << "\tConsider candiate " << candidate->text << " @ " << c.x << ", " << c.y << ", " << c.z << " distance = " << distance << endl;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (distance < best_distance) {
|
|
|
|
closest = candidate;
|
|
|
|
best_distance = distance;
|
|
|
|
which = pwhich;
|
|
|
|
}
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
if (best_distance > 20) { // arbitrary
|
|
|
|
return 0;
|
|
|
|
}
|
2010-11-23 11:38:17 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
cerr << "the winner is " << closest->text << endl;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
return closest;
|
2009-10-14 12:10:01 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-10-06 00:59:20 -04:00
|
|
|
bool
|
2005-09-25 22:48:59 -04:00
|
|
|
Panner2d::on_motion_notify_event (GdkEventMotion *ev)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
gint x, y;
|
|
|
|
GdkModifierType state;
|
|
|
|
|
|
|
|
if (ev->is_hint) {
|
|
|
|
gdk_window_get_pointer (ev->window, &x, &y, &state);
|
|
|
|
} else {
|
|
|
|
x = (int) floor (ev->x);
|
|
|
|
y = (int) floor (ev->y);
|
|
|
|
state = (GdkModifierType) ev->state;
|
|
|
|
}
|
2008-12-13 10:18:32 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
return handle_motion (x, y, state);
|
|
|
|
}
|
2008-12-13 10:18:32 -05:00
|
|
|
bool
|
|
|
|
Panner2d::on_expose_event (GdkEventExpose *event)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2008-12-13 10:18:32 -05:00
|
|
|
gint x, y;
|
|
|
|
cairo_t* cr;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
cr = gdk_cairo_create (get_window()->gobj());
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_set_line_width (cr, 1.0);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_rectangle (cr, event->area.x, event->area.y, event->area.width, event->area.height);
|
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
|
|
|
if (!panner->bypassed()) {
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_set_source_rgba (cr, 0.1, 0.1, 0.1, 1.0);
|
|
|
|
} else {
|
|
|
|
cairo_set_source_rgba (cr, 0.1, 0.1, 0.1, 0.2);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_fill_preserve (cr);
|
|
|
|
cairo_clip (cr);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
if (height > 100) {
|
|
|
|
cairo_translate (cr, 10.0, 10.0);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* horizontal line of "crosshairs" */
|
2010-11-23 11:38:17 -05:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_set_source_rgb (cr, 0.0, 0.1, 0.7);
|
|
|
|
cairo_move_to (cr, 0.5, height/2.0+0.5);
|
2010-11-23 11:38:17 -05:00
|
|
|
cairo_line_to (cr, width+0.5, height/2+0.5);
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_stroke (cr);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* vertical line of "crosshairs" */
|
|
|
|
|
2010-11-23 11:38:17 -05:00
|
|
|
cairo_move_to (cr, width/2+0.5, 0.5);
|
|
|
|
cairo_line_to (cr, width/2+0.5, height+0.5);
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_stroke (cr);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* the circle on which signals live */
|
2010-11-23 11:38:17 -05:00
|
|
|
|
|
|
|
cairo_arc (cr, width/2, height/2, height/2, 0, 2.0 * M_PI);
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_stroke (cr);
|
2005-11-24 22:36:42 -05: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
|
|
|
if (!panner->bypassed()) {
|
2008-12-13 10:18:32 -05:00
|
|
|
float arc_radius;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_select_font_face (cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
if (height < 100) {
|
|
|
|
cairo_set_font_size (cr, 10);
|
|
|
|
arc_radius = 2.0;
|
|
|
|
} else {
|
|
|
|
cairo_set_font_size (cr, 16);
|
|
|
|
arc_radius = 4.0;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
for (Targets::iterator i = pucks.begin(); i != pucks.end(); ++i) {
|
|
|
|
|
2010-08-07 19:30:37 -04:00
|
|
|
Target* puck = *i;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (puck->visible) {
|
|
|
|
/* redraw puck */
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
CartesianVector c;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
puck->position.cartesian (c);
|
|
|
|
cart_to_gtk (c);
|
2010-11-23 11:38:17 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
x = (gint) floor (c.x);
|
|
|
|
y = (gint) floor (c.y);
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* XXX need to shift circles so that they are centered on the circle */
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_arc (cr, x, y, arc_radius, 0, 2.0 * M_PI);
|
|
|
|
cairo_set_source_rgb (cr, 0.8, 0.2, 0.1);
|
|
|
|
cairo_close_path (cr);
|
|
|
|
cairo_fill (cr);
|
2005-11-24 22:36:42 -05:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_move_to (cr, x + 6, y + 6);
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
char buf[256];
|
|
|
|
snprintf (buf, sizeof (buf), "%s:%d", puck->text.c_str(), (int) lrint (puck->position.azi));
|
2010-11-26 12:43:03 -05:00
|
|
|
cairo_show_text (cr, buf);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* redraw any visible targets */
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
int n = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
for (Targets::iterator i = targets.begin(); i != targets.end(); ++i) {
|
2010-08-07 19:30:37 -04:00
|
|
|
Target *target = *i;
|
2008-12-13 10:18:32 -05:00
|
|
|
char buf[256];
|
|
|
|
++n;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (target->visible) {
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
CartesianVector c;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
target->position.cartesian (c);
|
|
|
|
cart_to_gtk (c);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
x = (int) floor (c.x);
|
|
|
|
y = (int) floor (c.y);
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
snprintf (buf, sizeof (buf), "%d", n);
|
|
|
|
|
|
|
|
cairo_set_source_rgb (cr, 0.0, 0.8, 0.1);
|
|
|
|
cairo_rectangle (cr, x-2, y-2, 4, 4);
|
|
|
|
cairo_fill (cr);
|
|
|
|
cairo_move_to (cr, x+6, y+6);
|
|
|
|
cairo_show_text (cr, buf);
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
cairo_destroy (cr);
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-10-06 00:59:20 -04:00
|
|
|
bool
|
2005-09-25 22:48:59 -04:00
|
|
|
Panner2d::on_button_press_event (GdkEventButton *ev)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2008-12-13 10:18:32 -05:00
|
|
|
GdkModifierType state;
|
|
|
|
|
|
|
|
if (ev->type == GDK_2BUTTON_PRESS && ev->button == 1) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
switch (ev->button) {
|
|
|
|
case 1:
|
2008-12-13 10:18:32 -05:00
|
|
|
case 2:
|
2010-11-23 11:38:17 -05:00
|
|
|
if ((drag_target = find_closest_object (ev->x, ev->y, drag_index)) != 0) {
|
2010-11-26 14:57:03 -05:00
|
|
|
drag_target->set_selected (true);
|
|
|
|
}
|
2010-11-23 11:38:17 -05:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
drag_x = (int) floor (ev->x);
|
|
|
|
drag_y = (int) floor (ev->y);
|
2005-09-25 14:42:24 -04:00
|
|
|
state = (GdkModifierType) ev->state;
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
return handle_motion (drag_x, drag_y, state);
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
2008-12-13 10:18:32 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2005-10-06 00:59:20 -04:00
|
|
|
bool
|
2005-09-25 22:48:59 -04:00
|
|
|
Panner2d::on_button_release_event (GdkEventButton *ev)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2008-12-13 10:18:32 -05:00
|
|
|
gint x, y;
|
|
|
|
GdkModifierType state;
|
|
|
|
bool ret = false;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
switch (ev->button) {
|
|
|
|
case 1:
|
|
|
|
x = (int) floor (ev->x);
|
|
|
|
y = (int) floor (ev->y);
|
|
|
|
state = (GdkModifierType) ev->state;
|
|
|
|
|
2010-11-23 11:38:17 -05:00
|
|
|
if (Keyboard::modifier_state_contains (state, Keyboard::TertiaryModifier)) {
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
for (Targets::iterator i = pucks.begin(); i != pucks.end(); ++i) {
|
2009-01-30 15:18:31 -05:00
|
|
|
//Target* puck = i->second;
|
2008-12-13 10:18:32 -05:00
|
|
|
/* XXX DO SOMETHING TO SET PUCK BACK TO "normal" */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
queue_draw ();
|
|
|
|
PuckMoved (-1);
|
2010-11-26 14:57:03 -05:00
|
|
|
ret = true;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
} else {
|
|
|
|
ret = handle_motion (x, y, state);
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
drag_target = 0;
|
|
|
|
break;
|
2008-12-13 10:18:32 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
case 2:
|
2008-12-13 10:18:32 -05:00
|
|
|
x = (int) floor (ev->x);
|
|
|
|
y = (int) floor (ev->y);
|
|
|
|
state = (GdkModifierType) ev->state;
|
|
|
|
|
2010-11-23 11:38:17 -05:00
|
|
|
if (Keyboard::modifier_state_contains (state, Keyboard::TertiaryModifier)) {
|
2008-12-13 10:18:32 -05:00
|
|
|
toggle_bypass ();
|
|
|
|
ret = true;
|
|
|
|
} else {
|
|
|
|
ret = handle_motion (x, y, state);
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
drag_target = 0;
|
|
|
|
break;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
case 3:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
return ret;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
gint
|
|
|
|
Panner2d::handle_motion (gint evx, gint evy, GdkModifierType state)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2008-12-13 10:18:32 -05:00
|
|
|
if (drag_target == 0) {
|
|
|
|
return false;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
if ((state & (GDK_BUTTON1_MASK|GDK_BUTTON2_MASK)) == 0) {
|
|
|
|
return false;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
if (state & GDK_BUTTON1_MASK && !(state & GDK_BUTTON2_MASK)) {
|
2010-11-26 14:57:03 -05:00
|
|
|
CartesianVector c;
|
|
|
|
bool need_move = false;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
drag_target->position.cartesian (c);
|
|
|
|
cart_to_gtk (c);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
if ((evx != c.x) || (evy != c.y)) {
|
|
|
|
need_move = true;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
if (need_move) {
|
|
|
|
CartesianVector cp (evx, evy, 0.0);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* canonicalize position */
|
2008-12-13 10:18:32 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
gtk_to_cart (cp);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* position actual signal on circle */
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
clamp_to_circle (cp.x, cp.y);
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* generate an angular representation and set drag target (GUI) position */
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
cp.angular (drag_target->position); /* sets drag target position */
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
panner->streampanner (drag_index).set_position (drag_target->position);
|
2010-11-26 12:43:03 -05:00
|
|
|
|
|
|
|
queue_draw ();
|
|
|
|
}
|
|
|
|
}
|
2008-12-13 10:18:32 -05:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-11-23 11:38:17 -05:00
|
|
|
void
|
2010-11-26 12:43:03 -05:00
|
|
|
Panner2d::cart_to_gtk (CartesianVector& c) const
|
2010-11-23 11:38:17 -05:00
|
|
|
{
|
2010-11-26 14:57:03 -05:00
|
|
|
/* "c" uses a coordinate space that is:
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
center = 0.0
|
|
|
|
dimension = 2.0 * 2.0
|
|
|
|
so max values along each axis are -1..+1
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
GTK uses a coordinate space that is:
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
top left = 0.0
|
|
|
|
dimension = width * height
|
|
|
|
so max values along each axis are 0,width and
|
|
|
|
0,height
|
|
|
|
*/
|
2010-11-23 11:38:17 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
c.x = (width / 2) * (c.x + 1);
|
|
|
|
c.y = (height / 2) * (1 - c.y);
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* XXX z-axis not handled - 2D for now */
|
2010-11-23 11:38:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-11-26 12:43:03 -05:00
|
|
|
Panner2d::gtk_to_cart (CartesianVector& c) const
|
2010-11-23 11:38:17 -05:00
|
|
|
{
|
2010-11-26 14:57:03 -05:00
|
|
|
c.x = (c.x / (width / 2.0)) - 1.0;
|
|
|
|
c.y = -((c.y / (height / 2.0)) - 1.0);
|
2010-11-23 11:38:17 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
/* XXX z-axis not handled - 2D for now */
|
2010-11-23 11:38:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Panner2d::clamp_to_circle (double& x, double& y)
|
|
|
|
{
|
2010-11-26 14:57:03 -05:00
|
|
|
double azi, ele;
|
|
|
|
double z = 0.0;
|
2010-11-26 12:43:03 -05:00
|
|
|
|
2010-11-26 14:57:03 -05:00
|
|
|
PBD::cart_to_azi_ele (x, y, z, azi, ele);
|
|
|
|
PBD::azi_ele_to_cart (azi, ele, x, y, z);
|
2010-11-23 11:38:17 -05:00
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
void
|
|
|
|
Panner2d::toggle_bypass ()
|
|
|
|
{
|
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
|
|
|
panner->set_bypassed (!panner->bypassed());
|
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
|
|
|
Panner2dWindow::Panner2dWindow (boost::shared_ptr<Panner> p, int32_t h, uint32_t inputs)
|
2008-12-13 10:18:32 -05:00
|
|
|
: widget (p, h)
|
|
|
|
, reset_button (_("Reset"))
|
|
|
|
, bypass_button (_("Bypass"))
|
|
|
|
, mute_button (_("Mute"))
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2008-12-13 10:18:32 -05:00
|
|
|
widget.set_name ("MixerPanZone");
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
set_title (_("Panner"));
|
|
|
|
widget.set_size_request (h, h);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
button_box.set_spacing (6);
|
|
|
|
button_box.pack_start (reset_button, false, false);
|
|
|
|
button_box.pack_start (bypass_button, false, false);
|
|
|
|
button_box.pack_start (mute_button, false, false);
|
|
|
|
|
|
|
|
spinner_box.set_spacing (6);
|
|
|
|
left_side.set_spacing (6);
|
|
|
|
|
|
|
|
left_side.pack_start (button_box, false, false);
|
|
|
|
left_side.pack_start (spinner_box, false, false);
|
|
|
|
|
|
|
|
reset_button.show ();
|
|
|
|
bypass_button.show ();
|
|
|
|
mute_button.show ();
|
|
|
|
button_box.show ();
|
|
|
|
spinner_box.show ();
|
|
|
|
left_side.show ();
|
|
|
|
|
|
|
|
hpacker.set_spacing (6);
|
|
|
|
hpacker.set_border_width (12);
|
|
|
|
hpacker.pack_start (widget, false, false);
|
|
|
|
hpacker.pack_start (left_side, false, false);
|
|
|
|
hpacker.show ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
add (hpacker);
|
|
|
|
reset (inputs);
|
|
|
|
widget.show ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
void
|
|
|
|
Panner2dWindow::reset (uint32_t n_inputs)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2008-12-13 10:18:32 -05:00
|
|
|
widget.reset (n_inputs);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-26 12:43:03 -05:00
|
|
|
#if 0
|
2008-12-13 10:18:32 -05:00
|
|
|
while (spinners.size() < n_inputs) {
|
2010-11-26 12:43:03 -05:00
|
|
|
// spinners.push_back (new Gtk::SpinButton (widget.azimuth (spinners.size())));
|
|
|
|
//spinner_box.pack_start (*spinners.back(), false, false);
|
|
|
|
//spinners.back()->set_digits (4);
|
2008-12-13 10:18:32 -05:00
|
|
|
spinners.back()->show ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-12-13 10:18:32 -05:00
|
|
|
while (spinners.size() > n_inputs) {
|
|
|
|
spinner_box.remove (*spinners.back());
|
|
|
|
delete spinners.back();
|
|
|
|
spinners.erase (--spinners.end());
|
|
|
|
}
|
2010-11-26 12:43:03 -05:00
|
|
|
#endif
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|