From e7f2b4315ed5b765381c934b09689ff1d421c970 Mon Sep 17 00:00:00 2001 From: Felix Dubrownik Date: Sat, 13 Sep 2014 22:41:10 +0200 Subject: [PATCH] MediaServer: added Filters for Video and Images --- src/MediaServer.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/MediaServer.h b/src/MediaServer.h index 49edf87..8ccbe5a 100644 --- a/src/MediaServer.h +++ b/src/MediaServer.h @@ -16,6 +16,26 @@ namespace ofx { namespace piMapper { + +class CustomVideoPathFilter : public ofx::IO::AbstractPathFilter { + CustomVideoPathFilter() {}; + virtual ~CustomVideoPathFilter() {}; + // TODO: Find useful filters e.g. *.mp4, etc + bool const accept(Poco::Path& path) const { + return !Poco::File(path).isHidden() && + ofIsStringInString(path.toString(), "mp4"); + } +}; + +class CustomImagePathFilter : public ofx::IO::AbstractPathFilter { + CustomImagePathFilter() {}; + virtual ~CustomImagePathFilter() {}; + // TODO: Find useful filters e.g. *.png,*.jpeg, etc. + bool const accept(Poco::Path& path) const { + return !Poco::File(path).isHidden() && + ofIsStringInString(path.toString(), "png"); + } +}; class MediaServer { public: MediaServer();