2007-08-17 13:25:20 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2007 Paul Davis
|
2007-08-17 13:25:20 -04:00
|
|
|
Author: Dave Robillard
|
|
|
|
|
|
|
|
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"
|
|
|
|
#include "canvas.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:
|
|
|
|
AutomationRegionView(ArdourCanvas::Group*,
|
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>,
|
|
|
|
double initial_samples_per_unit,
|
2009-06-08 15:28:51 -04:00
|
|
|
Gdk::Color const & basic_color);
|
2007-08-17 13:25:20 -04:00
|
|
|
|
|
|
|
~AutomationRegionView() {}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-08 15:28:51 -04:00
|
|
|
void init (Gdk::Color const & basic_color, bool wfd);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
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.
|
2009-07-09 13:58:13 -04:00
|
|
|
virtual GhostRegion* add_ghost(TimeAxisView&) { return NULL; }
|
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&);
|
2007-09-03 12:12:07 -04:00
|
|
|
bool canvas_event(GdkEvent* ev);
|
2010-12-03 17:26:29 -05:00
|
|
|
void add_automation_event (GdkEvent* event, framepos_t when, double y);
|
2010-07-16 17:12:06 -04:00
|
|
|
void entered (bool);
|
2007-08-17 13:25:20 -04:00
|
|
|
void exited();
|
|
|
|
|
|
|
|
private:
|
2008-09-29 18:47:40 -04:00
|
|
|
Evoral::Parameter _parameter;
|
2007-09-10 23:14:32 -04:00
|
|
|
boost::shared_ptr<AutomationLine> _line;
|
2007-08-17 13:25:20 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __gtk_ardour_automation_region_view_h__ */
|