--- a/hedgewars/uSound.pas Mon Jan 19 13:02:33 2009 +0000
+++ b/hedgewars/uSound.pas Mon Jan 19 15:25:22 2009 +0000
@@ -32,6 +32,8 @@
procedure SoundLoad;
procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
procedure PlayMusic;
+procedure PauseMusic;
+procedure ResumeMusic;
procedure StopSound(snd: TSound);
function ChangeVolume(voldelta: LongInt): LongInt;
@@ -43,11 +45,11 @@
uses uMisc, uConsole;
const chanTPU = 12;
-var Mus: PMixMusic = nil;
- Volume: LongInt;
+var Volume: LongInt;
lastChan: array [TSound] of LongInt;
voicepacks: array[0..cMaxTeams] of TVoicepack;
defVoicepack: PVoicepack;
+ Mus: PMixMusic = nil;
function AskForVoicepack(name: shortstring): Pointer;
var i: Longword;
@@ -152,7 +154,7 @@
begin
if (not isSoundEnabled)
or (MusicFN = '')
- or (not isMusicEnabled)then exit;
+ or (not isMusicEnabled) then exit;
s:= PathPrefix + '/Music/' + MusicFN;
WriteToConsole(msgLoading + s + ' ');
@@ -177,4 +179,18 @@
ChangeVolume:= Volume * 100 div MIX_MAX_VOLUME
end;
+procedure PauseMusic;
+begin
+if (MusicFN = '') or (not isMusicEnabled) then exit;
+
+Mix_PauseMusic(Mus);
+end;
+
+procedure ResumeMusic;
+begin
+if (MusicFN = '') or (not isMusicEnabled) then exit;
+
+Mix_ResumeMusic(Mus);
+end;
+
end.