Registriert seit: 13. Jun 2004
5 Beiträge
|
Re: Probleme mit FMod
21. Jun 2004, 00:25
Code:
function TFmodEngine.Get_Time : integer; // Get Time
begin
if Stream <> nil then
result:= FSOUND_Stream_GetTime(Stream);
if (PlayerState = ENGINE_STOP) or
(PlayerState = ENGINE_SONG_END) then
Result := 0
end;
function TFmodEngine.Get_SongLen : Integer; //Get SongLen
var MilliSec : integer;
begin
if Stream <> nil then
begin
MilliSec := FSOUND_Stream_GetLengthMs(stream);
result:= MilliSec;
end;
if (PlayerState = ENGINE_STOP) or
(PlayerState = ENGINE_SONG_END) then
Result := 0
end;
Code:
function SecondToTime(const m_secondes : String) : string;
var
minutes : Integer;
secondes : Integer;
m_secondsToTime : String;
begin
minutes := StrToInt(m_secondes) div 60;
secondes := StrToInt(m_secondes) - minutes * 60;
m_secondsToTime := Format('%.2d:%.2d', [minutes, secondes]);
result := m_secondsToTime;
end;
Total_Time.Caption:= FormatDateTime ('hh:nn:ss',(Get_Time div 1000)/ (24 * 60 * 60));
Cur_time.Caption:= FormatDateTime ('hh:nn:ss',(Get_SongLen / 1000)/ (24 * 60 * 60));
label1.Caption:= SecondToTime(inttostr(Get_SongLen div 1000));
|
|
Zitat
|