fixed the last commit to set and check the target more often, thanks fuzzie
[gemrb.git] / gemrb / core / Audio.h
blobf6e147a1b152d49a4bfa0cfcbd901817acd5f88f
1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003-2004 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef AUDIO_H_INCLUDED
22 #define AUDIO_H_INCLUDED
24 #include "globals.h"
25 #include "win32def.h"
27 #include "Plugin.h"
29 #define GEM_SND_RELATIVE 1
30 #define GEM_SND_SPEECH IE_STR_SPEECH // 4
31 #define GEM_SND_VOL_MUSIC 1
32 #define GEM_SND_VOL_AMBIENTS 2
34 class AmbientMgr;
35 class SoundMgr;
37 class GEM_EXPORT Audio : public Plugin {
38 public:
39 static const TypeID ID;
40 public:
41 Audio(void);
42 virtual ~Audio();
43 virtual bool Init(void) = 0;
44 virtual unsigned int Play(const char* ResRef, int XPos = 0, int YPos = 0, unsigned int flags = GEM_SND_RELATIVE) = 0;
45 virtual bool IsSpeaking() = 0;
46 virtual AmbientMgr* GetAmbientMgr() { return ambim; }
47 virtual void UpdateVolume(unsigned int flags = GEM_SND_VOL_MUSIC | GEM_SND_VOL_AMBIENTS) = 0;
48 virtual bool CanPlay() = 0;
49 virtual void ResetMusics() = 0;
50 virtual bool Play() = 0;
51 virtual bool Stop() = 0;
52 virtual int CreateStream(Holder<SoundMgr>) = 0;
53 virtual void UpdateListenerPos(int XPos, int YPos ) = 0;
54 virtual void GetListenerPos(int &XPos, int &YPos ) = 0;
55 virtual bool ReleaseStream(int stream, bool HardStop=false ) = 0;
56 virtual int SetupNewStream( ieWord x, ieWord y, ieWord z,
57 ieWord gain, bool point, bool Ambient) = 0;
58 virtual int QueueAmbient(int stream, const char* sound) = 0;
59 virtual void SetAmbientStreamVolume(int stream, int volume) = 0;
60 virtual void QueueBuffer(int stream, unsigned short bits,
61 int channels, short* memory, int size, int samplerate) = 0;
63 protected:
64 AmbientMgr* ambim;
68 #endif // AUDIO_H_INCLUDED