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__
28 #include <ardour/location.h>
30 #include "simplerect.h"
47 ArdourCanvas::SimpleRect* rectangle;
49 jack_nframes_t length;
54 class AudioTimeAxisView;
55 class AudioRegionView;
56 class AudioRegionSelection;
60 class StreamView : public sigc::trackable
63 StreamView (AudioTimeAxisView&);
66 void set_waveform_shape (WaveformShape);
68 AudioTimeAxisView& trackview() { return _trackview; }
72 int set_height (gdouble);
73 int set_position (gdouble x, gdouble y);
75 int set_samples_per_unit (gdouble spp);
76 gdouble get_samples_per_unit () { return _samples_per_unit; }
78 int set_amplitude_above_axis (gdouble app);
79 gdouble get_amplitude_above_axis () { return _amplitude_above_axis; }
81 void set_show_waveforms (bool yn);
82 void set_show_waveforms_recording (bool yn) { use_rec_regions = yn; }
84 ArdourCanvas::Item* canvas_item() { return canvas_group; }
86 sigc::signal<void,AudioRegionView*> AudioRegionViewAdded;
93 void apply_color (Gdk::Color&, ColorTarget t);
94 void set_selected_regionviews (AudioRegionSelection&);
95 void get_selectables (jack_nframes_t start, jack_nframes_t end, list<Selectable* >&);
96 void get_inverted_selectables (Selection&, list<Selectable* >& results);
97 Gdk::Color get_region_color () const { return region_color; }
99 void foreach_regionview (sigc::slot<void,AudioRegionView*> slot);
100 void foreach_crossfadeview (void (CrossfadeView::*pmf)(void));
104 void region_layered (AudioRegionView*);
106 AudioRegionView* find_view (const ARDOUR::AudioRegion&);
108 void show_all_xfades ();
109 void hide_all_xfades ();
110 void hide_xfades_involving (AudioRegionView&);
111 void reveal_xfades_involving (AudioRegionView&);
114 AudioTimeAxisView& _trackview;
116 ArdourCanvas::Group* canvas_group;
117 ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
119 typedef list<AudioRegionView* > AudioRegionViewList;
120 AudioRegionViewList region_views;
122 typedef list<CrossfadeView*> CrossfadeViewList;
123 CrossfadeViewList crossfade_views;
125 double _samples_per_unit;
126 double _amplitude_above_axis;
128 sigc::connection screen_update_connection;
129 vector<RecBoxInfo> rec_rects;
130 list<ARDOUR::AudioRegion* > rec_regions;
133 bool use_rec_regions;
134 list<sigc::connection> peak_ready_connections;
135 jack_nframes_t last_rec_peak_frame;
136 map<ARDOUR::Source*, bool> rec_peak_ready_map;
138 void update_rec_box ();
139 void transport_changed();
140 void rec_enable_changed(void* src = 0);
141 void sess_rec_enable_changed();
142 void setup_rec_box ();
143 void rec_peak_range_ready (jack_nframes_t start, jack_nframes_t cnt, ARDOUR::Source* src);
144 void update_rec_regions ();
146 void add_region_view (ARDOUR::Region*);
147 void add_region_view_internal (ARDOUR::Region*, bool wait_for_waves);
148 void remove_region_view (ARDOUR::Region* );
149 void remove_rec_region (ARDOUR::Region*);
150 void remove_audio_region_view (ARDOUR::AudioRegion* );
151 void remove_audio_rec_region (ARDOUR::AudioRegion*);
153 void display_diskstream (ARDOUR::DiskStream* );
154 void undisplay_diskstream ();
155 void redisplay_diskstream ();
156 void diskstream_changed (void* );
157 void playlist_state_changed (ARDOUR::Change);
158 void playlist_changed (ARDOUR::DiskStream* );
159 void playlist_modified ();
161 bool crossfades_visible;
162 void add_crossfade (ARDOUR::Crossfade*);
163 void remove_crossfade (ARDOUR::Crossfade*);
165 /* XXX why are these different? */
167 Gdk::Color region_color;
168 uint32_t stream_base_color;
170 vector<sigc::connection> playlist_connections;
171 sigc::connection playlist_change_connection;
174 #endif /* __ardour_streamview_h__ */