projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
live signal analysis is for the processor -- not the plugin(s) inside
[ardour.git]
/
gtk2_ardour
/
speaker_dialog.cc
diff --git
a/gtk2_ardour/speaker_dialog.cc
b/gtk2_ardour/speaker_dialog.cc
index 3d0c348df42aa850cd81bffd3ea9236fdbed0633..3578682422a0842e270c2384f249bf3eb335d401 100644
(file)
--- a/
gtk2_ardour/speaker_dialog.cc
+++ b/
gtk2_ardour/speaker_dialog.cc
@@
-33,8
+33,8
@@
using namespace Gtk;
using namespace Gtkmm2ext;
SpeakerDialog::SpeakerDialog ()
using namespace Gtkmm2ext;
SpeakerDialog::SpeakerDialog ()
- : Ardour
Dialog
(_("Speaker Configuration"))
- , aspect_frame ("", 0.5, 0.5, 1.
0
, false)
+ : Ardour
Window
(_("Speaker Configuration"))
+ , aspect_frame ("", 0.5, 0.5, 1.
5
, false)
, azimuth_adjustment (0, 0.0, 360.0, 10.0, 1.0)
, azimuth_spinner (azimuth_adjustment)
, add_speaker_button (_("Add Speaker"))
, azimuth_adjustment (0, 0.0, 360.0, 10.0, 1.0)
, azimuth_spinner (azimuth_adjustment)
, add_speaker_button (_("Add Speaker"))
@@
-49,14
+49,14
@@
SpeakerDialog::SpeakerDialog ()
side_vbox.set_spacing (6);
side_vbox.pack_start (add_speaker_button, false, false);
side_vbox.set_spacing (6);
side_vbox.pack_start (add_speaker_button, false, false);
- aspect_frame.set_size_request (
2
00, 200);
+ aspect_frame.set_size_request (
3
00, 200);
aspect_frame.set_shadow_type (SHADOW_NONE);
aspect_frame.add (darea);
hbox.set_spacing (6);
hbox.set_border_width (6);
hbox.pack_start (aspect_frame, true, true);
aspect_frame.set_shadow_type (SHADOW_NONE);
aspect_frame.add (darea);
hbox.set_spacing (6);
hbox.set_border_width (6);
hbox.pack_start (aspect_frame, true, true);
- hbox.pack_start (side_vbox,
true, tru
e);
+ hbox.pack_start (side_vbox,
false, fals
e);
HBox* current_speaker_hbox = manage (new HBox);
current_speaker_hbox->set_spacing (4);
HBox* current_speaker_hbox = manage (new HBox);
current_speaker_hbox->set_spacing (4);
@@
-64,9
+64,11
@@
SpeakerDialog::SpeakerDialog ()
current_speaker_hbox->pack_start (azimuth_spinner, true, true);
current_speaker_hbox->pack_start (remove_speaker_button, true, true);
current_speaker_hbox->pack_start (azimuth_spinner, true, true);
current_speaker_hbox->pack_start (remove_speaker_button, true, true);
- get_vbox()->pack_start (hbox);
- get_vbox()->pack_start (*current_speaker_hbox, true, true);
- get_vbox()->show_all ();
+ VBox* vbox = manage (new VBox);
+ vbox->pack_start (hbox);
+ vbox->pack_start (*current_speaker_hbox, true, true);
+ vbox->show_all ();
+ add (*vbox);
darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
@@
-160,6
+162,12
@@
SpeakerDialog::darea_expose_event (GdkEventExpose* event)
cart_to_gtk (c);
cart_to_gtk (c);
+ /* We have already moved our plotting origin to x_origin, y_origin,
+ so compensate for that.
+ */
+ c.x -= x_origin;
+ c.y -= y_origin;
+
x = (gint) floor (c.x);
y = (gint) floor (c.y);
x = (gint) floor (c.x);
y = (gint) floor (c.y);
@@
-177,7
+185,11
@@
SpeakerDialog::darea_expose_event (GdkEventExpose* event)
cairo_move_to (cr, x + 6, y + 6);
char buf[256];
cairo_move_to (cr, x + 6, y + 6);
char buf[256];
- snprintf (buf, sizeof (buf), "%d:%d", n+1, (int) lrint (s.angles().azi));
+ if (n == selected_index) {
+ snprintf (buf, sizeof (buf), "%d:%d", n+1, (int) lrint (s.angles().azi));
+ } else {
+ snprintf (buf, sizeof (buf), "%d", n + 1);
+ }
cairo_show_text (cr, buf);
++n;
}
cairo_show_text (cr, buf);
++n;
}
@@
-205,8
+217,8
@@
SpeakerDialog::cart_to_gtk (CartesianVector& c) const
0,height
*/
0,height
*/
- c.x = (width / 2) * (c.x + 1);
- c.y = (height / 2) * (1 - c.y);
+ c.x = (width / 2) * (c.x + 1)
+ x_origin
;
+ c.y = (height / 2) * (1 - c.y)
+ y_origin
;
/* XXX z-axis not handled - 2D for now */
}
/* XXX z-axis not handled - 2D for now */
}
@@
-214,8
+226,8
@@
SpeakerDialog::cart_to_gtk (CartesianVector& c) const
void
SpeakerDialog::gtk_to_cart (CartesianVector& c) const
{
void
SpeakerDialog::gtk_to_cart (CartesianVector& c) const
{
- c.x = (
c.x
/ (width / 2.0)) - 1.0;
- c.y = -((
c.y
/ (height / 2.0)) - 1.0);
+ c.x = (
(c.x - x_origin)
/ (width / 2.0)) - 1.0;
+ c.y = -((
(c.y - y_origin)
/ (height / 2.0)) - 1.0);
/* XXX z-axis not handled - 2D for now */
}
/* XXX z-axis not handled - 2D for now */
}
@@
-237,12
+249,19
@@
SpeakerDialog::darea_size_allocate (Gtk::Allocation& alloc)
width = alloc.get_width();
height = alloc.get_height();
width = alloc.get_width();
height = alloc.get_height();
+ /* The allocation will (should) be rectangualar, but make the basic
+ drawing square; space to the right of the square is for over-hanging
+ text labels.
+ */
+ width = height;
+
if (height > 100) {
width -= 20;
height -= 20;
}
if (height > 100) {
width -= 20;
height -= 20;
}
- x_origin = (alloc.get_width() - width) / 2;
+ /* Put the x origin to the left of the rectangular allocation */
+ x_origin = (alloc.get_width() - width) / 3;
y_origin = (alloc.get_height() - height) / 2;
}
y_origin = (alloc.get_height() - height) / 2;
}