svvitch
digital signage player
D:/vs_workspace/switch_sf/src/svvitch/Content.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <string>
00004 #include <vector>
00005 #include <Poco/ActiveMethod.h>
00006 #include <Poco/format.h>
00007 #include <Poco/Logger.h>
00008 #include <Poco/HashMap.h>
00009 
00010 #include "Renderer.h"
00011 #include "MediaItem.h"
00012 
00013 using std::string;
00014 using std::vector;
00015 using std::wstring;
00016 using Poco::HashMap;
00017 using Poco::ActiveMethod;
00018 
00019 
00025 class Content
00026 {
00027 private:
00028     //static const string NULL_STRING;
00029 
00030 protected:
00031     Poco::Logger& _log;
00032     Renderer& _renderer;
00033 
00034     int _splitType;
00035 //  MediaItemPtr _media;
00036     string _mediaID;
00037     bool _playing;
00038 
00039     int _duration;
00040     int _current;
00041 
00042     int _keycode;
00043     bool _shift;
00044     bool _ctrl;
00045 
00046     HashMap<string, string> _properties;
00047     float _x, _y, _w, _h;
00048 
00049 public:
00051     Content(Renderer& renderer, int splitType, float x = 0, float y = 0, float w = 0, float h = 0);
00052 
00054     virtual ‾Content();
00055 
00057     virtual void initialize();
00058 
00060     virtual bool open(const MediaItemPtr media, const int offset = 0);
00061 
00063     virtual const string opened() const;
00064 
00066     virtual void play();
00067 
00069     virtual void pause();
00070 
00072     virtual void stop();
00073 
00075     virtual bool useFastStop();
00076 
00078     virtual void rewind();
00079 
00081     virtual const bool playing() const;
00082 
00084     virtual const bool finished();
00085 
00087     virtual void close();
00088 
00089     ActiveMethod<void, void, Content> activeClose;
00090 
00091     void notifyKey(const int keycode, const bool shift, const bool ctrl);
00092 
00094     virtual void process(const DWORD& frame);
00095 
00097     virtual void draw(const DWORD& frame);
00098 
00100     virtual void preview(const DWORD& frame);
00101 
00103     virtual const int current() const;
00104 
00106     virtual const int duration() const;
00107 
00109     virtual void setPosition(float x, float y);
00110 
00112     virtual void getPosition(float& x, float& y);
00113 
00115     virtual void setBounds(float w, float h);
00116 
00118     virtual const bool contains(float x, float y) const;
00119 
00121     void set(const string& key, const string& value);
00122 
00124     void set(const string& key, const float& value);
00125 
00127     void set(const string& key, const unsigned int& value);
00128 
00130     const string& get(const string& key, const string& defaultValue = "") const;
00131 
00133     const DWORD getDW(const string& key, const DWORD& defaultValue = 0) const;
00134 
00136     const int getI(const string& key, const int& defaultValue = 0) const;
00137 
00139     const float getF(const string& key, const float& defaultValue = 0) const;
00140 };
00141 
00142 typedef Content* ContentPtr;
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines