index 5235f2c0097a7040f297b350e984b45bdda46fd7..fba2726d408d211e3fd32b453cf70dce4ab62513 100644 (file)
TFluidLoader = class (TSoundLoader)
public
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 FillBuffer(Buf: Pointer; Len: LongWord): LongWord; override;
- function GetAll(var OutPtr: Pointer): LongWord; override;
procedure Free(); override;
private
procedure Free(); override;
private
(* TFluidLoader *)
(* 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
var
Ret: cint;
begin
end;
end;
end;
end;
- if FLooping then
+ if Loop then
fluid_player_set_loop(FPlayer, -1);
fluid_player_set_loop(FPlayer, -1);
+
FFormat.SampleRate := 44100;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
FFormat.SampleRate := 44100;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
Result := True;
end;
Result := True;
end;
-function TFluidLoader.Load(FName: string; SStreaming: Boolean): Boolean;
+function TFluidLoader.Load(FName: string; Loop: Boolean): Boolean;
var
Ret: cint;
begin
var
Ret: cint;
begin
end;
end;
end;
end;
- if FLooping then
+ if Loop then
fluid_player_set_loop(FPlayer, -1);
fluid_player_set_loop(FPlayer, -1);
+
FFormat.SampleRate := 44100;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
FFormat.SampleRate := 44100;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
Result := True;
end;
Result := True;
end;
-function TFluidLoader.SetPosition(Pos: LongWord): Boolean;
+function TFluidLoader.Finished(): Boolean;
begin
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;
end;
function TFluidLoader.FillBuffer(Buf: Pointer; Len: LongWord): LongWord;
if Ret = FLUID_OK then Result := Len;
end;
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
procedure TFluidLoader.Free();
begin
if FPlayer <> nil then