2007-07-06 23:19:04 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2012-2014 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2007-07-06 23:19:04 -04:00
|
|
|
|
|
|
|
#ifndef __ardour_control_point_h__
|
|
|
|
#define __ardour_control_point_h__
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2013-04-04 00:32:52 -04:00
|
|
|
#include <gdk/gdkevents.h>
|
2007-07-06 23:19:04 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/automation_list.h"
|
2007-07-06 23:19:04 -04:00
|
|
|
|
2010-08-10 21:23:03 -04:00
|
|
|
#include "selectable.h"
|
2007-07-06 23:19:04 -04:00
|
|
|
|
|
|
|
class AutomationLine;
|
|
|
|
class ControlPoint;
|
|
|
|
class PointSelection;
|
|
|
|
class TimeAxisView;
|
|
|
|
class AutomationTimeAxisView;
|
|
|
|
class Selectable;
|
|
|
|
class Selection;
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
namespace ArdourCanvas {
|
|
|
|
class Rectangle;
|
|
|
|
class Diamond;
|
2014-06-26 15:04:22 -04:00
|
|
|
class Item;
|
2007-07-06 23:19:04 -04:00
|
|
|
}
|
|
|
|
|
2010-08-10 21:23:03 -04:00
|
|
|
class ControlPoint : public Selectable
|
2007-07-06 23:19:04 -04:00
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2007-07-06 23:19:04 -04:00
|
|
|
ControlPoint (AutomationLine& al);
|
|
|
|
ControlPoint (const ControlPoint&, bool dummy_arg_to_force_special_copy_constructor);
|
|
|
|
virtual ~ControlPoint ();
|
|
|
|
|
|
|
|
enum ShapeType {
|
|
|
|
Full,
|
|
|
|
Start,
|
|
|
|
End
|
|
|
|
};
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2022-10-25 13:10:32 -04:00
|
|
|
void move_to (double x, double y);
|
2007-07-06 23:19:04 -04:00
|
|
|
void move_to (double x, double y, ShapeType);
|
|
|
|
void reset (double x, double y, ARDOUR::AutomationList::iterator, uint32_t, ShapeType);
|
|
|
|
double get_x() const { return _x; }
|
|
|
|
double get_y() const { return _y; }
|
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
void hide ();
|
2007-07-06 23:19:04 -04:00
|
|
|
void show ();
|
2013-12-31 11:55:30 -05:00
|
|
|
bool visible () const;
|
2007-07-06 23:19:04 -04:00
|
|
|
|
2010-01-04 22:15:28 -05:00
|
|
|
double size () const {
|
|
|
|
return _size;
|
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2007-07-06 23:19:04 -04:00
|
|
|
void set_size (double);
|
2013-12-31 11:55:30 -05:00
|
|
|
void set_color ();
|
2007-07-06 23:19:04 -04:00
|
|
|
|
|
|
|
bool can_slide() const { return _can_slide; }
|
|
|
|
void set_can_slide(bool yn) { _can_slide = yn; }
|
|
|
|
uint32_t view_index() const { return _view_index; }
|
|
|
|
void set_view_index(uint32_t i) { _view_index = i; }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-06-26 15:04:22 -04:00
|
|
|
ArdourCanvas::Item& item() const;
|
2010-01-02 19:08:58 -05:00
|
|
|
|
2020-05-19 19:02:36 -04:00
|
|
|
/* used from ~AutomationLine */
|
|
|
|
void unset_item () { _item = 0 ; }
|
|
|
|
|
2007-07-06 23:19:04 -04:00
|
|
|
ARDOUR::AutomationList::iterator model() const { return _model; }
|
|
|
|
AutomationLine& line() const { return _line; }
|
|
|
|
|
2012-04-22 10:03:07 -04:00
|
|
|
static PBD::Signal1<void, ControlPoint *> CatchDeletion;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
private:
|
2013-04-04 00:32:52 -04:00
|
|
|
ArdourCanvas::Rectangle* _item;
|
2012-04-05 12:53:55 -04:00
|
|
|
AutomationLine& _line;
|
2007-07-06 23:19:04 -04:00
|
|
|
ARDOUR::AutomationList::iterator _model;
|
2012-04-05 12:53:55 -04:00
|
|
|
uint32_t _view_index;
|
|
|
|
bool _can_slide;
|
|
|
|
double _x;
|
|
|
|
double _y;
|
|
|
|
double _size;
|
|
|
|
ShapeType _shape;
|
2007-07-06 23:19:04 -04:00
|
|
|
|
|
|
|
virtual bool event_handler (GdkEvent*);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __ardour_control_point_h__ */
|
|
|
|
|