Ver Mensaje Individual
  #3  
Antiguo 07-09-2004
Avatar de Delphius
[Delphius] Delphius is offline
Miembro Premium
 
Registrado: jul 2004
Ubicación: Salta, Argentina
Posts: 5.582
Reputación: 25
Delphius Va camino a la fama
Thumbs up Facil... de esta manera:

Esto se puede hacer de esta manera:

Código Delphi [-]
procedure TFPral.Establecer_Tiempos;
var Hs, Min, Seg: integer;
    LHs, LMin, LSeg: string;
begin
// la barra de proceso trabaja en segundos
Proceso.Min := 0;
Proceso.Max := Reproductor.Length Div 1000;
Proceso.Position := 0;
// calcular tiempo
Seg := Reproductor.Length Div 1000;
Hs := Seg Div 3600;
Seg := Seg - (Hs * 3600);
Min := Seg Div 60;
Seg := Seg - (Min * 60);
if Hs >= 10
   then begin
        LHs := IntToStr(Hs);
        end
   else begin
        LHs := '0'+IntToStr(Hs);
        end;
if Min >= 10
   then begin
        LMin := IntToStr(Min);
        end
   else begin
        LMin := '0'+IntToStr(Min);
        end;
if Seg >= 10
   then begin
        LSeg := IntToStr(Seg);
        end
   else begin
        LSeg := '0'+IntToStr(Seg);
        end;
LTiempo.Caption := Lhs +':'+ LMin +':'+ LSeg;
Ltema.Caption := ExtractFileName(Reproductor.FileName);
Proceso.Enabled := True;
Play.Enabled := True;
end; { Fin Establecer_Tiempos }

Para que funcione correctamente asegúrate antes de hacer dichos cálculos que la proopiedad TimeFormat tenga el valor tfMilliseconds.
__________________
Delphius
[Guia de estilo][Buscar]
Responder Con Cita