2 * Copyright (C) 2016-2017 Nick Mainsbridge <mainsbridge@gmail.com>
3 * Copyright (C) 2017-2019 Robin Gareus <robin@gareus.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef __gtk_ardour_tempo_curve_h__
21 #define __gtk_ardour_tempo_curve_h__
26 #include <sigc++/signal.h>
28 #include "ardour/ardour.h"
29 #include "pbd/signals.h"
31 #include "canvas/types.h"
32 #include "canvas/framed_curve.h"
33 #include "canvas/text.h"
40 class TempoCurve : public sigc::trackable
43 TempoCurve (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, ARDOUR::TempoSection& temp, samplepos_t sample, bool handle_events);
46 static PBD::Signal1<void,TempoCurve*> CatchDeletion;
48 static void setup_sizes (const double timebar_height);
50 ArdourCanvas::Item& the_item() const;
51 void canvas_height_set (double);
53 void set_position (samplepos_t lower, samplepos_t upper);
54 void set_color_rgba (uint32_t rgba);
55 samplepos_t position() const { return sample_position; }
57 ArdourCanvas::Container* get_parent() { return _parent; }
58 void reparent (ArdourCanvas::Container& parent);
63 ARDOUR::TempoSection& tempo () const { return _tempo; }
65 void set_max_tempo (const double& max) { _max_tempo = max; }
66 void set_min_tempo (const double& min) { _min_tempo = min; }
71 ArdourCanvas::Container* _parent;
72 ArdourCanvas::Container* group;
73 ArdourCanvas::Points* points;
74 ArdourCanvas::FramedCurve* _curve;
77 samplepos_t sample_position;
78 samplepos_t _end_sample;
80 double _canvas_height;
86 /* disallow copy construction */
87 TempoCurve (TempoCurve const &);
89 TempoCurve & operator= (TempoCurve const &);
94 ARDOUR::TempoSection& _tempo;
95 ArdourCanvas::Text* _start_text;
96 ArdourCanvas::Text* _end_text;
98 #endif /* __gtk_ardour_tempo_curve_h__ */