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>
|
|
|
|
|
|
|
|
#include <ardour/location.h>
|
|
|
|
#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;
|
2006-10-21 15:01:50 -04:00
|
|
|
nframes_t start;
|
|
|
|
nframes_t length;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class PublicEditor;
|
|
|
|
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
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
RouteTimeAxisView& trackview() { 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
|
|
|
|
2007-05-17 06:41:14 -04:00
|
|
|
void set_layer_display (LayerDisplay);
|
|
|
|
|
2005-11-23 12:21:12 -05:00
|
|
|
ArdourCanvas::Item* 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&);
|
2006-10-21 15:01:50 -04:00
|
|
|
void get_selectables (nframes_t start, nframes_t end, list<Selectable* >&);
|
2006-07-23 08:03:19 -04:00
|
|
|
void get_inverted_selectables (Selection&, list<Selectable* >& results);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-29 17:21:48 -04:00
|
|
|
void add_region_view (boost::shared_ptr<ARDOUR::Region>);
|
2006-07-23 08:03:19 -04:00
|
|
|
void region_layered (RegionView*);
|
|
|
|
|
|
|
|
sigc::signal<void,RegionView*> RegionViewAdded;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
protected:
|
|
|
|
StreamView (RouteTimeAxisView&);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
//private: (FIXME?)
|
|
|
|
|
|
|
|
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 ();
|
2007-05-31 17:37:20 -04:00
|
|
|
//virtual void update_rec_regions () = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
virtual RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves) = 0;
|
2006-10-21 15:01:50 -04:00
|
|
|
virtual void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
|
2006-09-18 23:29:16 -04:00
|
|
|
//void remove_rec_region (boost::shared_ptr<ARDOUR::Region>); (unused)
|
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 ();
|
|
|
|
virtual void redisplay_diskstream () = 0;
|
2006-08-01 13:19:38 -04:00
|
|
|
void diskstream_changed ();
|
2006-07-29 23:25:38 -04:00
|
|
|
|
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
|
|
|
|
2007-05-17 06:41:14 -04:00
|
|
|
virtual void update_contents_y_position_and_height ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
RouteTimeAxisView& _trackview;
|
2006-07-23 08:03:19 -04:00
|
|
|
ArdourCanvas::Group* canvas_group;
|
|
|
|
ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
|
|
|
|
|
|
|
|
typedef 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;
|
|
|
|
vector<RecBoxInfo> rec_rects;
|
2007-05-31 17:37:20 -04:00
|
|
|
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
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
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
|
|
|
|
|
|
|
int layers;
|
|
|
|
double height;
|
|
|
|
LayerDisplay layer_display;
|
2007-05-31 17:37:20 -04:00
|
|
|
|
|
|
|
list<sigc::connection> rec_data_ready_connections;
|
|
|
|
jack_nframes_t last_rec_data_frame;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_streamview_h__ */
|
2006-07-23 08:03:19 -04:00
|
|
|
|