AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzCam.h
Go to the documentation of this file.
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(_CZ_CAM_H_)
00015 #define _CZ_CAM_H_
00016 
00017 //
00018 // Classes in this file
00019 //
00020 //  CzVideoCam          - A class that is used to control the video camera
00021 //  CzVideoCamCreator   - Creates an instance of a VideoCam
00022 //
00023 
00024 #include "IzPlatformCam.h"
00025 #include "CzUtil.h"
00026 #include "CzImage.h"
00027 #include "CzActions.h"
00028 #include "CzEvents.h"
00029 
00030 /**
00031  @class CzVideoCam
00032 
00033  @brief A class that is used to control the video camera.
00034 
00035  */
00036 
00037 class CzVideoCam : public IzXomlResource
00038 {
00039 public:
00040     // Properties
00041 protected:
00042     eCzCameraCaptureQuality     Quality;
00043     eCzCameraCaptureSize        Resolution;
00044     eCzCameraType               CameraType;
00045     CzEventManager*             EventsManager;          // List of events that the camera handles
00046 public:
00047     eCzCameraCaptureQuality getQuality() const                  { return Quality; }
00048     void                        setQuality(eCzCameraCaptureQuality quality)     { Quality = quality; }
00049     void                        setResolution(eCzCameraCaptureSize resolution)  { Resolution = resolution; }
00050     eCzCameraCaptureSize        getResolution() const           { return Resolution; }
00051     void                        setFrontFacing()                { CameraType = CCT_Front; }
00052     void                        setRearFacing()                 { CameraType = CCT_Rear;  }
00053     eCzCameraType               getCameraType() const           { return CameraType; }
00054     CzEventManager*             getEventsManager()              { return EventsManager; }
00055     // Properties end
00056 
00057 public:
00058     CzVideoCam() : IzXomlResource(), Quality(CCQ_Medium), Resolution(CCS_Medium), CameraType(CCT_Rear)
00059     {
00060         setClassType("videocam");
00061         EventsManager = new CzEventManager();
00062     }
00063     virtual ~CzVideoCam()
00064     {
00065         Stop();
00066 /*      if (PLATFORM_CAM != NULL)
00067         {
00068             PLATFORM_CAM->Release();
00069         }*/
00070         SAFE_DELETE(EventsManager);
00071     }
00072 
00073     // Implementation of IzXomlClass interface
00074     int                 LoadFromXoml(IzXomlResource* parent, bool load_children, CzXmlNode* node);
00075 
00076     void                Stop();
00077     bool                Start();
00078 
00079     // Event handlers
00080     virtual void        ProcessEventActions(unsigned int event_name, IzXomlResource* parent);
00081 };
00082 
00083 /**
00084  @class CzVideoCamCreator
00085 
00086  @brief Creates an instance of a VideoCam.
00087 
00088  */
00089 
00090 class CzVideoCamCreator : public IzXomlClassCreator
00091 {
00092 public:
00093     CzVideoCamCreator()
00094     {
00095         setClassName("videocam");
00096     }
00097     IzXomlResource* CreateInstance(IzXomlResource* parent)  { return new CzVideoCam(); }
00098 };
00099 
00100 
00101 
00102 
00103 #endif // _CZ_CAM_H_