Files
source/Utils/Music Control.h
T
Wanne ab02106512 - New Externalization: Externalized the used music to an OPTIONAL "Scripts\Music.lua" file (by Jazz)
o This file is OPTIONAL and if not available, the game uses the default music tracks
o With the user of the Music.lua script file, you can play different musics and types for each sector (*.WAV or *.OGG)
o An example of the usage has been added to "Docs\Externalized Music Example.zip"
o See comments from the Music.lua scripts below

--[[
AddMusic(SectorX,SectorY,SectorZ,MusicType,MusicID)

MusicType :
1 - standard music, sector no enemy (NOTHING_xxx.wav or NOTHING_xxx.ogg)
2 - enemy in sector  (TENSOR_xxx.wav or TENSOR_xxx.ogg)
3 - start battle  (BATTLE_xxx.wav or BATTLE_xxx.ogg)
4 - victory  (TRIUMPH_xxx.wav or TRIUMPH_xxx.ogg)
5 - death merc  (DEATH_xxx.wav or DEATH_xxx.ogg)

xxx - number file

MusicID - id of music

Put to "Music" folder ogg or wav file. We number the names of files NOTHING_0.wav... NOTHING_10.wav ... etc

Example :
AddMusic(1,10,0,1,0) -- add to sector A10, music type "1" and file NOTHING_0.wav or NOTHING_0.ogg.
AddMusic(1,10,1,1,0) -- add to sector A10_B1, music type "1" and file NOTHING_0.wav or NOTHING_0.ogg.
AddMusic(1,9,0,2,10) -- add to sector A9, music type "2" and file TENSOR_10.wav or TENSOR_10.ogg.

for x = 1,16 do
        for y = 1,16 do
		AddMusic(x,y,0,1,10) -- add to all sector, music type "1" and file NOTHING_10.wav or NOTHING_10.ogg.
	end
end

]]

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6295 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-08-20 07:15:30 +00:00

86 lines
1.8 KiB
C

#ifndef _MUSIC_CONTROL_H_
#define _MUSIC_CONTROL_H_
enum MusicList
{
MARIMBAD2_MUSIC,
MENUMIX_MUSIC,
NOTHING_A_MUSIC,
NOTHING_B_MUSIC,
NOTHING_C_MUSIC,
NOTHING_D_MUSIC,
TENSOR_A_MUSIC,
TENSOR_B_MUSIC,
TENSOR_C_MUSIC,
TRIUMPH_MUSIC,
DEATH_MUSIC,
BATTLE_A_MUSIC,
BATTLE_B_MUSIC, //same as tensor B
CREEPY_MUSIC,
CREATURE_BATTLE_MUSIC,
MUSIC_DIR,
NUM_MUSIC
};
enum MusicMode
{
MUSIC_NONE,
MUSIC_RESTORE,
MUSIC_MAIN_MENU,
MUSIC_TACTICAL_NOTHING,
MUSIC_TACTICAL_ENEMYPRESENT,
MUSIC_TACTICAL_BATTLE,
MUSIC_TACTICAL_VICTORY,
MUSIC_TACTICAL_DEATH,
MUSIC_LAPTOP,
MUSIC_OLD_TYPE,
};
typedef struct
{
UINT16 uiIndex;
INT32 SoundTacticalVictory[4];
INT32 SoundTacticalBattle[4];
INT32 SoundTacticalNothing[4];
INT32 SoundTacticalTensor[4];
INT32 SoundTacticalDeath[4];
} MUSIC_SOUND_VALUES;
extern MUSIC_SOUND_VALUES MusicSoundValues[256];
extern INT32 GlobalSoundID;
//extern UINT32 uiMusicHandle;
//extern BOOLEAN fMusicPlaying;
//extern UINT8 gubMusicMode;
//extern BOOLEAN gfForceMusicToTense;
UINT8 GetMusicMode(void);
BOOLEAN SetMusicMode(UINT8 ubMusicMode);
// only for editor (editscreen.cpp)
BOOLEAN MusicPlay(UINT32 uiNum, UINT32 MusicMode, BOOLEAN NewSound);
BOOLEAN SetMusicModeID(UINT8 ubMusicMode, INT32 SoundID);
UINT32 MusicGetVolume(void);
BOOLEAN MusicSetVolume(UINT32 uiVolume);
BOOLEAN MusicPoll(BOOLEAN fForce);
void SetMusicFadeSpeed(INT8 bFadeSpeed);
BOOLEAN UsingCreatureMusic(void);
void UseCreatureMusic(BOOLEAN fUseCreatureMusic);
// only for luaglobal.cpp
BOOLEAN IsMusicPlaying(void);
UINT32 GetMusicHandle(void);
//BOOLEAN MusicStop(void);
//BOOLEAN MusicFadeOut(void);
//BOOLEAN MusicFadeIn(void);
//void FadeMusicForXSeconds( UINT32 uiDelay );
#endif