2 Copyright (C) 2004 Paul Davis
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.
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.
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.
20 #ifndef __ardour_gtk_panner_ui_h__
21 #define __ardour_gtk_panner_ui_h__
25 #include <gtkmm/box.h>
26 #include <gtkmm/adjustment.h>
27 #include <gtkmm/viewport.h>
28 #include <gtkmm/eventbox.h>
29 #include <gtkmm/arrow.h>
30 #include <gtkmm/togglebutton.h>
31 #include <gtkmm/button.h>
33 #include <gtkmm2ext/click_box.h>
34 #include <gtkmm2ext/slider_controller.h>
36 #include "ardour/session_handle.h"
48 class AutomationControl;
60 class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
63 PannerUI (ARDOUR::Session*);
66 virtual void set_panner (boost::shared_ptr<ARDOUR::Panner>);
68 void pan_changed (void *);
70 void update_pan_sensitive ();
71 void update_gain_sensitive ();
73 void set_width (Width);
76 void effective_pan_display ();
78 void set_meter_strip_name (std::string name);
79 boost::shared_ptr<PBD::Controllable> get_controllable();
84 friend class MixerStrip;
86 boost::shared_ptr<ARDOUR::Panner> _panner;
87 PBD::ScopedConnectionList connections;
88 PBD::ScopedConnectionList _pan_control_connections;
95 static const int pan_bar_height;
97 Panner2d* twod_panner; ///< 2D panner, or 0
98 Panner2dWindow* big_window;
100 Gtk::VBox pan_bar_packer;
101 Gtk::Adjustment hAdjustment;
102 Gtk::Adjustment vAdjustment;
103 Gtk::Viewport panning_viewport;
104 Gtk::EventBox panning_up;
105 Gtk::Arrow panning_up_arrow;
106 Gtk::EventBox panning_down;
107 Gtk::Arrow panning_down_arrow;
111 Gtk::ToggleButton panning_link_button;
112 Gtk::Button panning_link_direction_button;
113 Gtk::HBox panning_link_box;
115 bool panning_link_button_press (GdkEventButton*);
116 bool panning_link_button_release (GdkEventButton*);
118 Gtk::Menu* pan_astate_menu;
119 Gtk::Menu* pan_astyle_menu;
121 Gtk::Button pan_automation_style_button;
122 Gtk::ToggleButton pan_automation_state_button;
124 void panning_link_direction_clicked ();
126 std::vector<Gtk::Adjustment*> pan_adjustments;
127 std::vector<PannerBar*> pan_bars;
129 void pan_adjustment_changed (uint32_t which);
130 void pan_value_changed (uint32_t which);
131 void update_pan_bars (bool only_if_aplay);
132 void update_pan_linkage ();
133 void update_pan_state ();
134 void build_astate_menu ();
135 void build_astyle_menu ();
137 void panner_changed ();
141 void panner_moved (int which);
142 void panner_bypass_toggled ();
144 gint start_pan_touch (GdkEventButton*);
145 gint end_pan_touch (GdkEventButton*);
147 bool pan_button_event (GdkEventButton*, uint32_t which);
149 void connect_to_pan_control (uint32_t);
152 Gtk::CheckMenuItem* bypass_menu_item;
153 void build_pan_menu (uint32_t which);
154 void pan_mute (uint32_t which);
155 void pan_reset (uint32_t);
156 void pan_reset_all ();
157 void pan_bypass_toggle ();
159 void pan_automation_state_changed();
160 void pan_automation_style_changed();
161 gint pan_automation_style_button_event (GdkEventButton *);
162 gint pan_automation_state_button_event (GdkEventButton *);
163 sigc::connection pan_watching;
165 std::string astate_string (ARDOUR::AutoState);
166 std::string short_astate_string (ARDOUR::AutoState);
167 std::string _astate_string (ARDOUR::AutoState, bool);
169 std::string astyle_string (ARDOUR::AutoStyle);
170 std::string short_astyle_string (ARDOUR::AutoStyle);
171 std::string _astyle_string (ARDOUR::AutoStyle, bool);
173 void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
174 void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
177 #endif /* __ardour_gtk_panner_ui_h__ */