2 fegdk: FE Game Development Kit
3 Copyright (C) 2001-2008 Alexey "waker" Yakovenko
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 keltar@users.sourceforge.net
23 #ifndef __F_OPENALSOUNDDRIVER_H
24 #define __F_OPENALSOUNDDRIVER_H
26 #include "basesounddriver.h"
31 class openalSoundDriverData
;
32 class openalSoundDriver
;
34 class FE_API openalSoundBuffer
: public baseSoundBuffer
38 std::vector
<uint
> mSourceIds
;
46 buffer_t
* mpCurrentBuffer
;
48 genericCallback
*mpFeeder
;
49 openalSoundDriver
* mpDriver
;
52 void addBuffer (void);
53 void freeBuffers (void);
54 buffer_t
*getNextBuffer (buffer_t
*buffer
);
56 openalSoundBuffer (openalSoundDriver
*driver
, int freq
, int sample_rate
, bool stereo
, size_t size
, bool streaming
);
57 ~openalSoundBuffer (void);
59 void write (void *data
, int size
, int fmt
, int sample_rate
);
60 void setLooping (bool onOff
);
63 int getChannelsCount (void) const;
64 bool isPlaying (void) const;
65 void setFeeder (genericCallback
*callback
);
67 void setVolume (float vol
);
68 void setMaxSources (int num
);
69 void pause (bool onoff
);
70 int getNumBuffers (void) const;
73 class FE_API openalSoundDriver
: public baseSoundDriver
75 friend class openalSoundBuffer
;
77 openalSoundDriverData
*mpData
;
78 openalSoundBuffer
** mpBuffers
;
84 void addBuffer (openalSoundBuffer
*buf
);
85 void removeBuffer (openalSoundBuffer
*buf
);
88 openalSoundDriver (void);
89 ~openalSoundDriver (void);
92 // openalSoundDriverData *getData (void);
93 openalSoundBuffer
* createBuffer (int freq
, int sample_rate
, bool stereo
, size_t size
, bool streaming
);
101 #endif // __F_OPENALSOUNDDRIVER_H