Ver Mensaje Individual
  #5  
Antiguo 08-08-2006
Avatar de darkphantom
darkphantom darkphantom is offline
Miembro
 
Registrado: may 2006
Ubicación: Villahermosa, Tabasco, México
Posts: 22
Reputación: 0
darkphantom Va por buen camino
heyyyy asunto arreglado, ahi les va lo ke hice, estoy usando

DIRECTORYLISTBOX
FILELISTBOX
SPEEDBUTTONS (o cualquier tipo de boton)

1: Cerrar
2: Detener

primero agregamos al uses del form el MMSYSTEM;

creamos dos variables tipo String yo las llame filenameold y filenamenew

y de ahi estos codigos :

Código Delphi [-]
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
 close; 
end;

procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
  MCISendString(PChar('stop ' + FileNameold), nil, 0, 0); //detienes la reproduccion con el boton.
end;

procedure TForm1.FormShow(Sender: TObject);
begin
 form1.DirectoryListBox1.Directory:='C:\MUSICA\'; //o donde tengas el directorio).
 form1.DirectoryListBox1.visible:=false;  // lo kitamos pa ke no se vea
 filenamenew:='';  //vaciamos las variables para ke no tengan basura
 filenameold:='';   //vaciamos las variables para ke no tengan basura 
end;

procedure TForm1.FileListBox1Click(Sender: TObject);
begin
 filenameold:=FileNamenew;  //toma el nombre del midi anterior
 filenamenew:=form1.FileListBox1.FileName; //toma el nombre del nuevo midi
 MCISendString(PChar('stop ' + FileNameold), nil, 0, 0); //detiene el anterior
 MCISendString(PChar('play ' + FileNamenew), nil, 0, 0); //reproduce el nuevo
end;

espero le sirva a alguien mas. suerte..!!!!

Última edición por dec fecha: 08-08-2006 a las 15:42:06.
Responder Con Cita