ardour
beats_frames_converter.cc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 Paul Davis
3  Author: David Robillard
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
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 
19  $Id: midiregion.h 733 2006-08-01 17:19:38Z drobilla $
20 */
21 
22 #include "pbd/stacktrace.h"
23 
25 #include "ardour/tempo.h"
26 
27 namespace ARDOUR {
28 
35 {
36  if (beats < Evoral::Beats()) {
37  std::cerr << "negative beats passed to BFC: " << beats << std::endl;
38  PBD::stacktrace (std::cerr, 30);
39  return 0;
40  }
42 }
43 
50 {
51  return _tempo_map.framewalk_to_beats (_origin_b, frames);
52 }
53 
56 DoubleBeatsFramesConverter::to (double beats) const
57 {
58  if (beats < 0.0) {
59  std::cerr << "negative beats passed to BFC: " << beats << std::endl;
60  PBD::stacktrace (std::cerr, 30);
61  return 0;
62  }
64 }
65 
67 double
69 {
71 }
72 
73 } /* namespace ARDOUR */
74 
Evoral::Beats framewalk_to_beats(framepos_t pos, framecnt_t distance) const
Definition: tempo.cc:2303
LIBPBD_API void stacktrace(std::ostream &out, int levels=0)
Definition: stacktrace.cc:115
Definition: amp.h:29
framepos_t framepos_plus_beats(framepos_t, Evoral::Beats) const
Definition: tempo.cc:1960
double from(framepos_t frames) const
Evoral::Beats from(framepos_t frames) const
int64_t framepos_t
Definition: types.h:66
framepos_t to(double beats) const
double to_double() const
Definition: Beats.hpp:185
framepos_t to(Evoral::Beats beats) const
int64_t framepos_t