#ifndef EVORAL_SMF_HPP
#define EVORAL_SMF_HPP
-#include <string>
-#include "evoral/types.hpp"
+#include "evoral/MIDIFile.hpp"
namespace Evoral {
/** Standard Midi File (Type 0)
*/
template<typename Time>
-class SMF {
+class SMF : public MIDIFile<Time> {
public:
SMF();
virtual ~SMF();
Time last_event_time() const { return _last_ev_time; }
- void begin_write(FrameTime start_time);
- void append_event_unlocked(uint32_t delta_t, const Event<Time>& ev);
- void end_write();
+ void begin_write();
+ void append_event_delta(uint32_t delta_t, const Event<Time>& ev);
+ void end_write() THROW_FILE_ERROR;
void flush();
int flush_header();
int flush_footer();
protected:
- int open(const std::string& path);
- void close();
+ int open(const std::string& path) THROW_FILE_ERROR;
+ void close() THROW_FILE_ERROR;
int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf) const;