ardour
speaker_dialog.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __ardour_gtk_speaker_dialog_h__
21 #define __ardour_gtk_speaker_dialog_h__
22 
23 #include <gtkmm/drawingarea.h>
24 #include <gtkmm/spinbutton.h>
25 #include <gtkmm/box.h>
26 #include <gtkmm/adjustment.h>
27 #include <gtkmm/aspectframe.h>
28 
29 #include "ardour/speakers.h"
30 
31 #include "ardour_window.h"
32 
34 {
35 public:
36  SpeakerDialog ();
37 
40 
41 private:
43  Gtk::HBox hbox;
44  Gtk::VBox side_vbox;
45  Gtk::AspectFrame aspect_frame;
46  Gtk::DrawingArea darea;
47  Gtk::Adjustment azimuth_adjustment;
48  Gtk::SpinButton azimuth_spinner;
49  Gtk::Button add_speaker_button;
50  Gtk::Button remove_speaker_button;
51  int width;
52  int height;
53  int x_origin;
54  int y_origin;
55 
58  double drag_offset_x;
59  double drag_offset_y;
65 
66  bool darea_expose_event (GdkEventExpose*);
67  void darea_size_allocate (Gtk::Allocation& alloc);
68  bool darea_motion_notify_event (GdkEventMotion *ev);
69  bool handle_motion (gint evx, gint evy, GdkModifierType state);
70  bool darea_button_press_event (GdkEventButton *ev);
71  bool darea_button_release_event (GdkEventButton *ev);
72 
73  void clamp_to_circle (double& x, double& y);
74  void gtk_to_cart (PBD::CartesianVector& c) const;
75  void cart_to_gtk (PBD::CartesianVector& c) const;
76  int find_closest_object (gdouble x, gdouble y);
77 
78  void add_speaker ();
79  void remove_speaker ();
80  void azimuth_changed ();
81  void set_selected (int);
83 };
84 
85 #endif /* __ardour_gtk_speaker_dialog_h__ */
int height
height of the circle
int y_origin
y origin of our stuff within the drawing area
void set_speakers(boost::shared_ptr< ARDOUR::Speakers >)
Gtk::AspectFrame aspect_frame
Gtk::HBox hbox
double drag_offset_y
void darea_size_allocate(Gtk::Allocation &alloc)
void azimuth_changed()
bool darea_motion_notify_event(GdkEventMotion *ev)
bool darea_button_release_event(GdkEventButton *ev)
Gtk::VBox side_vbox
void speaker_position_changed()
bool darea_button_press_event(GdkEventButton *ev)
bool ignore_azimuth_change
Gtk::Adjustment azimuth_adjustment
void gtk_to_cart(PBD::CartesianVector &c) const
int find_closest_object(gdouble x, gdouble y)
Gtk::DrawingArea darea
Gtk::Button add_speaker_button
int width
width of the circle
boost::shared_ptr< ARDOUR::Speakers > get_speakers() const
void set_selected(int)
boost::weak_ptr< ARDOUR::Speakers > _speakers
double drag_offset_x
bool darea_expose_event(GdkEventExpose *)
Gtk::SpinButton azimuth_spinner
int x_origin
x origin of our stuff within the drawing area
Gtk::Button remove_speaker_button
void cart_to_gtk(PBD::CartesianVector &c) const
int selected_index
index of any selected speaker, or -1
bool ignore_speaker_position_change
PBD::ScopedConnection selected_speaker_connection
void clamp_to_circle(double &x, double &y)
bool handle_motion(gint evx, gint evy, GdkModifierType state)