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"
48 ArdourCanvas::SimpleRect* rectangle;
50 jack_nframes_t length;
55 class AudioTimeAxisView;
56 class AudioRegionView;
57 class AudioRegionSelection;
61 class StreamView : public sigc::trackable
64 StreamView (AudioTimeAxisView&);
67 void set_waveform_shape (WaveformShape);
69 AudioTimeAxisView& trackview() { return _trackview; }
73 int set_height (gdouble);
74 int set_position (gdouble x, gdouble y);
76 int set_samples_per_unit (gdouble spp);
77 gdouble get_samples_per_unit () { return _samples_per_unit; }
79 int set_amplitude_above_axis (gdouble app);
80 gdouble get_amplitude_above_axis () { return _amplitude_above_axis; }
82 void set_show_waveforms (bool yn);
83 void set_show_waveforms_recording (bool yn) { use_rec_regions = yn; }
85 ArdourCanvas::Item* canvas_item() { return canvas_group; }
87 sigc::signal<void,AudioRegionView*> AudioRegionViewAdded;
94 void apply_color (Gdk::Color&, ColorTarget t);
95 void set_selected_regionviews (AudioRegionSelection&);
96 void get_selectables (jack_nframes_t start, jack_nframes_t end, list<Selectable* >&);
97 void get_inverted_selectables (Selection&, list<Selectable* >& results);
98 Gdk::Color get_region_color () const { return region_color; }
100 void foreach_regionview (sigc::slot<void,AudioRegionView*> slot);
101 void foreach_crossfadeview (void (CrossfadeView::*pmf)(void));
105 void region_layered (AudioRegionView*);
107 AudioRegionView* find_view (const ARDOUR::AudioRegion&);
109 void show_all_xfades ();
110 void hide_all_xfades ();
111 void hide_xfades_involving (AudioRegionView&);
112 void reveal_xfades_involving (AudioRegionView&);
115 AudioTimeAxisView& _trackview;
117 ArdourCanvas::Group* canvas_group;
118 ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
120 typedef list<AudioRegionView* > AudioRegionViewList;
121 AudioRegionViewList region_views;
123 typedef list<CrossfadeView*> CrossfadeViewList;
124 CrossfadeViewList crossfade_views;
126 double _samples_per_unit;
127 double _amplitude_above_axis;
129 sigc::connection screen_update_connection;
130 vector<RecBoxInfo> rec_rects;
131 list<ARDOUR::AudioRegion* > rec_regions;
134 bool use_rec_regions;
135 list<sigc::connection> peak_ready_connections;
136 jack_nframes_t last_rec_peak_frame;
137 map<ARDOUR::Source*, bool> rec_peak_ready_map;
139 void update_rec_box ();
140 void transport_changed();
141 void rec_enable_changed(void* src = 0);
142 void sess_rec_enable_changed();
143 void setup_rec_box ();
144 void rec_peak_range_ready (jack_nframes_t start, jack_nframes_t cnt, ARDOUR::Source* src);
145 void update_rec_regions ();
147 void add_region_view (ARDOUR::Region*);
148 void add_region_view_internal (ARDOUR::Region*, bool wait_for_waves);
149 void remove_region_view (ARDOUR::Region* );
150 void remove_rec_region (ARDOUR::Region*);
151 void remove_audio_region_view (ARDOUR::AudioRegion* );
152 void remove_audio_rec_region (ARDOUR::AudioRegion*);
154 void display_diskstream (ARDOUR::DiskStream* );
155 void undisplay_diskstream ();
156 void redisplay_diskstream ();
157 void diskstream_changed (void* );
158 void playlist_state_changed (ARDOUR::Change);
159 void playlist_changed (ARDOUR::DiskStream* );
160 void playlist_modified ();
162 bool crossfades_visible;
163 void add_crossfade (ARDOUR::Crossfade*);
164 void remove_crossfade (ARDOUR::Crossfade*);
166 /* XXX why are these different? */
168 Gdk::Color region_color;
169 uint32_t stream_base_color;
171 void color_handler (ColorID, uint32_t);
173 vector<sigc::connection> playlist_connections;
174 sigc::connection playlist_change_connection;
177 #endif /* __ardour_streamview_h__ */