diff --git a/src/MediaServer/DirectoryWatcher.cpp b/src/MediaServer/DirectoryWatcher.cpp index 661792c..b8d4199 100644 --- a/src/MediaServer/DirectoryWatcher.cpp +++ b/src/MediaServer/DirectoryWatcher.cpp @@ -9,15 +9,20 @@ #include "DirectoryWatcher.h" namespace ofx { -namespace piMapper { -DirectoryWatcher::DirectoryWatcher(std::string path, bool video) { - if (video) { - filter = CustomVideoPathFilter(); - } else { - filter = CustomImagePathFilter(); - } - dirWatcher.registerAllEvents(this); - dirWatcher.addPath(path, true, &filter); -} -} -} \ No newline at end of file + namespace piMapper { + DirectoryWatcher::DirectoryWatcher(std::string path, bool video) { + if (video) { + filter = CustomVideoPathFilter(); + } else { + filter = CustomImagePathFilter(); + } + dirWatcher.registerAllEvents(this); + dirWatcher.addPath(path, true, &filter); + } + + std::vector& DirectoryWatcher::getFilePaths() { + return filePaths; + } + + } // namespace piMapper +} // namespace ifx \ No newline at end of file diff --git a/src/MediaServer/DirectoryWatcher.h b/src/MediaServer/DirectoryWatcher.h index 121ea5c..47e6b27 100644 --- a/src/MediaServer/DirectoryWatcher.h +++ b/src/MediaServer/DirectoryWatcher.h @@ -99,7 +99,8 @@ class DirectoryWatcher { << "Error: " << exc.displayText(); } - std::vector filePaths; + // Getters + std::vector& getFilePaths(); // Custom events ofEvent onItemAdded; @@ -111,6 +112,7 @@ class DirectoryWatcher { private: ofx::IO::DirectoryWatcherManager dirWatcher; CustomPathFilter filter; + std::vector filePaths; }; } } \ No newline at end of file