2 Copyright (C) 2000 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.
21 #ifndef __ardour_audio_time_axis_h__
22 #define __ardour_audio_time_axis_h__
24 #include <gtkmm/table.h>
25 #include <gtkmm/button.h>
26 #include <gtkmm/box.h>
27 #include <gtkmm/menu.h>
28 #include <gtkmm/menuitem.h>
29 #include <gtkmm/radiomenuitem.h>
30 #include <gtkmm/checkmenuitem.h>
32 #include <gtkmm2ext/selector.h>
35 #include <ardour/types.h>
36 #include <ardour/region.h>
38 #include "ardour_dialog.h"
41 #include "route_time_axis.h"
47 class AudioDiskstream;
57 class AudioStreamView;
61 class AudioRegionView;
63 class AutomationGainLine;
64 class AutomationPanLine;
65 class RedirectAutomationLine;
67 class AutomationTimeAxisView;
69 class AudioTimeAxisView : public RouteTimeAxisView
72 AudioTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
73 virtual ~AudioTimeAxisView ();
75 AudioStreamView* audio_view();
77 void set_show_waveforms (bool yn);
78 void set_show_waveforms_recording (bool yn);
79 void show_all_xfades ();
80 void hide_all_xfades ();
81 void set_selected_regionviews (RegionSelection&);
82 void hide_dependent_views (TimeAxisViewItem&);
83 void reveal_dependent_views (TimeAxisViewItem&);
85 /* overridden from parent to store display state */
86 guint32 show_at (double y, int& nth, Gtk::VBox *parent);
89 void set_state (const XMLNode&);
90 XMLNode* get_child_xml_node (const string & childname);
93 friend class AudioStreamView;
94 friend class AudioRegionView;
96 void route_active_changed ();
98 AutomationTimeAxisView *gain_track;
99 AutomationTimeAxisView *pan_track;
101 void update_automation_view (ARDOUR::AutomationType);
102 void reset_redirect_automation_curves ();
104 // variables to get the context menu
105 // automation buttons correctly initialized
106 bool show_gain_automation;
107 bool show_pan_automation;
110 void redirects_changed (void *);
112 void build_display_menu ();
114 Gtk::CheckMenuItem* waveform_item;
115 Gtk::RadioMenuItem* traditional_item;
116 Gtk::RadioMenuItem* rectified_item;
118 void toggle_show_waveforms ();
120 void set_waveform_shape (WaveformShape);
121 void toggle_waveforms ();
123 /* automation stuff */
125 Gtk::Menu* automation_action_menu;
126 Gtk::CheckMenuItem* gain_automation_item;
127 Gtk::CheckMenuItem* pan_automation_item;
129 void automation_click ();
130 void clear_automation ();
131 void hide_all_automation ();
132 void show_all_automation ();
133 void show_existing_automation ();
135 struct RedirectAutomationNode {
137 Gtk::CheckMenuItem* menu_item;
138 AutomationTimeAxisView* view;
139 AudioTimeAxisView& parent;
141 RedirectAutomationNode (uint32_t w, Gtk::CheckMenuItem* mitem, AudioTimeAxisView& p)
142 : what (w), menu_item (mitem), view (0), parent (p) {}
144 ~RedirectAutomationNode ();
147 struct RedirectAutomationInfo {
148 boost::shared_ptr<ARDOUR::Redirect> redirect;
151 vector<RedirectAutomationNode*> lines;
153 RedirectAutomationInfo (boost::shared_ptr<ARDOUR::Redirect> r)
154 : redirect (r), valid (true) {}
156 ~RedirectAutomationInfo ();
159 list<RedirectAutomationInfo*> redirect_automation;
160 RedirectAutomationNode* find_redirect_automation_node (boost::shared_ptr<ARDOUR::Redirect> redirect, uint32_t what);
162 Gtk::Menu subplugin_menu;
163 void add_redirect_to_subplugin_menu (boost::shared_ptr<ARDOUR::Redirect>);
165 void remove_ran (RedirectAutomationNode* ran);
167 void redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo*,
168 AudioTimeAxisView::RedirectAutomationNode*);
169 void redirect_automation_track_hidden (RedirectAutomationNode*, boost::shared_ptr<ARDOUR::Redirect>);
171 vector<RedirectAutomationLine*> redirect_automation_curves;
172 RedirectAutomationLine *find_redirect_automation_curve (boost::shared_ptr<ARDOUR::Redirect>,uint32_t);
173 void add_redirect_automation_curve (boost::shared_ptr<ARDOUR::Redirect>, uint32_t);
174 void add_existing_redirect_automation_curves (boost::shared_ptr<ARDOUR::Redirect>);
176 void add_gain_automation_child ();
177 void add_pan_automation_child ();
178 void add_parameter_automation_child ();
180 void toggle_gain_track ();
181 void toggle_pan_track ();
188 void region_view_added (RegionView*);
189 void add_ghost_to_redirect (RegionView*, AutomationTimeAxisView*);
192 #endif /* __ardour_audio_time_axis_h__ */