Registriert seit: 15. Nov 2004
2.647 Beiträge
|
Re: Trackbar/Zeit
11. Dez 2004, 17:52
1. (Play)
Delphi-Quellcode:
procedure TFormPlayer.Image1Click(Sender: TObject);
var aStream: integer;
begin
BASS_Start();
BASS_ChannelPause(channel);
position := 0;
op1.Title := 'Open Files';
if not op1.Execute then exit;
Channel := BASS_StreamCreateFile(FALSE, PChar(op1.FileName), 0, 0, 0);
BASS_StreamPlay(Channel, False, 0);
Image1.Enabled:= true;
p1.Visible:= false;
tb1.MaxValue := BASS_MusicGetLength(aStream, True);
end;
2. (Timer)
Delphi-Quellcode:
procedure TFormPlayer.tbTimer(Sender: TObject);
var
TrackPos, hFileStream: Integer;
begin
TrackPos := BASS_ChannelGetPosition(hFileStream);
tb1.Position := TrackPos;
end;
|
|
Zitat
|