Browse Source

Make filePaths vector private and create a public getter method for it

master
Krisjanis Rijnieks 11 years ago
parent
commit
1a8f527f57
  1. 29
      src/MediaServer/DirectoryWatcher.cpp
  2. 4
      src/MediaServer/DirectoryWatcher.h

29
src/MediaServer/DirectoryWatcher.cpp

@ -9,15 +9,20 @@
#include "DirectoryWatcher.h" #include "DirectoryWatcher.h"
namespace ofx { namespace ofx {
namespace piMapper { namespace piMapper {
DirectoryWatcher::DirectoryWatcher(std::string path, bool video) { DirectoryWatcher::DirectoryWatcher(std::string path, bool video) {
if (video) { if (video) {
filter = CustomVideoPathFilter(); filter = CustomVideoPathFilter();
} else { } else {
filter = CustomImagePathFilter(); filter = CustomImagePathFilter();
} }
dirWatcher.registerAllEvents(this); dirWatcher.registerAllEvents(this);
dirWatcher.addPath(path, true, &filter); dirWatcher.addPath(path, true, &filter);
} }
}
} std::vector<std::string>& DirectoryWatcher::getFilePaths() {
return filePaths;
}
} // namespace piMapper
} // namespace ifx

4
src/MediaServer/DirectoryWatcher.h

@ -99,7 +99,8 @@ class DirectoryWatcher {
<< "Error: " << exc.displayText(); << "Error: " << exc.displayText();
} }
std::vector<std::string> filePaths; // Getters
std::vector<std::string>& getFilePaths();
// Custom events // Custom events
ofEvent<string> onItemAdded; ofEvent<string> onItemAdded;
@ -111,6 +112,7 @@ class DirectoryWatcher {
private: private:
ofx::IO::DirectoryWatcherManager dirWatcher; ofx::IO::DirectoryWatcherManager dirWatcher;
CustomPathFilter filter; CustomPathFilter filter;
std::vector<std::string> filePaths;
}; };
} }
} }
Loading…
Cancel
Save