2 Copyright (C) 2001 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_streamview_h__
22 #define __ardour_streamview_h__
29 #include <libgnomecanvas/libgnomecanvas.h>
31 #include <ardour/location.h>
44 GnomeCanvasItem* rectangle;
46 jack_nframes_t length;
51 class AudioTimeAxisView;
52 class AudioRegionView;
53 class AudioRegionSelection;
57 class StreamView : public sigc::trackable
60 StreamView (AudioTimeAxisView&);
63 void set_waveform_shape (WaveformShape);
65 AudioTimeAxisView& trackview() { return _trackview; }
69 int set_height (gdouble);
70 int set_position (gdouble x, gdouble y);
72 int set_samples_per_unit (gdouble spp);
73 gdouble get_samples_per_unit () { return _samples_per_unit; }
75 int set_amplitude_above_axis (gdouble app);
76 gdouble get_amplitude_above_axis () { return _amplitude_above_axis; }
78 void set_show_waveforms (bool yn);
79 void set_show_waveforms_recording (bool yn) { use_rec_regions = yn; }
81 GnomeCanvasItem* canvas_item() { return canvas_group; }
83 sigc::signal<void,AudioRegionView*> AudioRegionViewAdded;
90 void apply_color (GdkColor&, ColorTarget t);
91 void set_selected_regionviews (AudioRegionSelection&);
92 void get_selectables (jack_nframes_t start, jack_nframes_t end, list<Selectable* >&);
93 void get_inverted_selectables (Selection&, list<Selectable* >& results);
94 GdkColor get_region_color () const { return region_color; }
96 void foreach_regionview (sigc::slot<void,AudioRegionView*> slot);
97 void foreach_crossfadeview (void (CrossfadeView::*pmf)(void));
101 void region_layered (AudioRegionView*);
103 AudioRegionView* find_view (const ARDOUR::AudioRegion&);
105 void show_all_xfades ();
106 void hide_all_xfades ();
107 void hide_xfades_involving (AudioRegionView&);
108 void reveal_xfades_involving (AudioRegionView&);
111 AudioTimeAxisView& _trackview;
113 GnomeCanvasItem* canvas_group;
114 GnomeCanvasItem* canvas_rect; /* frame around the whole thing */
116 typedef list<AudioRegionView* > AudioRegionViewList;
117 AudioRegionViewList region_views;
119 typedef list<CrossfadeView*> CrossfadeViewList;
120 CrossfadeViewList crossfade_views;
122 double _samples_per_unit;
123 double _amplitude_above_axis;
125 sigc::connection screen_update_connection;
126 vector<RecBoxInfo> rec_rects;
127 list<ARDOUR::AudioRegion* > rec_regions;
130 bool use_rec_regions;
131 list<sigc::connection> peak_ready_connections;
132 jack_nframes_t last_rec_peak_frame;
133 map<ARDOUR::Source*, bool> rec_peak_ready_map;
135 void update_rec_box ();
136 void transport_changed();
137 void rec_enable_changed(void* src = 0);
138 void sess_rec_enable_changed();
139 void setup_rec_box ();
140 void rec_peak_range_ready (jack_nframes_t start, jack_nframes_t cnt, ARDOUR::Source* src);
141 void update_rec_regions ();
143 void add_region_view (ARDOUR::Region*);
144 void add_region_view_internal (ARDOUR::Region*, bool wait_for_waves);
145 void remove_region_view (ARDOUR::Region* );
146 void remove_rec_region (ARDOUR::Region*);
147 void remove_audio_region_view (ARDOUR::AudioRegion* );
148 void remove_audio_rec_region (ARDOUR::AudioRegion*);
150 void display_diskstream (ARDOUR::DiskStream* );
151 void undisplay_diskstream ();
152 void redisplay_diskstream ();
153 void diskstream_changed (void* );
154 void playlist_state_changed (ARDOUR::Change);
155 void playlist_changed (ARDOUR::DiskStream* );
156 void playlist_modified ();
158 bool crossfades_visible;
159 void add_crossfade (ARDOUR::Crossfade*);
160 void remove_crossfade (ARDOUR::Crossfade*);
162 /* XXX why are these different? */
164 GdkColor region_color;
165 uint32_t stream_base_color;
167 vector<sigc::connection> playlist_connections;
168 sigc::connection playlist_change_connection;
171 #endif /* __ardour_streamview_h__ */