Remove excess menu separator.
[ardour.git] / gtk2_ardour / streamview.h
index 5e716d7a36fd48d5d0a282f8ac541459faa0abbd..39ca9f10d38716f4a96a12aa189300ed6ea8c5ff 100644 (file)
@@ -22,7 +22,7 @@
 #include <list>
 #include <cmath>
 
-#include <ardour/location.h>
+#include "ardour/location.h"
 #include "enums.h"
 #include "simplerect.h"
 #include "canvas.h"
@@ -42,11 +42,10 @@ namespace ARDOUR {
 
 struct RecBoxInfo {
        ArdourCanvas::SimpleRect* rectangle;
-       nframes_t            start;
-       nframes_t            length;
+       nframes_t                 start;
+       nframes_t                 length;
 };
 
-class PublicEditor;
 class Selectable;
 class RouteTimeAxisView;
 class RegionView;
@@ -72,9 +71,11 @@ public:
        virtual int set_samples_per_unit (gdouble spp);
        gdouble     get_samples_per_unit () { return _samples_per_unit; }
 
-       void set_layer_display (LayerDisplay);
+       void set_layer_display (LayerDisplay);
+       LayerDisplay layer_display () const { return _layer_display; }
 
-       ArdourCanvas::Item* canvas_item() { return canvas_group; }
+       ArdourCanvas::Group* background_group() { return _background_group; }
+       ArdourCanvas::Group* canvas_item() { return canvas_group; }
 
        enum ColorTarget {
                RegionColor,
@@ -88,57 +89,68 @@ public:
        void         foreach_regionview (sigc::slot<void,RegionView*> slot);
 
        void set_selected_regionviews (RegionSelection&);
-       void get_selectables (nframes_t start, nframes_t end, list<Selectable* >&);
-       void get_inverted_selectables (Selection&, list<Selectable* >& results);
+       void get_selectables (nframes_t, nframes_t, double, double, std::list<Selectable* >&);
+       void get_inverted_selectables (Selection&, std::list<Selectable* >& results);
 
+       virtual void update_contents_metrics(boost::shared_ptr<ARDOUR::Region>) {}
+
+       void add_region_view_weak (boost::weak_ptr<ARDOUR::Region> r);
        void add_region_view (boost::shared_ptr<ARDOUR::Region>);
+
        void region_layered (RegionView*);
+       virtual void update_contents_height ();
        
        virtual void redisplay_diskstream () = 0;
+       double child_height () const;
+       ARDOUR::layer_t layers () const { return _layers; }
+
+       virtual RegionView* create_region_view (boost::shared_ptr<ARDOUR::Region>, bool, bool) {
+               return 0;
+       }
        
        sigc::signal<void,RegionView*> RegionViewAdded;
+       sigc::signal<void> HeightChanged;
 
 protected:
-       StreamView (RouteTimeAxisView&);
+       StreamView (RouteTimeAxisView&, ArdourCanvas::Group* group = NULL);
        
-//private: (FIXME?)
-
        void         transport_changed();
        void         transport_looped();
        void         rec_enable_changed();
        void         sess_rec_enable_changed();
        virtual void setup_rec_box () = 0;
        void         update_rec_box ();
-       //virtual void update_rec_regions () = 0;
        
-       virtual RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves) = 0;
+       virtual RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>,
+                     bool wait_for_waves, bool recording = false) = 0;
        virtual void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
-       //void         remove_rec_region (boost::shared_ptr<ARDOUR::Region>); (unused)
 
        void         display_diskstream (boost::shared_ptr<ARDOUR::Diskstream>);
        virtual void undisplay_diskstream ();
        void         diskstream_changed ();
+       void         layer_regions ();
        
+       virtual void playlist_changed_weak (boost::weak_ptr<ARDOUR::Diskstream>);
        virtual void playlist_changed (boost::shared_ptr<ARDOUR::Diskstream>);
        virtual void playlist_modified_weak (boost::weak_ptr<ARDOUR::Diskstream>);
        virtual void playlist_modified (boost::shared_ptr<ARDOUR::Diskstream>);
        
        virtual void color_handler () = 0;
 
-       virtual void update_contents_y_position_and_height ();
-
        RouteTimeAxisView&        _trackview;
+       bool                      owns_canvas_group;
+       ArdourCanvas::Group*      _background_group;
        ArdourCanvas::Group*      canvas_group;
        ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
 
-       typedef list<RegionView* > RegionViewList;
+       typedef std::list<RegionView* > RegionViewList;
        RegionViewList  region_views;
 
        double _samples_per_unit;
 
        sigc::connection       screen_update_connection;
-       vector<RecBoxInfo>     rec_rects;
-       list< std::pair<boost::shared_ptr<ARDOUR::Region>,RegionView* > > rec_regions;
+       std::vector<RecBoxInfo>     rec_rects;
+       std::list< std::pair<boost::shared_ptr<ARDOUR::Region>,RegionView* > > rec_regions;
        bool                   rec_updating;
        bool                   rec_active;
        bool                   use_rec_regions;
@@ -146,15 +158,19 @@ protected:
        Gdk::Color region_color;      ///< Contained region color
        uint32_t   stream_base_color; ///< Background color
 
-       vector<sigc::connection> playlist_connections;
+       std::vector<sigc::connection> playlist_connections;
        sigc::connection         playlist_change_connection;
 
-       int layers;
+       ARDOUR::layer_t _layers;
+       LayerDisplay    _layer_display;
+       
        double height;
-       LayerDisplay layer_display;
 
-       list<sigc::connection> rec_data_ready_connections;
+       std::list<sigc::connection> rec_data_ready_connections;
        jack_nframes_t         last_rec_data_frame;
+
+private:
+       void update_coverage_frames ();
 };
 
 #endif /* __ardour_streamview_h__ */