Autor Beitrag
Starfighter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Fr 09.05.03 18:05 
Hallo ihr Profis.

Ich habe mal ne Frage, ich habe eine Tmediaplayer komponente und wollte wohl gerne wissen wie ich es hin bekomme das der im Label die Trackzeit der mp3 anzeigt.

Danke für jede Antwort.. :)
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Fr 09.05.03 18:45 
Hallo,

für den aktuellen Titel machst du das so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Procedure ...;
var x : Integer;
begin
x := MediaPlayer1.Length div 1000; // Umrechnen von Millisekunden nach Sekunden
Label.Caption := IntToStr(x div 60)+':'+IntToStr(x mod 60); // Minuten:Sekunden
[...]
end;


Für verschiedene Titel (z.Bsp. Playlist) schau dir mal die Eigenschaft TrackLength[] an.

Wenn du die aktuelle Zeit haben willst, nimmst du MediaPlayer.Position (wieder in Millisekunden).

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.

_________________
If accidentally read, induce vomitting.
Starfighter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Fr 09.05.03 19:14 
Danke... Nur er soll die aktuelle Zeit anzeigen. Aber das kann ich auch gebrauchen.. :)
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 09.05.03 21:35 
Hi,

für die aktuelle position geht es genauso, nur mit TMediaPlayer.Position ;)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Starfighter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Sa 10.05.03 08:34 
ja, danke hat geklappt!! :)
Fisheye
Hält's aus hier
Beiträge: 11



BeitragVerfasst: So 12.06.05 03:07 
Ich Habe ein kelines problem mit TMediaPlayer.Position. Die Aktuelle Zeit wird auf label 2 nicht angezeig nur 0:0. Die komplette Länge des Liedes wird auf label 1 aber angezeigt angezeigt,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
//Aktuelle Zeit wrid nicht angezeigt
x2 := MediaPlayer1.Position div 1000; // Umrechnen von Millisekunden nach Sekunden
  Label2.Caption := IntToStr(x2 div 60)+':'+IntToStr(x2 mod 60); //Minuten : Sekunden
  
  //Länge des Liedes wird angezeigt
x := MediaPlayer1.Length div 1000; // Umrechnen von Millisekunden nach Sekunden
  Label1.Caption := 'Gesamtzeit : ' + IntToStr(x div 60)+':'+IntToStr(x mod 60); //Minuten : Sekunden


x2 sowie x sind integer

Wo lieg mein fehler ?
Darnus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Fr 13.10.06 18:17 
Hallo ich poste mal mein problemm hinzu...

Wie geht das bei bassdllplayer ?? Mit dem anzeigen ich habe ganze zeit aus probiert aber klappt irgendwie nicht. :(

:arrow:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Timer4Timer(Sender: TObject);
var i:integer;
begin
i := BassdllPlayer1.SongLength div 1000; // Umrechnen von Millisekunden nach Sekunden
Label3.Caption :='Zeit: '+ IntToStr(i div 60)+':'+IntToStr(i mod 60); // Minuten:Sekunden
end;


kann mir jemand helfen ??? Thx!
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Sa 14.10.06 01:25 
darnus mach plzn neues thema auf, wenn wir hier jetz vollkommen durcheinander fragen beantworten weiß niemand mehr worums denn nun wirklich geht

fisheye:
wo schreibst du das hin?
ausblenden Delphi-Quelltext
1:
2:
  x2 := MediaPlayer1.Position div 1000; // Umrechnen von Millisekunden nach Sekunden  
  Label2.Caption := IntToStr(x2 div 60)+':'+IntToStr(x2 mod 60);
Darnus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Sa 14.10.06 02:59 
Das kommt im timer, habs bereits getestet.. es geht....