hedgewars/uSound.pas
changeset 4748 ce9b48de1f52
parent 4461 2f4f5d649bcd
child 4948 c3dc41ae68fa
equal deleted inserted replaced
4745:b9a9f70948da 4748:ce9b48de1f52
    37 function  LoopSound(snd: TSound): LongInt;
    37 function  LoopSound(snd: TSound): LongInt;
    38 function  LoopSound(snd: TSound; voicepack: PVoicepack): LongInt;
    38 function  LoopSound(snd: TSound; voicepack: PVoicepack): LongInt;
    39 procedure PlayMusic;
    39 procedure PlayMusic;
    40 procedure PauseMusic;
    40 procedure PauseMusic;
    41 procedure ResumeMusic;
    41 procedure ResumeMusic;
       
    42 procedure ChangeMusic;
    42 procedure StopSound(snd: TSound);
    43 procedure StopSound(snd: TSound);
    43 procedure StopSound(chn: LongInt);
    44 procedure StopSound(chn: LongInt);
    44 function  ChangeVolume(voldelta: LongInt): LongInt;
    45 function  ChangeVolume(voldelta: LongInt): LongInt;
    45 function  AskForVoicepack(name: shortstring): Pointer;
    46 function  AskForVoicepack(name: shortstring): Pointer;
    46 
    47 
   316         exit;
   317         exit;
   317 
   318 
   318     Mix_ResumeMusic(Mus);
   319     Mix_ResumeMusic(Mus);
   319 end;
   320 end;
   320 
   321 
       
   322 procedure ChangeMusic;
       
   323 begin
       
   324     if (MusicFN = '') or (not isMusicEnabled) then
       
   325         exit;
       
   326 
       
   327     if Mus <> nil then
       
   328         Mix_FreeMusic(Mus);
       
   329 
       
   330     PlayMusic;
       
   331 end;
       
   332 
   321 procedure chVoicepack(var s: shortstring);
   333 procedure chVoicepack(var s: shortstring);
   322 begin
   334 begin
   323     if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/voicepack"', true);
   335     if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/voicepack"', true);
   324     if s[1]='"' then Delete(s, 1, 1);
   336     if s[1]='"' then Delete(s, 1, 1);
   325     if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
   337     if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);