X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fstreamview.h;h=3c9bd4366626435f3e9790d24ea6216402ba6bc5;hb=1aba241919420198c82f31cffa11f6c8189747fb;hp=2913aaea2dc9280f79dbd7dd271372f8d7e2106f;hpb=183f69970c6c436b102f8b2fbe1bc6070c9e9bfe;p=ardour.git diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index 2913aaea2d..3c9bd43666 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2001 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 @@ -14,159 +14,147 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ */ #ifndef __ardour_streamview_h__ #define __ardour_streamview_h__ #include -#include #include -#include -#include - #include #include "enums.h" #include "simplerect.h" +#include "canvas.h" + +namespace Gdk { + class Color; +} namespace ARDOUR { class Route; - class DiskStream; + class Diskstream; class Crossfade; class PeakData; - class AudioRegion; + class Region; class Source; } struct RecBoxInfo { - Gnome::Canvas::SimpleRect* rectangle; - jack_nframes_t start; - jack_nframes_t length; + ArdourCanvas::SimpleRect* rectangle; + nframes_t start; + nframes_t length; }; class PublicEditor; class Selectable; -class AudioTimeAxisView; -class AudioRegionView; -class AudioRegionSelection; +class RouteTimeAxisView; +class RegionView; +class RegionSelection; class CrossfadeView; class Selection; class StreamView : public sigc::trackable { - public: - StreamView (AudioTimeAxisView&); - ~StreamView (); +public: + virtual ~StreamView (); - void set_waveform_shape (WaveformShape); + RouteTimeAxisView& trackview() { return _trackview; } - AudioTimeAxisView& trackview() { return _trackview; } + void attach (); void set_zoom_all(); - int set_height (gdouble); int set_position (gdouble x, gdouble y); + virtual int set_height (double); - int set_samples_per_unit (gdouble spp); - gdouble get_samples_per_unit () { return _samples_per_unit; } - - int set_amplitude_above_axis (gdouble app); - gdouble get_amplitude_above_axis () { return _amplitude_above_axis; } + virtual int set_samples_per_unit (gdouble spp); + gdouble get_samples_per_unit () { return _samples_per_unit; } - void set_show_waveforms (bool yn); - void set_show_waveforms_recording (bool yn) { use_rec_regions = yn; } + void set_layer_display (LayerDisplay); - Gnome::Canvas::Item* canvas_item() { return canvas_group; } - - sigc::signal AudioRegionViewAdded; + ArdourCanvas::Item* canvas_item() { return canvas_group; } enum ColorTarget { RegionColor, StreamBaseColor }; - void apply_color (Gdk::Color&, ColorTarget t); - void set_selected_regionviews (AudioRegionSelection&); - void get_selectables (jack_nframes_t start, jack_nframes_t end, list&); - void get_inverted_selectables (Selection&, list& results); Gdk::Color get_region_color () const { return region_color; } + void apply_color (Gdk::Color&, ColorTarget t); - void foreach_regionview (sigc::slot slot); - void foreach_crossfadeview (void (CrossfadeView::*pmf)(void)); + RegionView* find_view (boost::shared_ptr); + void foreach_regionview (sigc::slot slot); - void attach (); + void set_selected_regionviews (RegionSelection&); + void get_selectables (nframes_t start, nframes_t end, list&); + void get_inverted_selectables (Selection&, list& results); + + void add_region_view (boost::shared_ptr); + void region_layered (RegionView*); - void region_layered (AudioRegionView*); + virtual void redisplay_diskstream () = 0; - AudioRegionView* find_view (const ARDOUR::AudioRegion&); + sigc::signal RegionViewAdded; - void show_all_xfades (); - void hide_all_xfades (); - void hide_xfades_involving (AudioRegionView&); - void reveal_xfades_involving (AudioRegionView&); +protected: + StreamView (RouteTimeAxisView&); + +//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, bool wait_for_waves) = 0; + virtual void remove_region_view (boost::weak_ptr ); + //void remove_rec_region (boost::shared_ptr); (unused) - private: - AudioTimeAxisView& _trackview; + void display_diskstream (boost::shared_ptr); + virtual void undisplay_diskstream (); + void diskstream_changed (); + + virtual void playlist_changed (boost::shared_ptr); + virtual void playlist_modified_weak (boost::weak_ptr); + virtual void playlist_modified (boost::shared_ptr); + + virtual void color_handler () = 0; - Gnome::Canvas::Group* canvas_group; - Gnome::Canvas::SimpleRect* canvas_rect; /* frame around the whole thing */ + virtual void update_contents_y_position_and_height (); - typedef list AudioRegionViewList; - AudioRegionViewList region_views; + RouteTimeAxisView& _trackview; + ArdourCanvas::Group* canvas_group; + ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */ - typedef list CrossfadeViewList; - CrossfadeViewList crossfade_views; + typedef list RegionViewList; + RegionViewList region_views; double _samples_per_unit; - double _amplitude_above_axis; - - sigc::connection screen_update_connection; - vector rec_rects; - list rec_regions; - bool rec_updating; - bool rec_active; - bool use_rec_regions; - list peak_ready_connections; - jack_nframes_t last_rec_peak_frame; - map rec_peak_ready_map; - - void update_rec_box (); - void transport_changed(); - void rec_enable_changed(void* src = 0); - void sess_rec_enable_changed(); - void setup_rec_box (); - void rec_peak_range_ready (jack_nframes_t start, jack_nframes_t cnt, ARDOUR::Source* src); - void update_rec_regions (); - - void add_region_view (ARDOUR::Region*); - void add_region_view_internal (ARDOUR::Region*, bool wait_for_waves); - void remove_region_view (ARDOUR::Region* ); - void remove_rec_region (ARDOUR::Region*); - void remove_audio_region_view (ARDOUR::AudioRegion* ); - void remove_audio_rec_region (ARDOUR::AudioRegion*); - - void display_diskstream (ARDOUR::DiskStream* ); - void undisplay_diskstream (); - void redisplay_diskstream (); - void diskstream_changed (void* ); - void playlist_state_changed (ARDOUR::Change); - void playlist_changed (ARDOUR::DiskStream* ); - void playlist_modified (); - - bool crossfades_visible; - void add_crossfade (ARDOUR::Crossfade*); - void remove_crossfade (ARDOUR::Crossfade*); - - /* XXX why are these different? */ + + sigc::connection screen_update_connection; + vector rec_rects; + list< std::pair,RegionView* > > rec_regions; + bool rec_updating; + bool rec_active; + bool use_rec_regions; - Gdk::Color region_color; - uint32_t stream_base_color; + Gdk::Color region_color; ///< Contained region color + uint32_t stream_base_color; ///< Background color vector playlist_connections; - sigc::connection playlist_change_connection; + sigc::connection playlist_change_connection; + + int layers; + double height; + LayerDisplay layer_display; + + list rec_data_ready_connections; + jack_nframes_t last_rec_data_frame; }; #endif /* __ardour_streamview_h__ */ +