diff options
author | David Robillard <d@drobilla.net> | 2009-02-14 22:23:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-14 22:23:40 +0000 |
commit | cdbb1f898e5bbdac23037c1c8ca03dc51333df04 (patch) | |
tree | 612dc1ab33d05f55777ef5b7b7e938b3e01146e7 /libs | |
parent | 8249cfb6a7335c6f2729bbfcf80948827936db3a (diff) |
Update for libsmf API changes.
git-svn-id: svn://localhost/ardour2/branches/3.0@4561 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/evoral/evoral/SMF.hpp | 2 | ||||
-rw-r--r-- | libs/evoral/src/SMF.cpp | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/libs/evoral/evoral/SMF.hpp b/libs/evoral/evoral/SMF.hpp index 5f91f12bb6..59f9448b4e 100644 --- a/libs/evoral/evoral/SMF.hpp +++ b/libs/evoral/evoral/SMF.hpp @@ -47,7 +47,7 @@ public: virtual ~SMF(); int open(const std::string& path, int track=1) THROW_FILE_ERROR; - int create(const std::string& path, int track=1, int ppqn=19200) THROW_FILE_ERROR; + int create(const std::string& path, int track=1, uint16_t ppqn=19200) THROW_FILE_ERROR; void close() THROW_FILE_ERROR; const std::string& path() const { return _path; }; diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp index e190423c45..2b47cbfe4b 100644 --- a/libs/evoral/src/SMF.cpp +++ b/libs/evoral/src/SMF.cpp @@ -50,8 +50,7 @@ template<typename Time> uint16_t SMF<Time>::ppqn() const { - assert(_smf->ppqn >= 0 && _smf->ppqn <= UINT16_MAX); - return (uint16_t)_smf->ppqn; + return _smf->ppqn; } /** Seek to the specified track (1-based indexing) @@ -63,7 +62,7 @@ SMF<Time>::seek_to_track(int track) { _smf_track = smf_get_track_by_number(_smf, track); if (_smf_track != NULL) { - _smf_track->next_event_number = (_smf_track->number_of_events == 0) ? -1 : 1; + _smf_track->next_event_number = (_smf_track->number_of_events == 0) ? 0 : 1; return 0; } else { return -1; @@ -97,7 +96,7 @@ SMF<Time>::open(const std::string& path, int track) THROW_FILE_ERROR cerr << "Track " << track << " # events: " << _smf_track->number_of_events << endl; if (_smf_track->number_of_events == 0) { - _smf_track->next_event_number = -1; + _smf_track->next_event_number = 0; _empty = true; } else { _smf_track->next_event_number = 1; @@ -116,7 +115,7 @@ SMF<Time>::open(const std::string& path, int track) THROW_FILE_ERROR */ template<typename Time> int -SMF<Time>::create(const std::string& path, int track, int ppqn) THROW_FILE_ERROR +SMF<Time>::create(const std::string& path, int track, uint16_t ppqn) THROW_FILE_ERROR { assert(track >= 1); if (_smf) { @@ -144,7 +143,7 @@ SMF<Time>::create(const std::string& path, int track, int ppqn) THROW_FILE_ERROR if (!_smf_track) return -2; - _smf_track->next_event_number = -1; + _smf_track->next_event_number = 0; _empty = true; return 0; |