diff options
author | David Robillard <d@drobilla.net> | 2009-10-25 21:13:02 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-25 21:13:02 +0000 |
commit | 01b761bbaa1dd7af210b20f47530efe31e9edc76 (patch) | |
tree | 058a2b6432346cc2063015e7accd82dd0dece334 /libs/ardour/beats_frames_converter.cc | |
parent | cd1c58e031e29b83b85d433a90978745adc080c0 (diff) |
Remove Session dependency from BeatsFramesConverter.
More constey TempoMap accessors.
git-svn-id: svn://localhost/ardour2/branches/3.0@5916 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/beats_frames_converter.cc')
-rw-r--r-- | libs/ardour/beats_frames_converter.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/ardour/beats_frames_converter.cc b/libs/ardour/beats_frames_converter.cc index da0f6e4c18..f93e5e7224 100644 --- a/libs/ardour/beats_frames_converter.cc +++ b/libs/ardour/beats_frames_converter.cc @@ -19,9 +19,7 @@ $Id: midiregion.h 733 2006-08-01 17:19:38Z drobilla $ */ -#include "ardour/audioengine.h" #include "ardour/beats_frames_converter.h" -#include "ardour/session.h" #include "ardour/tempo.h" namespace ARDOUR { @@ -30,10 +28,10 @@ sframes_t BeatsFramesConverter::to(double beats) const { // FIXME: assumes tempo never changes after origin - const Tempo& tempo = _session.tempo_map().tempo_at(_origin); + const Tempo& tempo = _tempo_map.tempo_at(_origin); const double frames_per_beat = tempo.frames_per_beat( - _session.engine().frame_rate(), - _session.tempo_map().meter_at(_origin)); + _tempo_map.frame_rate(), + _tempo_map.meter_at(_origin)); return lrint(beats * frames_per_beat); } @@ -42,10 +40,10 @@ double BeatsFramesConverter::from(sframes_t frames) const { // FIXME: assumes tempo never changes after origin - const Tempo& tempo = _session.tempo_map().tempo_at(_origin); + const Tempo& tempo = _tempo_map.tempo_at(_origin); const double frames_per_beat = tempo.frames_per_beat( - _session.engine().frame_rate(), - _session.tempo_map().meter_at(_origin)); + _tempo_map.frame_rate(), + _tempo_map.meter_at(_origin)); return frames / frames_per_beat; } |