Ardour  9.0-pre0-582-g084a23a80d
tempo_curve.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2017 Nick Mainsbridge <mainsbridge@gmail.com>
3  * Copyright (C) 2017-2019 Robin Gareus <robin@gareus.org>
4  *
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.
9  *
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.
14  *
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.
18  */
19 
20 #pragma once
21 
22 #include <string>
23 #include <glib.h>
24 
25 #include <sigc++/signal.h>
26 
27 #include "ardour/ardour.h"
28 #include "pbd/signals.h"
29 
30 #include "canvas/container.h"
31 #include "canvas/types.h"
32 #include "canvas/framed_curve.h"
33 #include "canvas/text.h"
34 
35 namespace Temporal {
36  class TempoPoint;
37 }
38 class PublicEditor;
39 
40 class TempoCurve : public sigc::trackable
41 {
42 public:
43  TempoCurve (PublicEditor& editor, ArdourCanvas::Item &, guint32 rgba, Temporal::TempoPoint const & temp, bool handle_events , ArdourCanvas::Distance marker_width);
45 
47 
48  static void setup_sizes (const double timebar_height);
49 
51 
53  void set_color_rgba (uint32_t rgba);
54 
55  void hide ();
56  void show ();
57 
58  Temporal::TempoPoint const & tempo () const { return *_tempo; }
60 
61  void update_range (double min, double max) { _max_tempo = max; _min_tempo = min; }
62 
63  static void format_tempo (double ntpm, int nt, char*, size_t);
64 
65 protected:
67 
72 
75  uint32_t _color;
76 
77  void reposition ();
78 
79 private:
80  /* disallow copy construction */
82 
84 
85  double _min_tempo;
86  double _max_tempo;
87 
91 };
Representation of the interface of the Editor class.
double _max_tempo
Definition: tempo_curve.h:86
void set_duration(ARDOUR::samplecnt_t duration)
ArdourCanvas::Points points
Definition: tempo_curve.h:70
void reset_point(Temporal::TempoPoint const &)
static PBD::Signal< void(TempoCurve *)> CatchDeletion
Definition: tempo_curve.h:46
Temporal::TempoPoint const & tempo() const
Definition: tempo_curve.h:58
Temporal::TempoPoint const * _tempo
Definition: tempo_curve.h:88
ArdourCanvas::Container * group
Definition: tempo_curve.h:69
ArdourCanvas::Item & the_item() const
void set_color_rgba(uint32_t rgba)
static void setup_sizes(const double timebar_height)
ArdourCanvas::Text * _start_text
Definition: tempo_curve.h:89
ArdourCanvas::FramedCurve * _curve
Definition: tempo_curve.h:71
TempoCurve(PublicEditor &editor, ArdourCanvas::Item &, guint32 rgba, Temporal::TempoPoint const &temp, bool handle_events, ArdourCanvas::Distance marker_width)
ArdourCanvas::Text * _end_text
Definition: tempo_curve.h:90
uint32_t _color
Definition: tempo_curve.h:75
void update_range(double min, double max)
Definition: tempo_curve.h:61
void reposition()
double _min_tempo
Definition: tempo_curve.h:85
void hide()
ArdourCanvas::Distance _marker_width
Definition: tempo_curve.h:74
void show()
ARDOUR::samplecnt_t _duration
Definition: tempo_curve.h:73
static void format_tempo(double ntpm, int nt, char *, size_t)
ArdourCanvas::Item * _parent
Definition: tempo_curve.h:68
PublicEditor & editor
Definition: tempo_curve.h:66
TempoCurve & operator=(TempoCurve const &)
TempoCurve(TempoCurve const &)
Temporal::samplecnt_t samplecnt_t
std::vector< Duple > Points