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/eventbox.h>
28 #include <gtkmm/arrow.h>
29 #include <gtkmm/togglebutton.h>
30 #include <gtkmm/button.h>
32 #include <gtkmm2ext/click_box.h>
33 #include <gtkmm2ext/slider_controller.h>
35 #include "ardour/session_handle.h"
49 class AutomationControl;
61 class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
64 PannerUI (ARDOUR::Session*);
67 virtual void set_panner (boost::shared_ptr<ARDOUR::PannerShell>, boost::shared_ptr<ARDOUR::Panner>);
69 void panshell_changed ();
71 void update_pan_sensitive ();
72 void update_gain_sensitive ();
74 void set_width (Width);
76 void set_available_panners(std::map<std::string,std::string>);
77 void set_send_drawing_mode (bool);
79 void effective_pan_display ();
81 void set_meter_strip_name (std::string name);
83 void on_size_allocate (Gtk::Allocation &);
85 static void setup_slider_pix ();
88 friend class MixerStrip;
91 boost::shared_ptr<ARDOUR::PannerShell> _panshell;
92 boost::shared_ptr<ARDOUR::Panner> _panner;
93 PBD::ScopedConnectionList connections;
94 PBD::ScopedConnectionList _pan_control_connections;
100 std::string _current_uri;
103 static const int pan_bar_height;
105 Panner2d* twod_panner; ///< 2D panner, or 0
106 Panner2dWindow* big_window;
108 Gtk::VBox pan_bar_packer;
110 Gtk::VBox poswidth_box;
113 StereoPanner* _stereo_panner;
114 MonoPanner* _mono_panner;
116 bool _ignore_width_change;
117 bool _ignore_position_change;
118 void width_adjusted ();
120 void position_adjusted ();
121 void show_position ();
123 Gtk::Menu* pan_astate_menu;
124 Gtk::Menu* pan_astyle_menu;
126 Gtk::Button pan_automation_style_button;
127 Gtk::ToggleButton pan_automation_state_button;
129 void pan_value_changed (uint32_t which);
130 void build_astate_menu ();
131 void build_astyle_menu ();
135 void panner_moved (int which);
136 void panner_bypass_toggled ();
138 gint start_pan_touch (GdkEventButton*);
139 gint end_pan_touch (GdkEventButton*);
141 bool pan_button_event (GdkEventButton*);
144 Gtk::CheckMenuItem* bypass_menu_item;
145 void build_pan_menu ();
147 void pan_bypass_toggle ();
149 void pan_set_custom_type (std::string type);
151 void pan_automation_state_changed();
152 void pan_automation_style_changed();
153 gint pan_automation_style_button_event (GdkEventButton *);
154 gint pan_automation_state_button_event (GdkEventButton *);
155 sigc::connection pan_watching;
157 std::string astate_string (ARDOUR::AutoState);
158 std::string short_astate_string (ARDOUR::AutoState);
159 std::string _astate_string (ARDOUR::AutoState, bool);
161 std::string astyle_string (ARDOUR::AutoStyle);
162 std::string short_astyle_string (ARDOUR::AutoStyle);
163 std::string _astyle_string (ARDOUR::AutoStyle, bool);
165 void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
166 void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
168 std::map<std::string,std::string> _panner_list;
169 bool _suspend_menu_callbacks;
172 #endif /* __ardour_gtk_panner_ui_h__ */