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