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