[vlmc-devel] [PATCH 5/5] RenderTarget: File

Yikai Lu luyikei.qmltu at gmail.com
Thu Apr 14 10:50:30 CEST 2016


---
 src/Backend/Target/FileTarget.cpp | 21 +++++++++++++++++++++
 src/Backend/Target/FileTarget.h   | 19 +++++++++++++++++++
 src/CMakeLists.txt                |  1 +
 3 files changed, 41 insertions(+)
 create mode 100644 src/Backend/Target/FileTarget.cpp
 create mode 100644 src/Backend/Target/FileTarget.h

diff --git a/src/Backend/Target/FileTarget.cpp b/src/Backend/Target/FileTarget.cpp
new file mode 100644
index 0000000..1ed1ea6
--- /dev/null
+++ b/src/Backend/Target/FileTarget.cpp
@@ -0,0 +1,21 @@
+#include "FileTarget.h"
+
+#include "Backend/ISourceRenderer.h"
+
+using namespace Backend;
+
+FileTarget::FileTarget( const char* filePath )
+    : m_filePath( filePath )
+{
+}
+
+FileTarget::~FileTarget()
+{
+    delete m_filePath;
+}
+
+void
+FileTarget::configure( Backend::ISourceRenderer *renderer )
+{
+    renderer->setOutputFile( m_filePath );
+}
diff --git a/src/Backend/Target/FileTarget.h b/src/Backend/Target/FileTarget.h
new file mode 100644
index 0000000..9a4266c
--- /dev/null
+++ b/src/Backend/Target/FileTarget.h
@@ -0,0 +1,19 @@
+#ifndef FILETARGET_H
+#define FILETARGET_H
+
+#include "Backend/IRenderTarget.h"
+
+namespace Backend
+{
+    class FileTarget : public IRenderTarget
+    {
+    public:
+        FileTarget( const char* filePath );
+        ~FileTarget();
+        virtual void configure( ISourceRenderer *renderer );
+    private:
+        const char* m_filePath;
+    };
+}
+
+#endif // FILETARGET_H
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4c59e63..a7cee9c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -47,6 +47,7 @@ SET(VLMC_SRCS
     Backend/VLC/VLCSource.cpp
     Backend/VLC/VLCMemorySource.cpp
     Backend/Target/WidgetTarget.cpp
+    Backend/Target/FileTarget.cpp
     EffectsEngine/EffectsEngine.cpp
     EffectsEngine/Effect.cpp
     EffectsEngine/EffectUser.cpp
-- 
1.9.1



More information about the Vlmc-devel mailing list