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__
30 #include <ardour/location.h>
32 #include "simplerect.h"
45 ArdourCanvas::SimpleRect* rectangle;
47 jack_nframes_t length;
52 class AudioTimeAxisView;
53 class AudioRegionView;
54 class AudioRegionSelection;
58 class StreamView : public sigc::trackable
61 StreamView (AudioTimeAxisView&);
64 void set_waveform_shape (WaveformShape);
66 AudioTimeAxisView& trackview() { return _trackview; }
70 int set_height (gdouble);
71 int set_position (gdouble x, gdouble y);
73 int set_samples_per_unit (gdouble spp);
74 gdouble get_samples_per_unit () { return _samples_per_unit; }
76 int set_amplitude_above_axis (gdouble app);
77 gdouble get_amplitude_above_axis () { return _amplitude_above_axis; }
79 void set_show_waveforms (bool yn);
80 void set_show_waveforms_recording (bool yn) { use_rec_regions = yn; }
82 ArdourCanvas::Item* canvas_item() { return canvas_group; }
84 sigc::signal<void,AudioRegionView*> AudioRegionViewAdded;
91 void apply_color (Gdk::Color&, ColorTarget t);
92 void set_selected_regionviews (AudioRegionSelection&);
93 void get_selectables (jack_nframes_t start, jack_nframes_t end, list<Selectable* >&);
94 void get_inverted_selectables (Selection&, list<Selectable* >& results);
95 Gdk::Color get_region_color () const { return region_color; }
97 void foreach_regionview (sigc::slot<void,AudioRegionView*> slot);
98 void foreach_crossfadeview (void (CrossfadeView::*pmf)(void));
102 void region_layered (AudioRegionView*);
104 AudioRegionView* find_view (const ARDOUR::AudioRegion&);
106 void show_all_xfades ();
107 void hide_all_xfades ();
108 void hide_xfades_involving (AudioRegionView&);
109 void reveal_xfades_involving (AudioRegionView&);
112 AudioTimeAxisView& _trackview;
114 ArdourCanvas::Group* canvas_group;
115 ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
117 typedef list<AudioRegionView* > AudioRegionViewList;
118 AudioRegionViewList region_views;
120 typedef list<CrossfadeView*> CrossfadeViewList;
121 CrossfadeViewList crossfade_views;
123 double _samples_per_unit;
124 double _amplitude_above_axis;
126 sigc::connection screen_update_connection;
127 vector<RecBoxInfo> rec_rects;
128 list<ARDOUR::AudioRegion* > rec_regions;
131 bool use_rec_regions;
132 list<sigc::connection> peak_ready_connections;
133 jack_nframes_t last_rec_peak_frame;
134 map<ARDOUR::Source*, bool> rec_peak_ready_map;
136 void update_rec_box ();
137 void transport_changed();
138 void rec_enable_changed(void* src = 0);
139 void sess_rec_enable_changed();
140 void setup_rec_box ();
141 void rec_peak_range_ready (jack_nframes_t start, jack_nframes_t cnt, ARDOUR::Source* src);
142 void update_rec_regions ();
144 void add_region_view (ARDOUR::Region*);
145 void add_region_view_internal (ARDOUR::Region*, bool wait_for_waves);
146 void remove_region_view (ARDOUR::Region* );
147 void remove_rec_region (ARDOUR::Region*);
148 void remove_audio_region_view (ARDOUR::AudioRegion* );
149 void remove_audio_rec_region (ARDOUR::AudioRegion*);
151 void display_diskstream (ARDOUR::DiskStream* );
152 void undisplay_diskstream ();
153 void redisplay_diskstream ();
154 void diskstream_changed (void* );
155 void playlist_state_changed (ARDOUR::Change);
156 void playlist_changed (ARDOUR::DiskStream* );
157 void playlist_modified ();
159 bool crossfades_visible;
160 void add_crossfade (ARDOUR::Crossfade*);
161 void remove_crossfade (ARDOUR::Crossfade*);
163 /* XXX why are these different? */
165 Gdk::Color region_color;
166 uint32_t stream_base_color;
168 vector<sigc::connection> playlist_connections;
169 sigc::connection playlist_change_connection;
172 #endif /* __ardour_streamview_h__ */