diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-09-14 16:01:32 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-09-14 16:01:32 +0000 |
commit | bf0a99f0c0a8f76725fba89d076010009c4cdcb0 (patch) | |
tree | 128afdd123424872c922260a8f180912ff996431 /libs/evoral/src/SMF.cpp | |
parent | 3023d53d7d3f6dd726bcd07b0ebec8d7cfc2948d (diff) |
fix up marshall/unmarshall of note data for MidiModel::DiffCommand
git-svn-id: svn://localhost/ardour2/branches/3.0@5662 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/src/SMF.cpp')
-rw-r--r-- | libs/evoral/src/SMF.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp index 372c37c0bb..2103ad8eae 100644 --- a/libs/evoral/src/SMF.cpp +++ b/libs/evoral/src/SMF.cpp @@ -19,6 +19,7 @@ #define __STDC_LIMIT_MACROS 1 #include <cassert> +#include <cmath> #include <iostream> #include <stdint.h> #include "libsmf/smf.h" @@ -262,5 +263,13 @@ SMF::end_write() THROW_FILE_ERROR throw FileError(); } +double +SMF::round_to_file_precision (double val) const +{ + double div = ppqn(); + + return round (val * div) / div; +} + } // namespace Evoral |