702 |
/// Returns a pointer to the instrument object |
/// Returns a pointer to the instrument object |
703 |
Instrument* GetInstrument(); |
Instrument* GetInstrument(); |
704 |
|
|
705 |
|
/// Returns true if file was modified since last call |
706 |
|
bool checkFileModified(std::string filename = ""); |
707 |
|
|
708 |
|
protected: |
709 |
|
struct Time { |
710 |
|
intmax_t sec; |
711 |
|
uint32_t nsec; |
712 |
|
|
713 |
|
bool operator==(const Time& o) const { |
714 |
|
return sec == o.sec && nsec == o.nsec; |
715 |
|
} |
716 |
|
|
717 |
|
bool operator!=(const Time& o) const { |
718 |
|
return !(*this == o); |
719 |
|
} |
720 |
|
}; |
721 |
|
|
722 |
private: |
private: |
723 |
void push_header(std::string token); |
void push_header(std::string token); |
724 |
void push_opcode(std::string token); |
void push_opcode(std::string token); |
754 |
std::string default_path; |
std::string default_path; |
755 |
int octave_offset; |
int octave_offset; |
756 |
int note_offset; |
int note_offset; |
757 |
|
|
758 |
|
/// to detect when files were modified (e.g. by some external app) |
759 |
|
std::map<std::string,Time> mod_times; |
760 |
|
|
761 |
|
static optional<File::Time> getModTimeOfFile(std::string filename); |
762 |
}; |
}; |
763 |
|
|
764 |
} // !namespace sfz |
} // !namespace sfz |