AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
00001 // 00002 // 00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine 00004 // 00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk 00006 // 00007 // For updates, tutorials and more details check out www.appeasymobile.com 00008 // 00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin. 00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support 00011 // 00012 // 00013 00014 #if !defined(_CCZ_UI_VIDEO_OVERLAY_H_) 00015 #define _CCZ_UI_VIDEO_OVERLAY_H_ 00016 00017 #include "CzUIBase.h" 00018 #include "CzVideo.h" 00019 00020 // 00021 // 00022 // 00023 // 00024 // CzUIVideoOverlay- A video overlay based UI actor 00025 // 00026 // 00027 // 00028 // 00029 class CzUIVideoOverlay : public CzUIBase 00030 { 00031 // Properties 00032 protected: 00033 bool AutoPlay; 00034 CzVideo* Video; 00035 bool Playing; 00036 bool Started; 00037 public: 00038 void setAutoPlay(bool auto_play) { AutoPlay = auto_play; } 00039 bool isAutoPlay() const { return AutoPlay; } 00040 void setVideo(CzVideo* video) { Video = video; } 00041 CzVideo* getVideo() { return Video; } 00042 bool isPlaying() const { return Playing; } 00043 bool isStarted() const { return Started; } 00044 bool setProperty(unsigned int property_name, const CzXomlProperty& data, bool delta); 00045 bool setProperty(unsigned int property_name, const CzString& data, bool delta); 00046 bool getProperty(unsigned int property_name, CzXomlProperty& prop); 00047 // Properties end 00048 protected: 00049 bool UpdateBinding(unsigned int property_name, CzXomlVariable* var); 00050 public: 00051 CzUIVideoOverlay() : CzUIBase(), AutoPlay(false), Video(NULL), Playing(false), Started(false) { setActualClassType("videooverlay"); } 00052 00053 bool Update(float dt); 00054 00055 // Implementation of IzXomlClass interface 00056 int LoadFromXoml(IzXomlResource* parent, bool load_children, CzXmlNode* node); 00057 00058 // Implementation of IzAnimTarget interface 00059 bool UpdateFromAnimation(CzAnimInstance *animation); 00060 00061 bool Play(); 00062 void Stop(); 00063 void Pause(); 00064 void Resume(); 00065 00066 // Internal (used by XOML system to setup and cleanup the XOML class properties system 00067 protected: 00068 static CzXomlClassDef* VideoOverlayClassDef; // XOML class definition 00069 public: 00070 static void InitClass(); 00071 static void ReleaseClass(); 00072 00073 static bool _setVideo(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00074 static CzXomlProperty _getVideo(IzXomlResource* target); 00075 static bool _setAutoPlay(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00076 static CzXomlProperty _getAutoPlay(IzXomlResource* target); 00077 static bool _setRepeat(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00078 static CzXomlProperty _getRepeat(IzXomlResource* target); 00079 static bool _setVolume(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00080 static CzXomlProperty _getVolume(IzXomlResource* target); 00081 static bool _setCommand(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00082 static CzXomlProperty _getIsPlaying(IzXomlResource* target); 00083 static CzXomlProperty _getStarted(IzXomlResource* target); 00084 static bool _setOnStart(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00085 static bool _setOnEnd(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00086 static bool _setOnPause(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00087 static bool _setOnResume(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00088 static bool _setOnError(IzXomlResource* target, const CzXomlProperty& prop, bool add); 00089 00090 }; 00091 00092 // 00093 // CzUIVideoOverlayCreator - Creates an instance of an video overlay actor object 00094 // 00095 class CzUIVideoOverlayCreator : public IzXomlClassCreator 00096 { 00097 public: 00098 CzUIVideoOverlayCreator() 00099 { 00100 setClassName("videooverlay"); 00101 } 00102 IzXomlResource* CreateInstance(IzXomlResource* parent) { return new CzUIVideoOverlay(); } 00103 }; 00104 00105 00106 00107 00108 00109 00110 00111 #endif // _CCZ_UI_VIDEO_OVERLAY_H_