summaryrefslogtreecommitdiff
path: root/src/sound/sound.h
diff options
context:
space:
mode:
authorAlexander Baldeck <alexander@archlinux.org>2004-12-26 06:03:39 +0000
committerAlexander Baldeck <alexander@archlinux.org>2004-12-26 06:03:39 +0000
commit39b055069250279bd0138d3dd99674d3de1a39a9 (patch)
treee72afeef4ded2e4684d55e220d3d0787700cc2dd /src/sound/sound.h
parentc1ad3223a1c7ac9d85fa4057c4d43123544e1b5a (diff)
downloadmana-39b055069250279bd0138d3dd99674d3de1a39a9.tar.gz
mana-39b055069250279bd0138d3dd99674d3de1a39a9.tar.bz2
mana-39b055069250279bd0138d3dd99674d3de1a39a9.tar.xz
mana-39b055069250279bd0138d3dd99674d3de1a39a9.zip
some more code beautification :)
Diffstat (limited to 'src/sound/sound.h')
-rw-r--r--src/sound/sound.h127
1 files changed, 62 insertions, 65 deletions
diff --git a/src/sound/sound.h b/src/sound/sound.h
index 4f7f573c..8df4eb08 100644
--- a/src/sound/sound.h
+++ b/src/sound/sound.h
@@ -24,7 +24,7 @@
#ifdef WIN32
- #pragma warning(disable:4312)
+ #pragma warning(disable:4312)
#endif
#include <allegro.h>
#include <jgmod.h>
@@ -42,71 +42,68 @@
typedef unsigned short TMWSOUND_SID ;
/**
- rewrite of non-existend sdl-soundengine using allegro
-
- Bestviewd w/ Bitstream Vera Sans Mono @ 9pt and a tab-width of 2 spaces
-
- Author: kth5 aka Alexander Baldeck
- pipe your question, suggestions and flames to: kth5@gawab.com
-*/
+ * Sound engine
+ *
+ * \ingroup CORE
+ */
class TmwSound {
- public:
- void Init(int, int);
- void Close();
-
- void StartMIDI(char *, int);
- void StartMOD(char *, int);
- void StopBGM();
-
- void StartWAV(char *, int);
- void SetVol(int, int, int);
- void SetAdjVol(int, int, int);
-
- TMWSOUND_SID LoadItem(char *, char);
- void UnloadItem(TMWSOUND_SID);
- void PlayItem(TMWSOUND_SID, int);
-
- TmwSound() {isOk=-1;}
-
- /** if allegro is shut down or object is deleted any BGM is
- stopped and SFX run out */
- ~TmwSound() {StopBGM(); Close();};
- private:
- /** initial value is -1 which means error or noninitialzed.
- you can only play sounds and bgm if this is 0.
- that should be the case after calling Init() successfully */
- int isOk;
-
- MIDI * mid;
- JGMOD * mod;
- SAMPLE * sfx;
-
- int pan;
- int pitch;
-
- int ret;
- int vol_digi;
- int vol_midi;
- int vol_mod;
-
- /** structure can hold a sound item's attributes and data (sample-only) */
- typedef struct POOL_ITEM {
- /** incremental id of pool item */
- TMWSOUND_SID id;
- /** type of item */
- char type;
- /** (file-)name of sfx only kept for human reasons ^_^ */
- std::string fname;
- /** generic data */
- void * data;
- };
-
- /** list of preloaded sound data / items */
- std::list<POOL_ITEM> soundpool;
- std::list<POOL_ITEM>::iterator sounditem;
- TMWSOUND_SID items;
-
- bool isMaxVol(int);
+ public:
+ void Init(int, int);
+ void Close();
+
+ void StartMIDI(char *, int);
+ void StartMOD(char *, int);
+ void StopBGM();
+
+ void StartWAV(char *, int);
+ void SetVol(int, int, int);
+ void SetAdjVol(int, int, int);
+
+ TMWSOUND_SID LoadItem(char *, char);
+ void UnloadItem(TMWSOUND_SID);
+ void PlayItem(TMWSOUND_SID, int);
+
+ TmwSound() {isOk=-1;}
+
+ /** if allegro is shut down or object is deleted any BGM is
+ stopped and SFX run out */
+ ~TmwSound() {StopBGM(); Close();};
+ private:
+ /** initial value is -1 which means error or noninitialzed.
+ you can only play sounds and bgm if this is 0.
+ that should be the case after calling Init() successfully */
+ int isOk;
+
+ MIDI * mid;
+ JGMOD * mod;
+ SAMPLE * sfx;
+
+ int pan;
+ int pitch;
+
+ int ret;
+ int vol_digi;
+ int vol_midi;
+ int vol_mod;
+
+ /** structure can hold a sound item's attributes and data (sample-only) */
+ typedef struct POOL_ITEM {
+ /** incremental id of pool item */
+ TMWSOUND_SID id;
+ /** type of item */
+ char type;
+ /** (file-)name of sfx only kept for human reasons ^_^ */
+ std::string fname;
+ /** generic data */
+ void * data;
+ };
+
+ /** list of preloaded sound data / items */
+ std::list<POOL_ITEM> soundpool;
+ std::list<POOL_ITEM>::iterator sounditem;
+ TMWSOUND_SID items;
+
+ bool isMaxVol(int);
};
#endif