X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fengine%2Fe_soundfile_xmp.pas;h=b4c406ce139d3ade999c6697c5b0aa4c55ceba27;hb=6c6b87eea9373ec4f1cb859223d3708d8e2a59c6;hp=33c902f9618b1fa8b0fc1982b49f1d8b147aea58;hpb=1091a54dd9996ee2bc7620dfed900d64d066af88;p=d2df-sdl.git diff --git a/src/engine/e_soundfile_xmp.pas b/src/engine/e_soundfile_xmp.pas index 33c902f..b4c406c 100644 --- a/src/engine/e_soundfile_xmp.pas +++ b/src/engine/e_soundfile_xmp.pas @@ -2,8 +2,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -37,6 +36,7 @@ type end; TXMPLoaderFactory = class (TSoundLoaderFactory) + public function MatchHeader(Data: Pointer; Len: LongWord): Boolean; override; function MatchExtension(FName: string): Boolean; override; function GetLoader(): TSoundLoader; override; @@ -88,6 +88,7 @@ end; function TXMPLoader.Load(Data: Pointer; Len: LongWord; SStreaming: Boolean): Boolean; var Err: LongInt; + Interp: LongInt; begin Result := False; @@ -103,6 +104,10 @@ begin if xmp_start_player(FXMP, 48000, 0) <> 0 then raise Exception.Create('xmp_start_player failed'); + if e_MusicLerp then Interp := XMP_INTERP_LINEAR + else Interp := XMP_INTERP_NEAREST; + xmp_set_player(FXMP, XMP_PLAYER_INTERP, Interp); + FFormat.SampleRate := 48000; FFormat.SampleBits := 16; FFormat.Channels := 2; @@ -124,6 +129,7 @@ end; function TXMPLoader.Load(FName: string; SStreaming: Boolean): Boolean; var Err: LongInt; + Interp: LongInt; begin Result := False; @@ -139,6 +145,10 @@ begin if xmp_start_player(FXMP, 48000, 0) <> 0 then raise Exception.Create('xmp_start_player failed'); + if e_MusicLerp then Interp := XMP_INTERP_LINEAR + else Interp := XMP_INTERP_NEAREST; + xmp_set_player(FXMP, XMP_PLAYER_INTERP, Interp); + FFormat.SampleRate := 48000; FFormat.SampleBits := 16; FFormat.Channels := 2;