X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fstreamview.h;h=a1ebe2cc2a9fefee42be4f64d65bcae4a9f7e64b;hb=b5148d93d5a9e6949f82f8685cab50cb772f2b9d;hp=197c854b7a91f8cb2ec4f6ef7d4c4d7a24fdc79c;hpb=fe7c3976c9382bb9f19797034dece570eefcbf01;p=ardour.git diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index 197c854b7a..a1ebe2cc2a 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2001, 2006 Paul Davis + Copyright (C) 2001, 2006 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,14 +20,14 @@ #define __ardour_streamview_h__ #include -#include #include -#include +#include "pbd/signals.h" + +#include "ardour/location.h" #include "enums.h" #include "simplerect.h" #include "canvas.h" -#include "color.h" namespace Gdk { class Color; @@ -44,11 +44,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; @@ -56,24 +55,29 @@ class RegionSelection; class CrossfadeView; class Selection; -class StreamView : public sigc::trackable +class StreamView : public sigc::trackable, public PBD::ScopedConnectionList { public: virtual ~StreamView (); - RouteTimeAxisView& trackview() { return _trackview; } + RouteTimeAxisView& trackview() { return _trackview; } + const RouteTimeAxisView& trackview() const { return _trackview; } void attach (); void set_zoom_all(); int set_position (gdouble x, gdouble y); - virtual int set_height (gdouble); + virtual int set_height (double); virtual int set_samples_per_unit (gdouble spp); gdouble get_samples_per_unit () { return _samples_per_unit; } - ArdourCanvas::Item* canvas_item() { return canvas_group; } + void set_layer_display (LayerDisplay); + LayerDisplay layer_display () const { return _layer_display; } + + ArdourCanvas::Group* background_group() { return _background_group; } + ArdourCanvas::Group* canvas_item() { return canvas_group; } enum ColorTarget { RegionColor, @@ -83,67 +87,92 @@ public: Gdk::Color get_region_color () const { return region_color; } void apply_color (Gdk::Color&, ColorTarget t); + uint32_t num_selected_regionviews () const; + RegionView* find_view (boost::shared_ptr); void foreach_regionview (sigc::slot slot); + void foreach_selected_regionview (sigc::slot slot); void set_selected_regionviews (RegionSelection&); - void get_selectables (nframes_t start, nframes_t end, list&); - void get_inverted_selectables (Selection&, list& results); + void get_selectables (nframes_t, nframes_t, double, double, std::list&); + void get_inverted_selectables (Selection&, std::list& results); + + virtual void update_contents_metrics(boost::shared_ptr) {} + + void add_region_view (boost::weak_ptr); - void add_region_view (boost::shared_ptr); 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, bool, bool) { + return 0; + } + sigc::signal RegionViewAdded; + sigc::signal HeightChanged; protected: - StreamView (RouteTimeAxisView&); - -//private: (FIXME?) + StreamView (RouteTimeAxisView&, ArdourCanvas::Group* group = NULL); 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 void add_region_view_internal (boost::shared_ptr, bool wait_for_waves, bool watch_death) = 0; + + virtual RegionView* add_region_view_internal (boost::shared_ptr, + bool wait_for_waves, bool recording = false) = 0; virtual void remove_region_view (boost::weak_ptr ); - //void remove_rec_region (boost::shared_ptr); (unused) void display_diskstream (boost::shared_ptr); virtual void undisplay_diskstream (); - virtual void redisplay_diskstream () = 0; void diskstream_changed (); - - void playlist_state_changed (ARDOUR::Change); - virtual void playlist_changed (boost::shared_ptr); - virtual void playlist_modified (); - - virtual void color_handler (ColorID, uint32_t) = 0; + void layer_regions (); + virtual void playlist_switched (boost::weak_ptr); + virtual void playlist_layered (boost::weak_ptr); + + virtual void color_handler () = 0; 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 RegionViewList; + typedef std::list RegionViewList; RegionViewList region_views; double _samples_per_unit; sigc::connection screen_update_connection; - vector rec_rects; - list > rec_regions; + std::vector rec_rects; + std::list< std::pair,RegionView* > > rec_regions; bool rec_updating; bool rec_active; bool use_rec_regions; - + Gdk::Color region_color; ///< Contained region color uint32_t stream_base_color; ///< Background color - vector playlist_connections; - sigc::connection playlist_change_connection; + PBD::ScopedConnectionList playlist_connections; + PBD::ScopedConnection playlist_switched_connection; + + ARDOUR::layer_t _layers; + LayerDisplay _layer_display; + + double height; + + PBD::ScopedConnectionList rec_data_ready_connections; + nframes_t last_rec_data_frame; + +private: + void update_coverage_frames (); }; #endif /* __ardour_streamview_h__ */