Ver Mensaje Individual
  #4  
Antiguo 24-05-2012
Avatar de Faust
Faust Faust is offline
Miembro
 
Registrado: abr 2006
Ubicación: México D.F.
Posts: 930
Reputación: 19
Faust Va por buen camino
Ya hace mucho que hice algo así... no tengo el proyecto a la mano pero es algo más o menos así:

Utiliza un Scrollbar y le asignas el valor mínimo y máximo al cargar el archivo:

Código Delphi [-]
ScrollBar1.Min := 0;
ScrollBar1.Max := MediaPlayer1.Length;

Actualizas cada cierto tiempo con un timer el progreso y utilizas una variable semáforo en tu form para indicar si se está arrastrando o no el scroll:

Código Delphi [-]
procedure TForm1.Timer.Timer1Timer(Sender: TObject);
begin
  if not FScrolling then
    ScrollBar1.Position := MediaPlayer1.Position;
end;

Y en el evento de arrastrar el scroll:

Código Delphi [-]
procedure TForm1.SCrollBar1Scroll(Sender: TObject; ScrollCode: TScrollCode;
  var ScrollPos: Integer);
begin
  FScrolling := True;
  if SCrollCode=scEndScroll then
  begin
    MediaPlayer1.Position := ScrollBar1.Position;
    MediaPlayer.Play;
    FScrolling := False;
  end;
end;

Y eso es todo, no era mi intención hacerte la tarea, pero me encontraba inspirado en este momento .

De todas maneras analiza la lógica que usé, trata de comprender el código y manos a la obra.
__________________
Herr Heins Faust
Responder Con Cita