2 Copyright (C) 2001, 2006 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.
19 #ifndef __ardour_streamview_h__
20 #define __ardour_streamview_h__
26 #include <ardour/location.h>
28 #include "simplerect.h"
46 ArdourCanvas::SimpleRect* rectangle;
53 class RouteTimeAxisView;
55 class RegionSelection;
59 class StreamView : public sigc::trackable
62 virtual ~StreamView ();
64 RouteTimeAxisView& trackview() { return _trackview; }
70 int set_position (gdouble x, gdouble y);
71 virtual int set_height (double);
73 virtual int set_samples_per_unit (gdouble spp);
74 gdouble get_samples_per_unit () { return _samples_per_unit; }
76 void set_layer_display (LayerDisplay);
78 ArdourCanvas::Item* canvas_item() { return canvas_group; }
85 Gdk::Color get_region_color () const { return region_color; }
86 void apply_color (Gdk::Color&, ColorTarget t);
88 RegionView* find_view (boost::shared_ptr<const ARDOUR::Region>);
89 void foreach_regionview (sigc::slot<void,RegionView*> slot);
91 void set_selected_regionviews (RegionSelection&);
92 void get_selectables (nframes_t start, nframes_t end, list<Selectable* >&);
93 void get_inverted_selectables (Selection&, list<Selectable* >& results);
95 void add_region_view (boost::shared_ptr<ARDOUR::Region>);
96 void region_layered (RegionView*);
98 sigc::signal<void,RegionView*> RegionViewAdded;
101 StreamView (RouteTimeAxisView&);
105 void transport_changed();
106 void rec_enable_changed();
107 void sess_rec_enable_changed();
108 virtual void setup_rec_box () = 0;
109 void update_rec_box ();
110 virtual void update_rec_regions () = 0;
112 virtual void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves) = 0;
113 virtual void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
114 //void remove_rec_region (boost::shared_ptr<ARDOUR::Region>); (unused)
116 void display_diskstream (boost::shared_ptr<ARDOUR::Diskstream>);
117 virtual void undisplay_diskstream ();
118 virtual void redisplay_diskstream () = 0;
119 void diskstream_changed ();
121 virtual void playlist_changed (boost::shared_ptr<ARDOUR::Diskstream>);
122 virtual void playlist_modified_weak (boost::weak_ptr<ARDOUR::Diskstream>);
123 virtual void playlist_modified (boost::shared_ptr<ARDOUR::Diskstream>);
125 virtual void color_handler (ColorID, uint32_t) = 0;
127 virtual void update_contents_y_position_and_height ();
129 RouteTimeAxisView& _trackview;
130 ArdourCanvas::Group* canvas_group;
131 ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
133 typedef list<RegionView* > RegionViewList;
134 RegionViewList region_views;
136 double _samples_per_unit;
138 sigc::connection screen_update_connection;
139 vector<RecBoxInfo> rec_rects;
140 list<boost::shared_ptr<ARDOUR::Region> > rec_regions;
143 bool use_rec_regions;
145 Gdk::Color region_color; ///< Contained region color
146 uint32_t stream_base_color; ///< Background color
148 vector<sigc::connection> playlist_connections;
149 sigc::connection playlist_change_connection;
153 LayerDisplay layer_display;
155 list<sigc::connection> rec_data_ready_connections;
156 jack_nframes_t last_rec_data_frame;
157 map<boost::shared_ptr<ARDOUR::Source>, bool> rec_data_ready_map;
160 #endif /* __ardour_streamview_h__ */