Ardour  9.0-pre0-582-g084a23a80d
speaker_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-2014 David Robillard <d@drobilla.net>
3  * Copyright (C) 2011-2017 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2011 Carl Hetherington <carl@carlh.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #pragma once
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:
37 
38  std::shared_ptr<ARDOUR::Speakers> get_speakers() const;
39  void set_speakers (std::shared_ptr<ARDOUR::Speakers>);
40 
41 private:
42  std::weak_ptr<ARDOUR::Speakers> _speakers;
51  int width;
52  int height;
53  int x_origin;
54  int y_origin;
58  double drag_offset_x;
59  double drag_offset_y;
65 
69  bool handle_motion (gint evx, gint evy, GdkModifierType state);
72 
73  void clamp_to_circle (double& x, double& y);
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 
void cart_to_gtk(PBD::CartesianVector &c) const
Gtk::AspectFrame aspect_frame
void add_speaker()
void gtk_to_cart(PBD::CartesianVector &c) const
bool ignore_azimuth_change
bool darea_button_release_event(GdkEventButton *ev)
int y_origin
y origin of our stuff within the drawing area
int selected_index
index of any selected speaker, or -1
int x_origin
x origin of our stuff within the drawing area
bool darea_button_press_event(GdkEventButton *ev)
void darea_size_allocate(Gtk::Allocation &alloc)
std::shared_ptr< ARDOUR::Speakers > get_speakers() const
Gtk::SpinButton azimuth_spinner
bool ignore_speaker_position_change
void speaker_position_changed()
void azimuth_changed()
Gtk::Adjustment azimuth_adjustment
void remove_speaker()
void set_selected(int)
Gtk::Button add_speaker_button
int width
width of the circle
Gtk::DrawingArea darea
int height
height of the circle
Gtk::Button remove_speaker_button
double drag_offset_x
bool handle_motion(gint evx, gint evy, GdkModifierType state)
bool darea_motion_notify_event(GdkEventMotion *ev)
void clamp_to_circle(double &x, double &y)
double drag_offset_y
void set_speakers(std::shared_ptr< ARDOUR::Speakers >)
Gtk::VBox side_vbox
PBD::ScopedConnection selected_speaker_connection
Gtk::HBox hbox
std::weak_ptr< ARDOUR::Speakers > _speakers
bool darea_expose_event(GdkEventExpose *)
int find_closest_object(gdouble x, gdouble y)
GdkModifierType
Definition: gdktypes.h:127