index ba9671542c6ded021daad64b7d871d727392c204..fba2726d408d211e3fd32b453cf70dce4ab62513 100644 (file)
*
* 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
TFluidLoader = class (TSoundLoader)
public
- function Load(Data: Pointer; Len: LongWord; SStreaming: Boolean): Boolean; override; overload;
- function Load(FName: string; SStreaming: Boolean): Boolean; override; overload;
- function SetPosition(Pos: LongWord): Boolean; override;
+ function Load(Data: Pointer; Len: LongWord; Loop: Boolean): Boolean; override; overload;
+ function Load(FName: string; Loop: Boolean): Boolean; override; overload;
+ function Finished(): Boolean; override;
+ function Restart(): Boolean; override;
function FillBuffer(Buf: Pointer; Len: LongWord): LongWord; override;
- function GetAll(var OutPtr: Pointer): LongWord; override;
procedure Free(); override;
private
(* TFluidLoader *)
-function TFluidLoader.Load(Data: Pointer; Len: LongWord; SStreaming: Boolean): Boolean;
+function TFluidLoader.Load(Data: Pointer; Len: LongWord; Loop: Boolean): Boolean;
var
Ret: cint;
begin
end;
end;
- if FLooping then
+ if Loop then
fluid_player_set_loop(FPlayer, -1);
+
FFormat.SampleRate := 44100;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
Result := True;
end;
-function TFluidLoader.Load(FName: string; SStreaming: Boolean): Boolean;
+function TFluidLoader.Load(FName: string; Loop: Boolean): Boolean;
var
Ret: cint;
begin
end;
end;
- if FLooping then
+ if Loop then
fluid_player_set_loop(FPlayer, -1);
+
FFormat.SampleRate := 44100;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
Result := True;
end;
-function TFluidLoader.SetPosition(Pos: LongWord): Boolean;
+function TFluidLoader.Finished(): Boolean;
begin
- Result := False; // unsupported?
+ Result := fluid_player_get_status(FPlayer) = FLUID_PLAYER_DONE;
+end;
+
+function TFluidLoader.Restart(): Boolean;
+begin
+ Result := False;
+ // fluid_player_seek() is only supported in full 2.x.x, and I ain't compiling that shit
+ // if (FSynth <> nil) and (FPlayer <> nil) then
+ // begin
+ // fluid_synth_system_reset(FSynth);
+ // fluid_player_seek(FPlayer, 0);
+ // fluid_player_play(FPlayer);
+ // Result := True;
+ // end;
end;
function TFluidLoader.FillBuffer(Buf: Pointer; Len: LongWord): LongWord;
if Ret = FLUID_OK then Result := Len;
end;
-function TFluidLoader.GetAll(var OutPtr: Pointer): LongWord;
-begin
- Result := 0; // midis are always streaming, so this don't make sense
-end;
-
procedure TFluidLoader.Free();
begin
if FPlayer <> nil then