18 #ifndef RAUL_SMF_READER_HPP
19 #define RAUL_SMF_READER_HPP
24 #include "raul/TimeStamp.hpp"
36 class PrematureEOF :
public std::exception {
37 const char* what()
const throw() {
return "Unexpected end of file"; }
39 class CorruptFile :
public std::exception {
40 const char* what()
const throw() {
return "Corrupted file"; }
42 class UnsupportedTime :
public std::exception {
43 const char* what()
const throw() {
return "Unsupported time stamp type (SMPTE)"; }
46 explicit SMFReader(
const std::string filename=
"");
49 bool open(
const std::string& filename)
throw (std::logic_error, UnsupportedTime);
53 uint16_t type()
const {
return _type; }
54 uint16_t ppqn()
const {
return _ppqn; }
55 size_t num_tracks() {
return _num_tracks; }
60 uint32_t* ev_delta_time)
61 throw (std::logic_error, PrematureEOF, CorruptFile);
65 static uint32_t read_var_len(FILE* fd)
throw (PrematureEOF);
71 std::string _filename;
83 #endif // RAUL_SMF_READER_HPP