fix keyboard event handling for host-provided plugin GUIs
[ardour2.git] / gtk2_ardour / audio_time_axis.h
blob3d2577013001f4c64c5809862159ccc10b3b0a52
1 /*
2 Copyright (C) 2000-2006 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_audio_time_axis_h__
21 #define __ardour_audio_time_axis_h__
23 #include <gtkmm/table.h>
24 #include <gtkmm/button.h>
25 #include <gtkmm/box.h>
26 #include <gtkmm/menu.h>
27 #include <gtkmm/menuitem.h>
28 #include <gtkmm/radiomenuitem.h>
29 #include <gtkmm/checkmenuitem.h>
31 #include <gtkmm2ext/selector.h>
32 #include <list>
34 #include <ardour/types.h>
36 #include "ardour_dialog.h"
37 #include "route_ui.h"
38 #include "enums.h"
39 #include "editing.h"
40 #include "route_time_axis.h"
41 #include "canvas.h"
43 namespace ARDOUR {
44 class Session;
45 class AudioDiskstream;
46 class RouteGroup;
47 class Redirect;
48 class Insert;
49 class Location;
50 class AudioPlaylist;
53 class PublicEditor;
54 class AudioThing;
55 class AudioStreamView;
56 class Selection;
57 class Selectable;
58 class RegionView;
59 class AudioRegionView;
60 class AutomationLine;
61 class AutomationGainLine;
62 class AutomationPanLine;
63 class TimeSelection;
64 class AutomationTimeAxisView;
66 class AudioTimeAxisView : public RouteTimeAxisView
68 public:
69 AudioTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
70 virtual ~AudioTimeAxisView ();
72 AudioStreamView* audio_view();
74 void set_show_waveforms (bool yn);
75 void set_show_waveforms_rectified (bool yn);
76 void set_show_waveforms_recording (bool yn);
77 void show_all_xfades ();
78 void hide_all_xfades ();
79 void hide_dependent_views (TimeAxisViewItem&);
80 void reveal_dependent_views (TimeAxisViewItem&);
82 /* Overridden from parent to store display state */
83 guint32 show_at (double y, int& nth, Gtk::VBox *parent);
84 void hide ();
86 int set_state (const XMLNode&);
87 XMLNode* get_child_xml_node (const string & childname);
89 void first_idle ();
91 void set_waveform_shape (Editing::WaveformShape);
92 void set_waveform_scale (Editing::WaveformScale);
94 private:
95 friend class AudioStreamView;
96 friend class AudioRegionView;
98 void route_active_changed ();
100 void build_automation_action_menu ();
101 void append_extra_display_menu_items ();
103 void toggle_show_waveforms ();
104 void toggle_waveforms ();
106 void show_all_automation ();
107 void show_existing_automation ();
108 void hide_all_automation ();
110 void add_gain_automation_child ();
111 void add_pan_automation_child ();
112 void add_parameter_automation_child ();
114 void toggle_gain_track ();
115 void toggle_pan_track ();
117 void gain_hidden ();
118 void pan_hidden ();
120 void update_pans ();
121 void update_control_names ();
123 AutomationTimeAxisView* gain_track;
124 AutomationTimeAxisView* pan_track;
126 // Set from XML so context menu automation buttons can be correctly initialized
127 bool show_gain_automation;
128 bool show_pan_automation;
130 Gtk::CheckMenuItem* waveform_item;
131 Gtk::RadioMenuItem* traditional_item;
132 Gtk::RadioMenuItem* rectified_item;
133 Gtk::RadioMenuItem* linearscale_item;
134 Gtk::RadioMenuItem* logscale_item;
135 Gtk::CheckMenuItem* gain_automation_item;
136 Gtk::CheckMenuItem* pan_automation_item;
139 #endif /* __ardour_audio_time_axis_h__ */