Question sur le composant TMediaPLayer !

Hi !

J'aimerais savoir comment obtenir la durée totale de la chanson sélectionnée dans un composant TMediaPlayer...

Merci A+.

2 réponses

  1. Pardon pour NOn Utilsé fallait écrire Non_Utilise

    </alicia_3107>
    0
    1. Voici un TRUC que tu peux essayer ...

      ---------------------------------------------------------------------------
      type

      Tableau_HMS = record
      H: byte;
      M: byte;
      S: byte;
      Non Utilisé: byte;
      end ;

      procedure TForm1.Button1Click(Sender: TObject);
      var Longueur: LongInt;
      begin

      MediaPlayer1.TimeFormat := tfHMS;
      { Initialise le format de l'heure - remarquez que certains pilotes ne supportent pas tfHMS }

      Longueur := MediaPlayer1.Length;
      { Récupérer la .Length dans la variable Longueur }

      with Tableau_HMS(Longueur) do
      { Transtyper Longuer dans un Tableau_HMS }

      begin
      Label1.Caption := IntToStr(Hours);
      { Affiche les heures dans Label1 }

      Label2.Caption := IntToStr(Minutes);
      { Affiche les minutes dans Label2 }

      Label3.Caption := IntToStr(Seconds);
      { Affiche les secondes dans Label3 }

      end ;
      end ;
      ----------------------------------------------------------------------------

      </alicia_3107>
      0