diff options
author | David Robillard <d@drobilla.net> | 2009-02-14 20:52:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-14 20:52:15 +0000 |
commit | 80e54c6ea05d35465f50f84897f113e0a48b7afd (patch) | |
tree | 8a70fa384c75569291c0a96bb6c27ffb57189fee /libs/evoral/evoral/SMF.hpp | |
parent | b0091c899bfc868de6a19af2f0cc74abca7fe173 (diff) |
MIDI robustness.
- Separate SMF::open and SMF::create, more powerful interface for both.
- Correctly handle note ons with velocity 0 as note offs in sequence.
- Use SMF (i.e. libsmf) for MIDI import
git-svn-id: svn://localhost/ardour2/branches/3.0@4558 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/evoral/SMF.hpp')
-rw-r--r-- | libs/evoral/evoral/SMF.hpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libs/evoral/evoral/SMF.hpp b/libs/evoral/evoral/SMF.hpp index c2760d9df5..5f91f12bb6 100644 --- a/libs/evoral/evoral/SMF.hpp +++ b/libs/evoral/evoral/SMF.hpp @@ -46,14 +46,21 @@ public: SMF() : _last_ev_time(0), _smf(0), _smf_track(0), _empty(true) {}; virtual ~SMF(); - int open(const std::string& path, bool create=true, int track=1) THROW_FILE_ERROR; + 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; void close() THROW_FILE_ERROR; + + const std::string& path() const { return _path; }; void seek_to_start() const; + int seek_to_track(int track); + + int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf) const; - uint16_t ppqn() const { return _ppqn; } - bool is_empty() const { return _empty; } - bool eof() const { assert(false); return true; } + uint16_t num_tracks() const; + uint16_t ppqn() const; + bool is_empty() const { return _empty; } + bool eof() const { assert(false); return true; } Time last_event_time() const { return _last_ev_time; } @@ -62,11 +69,6 @@ public: void end_write() THROW_FILE_ERROR; void flush() {}; - int flush_header() { return 0; } - int flush_footer() { return 0; } - -protected: - int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf) const; private: static const uint16_t _ppqn = 19200; |