Tweaks to Mixer and Monitor keybindings:
[ardour.git] / gtk2_ardour / tempo_lines.h
1 /*
2     Copyright (C) 2000-2007 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #ifndef __ardour_tempo_lines_h__
20 #define __ardour_tempo_lines_h__
21
22 #include "ardour/beats_samples_converter.h"
23 #include "ardour/tempo.h"
24
25 #include "canvas/line_set.h"
26
27 class TempoLines {
28 public:
29         TempoLines (ArdourCanvas::Container* group, double screen_height, ARDOUR::BeatsSamplesConverter* bfc);
30         ~TempoLines ();
31
32         void tempo_map_changed(samplepos_t new_origin);
33
34         void draw (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
35                    unsigned                                              divisions,
36                    ARDOUR::samplecnt_t                                    leftmost_sample,
37                    ARDOUR::samplecnt_t                                    sample_rate);
38
39         void show();
40         void hide();
41
42 private:
43         void draw_ticks (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
44                          unsigned                                              divisions,
45                          ARDOUR::samplecnt_t                                    leftmost_sample,
46                          ARDOUR::samplecnt_t                                    sample_rate);
47
48         ArdourCanvas::LineSet lines;
49         ARDOUR::BeatsSamplesConverter* _bfc;
50 };
51
52 #endif /* __ardour_tempo_lines_h__ */