13
0
livetrax/gtk2_ardour/streamview.h
David Robillard e0aaed6d65 *** NEW CODING POLICY ***
All #include statements that include a header that is a part of a library
bundled with ardour MUST use quotes, not angle brackets.

Do this:

#include "ardour/types.h"

NOT this:

#include <ardour/types.h>

Rationale:

This is best practice in general, to ensure we include the local version
and not the system version.  That quotes mean "local" (in some sense)
and angle brackets mean "system" (in some sense) is a ubiquitous
convention and IIRC right in the C spec somewhere.

More pragmatically, this is required by (my) waf (stuff) for dependencies
to work correctly.  That is:

!!! FAILURE TO DO THIS CAN RESULT IN BROKEN BUILDS !!!

Failure to comply is punishable by death by torture. :)

P.S. It's not that dramatic in all cases, but this (in combination with some
GCC flags specific to the include type) is the best way I have found to be
absolutely 100% positive the local ones are being used (and we definitely
want to be absolutely 100% positive on that one).


git-svn-id: svn://localhost/ardour2/branches/3.0@4655 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-25 18:26:51 +00:00

171 lines
5.0 KiB
C++

/*
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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.
*/
#ifndef __ardour_streamview_h__
#define __ardour_streamview_h__
#include <list>
#include <cmath>
#include "ardour/location.h"
#include "enums.h"
#include "simplerect.h"
#include "canvas.h"
namespace Gdk {
class Color;
}
namespace ARDOUR {
class Route;
class Diskstream;
class Crossfade;
class PeakData;
class Region;
class Source;
}
struct RecBoxInfo {
ArdourCanvas::SimpleRect* rectangle;
nframes_t start;
nframes_t length;
};
class PublicEditor;
class Selectable;
class RouteTimeAxisView;
class RegionView;
class RegionSelection;
class CrossfadeView;
class Selection;
class StreamView : public sigc::trackable
{
public:
virtual ~StreamView ();
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 (double);
virtual int set_samples_per_unit (gdouble spp);
gdouble get_samples_per_unit () { return _samples_per_unit; }
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,
StreamBaseColor
};
Gdk::Color get_region_color () const { return region_color; }
void apply_color (Gdk::Color&, ColorTarget t);
RegionView* find_view (boost::shared_ptr<const ARDOUR::Region>);
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);
virtual void update_contents_metrics(boost::shared_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; }
sigc::signal<void,RegionView*> RegionViewAdded;
protected:
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 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 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;
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;
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;
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<sigc::connection> playlist_connections;
sigc::connection playlist_change_connection;
ARDOUR::layer_t _layers;
LayerDisplay _layer_display;
double height;
list<sigc::connection> rec_data_ready_connections;
jack_nframes_t last_rec_data_frame;
private:
void update_coverage_frames ();
};
#endif /* __ardour_streamview_h__ */