2007-08-17 13:25:20 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2007 Paul Davis
|
2011-04-06 11:00:16 -04:00
|
|
|
Author: David Robillard
|
2007-08-17 13:25:20 -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 __gtk_ardour_automation_region_view_h__
|
|
|
|
#define __gtk_ardour_automation_region_view_h__
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/types.h"
|
2007-08-17 13:25:20 -04:00
|
|
|
|
|
|
|
#include "region_view.h"
|
|
|
|
#include "automation_time_axis.h"
|
|
|
|
#include "automation_line.h"
|
|
|
|
#include "enums.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class AutomationList;
|
2008-09-19 02:30:49 -04:00
|
|
|
class Parameter;
|
2007-08-17 13:25:20 -04:00
|
|
|
};
|
|
|
|
|
2008-02-10 13:16:25 -05:00
|
|
|
class TimeAxisView;
|
2007-08-17 13:25:20 -04:00
|
|
|
|
|
|
|
class AutomationRegionView : public RegionView
|
|
|
|
{
|
|
|
|
public:
|
2014-06-22 11:41:05 -04:00
|
|
|
AutomationRegionView(ArdourCanvas::Container*,
|
2009-07-09 13:58:13 -04:00
|
|
|
AutomationTimeAxisView&,
|
2007-08-17 13:25:20 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Region>,
|
2008-09-29 18:47:40 -04:00
|
|
|
const Evoral::Parameter& parameter,
|
2007-08-17 13:25:20 -04:00
|
|
|
boost::shared_ptr<ARDOUR::AutomationList>,
|
2013-04-12 11:31:50 -04:00
|
|
|
double initial_samples_per_pixel,
|
2014-06-09 23:28:32 -04:00
|
|
|
uint32_t basic_color);
|
2007-08-17 13:25:20 -04:00
|
|
|
|
2011-07-10 11:28:36 -04:00
|
|
|
~AutomationRegionView();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-06-09 23:28:32 -04:00
|
|
|
void init (bool wfd);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-11-16 17:04:27 -05:00
|
|
|
bool paste (framepos_t pos,
|
|
|
|
unsigned paste_count,
|
|
|
|
float times,
|
|
|
|
boost::shared_ptr<const ARDOUR::AutomationList> slist);
|
|
|
|
|
2014-11-22 04:05:42 -05:00
|
|
|
ARDOUR::DoubleBeatsFramesConverter const & region_relative_time_converter () const {
|
2014-11-20 17:36:09 -05:00
|
|
|
return _region_relative_time_converter;
|
|
|
|
}
|
|
|
|
|
2014-11-22 04:05:42 -05:00
|
|
|
ARDOUR::DoubleBeatsFramesConverter const & source_relative_time_converter () const {
|
2014-11-20 17:36:09 -05:00
|
|
|
return _source_relative_time_converter;
|
|
|
|
}
|
|
|
|
|
2009-07-09 13:58:13 -04:00
|
|
|
inline AutomationTimeAxisView* automation_view() const
|
|
|
|
{ return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-09-10 23:14:32 -04:00
|
|
|
boost::shared_ptr<AutomationLine> line() { return _line; }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-08-17 13:25:20 -04:00
|
|
|
// We are a ghost. Meta ghosts? Crazy talk.
|
2014-01-10 10:55:43 -05:00
|
|
|
virtual GhostRegion* add_ghost(TimeAxisView&) { return 0; }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-09-19 02:30:49 -04:00
|
|
|
void set_height (double);
|
2007-09-05 22:30:39 -04:00
|
|
|
void reset_width_dependent_items(double pixel_width);
|
2007-08-17 13:25:20 -04:00
|
|
|
|
|
|
|
protected:
|
2008-09-19 02:30:49 -04:00
|
|
|
void create_line(boost::shared_ptr<ARDOUR::AutomationList> list);
|
2010-09-17 14:20:37 -04:00
|
|
|
bool set_position(framepos_t pos, void* src, double* ignored);
|
2010-02-19 13:09:08 -05:00
|
|
|
void region_resized (const PBD::PropertyChange&);
|
2014-11-15 02:58:39 -05:00
|
|
|
bool canvas_group_event(GdkEvent* ev);
|
|
|
|
void add_automation_event (GdkEvent* event, framepos_t when, double y, bool with_guard_points);
|
2014-12-08 23:00:00 -05:00
|
|
|
void entered();
|
2007-08-17 13:25:20 -04:00
|
|
|
void exited();
|
|
|
|
|
|
|
|
private:
|
2014-11-22 04:05:42 -05:00
|
|
|
ARDOUR::DoubleBeatsFramesConverter _region_relative_time_converter;
|
|
|
|
ARDOUR::DoubleBeatsFramesConverter _source_relative_time_converter;
|
|
|
|
Evoral::Parameter _parameter;
|
|
|
|
boost::shared_ptr<AutomationLine> _line;
|
2007-08-17 13:25:20 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __gtk_ardour_automation_region_view_h__ */
|