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
CzActionsMedia.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_ACTIONS_MEDIA_H_)
00015 #define _CZ_ACTIONS_MEDIA_H_
00016 
00017 #include "CzActions.h"
00018 #include "CzXoml.h"
00019 
00020 /**
00021  @addtogroup Actions
00022  @{
00023  */
00024  
00025 /**
00026  @class CzXomlActions_Media
00027 
00028  @brief Implements actions that relate to media control
00029 
00030  The CzXomlActions_Media class holds Actions (IzXomlAction) that deal with media play back and control such as playing a sound effect, music or modifiying the video cam stream. 
00031  
00032  The following actions are supported:
00033  - PlaySound    
00034  - PlayMusic    
00035  - StopMusic    
00036  - ChangeVideoCam
00037  - AudioEnable
00038 
00039  The above actions have the following XOML prototypes:
00040  - PlaySound(sound-name, looped)
00041    - sound-name - sound resource name
00042    - looped - true if the sound should loop
00043  - PlayMusic(filename, repeat_count)
00044    - filename - Name of the file that contains the music
00045    - repeat-count - Total number of tims to repeat play back (0 - forever)
00046  - StopMusic()
00047  - ChangeVideoCam(videocam-name, command)
00048    - videocam-name - Name of VideoCam resource to change
00049    - command - Command to use to change video cam (start or stop)
00050  - AudioEnable(music_enable, sounds_enable)
00051 
00052  For more information on audio playback see CzAudio and for more information on VideoCam see CzVideoCam
00053  
00054  */
00055  
00056 class CzXomlActions_Media : public IzXomlAction
00057 {
00058 public:
00059     enum eActionType
00060     {
00061         Action_PlaySound        = 0, 
00062         Action_PlayMusic        = 1, 
00063         Action_StopMusic        = 2, 
00064         Action_ChangeVideoCam   = 3, 
00065         Action_AudioEnable      = 4, 
00066         Action_Max              = 5, 
00067     };
00068 protected:
00069     eActionType Type;
00070     CzXomlActions_Media() {}
00071 public:
00072     CzXomlActions_Media(eActionType type)
00073     {
00074         Type = type;
00075         switch (Type)
00076         {
00077         case Action_PlaySound:
00078             setActionName("playsound");
00079             break;
00080         case Action_PlayMusic:
00081             setActionName("playmusic");
00082             break;
00083         case Action_StopMusic:
00084             setActionName("stopmusic");
00085             break;
00086         case Action_ChangeVideoCam:
00087             setActionName("changevideocam");
00088             break;
00089         case Action_AudioEnable:
00090             setActionName("audioenable");
00091             break;
00092         }
00093     }
00094     void Execute(IzXomlResource* source, CzAction* action);
00095 };
00096 
00097 /// @}
00098 
00099 #endif // _CZ_ACTIONS_MEDIA_H_