18 #ifndef RAUL_SMF_READER_HPP
19 #define RAUL_SMF_READER_HPP
24 #include <raul/TimeStamp.hpp>
35 class PrematureEOF :
public std::exception {
36 const char* what()
const throw() {
return "Unexpected end of file"; }
38 class CorruptFile :
public std::exception {
39 const char* what()
const throw() {
return "Corrupted file"; }
41 class UnsupportedTime :
public std::exception {
42 const char* what()
const throw() {
return "Unsupported time stamp type (SMPTE)"; }
48 bool open(
const std::string& filename)
throw (std::logic_error, UnsupportedTime);
50 bool seek_to_track(
unsigned track)
throw (std::logic_error);
52 uint16_t type()
const {
return _type; }
53 uint16_t ppqn()
const {
return _ppqn; }
54 size_t num_tracks() {
return _num_tracks; }
56 int read_event(
size_t buf_len,
59 uint32_t* ev_delta_time)
60 throw (std::logic_error, PrematureEOF, CorruptFile);
64 static uint32_t read_var_len(FILE* fd)
throw (PrematureEOF);
70 std::string _filename;
82 #endif // RAUL_SMF_READER_HPP
Standard Midi File (Type 0) Reader.
Definition: SMFReader.hpp:33
static const uint32_t HEADER_SIZE
size of SMF header, including MTrk chunk header
Definition: SMFReader.hpp:68