svvitch
digital signage player
D:/vs_workspace/switch_sf/src/svvitch/CvContent.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <Poco/ActiveMethod.h>
00004 #include <Poco/ActiveResult.h>
00005 #include <Poco/Mutex.h>
00006 #include <Poco/Thread.h>
00007 #include <Poco/Runnable.h>
00008 
00009 #include "Content.h"
00010 #include "CaptureScene.h"
00011 #include "MediaItem.h"
00012 #include "FFMovieContent.h"
00013 #include "PerformanceTimer.h"
00014 #include "Renderer.h"
00015 #include "Workspace.h"
00016 
00017 #include <queue>
00018 
00019 using std::queue;
00020 using std::string;
00021 using std::wstring;
00022 
00023 
00028 class CvContent: public Content
00029 {
00030 private:
00031     Poco::FastMutex _lock;
00032 
00033     CaptureScenePtr _scene;
00034 
00035     float _subtract;
00036     int _intervalDiff;
00037     int _intervalSmall;
00038 
00039     int _clipX;
00040     int _clipY;
00041     int _clipW;
00042     int _clipH;
00043 
00044     LPD3DXEFFECT _fx;
00045     LPDIRECT3DTEXTURE9 _small1;
00046     LPDIRECT3DTEXTURE9 _small2;
00047     LPDIRECT3DTEXTURE9 _diff;
00048     LPDIRECT3DSURFACE9 _diff2;
00049     LPDIRECT3DTEXTURE9 _photo;
00050     int _detectThreshold;
00051     int _diffCount;
00052 
00053     string _normalFile;
00054     MediaItemPtr _normalItem;
00055     FFMovieContentPtr _normalMovie;
00056     vector<string> _detectFiles;
00057     MediaItemPtr _detectedItem;
00058     FFMovieContentPtr _detectedMovie;
00059 
00060     int _detectCount;
00061     bool _detected;
00062     int _doShutter;
00063     int _viewPhoto;
00064 
00065     bool _finished;
00066     bool _playing;
00067     PerformanceTimer _playTimer;
00068 
00069     DWORD _statusFrame;
00070     string _status;
00071 
00072 public:
00073     CvContent(Renderer& renderer, int splitType);
00074 
00075     virtual ‾CvContent();
00076 
00077 
00078     void saveConfiguration();
00079 
00080     void initialize();
00081 
00083     bool open(const MediaItemPtr media, const int offset = 0);
00084 
00085     Poco::ActiveMethod<void, void, CvContent> activeOpenDetectMovie;
00086     void openDetectMovie();
00087 
00091     void play();
00092 
00096     void stop();
00097 
00098     bool useFastStop();
00099 
00103     const bool playing() const;
00104 
00105     const bool finished();
00106 
00108     void close();
00109 
00110     void process(const DWORD& frame);
00111 
00112     void draw(const DWORD& frame);
00113 };
00114 
00115 typedef CvContent* CvContentPtr;
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines