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>
54 class PannerUI : public Gtk::HBox
57 PannerUI (boost::shared_ptr<ARDOUR::IO>, ARDOUR::Session&);
60 void pan_changed (void *);
62 void update_pan_sensitive ();
63 void update_gain_sensitive ();
65 void set_width (Width);
68 void effective_pan_display ();
70 void set_meter_strip_name (string name);
73 friend class MixerStrip;
74 boost::shared_ptr<ARDOUR::IO> _io;
75 ARDOUR::Session& _session;
80 static const int pan_bar_height;
84 Gtk::VBox pan_bar_packer;
85 Gtk::Adjustment hAdjustment;
86 Gtk::Adjustment vAdjustment;
87 Gtk::Viewport panning_viewport;
88 Gtk::EventBox panning_up;
89 Gtk::Arrow panning_up_arrow;
90 Gtk::EventBox panning_down;
91 Gtk::Arrow panning_down_arrow;
95 Gtk::ToggleButton panning_link_button;
96 Gtk::Button panning_link_direction_button;
97 Gtk::HBox panning_link_box;
99 bool panning_link_button_press (GdkEventButton*);
100 bool panning_link_button_release (GdkEventButton*);
102 Gtk::Menu pan_astate_menu;
103 Gtk::Menu pan_astyle_menu;
105 Gtk::Button pan_automation_style_button;
106 Gtk::ToggleButton pan_automation_state_button;
108 void panning_link_direction_clicked ();
110 vector<Gtk::Adjustment*> pan_adjustments;
111 vector<PannerBar*> pan_bars;
113 void pan_adjustment_changed (uint32_t which);
114 void pan_value_changed (uint32_t which);
115 void pan_printer (char* buf, uint32_t, Gtk::Adjustment*);
116 void update_pan_bars (bool only_if_aplay);
117 void update_pan_linkage ();
118 void update_pan_state ();
120 void panner_changed ();
124 void panner_moved (int which);
125 void panner_bypass_toggled ();
127 gint start_pan_touch (GdkEventButton*);
128 gint end_pan_touch (GdkEventButton*);
130 bool pan_button_event (GdkEventButton*, uint32_t which);
133 Gtk::CheckMenuItem* bypass_menu_item;
134 void build_pan_menu (uint32_t which);
135 void pan_mute (uint32_t which);
137 void pan_bypass_toggle ();
139 void pan_automation_state_changed();
140 void pan_automation_style_changed();
141 gint pan_automation_style_button_event (GdkEventButton *);
142 gint pan_automation_state_button_event (GdkEventButton *);
143 sigc::connection pan_watching;
145 std::string astate_string (ARDOUR::AutoState);
146 std::string short_astate_string (ARDOUR::AutoState);
147 std::string _astate_string (ARDOUR::AutoState, bool);
149 std::string astyle_string (ARDOUR::AutoStyle);
150 std::string short_astyle_string (ARDOUR::AutoStyle);
151 std::string _astyle_string (ARDOUR::AutoStyle, bool);
154 #endif /* __ardour_gtk_panner_ui_h__ */