X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fspeaker_dialog.h;h=2fce9e55c3bd9cd12fb79f43b88459038f6d1081;hb=6ee23029a338951705c589be6c61ab52099758b6;hp=9a04896e7f47372a14e0de6e8a2f181e4062baf6;hpb=fee370943854ff99aba1794382b6700b9feeb751;p=ardour.git diff --git a/gtk2_ardour/speaker_dialog.h b/gtk2_ardour/speaker_dialog.h index 9a04896e7f..2fce9e55c3 100644 --- a/gtk2_ardour/speaker_dialog.h +++ b/gtk2_ardour/speaker_dialog.h @@ -24,46 +24,63 @@ #include #include #include +#include #include "ardour/speakers.h" -#include "ardour_dialog.h" +#include "ardour_window.h" -class SpeakerDialog : public ArdourDialog +class SpeakerDialog : public ArdourWindow { - public: - SpeakerDialog (); - - ARDOUR::Speakers get_speakers() const; - void set_speakers (const ARDOUR::Speakers&); +public: + SpeakerDialog (); - private: - ARDOUR::Speakers speakers; - Gtk::HBox hbox; - Gtk::VBox side_vbox; - Gtk::DrawingArea darea; - Gtk::Adjustment azimuth_adjustment; - Gtk::SpinButton azimuth_spinner; - Gtk::Button add_speaker_button; - Gtk::Button use_system_button; - int32_t selected_speaker; - int width; - int height; - int drag_x; - int drag_y; - int drag_index; + boost::shared_ptr get_speakers() const; + void set_speakers (boost::shared_ptr); - bool darea_expose_event (GdkEventExpose*); - void darea_size_allocate (Gtk::Allocation& alloc); - bool darea_motion_notify_event (GdkEventMotion *ev); - bool handle_motion (gint evx, gint evy, GdkModifierType state); - bool darea_button_press_event (GdkEventButton *ev); - bool darea_button_release_event (GdkEventButton *ev); +private: + boost::weak_ptr _speakers; + Gtk::HBox hbox; + Gtk::VBox side_vbox; + Gtk::AspectFrame aspect_frame; + Gtk::DrawingArea darea; + Gtk::Adjustment azimuth_adjustment; + Gtk::SpinButton azimuth_spinner; + Gtk::Button add_speaker_button; + Gtk::Button remove_speaker_button; + int32_t selected_speaker; + int width; ///< width of the circle + int height; ///< height of the circle + int x_origin; ///< x origin of our stuff within the drawing area + int y_origin; ///< y origin of our stuff within the drawing area + /** distance from the centre of the object being dragged to the mouse pointer + * when the drag was started (ie start_pointer - object_position). + */ + double drag_offset_x; + double drag_offset_y; + int drag_index; + int selected_index; ///< index of any selected speaker, or -1 + PBD::ScopedConnection selected_speaker_connection; + bool ignore_speaker_position_change; + bool ignore_azimuth_change; - void clamp_to_circle (double& x, double& y); - void gtk_to_cart (PBD::CartesianVector& c) const; - void cart_to_gtk (PBD::CartesianVector& c) const; - int find_closest_object (gdouble x, gdouble y, int& which); + bool darea_expose_event (GdkEventExpose*); + void darea_size_allocate (Gtk::Allocation& alloc); + bool darea_motion_notify_event (GdkEventMotion *ev); + bool handle_motion (gint evx, gint evy, GdkModifierType state); + bool darea_button_press_event (GdkEventButton *ev); + bool darea_button_release_event (GdkEventButton *ev); + + void clamp_to_circle (double& x, double& y); + void gtk_to_cart (PBD::CartesianVector& c) const; + void cart_to_gtk (PBD::CartesianVector& c) const; + int find_closest_object (gdouble x, gdouble y); + + void add_speaker (); + void remove_speaker (); + void azimuth_changed (); + void set_selected (int); + void speaker_position_changed (); }; #endif /* __ardour_gtk_speaker_dialog_h__ */