2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -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-12-19 15:26:31 -05:00
|
|
|
#include "pbd/signals.h"
|
2009-12-17 13:24:23 -05:00
|
|
|
|
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-28 23:41:15 -05:00
|
|
|
namespace Gdk {
|
|
|
|
class Color;
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
namespace ARDOUR {
|
|
|
|
class Crossfade;
|
2006-07-23 08:03:19 -04:00
|
|
|
class Region;
|
2012-05-23 22:54:10 -04:00
|
|
|
class Route;
|
2005-09-25 14:42:24 -04:00
|
|
|
class Source;
|
2010-04-21 16:42:22 -04:00
|
|
|
class Track;
|
2012-05-23 22:54:10 -04:00
|
|
|
struct PeakData;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
namespace ArdourCanvas {
|
|
|
|
class Rectangle;
|
2014-06-22 11:41:05 -04:00
|
|
|
class Container;
|
2013-04-04 00:32:52 -04:00
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
struct RecBoxInfo {
|
2013-04-04 00:32:52 -04:00
|
|
|
ArdourCanvas::Rectangle* rectangle;
|
2010-12-03 17:26:29 -05:00
|
|
|
framepos_t start;
|
|
|
|
ARDOUR::framecnt_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;
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
class StreamView : public sigc::trackable, public PBD::ScopedConnectionList
|
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
|
|
|
|
2013-04-12 11:31:50 -04:00
|
|
|
virtual int set_samples_per_pixel (double);
|
|
|
|
gdouble get_samples_per_pixel () const { return _samples_per_pixel; }
|
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
|
|
|
|
2014-06-22 11:41:05 -04:00
|
|
|
ArdourCanvas::Container* canvas_item() { return _canvas_group; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
enum ColorTarget {
|
|
|
|
RegionColor,
|
|
|
|
StreamBaseColor
|
|
|
|
};
|
|
|
|
|
2014-06-09 23:28:32 -04:00
|
|
|
uint32_t get_region_color () const { return region_color; }
|
|
|
|
void apply_color (uint32_t, ColorTarget t);
|
|
|
|
void apply_color (Gdk::Color const &, ColorTarget t);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-01-07 14:15:33 -05:00
|
|
|
uint32_t num_selected_regionviews () const;
|
|
|
|
|
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);
|
2010-01-07 14:15:33 -05:00
|
|
|
void foreach_selected_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&);
|
2015-01-09 13:20:02 -05:00
|
|
|
void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable* >&, bool within = false);
|
2009-05-12 13:03:42 -04:00
|
|
|
void get_inverted_selectables (Selection&, std::list<Selectable* >& results);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-07-21 11:55:17 -04:00
|
|
|
virtual void update_contents_metrics(boost::shared_ptr<ARDOUR::Region>) {}
|
2009-05-13 17:34:09 -04:00
|
|
|
|
2010-01-25 15:34:09 -05:00
|
|
|
void add_region_view (boost::weak_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 ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-04-21 16:42:22 -04:00
|
|
|
virtual void redisplay_track () = 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;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-11-14 10:01:53 -05:00
|
|
|
void check_record_layers (boost::shared_ptr<ARDOUR::Region>, ARDOUR::framepos_t);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-12-27 16:10:20 -05:00
|
|
|
virtual void playlist_layered (boost::weak_ptr<ARDOUR::Track>);
|
|
|
|
|
2011-01-30 08:24:41 -05:00
|
|
|
sigc::signal<void, RegionView*> RegionViewAdded;
|
|
|
|
sigc::signal<void> RegionViewRemoved;
|
2012-06-13 16:37:34 -04:00
|
|
|
/** Emitted when the height of regions has changed */
|
|
|
|
sigc::signal<void> ContentsHeightChanged;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
protected:
|
2014-06-22 11:41:05 -04:00
|
|
|
StreamView (RouteTimeAxisView&, ArdourCanvas::Container* canvas_group = 0);
|
2009-10-14 12:10:01 -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();
|
2014-12-17 18:40:38 -05:00
|
|
|
void create_rec_box(framepos_t frame_pos, double width);
|
2006-07-23 08:03:19 -04:00
|
|
|
virtual void setup_rec_box () = 0;
|
2010-10-08 10:54:16 -04:00
|
|
|
virtual void update_rec_box ();
|
2009-10-14 12:10:01 -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
|
|
|
|
2010-04-21 16:42:22 -04:00
|
|
|
void display_track (boost::shared_ptr<ARDOUR::Track>);
|
|
|
|
virtual void undisplay_track ();
|
2006-08-01 13:19:38 -04:00
|
|
|
void diskstream_changed ();
|
2009-02-15 15:31:05 -05:00
|
|
|
void layer_regions ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-04-16 12:32:22 -04:00
|
|
|
void playlist_switched (boost::weak_ptr<ARDOUR::Track>);
|
2009-10-14 12:10:01 -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;
|
2014-06-22 11:41:05 -04:00
|
|
|
ArdourCanvas::Container* _canvas_group;
|
2013-04-15 13:50:05 -04:00
|
|
|
ArdourCanvas::Rectangle* canvas_rect; /* frame around the whole thing */
|
2006-07-23 08:03:19 -04:00
|
|
|
|
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
|
|
|
|
2013-04-12 11:31:50 -04:00
|
|
|
double _samples_per_pixel;
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
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;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-06-09 23:28:32 -04:00
|
|
|
uint32_t region_color; ///< Contained region color
|
|
|
|
uint32_t stream_base_color; ///< Background color
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
PBD::ScopedConnectionList playlist_connections;
|
2010-01-25 15:34:09 -05:00
|
|
|
PBD::ScopedConnection playlist_switched_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;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-05-17 06:41:14 -04:00
|
|
|
double height;
|
2007-05-31 17:37:20 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
PBD::ScopedConnectionList rec_data_ready_connections;
|
2010-12-03 17:26:29 -05:00
|
|
|
framepos_t last_rec_data_frame;
|
2008-12-31 13:44:32 -05:00
|
|
|
|
2010-11-14 10:01:53 -05:00
|
|
|
/* When recording, the session time at which a new layer must be created for the region
|
|
|
|
being recorded, or max_framepos if not applicable.
|
|
|
|
*/
|
|
|
|
framepos_t _new_rec_layer_time;
|
|
|
|
void setup_new_rec_layer_time (boost::shared_ptr<ARDOUR::Region>);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
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
|
|
|
|