--- linuxsampler/trunk/src/engines/sfz/sfz.h 2022/01/03 15:10:25 4015 +++ linuxsampler/trunk/src/engines/sfz/sfz.h 2022/01/03 15:36:02 4016 @@ -702,6 +702,23 @@ /// Returns a pointer to the instrument object Instrument* GetInstrument(); + /// Returns true if file was modified since last call + bool checkFileModified(std::string filename = ""); + + protected: + struct Time { + intmax_t sec; + uint32_t nsec; + + bool operator==(const Time& o) const { + return sec == o.sec && nsec == o.nsec; + } + + bool operator!=(const Time& o) const { + return !(*this == o); + } + }; + private: void push_header(std::string token); void push_opcode(std::string token); @@ -737,6 +754,11 @@ std::string default_path; int octave_offset; int note_offset; + + /// to detect when files were modified (e.g. by some external app) + std::map mod_times; + + static optional getModTimeOfFile(std::string filename); }; } // !namespace sfz