hedgewars/uSound.pas
changeset 2716 b9ca1bfca24f
parent 2674 2fce032f2f95
child 2744 803d0142594e
equal deleted inserted replaced
2715:0e4e0db79e2a 2716:b9ca1bfca24f
    26 	TVoicepack = record
    26 	TVoicepack = record
    27 		name: shortstring;
    27 		name: shortstring;
    28 		chunks: array [TSound] of PMixChunk;
    28 		chunks: array [TSound] of PMixChunk;
    29 		end;
    29 		end;
    30 
    30 
       
    31 var MusicFN: shortstring;
       
    32 
       
    33 procedure init_uSound;
       
    34 procedure free_uSound;
       
    35 
    31 procedure InitSound;
    36 procedure InitSound;
    32 procedure ReleaseSound;
    37 procedure ReleaseSound;
    33 procedure SoundLoad;
    38 procedure SoundLoad;
    34 procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
    39 procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
    35 procedure LoopSound(snd: TSound; voicepack: PVoicepack);
    40 procedure LoopSound(snd: TSound; voicepack: PVoicepack);
    36 procedure PlayMusic;
    41 procedure PlayMusic;
    37 procedure PauseMusic;
    42 procedure PauseMusic;
    38 procedure ResumeMusic;
    43 procedure ResumeMusic;
    39 procedure StopSound(snd: TSound);
    44 procedure StopSound(snd: TSound);
    40 function  ChangeVolume(voldelta: LongInt): LongInt;
    45 function  ChangeVolume(voldelta: LongInt): LongInt;
    41 
       
    42 function  AskForVoicepack(name: shortstring): Pointer;
    46 function  AskForVoicepack(name: shortstring): Pointer;
    43 
    47 
    44 var MusicFN: shortstring = '';
       
    45 
    48 
    46 implementation
    49 implementation
    47 uses uMisc, uConsole;
    50 uses uMisc, uConsole;
    48 
    51 
    49 const chanTPU = 12;
    52 const chanTPU = 12;
    50 var Volume: LongInt;
    53 var Volume: LongInt;
    51 	lastChan: array [TSound] of LongInt;
    54     lastChan: array [TSound] of LongInt;
    52 	voicepacks: array[0..cMaxTeams] of TVoicepack;
    55     voicepacks: array[0..cMaxTeams] of TVoicepack;
    53 	defVoicepack: PVoicepack;
    56     defVoicepack: PVoicepack;
    54 	Mus: PMixMusic = nil;
    57     Mus: PMixMusic = nil;
    55 
    58 
    56 function  AskForVoicepack(name: shortstring): Pointer;
    59 function  AskForVoicepack(name: shortstring): Pointer;
    57 var i: Longword;
    60 var i: Longword;
    58 begin
    61 begin
    59 i:= 0;
    62 i:= 0;
   224 if (MusicFN = '') or (not isMusicEnabled) then exit;
   227 if (MusicFN = '') or (not isMusicEnabled) then exit;
   225 
   228 
   226 Mix_ResumeMusic(Mus);
   229 Mix_ResumeMusic(Mus);
   227 end;
   230 end;
   228 
   231 
       
   232 procedure init_uSound;
       
   233 begin
       
   234 	MusicFN:='';
       
   235 end;
       
   236 
       
   237 procedure free_uSound;
       
   238 begin
       
   239 
       
   240 end;
       
   241 
   229 end.
   242 end.
   230 
   243