#pragma once #include #include #include #include #include namespace pangolin { class Params; class PlaybackSession { public: // Singleton Instance static std::shared_ptr Default(); // Return thread-safe, shared instance of PacketStreamReader, providing // serialised read for PacketStreamReader std::shared_ptr Open(const std::string& filename) { const std::string path = SanitizePath(PathExpand(filename)); auto i = readers.find(path); if(i == readers.end()) { auto psr = std::make_shared(path); readers[path] = psr; return psr; }else{ return i->second; } } SyncTime& Time() { return time; } static std::shared_ptr ChooseFromParams(const Params& params); private: std::map> readers; SyncTime time; }; }