fix names of new no-selected-tracks actions in menus
[ardour2.git] / gtk2_ardour / streamview.h
blob5ace1ed8de13b28c162794f9625188da84266488
1 /*
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__
22 #include <list>
23 #include <map>
24 #include <cmath>
26 #include <ardour/location.h>
27 #include "enums.h"
28 #include "simplerect.h"
29 #include "canvas.h"
31 namespace Gdk {
32 class Color;
35 namespace ARDOUR {
36 class Route;
37 class Diskstream;
38 class Crossfade;
39 class PeakData;
40 class Region;
41 class Source;
44 struct RecBoxInfo {
45 ArdourCanvas::SimpleRect* rectangle;
46 nframes_t start;
47 nframes_t length;
50 class PublicEditor;
51 class Selectable;
52 class RouteTimeAxisView;
53 class RegionView;
54 class RegionSelection;
55 class CrossfadeView;
56 class Selection;
58 class StreamView : public sigc::trackable
60 public:
61 virtual ~StreamView ();
63 RouteTimeAxisView& trackview() { return _trackview; }
65 void attach ();
67 void set_zoom_all();
69 int set_position (gdouble x, gdouble y);
70 virtual int set_height (gdouble);
72 virtual int set_samples_per_unit (gdouble spp);
73 gdouble get_samples_per_unit () { return _samples_per_unit; }
75 ArdourCanvas::Group* background_group() { return _background_group; }
76 ArdourCanvas::Group* canvas_item() { return canvas_group; }
78 enum ColorTarget {
79 RegionColor,
80 StreamBaseColor
83 Gdk::Color get_region_color () const { return region_color; }
84 void apply_color (Gdk::Color&, ColorTarget t);
86 RegionView* find_view (boost::shared_ptr<const ARDOUR::Region>);
87 void foreach_regionview (sigc::slot<void,RegionView*> slot);
89 void set_selected_regionviews (RegionSelection&);
90 void get_selectables (nframes_t start, nframes_t end, list<Selectable* >&);
91 void get_inverted_selectables (Selection&, list<Selectable* >& results);
93 void add_region_view (boost::shared_ptr<ARDOUR::Region>);
94 void region_layered (RegionView*);
96 sigc::signal<void,RegionView*> RegionViewAdded;
98 protected:
99 StreamView (RouteTimeAxisView&);
101 //private: (FIXME?)
103 void transport_changed();
104 void transport_looped();
105 void rec_enable_changed();
106 void sess_rec_enable_changed();
107 virtual void setup_rec_box () = 0;
108 void update_rec_box ();
109 virtual void update_rec_regions () = 0;
111 virtual void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool recording = false) = 0;
112 virtual void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
113 //void remove_rec_region (boost::shared_ptr<ARDOUR::Region>); (unused)
115 void display_diskstream (boost::weak_ptr<ARDOUR::Diskstream>);
116 virtual void undisplay_diskstream ();
117 virtual void redisplay_diskstream () = 0;
118 void diskstream_changed ();
120 virtual void playlist_changed (boost::weak_ptr<ARDOUR::Diskstream>);
121 virtual void playlist_modified ();
123 virtual void color_handler () = 0;
126 RouteTimeAxisView& _trackview;
127 ArdourCanvas::Group* _background_group;
128 ArdourCanvas::Group* canvas_group;
129 ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
131 typedef list<RegionView* > RegionViewList;
132 RegionViewList region_views;
134 double _samples_per_unit;
136 sigc::connection screen_update_connection;
137 vector<RecBoxInfo> rec_rects;
138 list<boost::shared_ptr<ARDOUR::Region> > rec_regions;
139 bool rec_updating;
140 bool rec_active;
141 bool use_rec_regions;
143 Gdk::Color region_color; ///< Contained region color
144 uint32_t stream_base_color; ///< Background color
146 vector<sigc::connection> playlist_connections;
147 sigc::connection playlist_change_connection;
150 #endif /* __ardour_streamview_h__ */