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
CzPlatformAudio.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(_CCZ_PLATFORM_AUDIO_H_)
00015 #define _CCZ_PLATFORM_AUDIO_H_
00016 
00017 #include "IzPlatformAudio.h"
00018 #include "s3eAudio.h"
00019 
00020 class CzScene;
00021 
00022 class CzPlatformAudio : public IzPlatformAudio
00023 {
00024     // Properties
00025 protected:
00026     s3eAudioCodec   getCodec(eCzAudioCodec codec);
00027     void            setSoundOn(bool on);
00028     void            setMusicOn(bool on);
00029 public:
00030     // Properties end
00031 public:
00032     int             Init();
00033     void            Release();
00034     void            Update();
00035 
00036     bool            InitSound(void* memory_file, int memory_file_size, CzSoundData& sound_data, CzSoundSpec& sound_spec);
00037     CzSoundInst     PlaySound(unsigned int name_hash, CzScene* scene, float volume, float pitch, float pan, bool looped);
00038     CzSoundInst     PlaySound(CzSoundSpec sound_spec, float volume, float pitch, float pan, bool looped);
00039     void            StopSound(CzSoundInst sound_inst);
00040     void            PauseSound(CzSoundInst sound_inst);
00041     void            ResumeSound(CzSoundInst sound_inst);
00042     void            setSoundVolume(CzSoundInst sound_inst, float volume);
00043     void            setSoundPitch(CzSoundInst sound_inst, float pitch);
00044     void            setSoundPan(CzSoundInst sound_inst, float pan);
00045     bool            isSoundPlaying(CzSoundInst sound_inst) const;
00046     void            StopAllSounds();
00047     void            PauseAllSounds();
00048     void            ResumeAllSounds();
00049 
00050     bool            isMusicCodecSupported(eCzAudioCodec codec);
00051     void            setGlobalSoundVolume(float vol);
00052     void            setMusicVolume(float vol);
00053     bool            PlayMusic(const char* name, int repeat_count = 0);
00054     bool            PlayMusic(void* buffer, uint32 buffer_length, uint32 repeat_count);
00055     void            StopMusic();
00056     void            PauseMusic();
00057     void            ResumeMusic();
00058     bool            isMusicPlaying();
00059 
00060     void            DeleteSoundData(CzSoundData data);
00061     void            DeleteSoundSpec(CzSoundSpec spec);
00062 };
00063 
00064 
00065 #endif  // _CCZ_PLATFORM_AUDIO_H_