summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aac50c0)
raw | patch | inline | side by side (parent: aac50c0)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 1 Sep 2019 00:01:27 +0000 (03:01 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 1 Sep 2019 00:01:27 +0000 (03:01 +0300) |
src/engine/e_sound_al.inc | patch | blob | history | |
src/engine/e_soundfile.pas | patch | blob | history | |
src/engine/e_soundfile_xmp.pas | patch | blob | history |
index dfe5919ea8ef52f374a57939a80ecc6ce474ca7e..312b701bed68abae6a4cc1c31cfffd0cd2fed1bb 100644 (file)
end
else
begin
+ Loader.Looping := e_SoundsArray[find_id].Loops;
e_SoundsArray[find_id].alBuffer := 0;
e_SoundsArray[find_id].Loader := Loader;
end;
end
else
begin
+ Loader.Looping := e_SoundsArray[find_id].Loops;
e_SoundsArray[find_id].alBuffer := 0;
e_SoundsArray[find_id].Loader := Loader;
end;
index 919715c5dea3dc3da6a7a9242748b10e5af7f87a..6cae52c6a5739335df7329212bfed65d266f09cf 100644 (file)
protected
FFormat: TSoundFormat;
FStreaming: Boolean;
+ FLooping: Boolean;
public
function Load(Data: Pointer; Len: LongWord; SStreaming: Boolean): Boolean; virtual; abstract; overload;
property Format: TSoundFormat read FFormat;
property Streaming: Boolean read FStreaming;
+ property Looping: Boolean read FLooping write FLooping;
end;
TSoundLoaderFactory = class
index aaf1df194d3b1904f25ff6993d6e5beab46d503f..33c902f9618b1fa8b0fc1982b49f1d8b147aea58 100644 (file)
if Err <> 0 then
raise Exception.Create('xmp_load_module_from_memory failed');
- if xmp_start_player(FXMP, e_SoundFormat.SampleRate, 0) <> 0 then
+ if xmp_start_player(FXMP, 48000, 0) <> 0 then
raise Exception.Create('xmp_start_player failed');
- FFormat.SampleRate := e_SoundFormat.SampleRate;
+ FFormat.SampleRate := 48000;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
if Err <> 0 then
raise Exception.Create('xmp_load_module failed');
- if xmp_start_player(FXMP, e_SoundFormat.SampleRate, 0) <> 0 then
+ if xmp_start_player(FXMP, 48000, 0) <> 0 then
raise Exception.Create('xmp_start_player failed');
- FFormat.SampleRate := e_SoundFormat.SampleRate;
+ FFormat.SampleRate := 48000;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
end;
function TXMPLoader.FillBuffer(Buf: Pointer; Len: LongWord): LongWord;
+var
+ LoopN: LongInt;
begin
Result := 0;
if FXMP = nil then Exit;
- if xmp_play_buffer(FXMP, Buf, Len, 0) = 0 then
+ if FLooping then
+ LoopN := 0
+ else
+ LoopN := 1;
+ if xmp_play_buffer(FXMP, Buf, Len, LoopN) = 0 then
Result := Len;
end;