2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2006-07-23 08:03:19 -04:00
|
|
|
Copyright (C) 2001, 2006 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
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>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/location.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "enums.h"
|
2005-11-12 22:53:51 -05:00
|
|
|
#include "simplerect.h"
|
2005-11-23 12:21:12 -05:00
|
|
|
#include "canvas.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-28 23:41:15 -05:00
|
|
|
namespace Gdk {
|
|
|
|
class Color;
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
namespace ARDOUR {
|
|
|
|
class Route;
|
2006-07-23 08:03:19 -04:00
|
|
|
class Diskstream;
|
2005-09-25 14:42:24 -04:00
|
|
|
class Crossfade;
|
|
|
|
class PeakData;
|
2006-07-23 08:03:19 -04:00
|
|
|
class Region;
|
2005-09-25 14:42:24 -04:00
|
|
|
class Source;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct RecBoxInfo {
|
2006-07-23 08:03:19 -04:00
|
|
|
ArdourCanvas::SimpleRect* rectangle;
|
2009-02-16 02:04:27 -05:00
|
|
|
nframes_t start;
|
|
|
|
nframes_t length;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class Selectable;
|
2006-07-23 08:03:19 -04:00
|
|
|
class RouteTimeAxisView;
|
|
|
|
class RegionView;
|
|
|
|
class RegionSelection;
|
2005-09-25 14:42:24 -04:00
|
|
|
class CrossfadeView;
|
|
|
|
class Selection;
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
class StreamView : public sigc::trackable
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-07-23 08:03:19 -04:00
|
|
|
public:
|
|
|
|
virtual ~StreamView ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-07-09 13:58:13 -04:00
|
|
|
RouteTimeAxisView& trackview() { return _trackview; }
|
|
|
|
const RouteTimeAxisView& trackview() const { return _trackview; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
void attach ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void set_zoom_all();
|
|
|
|
|
|
|
|
int set_position (gdouble x, gdouble y);
|
2007-05-17 06:41:14 -04:00
|
|
|
virtual int set_height (double);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
virtual int set_samples_per_unit (gdouble spp);
|
|
|
|
gdouble get_samples_per_unit () { return _samples_per_unit; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-22 23:11:24 -05:00
|
|
|
void set_layer_display (LayerDisplay);
|
2009-01-05 22:18:09 -05:00
|
|
|
LayerDisplay layer_display () const { return _layer_display; }
|
2007-05-17 06:41:14 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
ArdourCanvas::Group* background_group() { return _background_group; }
|
2008-09-10 17:27:39 -04:00
|
|
|
ArdourCanvas::Group* canvas_item() { return canvas_group; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
enum ColorTarget {
|
|
|
|
RegionColor,
|
|
|
|
StreamBaseColor
|
|
|
|
};
|
|
|
|
|
2005-10-06 00:59:20 -04:00
|
|
|
Gdk::Color get_region_color () const { return region_color; }
|
2006-07-23 08:03:19 -04:00
|
|
|
void apply_color (Gdk::Color&, ColorTarget t);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-29 17:21:48 -04:00
|
|
|
RegionView* find_view (boost::shared_ptr<const ARDOUR::Region>);
|
2006-07-23 08:03:19 -04:00
|
|
|
void foreach_regionview (sigc::slot<void,RegionView*> slot);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
void set_selected_regionviews (RegionSelection&);
|
2009-05-12 13:03:42 -04:00
|
|
|
void get_selectables (nframes_t start, nframes_t end, std::list<Selectable* >&);
|
|
|
|
void get_inverted_selectables (Selection&, std::list<Selectable* >& results);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-02-15 14:44:27 -05:00
|
|
|
virtual void update_contents_metrics(boost::shared_ptr<ARDOUR::Region> r) {}
|
2009-05-13 17:34:09 -04:00
|
|
|
|
|
|
|
void add_region_view_weak (boost::weak_ptr<ARDOUR::Region> r);
|
2006-08-29 17:21:48 -04:00
|
|
|
void add_region_view (boost::shared_ptr<ARDOUR::Region>);
|
2009-05-13 17:34:09 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
void region_layered (RegionView*);
|
2008-09-19 15:32:10 -04:00
|
|
|
virtual void update_contents_height ();
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2007-07-06 23:19:04 -04:00
|
|
|
virtual void redisplay_diskstream () = 0;
|
2009-01-05 22:18:09 -05:00
|
|
|
double child_height () const;
|
|
|
|
ARDOUR::layer_t layers () const { return _layers; }
|
2009-06-08 15:28:51 -04:00
|
|
|
|
|
|
|
virtual RegionView* create_region_view (boost::shared_ptr<ARDOUR::Region>, bool, bool) {
|
|
|
|
return 0;
|
|
|
|
}
|
2007-07-06 23:19:04 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
sigc::signal<void,RegionView*> RegionViewAdded;
|
2009-06-13 13:52:51 -04:00
|
|
|
sigc::signal<void> HeightChanged;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
protected:
|
2009-07-09 13:58:13 -04:00
|
|
|
StreamView (RouteTimeAxisView&, ArdourCanvas::Group* group = NULL);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
void transport_changed();
|
2007-06-25 22:16:54 -04:00
|
|
|
void transport_looped();
|
2006-08-01 13:19:38 -04:00
|
|
|
void rec_enable_changed();
|
2006-07-29 23:25:38 -04:00
|
|
|
void sess_rec_enable_changed();
|
2006-07-23 08:03:19 -04:00
|
|
|
virtual void setup_rec_box () = 0;
|
2006-07-29 23:25:38 -04:00
|
|
|
void update_rec_box ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-02-16 02:04:27 -05:00
|
|
|
virtual RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>,
|
2009-05-13 17:34:09 -04:00
|
|
|
bool wait_for_waves, bool recording = false) = 0;
|
2006-10-21 15:01:50 -04:00
|
|
|
virtual void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-24 03:37:17 -04:00
|
|
|
void display_diskstream (boost::shared_ptr<ARDOUR::Diskstream>);
|
2006-07-23 08:03:19 -04:00
|
|
|
virtual void undisplay_diskstream ();
|
2006-08-01 13:19:38 -04:00
|
|
|
void diskstream_changed ();
|
2009-02-15 15:31:05 -05:00
|
|
|
void layer_regions ();
|
2006-07-29 23:25:38 -04:00
|
|
|
|
2009-02-16 00:13:05 -05:00
|
|
|
virtual void playlist_changed_weak (boost::weak_ptr<ARDOUR::Diskstream>);
|
2006-08-24 03:37:17 -04:00
|
|
|
virtual void playlist_changed (boost::shared_ptr<ARDOUR::Diskstream>);
|
2007-05-17 06:41:14 -04:00
|
|
|
virtual void playlist_modified_weak (boost::weak_ptr<ARDOUR::Diskstream>);
|
|
|
|
virtual void playlist_modified (boost::shared_ptr<ARDOUR::Diskstream>);
|
2006-07-29 23:25:38 -04:00
|
|
|
|
2007-06-15 18:08:27 -04:00
|
|
|
virtual void color_handler () = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-07-09 13:58:13 -04:00
|
|
|
RouteTimeAxisView& _trackview;
|
2008-02-21 20:45:29 -05:00
|
|
|
bool owns_canvas_group;
|
2008-12-12 09:43:24 -05:00
|
|
|
ArdourCanvas::Group* _background_group;
|
2006-07-23 08:03:19 -04:00
|
|
|
ArdourCanvas::Group* canvas_group;
|
|
|
|
ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
|
|
|
|
|
2009-05-12 13:03:42 -04:00
|
|
|
typedef std::list<RegionView* > RegionViewList;
|
2006-07-29 23:25:38 -04:00
|
|
|
RegionViewList region_views;
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
double _samples_per_unit;
|
|
|
|
|
|
|
|
sigc::connection screen_update_connection;
|
2009-05-12 13:03:42 -04:00
|
|
|
std::vector<RecBoxInfo> rec_rects;
|
|
|
|
std::list< std::pair<boost::shared_ptr<ARDOUR::Region>,RegionView* > > rec_regions;
|
2006-07-23 08:03:19 -04:00
|
|
|
bool rec_updating;
|
|
|
|
bool rec_active;
|
|
|
|
bool use_rec_regions;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-01 20:22:16 -04:00
|
|
|
Gdk::Color region_color; ///< Contained region color
|
|
|
|
uint32_t stream_base_color; ///< Background color
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-05-12 13:03:42 -04:00
|
|
|
std::vector<sigc::connection> playlist_connections;
|
2006-07-23 08:03:19 -04:00
|
|
|
sigc::connection playlist_change_connection;
|
2007-05-17 06:41:14 -04:00
|
|
|
|
2009-01-05 22:18:09 -05:00
|
|
|
ARDOUR::layer_t _layers;
|
2009-02-16 02:04:27 -05:00
|
|
|
LayerDisplay _layer_display;
|
|
|
|
|
2007-05-17 06:41:14 -04:00
|
|
|
double height;
|
2007-05-31 17:37:20 -04:00
|
|
|
|
2009-05-12 13:03:42 -04:00
|
|
|
std::list<sigc::connection> rec_data_ready_connections;
|
2007-05-31 17:37:20 -04:00
|
|
|
jack_nframes_t last_rec_data_frame;
|
2008-12-31 13:44:32 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void update_coverage_frames ();
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_streamview_h__ */
|
2006-07-23 08:03:19 -04:00
|
|
|
|