2007-08-05 17:31:02 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2000-2007 Paul Davis
|
2007-08-05 17:31:02 -04:00
|
|
|
|
|
|
|
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 __ardour_tempo_lines_h__
|
|
|
|
#define __ardour_tempo_lines_h__
|
|
|
|
|
2008-09-23 18:23:39 -04:00
|
|
|
#include <map>
|
|
|
|
#include <boost/pool/pool.hpp>
|
|
|
|
#include <boost/pool/pool_alloc.hpp>
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/tempo.h"
|
2007-08-05 17:31:02 -04:00
|
|
|
#include "canvas.h"
|
|
|
|
#include "simpleline.h"
|
|
|
|
|
2008-09-23 18:23:39 -04:00
|
|
|
typedef boost::fast_pool_allocator<
|
2008-12-30 12:51:21 -05:00
|
|
|
std::pair<const double, ArdourCanvas::SimpleLine*>,
|
2008-09-23 18:23:39 -04:00
|
|
|
boost::default_user_allocator_new_delete,
|
|
|
|
boost::details::pool::null_mutex,
|
|
|
|
8192>
|
|
|
|
MapAllocator;
|
|
|
|
|
2007-08-05 17:31:02 -04:00
|
|
|
class TempoLines {
|
|
|
|
public:
|
2008-10-14 09:35:17 -04:00
|
|
|
TempoLines(ArdourCanvas::Canvas& canvas, ArdourCanvas::Group* group, double screen_height);
|
2008-09-23 18:23:39 -04:00
|
|
|
|
|
|
|
void tempo_map_changed();
|
2007-08-05 17:31:02 -04:00
|
|
|
|
2012-01-03 13:43:58 -05:00
|
|
|
void draw(const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
|
|
|
|
const ARDOUR::TempoMap::BBTPointList::const_iterator& end,
|
|
|
|
double frames_per_unit);
|
2008-09-23 18:23:39 -04:00
|
|
|
|
|
|
|
void show();
|
2007-08-05 17:31:02 -04:00
|
|
|
void hide();
|
|
|
|
|
|
|
|
private:
|
2008-09-23 18:23:39 -04:00
|
|
|
typedef std::map<double, ArdourCanvas::SimpleLine*, std::less<double>, MapAllocator> Lines;
|
|
|
|
Lines _lines;
|
2007-08-05 17:31:02 -04:00
|
|
|
|
|
|
|
ArdourCanvas::Canvas& _canvas;
|
|
|
|
ArdourCanvas::Group* _group;
|
2008-09-23 18:23:39 -04:00
|
|
|
double _clean_left;
|
|
|
|
double _clean_right;
|
2008-10-14 09:35:17 -04:00
|
|
|
double _height;
|
2007-08-05 17:31:02 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_tempo_lines_h__ */
|