New theme manager from trunk, backported to 2.0-ongoing
[ardour.git] / gtk2_ardour / audio_time_axis.h
1 /*
2     Copyright (C) 2000-2006 Paul Davis 
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __ardour_audio_time_axis_h__
21 #define __ardour_audio_time_axis_h__
22
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>
30
31 #include <gtkmm2ext/selector.h>
32 #include <list>
33
34 #include <ardour/types.h>
35
36 #include "ardour_dialog.h"
37 #include "route_ui.h"
38 #include "enums.h"
39 #include "route_time_axis.h"
40 #include "canvas.h"
41
42 namespace ARDOUR {
43         class Session;
44         class AudioDiskstream;
45         class RouteGroup;
46         class Redirect;
47         class Insert;
48         class Location;
49         class AudioPlaylist;
50 }
51
52 class PublicEditor;
53 class AudioThing;
54 class AudioStreamView;
55 class Selection;
56 class Selectable;
57 class RegionView;
58 class AudioRegionView;
59 class AutomationLine;
60 class AutomationGainLine;
61 class AutomationPanLine;
62 class TimeSelection;
63 class AutomationTimeAxisView;
64
65 class AudioTimeAxisView : public RouteTimeAxisView
66 {
67   public:
68         AudioTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
69         virtual ~AudioTimeAxisView ();
70         
71         AudioStreamView* audio_view();
72
73         void set_show_waveforms (bool yn);
74         void set_show_waveforms_recording (bool yn);
75         void show_all_xfades ();
76         void hide_all_xfades ();
77         void hide_dependent_views (TimeAxisViewItem&);
78         void reveal_dependent_views (TimeAxisViewItem&);
79                 
80         /* Overridden from parent to store display state */
81         guint32 show_at (double y, int& nth, Gtk::VBox *parent);
82         void hide ();
83         
84         void set_state (const XMLNode&);
85         XMLNode* get_child_xml_node (const string & childname);
86
87   private:
88         friend class AudioStreamView;
89         friend class AudioRegionView;
90         
91         void route_active_changed ();
92
93         void build_automation_action_menu ();
94         void append_extra_display_menu_items ();
95         
96         void toggle_show_waveforms ();
97         void set_waveform_shape (WaveformShape);
98         void toggle_waveforms ();
99         void set_waveform_scale (WaveformScale);
100
101         void show_all_automation ();
102         void show_existing_automation ();
103         void hide_all_automation ();
104
105         void add_gain_automation_child ();
106         void add_pan_automation_child ();
107         void add_parameter_automation_child ();
108
109         void toggle_gain_track ();
110         void toggle_pan_track ();
111
112         void gain_hidden ();
113         void pan_hidden ();
114
115         void update_pans ();
116         void update_control_names ();
117
118         AutomationTimeAxisView* gain_track;
119         AutomationTimeAxisView* pan_track;
120
121         // Set from XML so context menu automation buttons can be correctly initialized
122         bool show_gain_automation;
123         bool show_pan_automation;
124         
125         Gtk::CheckMenuItem* waveform_item;
126         Gtk::RadioMenuItem* traditional_item;
127         Gtk::RadioMenuItem* rectified_item;
128         Gtk::RadioMenuItem* linearscale_item;
129         Gtk::RadioMenuItem* logscale_item;
130         Gtk::CheckMenuItem* gain_automation_item;
131         Gtk::CheckMenuItem* pan_automation_item;
132 };
133
134 #endif /* __ardour_audio_time_axis_h__ */
135