DelphiFAQ Home Search:

Determine current CD track of TMediaPlayer

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Question:
How can I determine the current track of an audio CD played by TMediaPlayer?

Answer:
The following code will retrieve it from the TMediaPlayer component. If you want to display it on a form, you could put the code in a timer event. You need the unit MMSystem in your uses clause.

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  MMSystem, MPlayer, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    MediaPlayer1: TMediaPlayer;
    Timer1: TTimer;
    Label1: TLabel;
    Label2: TLabel;
    procedure Timer1Timer(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Timer1Timer(Sender: TObject);
var
  Trk,
  Min,
  Sec: Word;
begin
  with MediaPlayer1 do
  begin
    Trk := MCI_TMSF_TRACK(position);
    Min := MCI_TMSF_MINUTE(position);
    Sec := MCI_TMSF_SECOND(position);
    Label1.caption := Format('Track %.2d', [Trk]);
    Label2.caption := Format('Position %.2d:%.2d', [Min, Sec]);
  end;
end;

end.
You don't like the formatting? Check out SourceCoder then!
Content-type: text/html

Comments:

2012-11-12, 03:52:59
coach001 from United States  
2018-02-01, 23:20:02
MarkHelton from India  
Nice update to the release page! While on the surface it looks similar, we have made lots of small improvements under the hood and a completely new media player that we'd love to tell you about! The media player now launches at the bottom of the page so you can continue using it. Anyways Thank you so much for this submit and got many ideas from it. All bloggers should have the responsibility to contribute genuine contents.
Ref: https://waltessays.com/
2018-11-01, 04:26:10
Haris ohoo from Pakistan  
I am glad to read it.
https://www.sfsd.com
2019-04-22, 05:26:13
ronikasharma  
Hello, This side ronika sharma an independent Bangalore Escorts. Today i will share every moment of my life here. So are you ready to have fun on this amazing place?
http://www.thebanga..scorts.in/
2020-04-29, 07:02:11
maryajonus0037 from Canada  
[url=' https://www.escortsb..com/']Call Girls in Haridwar[/url]
[url=' https://www.lailaesc..html']Call Girls in Haridwar[/url]
[url=' https://www.lailaesc..html']Call Girls in Jaipur[/url]
[url=' http://www.callgirl..mer/']Call Girls in Ajmer[/url]
[url=' http://www.callgirl..mer/']Call Girls in Ajmer[/url]
[url=' http://www.callgirl..mer/']Call Girls in Ajmer[/url]
[url=' https://www.lailaesc..html']Call Girls in Ajmer[/url]
[url=' https://www.sexygirl...php']Call Girls in Ajmer[/url]
[url=' https://www.taniasha...php']Call Girls in Ajmer[/url]
[url=' http://www.callgirl..war/']Call Girls in Haridwar[/url]
2020-04-29, 07:02:59
maryajonus0037 from Canada  
<a href=' https://www.lailaesc..gt;Russian Escorts in Jaipur</a>
<a href=' https://www.taniasha..gt;Russian Escorts in Jaipur</a>
<a href=' http://www.callgirl..gt;Escorts in Jaipur</a>
<a href=' http://www.callgirl../'>Call Girls in Jaipur</a>
<a href=' https://www.taniasha..gt;Russian Escorts in Jaipur</a>
2020-04-29, 07:03:24
maryajonus0037 from Canada  
https://www.escortsb..etin.com/
https://www.lailaesc..dwar.html
https://www.lailaesc..ipur.html
http://www.callgirl..ls-ajmer/
http://www.callgirl..ls-ajmer/
http://www.callgirl..in-ajmer/
https://www.lailaesc..jmer.html
https://www.sexygirl..ajmer.php
https://www.taniasha..aipur.php
http://www.callgirl..haridwar/
http://www.callgirl..haridwar/
https://www.lailaesc..ices.html
https://www.sexygirl..idwar.php
http://www.callgirl..s-jaipur/
http://www.callgirl..s-jaipur/
http://www.callgirl..ipur.com/
http://www.callgirl..s-jaipur/
http://www.pinkzilla.in/
https://www.sexygirl..aipur.php
http://www.callgirl..om/ajmer/
http://www.callgirl..mer-road/
http://www.callgirl..ls-ajmer/
http://www.callgirl..in-ajmer/
https://www.taniasha..aipur.php
http://www.callgirl..haridwar/
http://www.callgirl..haridwar/
https://www.escortsb..etin.com/
https://www.lailaesc..dwar.html
http://www.callgirl..n-jaipur/
http://www.callgirl..agatpura/
https://www.taniasha..aipur.php
http://www.callgirl..in-ajmer/
http://www.callgirl..in-ajmer/
http://www.callgirl..in-ajmer/
https://www.lailaesc..jmer.html
https://www.taniasha..aipur.php
http://www.callgirl..haridwar/
http://www.callgirl..haridwar/
http://www.callgirl..haridwar/
https://www.escortsb..etin.com/
https://www.lailaesc..dwar.html
https://www.sexygirl..idwar.php
http://www.callgirl..n-jaipur/
http://www.callgirl..n-jaipur/
http://www.callgirl..n-jaipur/
http://www.pinkzilla.in/
https://www.lailaesc..ipur.html
https://www.taniasha..aipur.php
https://www.taniasha..corts.php
http://www.callgirl..in-ajmer/
https://www.lailaesc..jmer.html
http://www.callgirl..haridwar/
http://www.callgirl..haridwar/
http://www.callgirl..haridwar/
https://www.escortsb..etin.com/
https://www.lailaesc..dwar.html
http://www.callgirl..n-jaipur/
http://www.callgirl..n-jaipur/
http://www.callgirl..s-jaipur/
https://www.lailaesc..ipur.html
https://www.taniasha..aipur.php
http://www.callgirl..s-jaipur/
http://www.callgirl..s-jaipur/
http://www.callgirl..ipur.com/
http://www.pinkzill..ipur.html
https://www.taniasha..aipur.php
http://www.callgirl..ls-ajmer/
http://www.callgirl..ls-ajmer/
http://www.callgirl..in-ajmer/
https://www.taniasha..aipur.php
http://www.callgirl..haridwar/
http://www.callgirl..haridwar/
https://www.escortsb..etin.com/
https://www.lailaesc..dwar.html
http://www.callgirl..s-jaipur/
http://www.callgirl..s-jaipur/
http://www.callgirl..s-jaipur/
http://www.callgirl..ajasthan/
http://www.pinkzill..ipur.html
https://www.lailaesc..ipur.html
https://www.taniasha..aipur.php
http://www.callgirl..n-jaipur/
http://www.callgirl..s-jaipur/
https://www.taniasha..corts.php
2020-06-14, 06:54:31
wares903  
At SaludWares.com we offer :
* Reshipment is offered and refunds for any unforeseen circumstance only at saludWares
* Secure delivery options depending on location only at SaludWares
* No Prescription Required | Without Rx only at saludWares
* Pharmacy Grade Medicines only at SaludWares
* Affordable and discount prices only at saludWares
* Only at Saludwares - Fast and Stealth delivery - Tracking Available! 
* Cryptocurrency only Pharmacy - notify us in helping you to purchase cryptocurrency fast and discreet

buy 10mg Ambien zolpidem | buy 10mg diazepam valium | buy 10mg Ritalin online | order 100mg viagra securely
| buy 10mg/325mg hydrocodone online | buy 30mg Adderall XR online
| buy 40mg Opana er online | Purchase 50mg Vyvanse secure | 60mg morphine for sale
| buy 70mg Vyvanse discreetly | order 80mg oxycontin online | where to buy 8mg Dilaudid online
| order 8mg subtext near you | buy Codeine 30mg Securely | Buy 30mg Adderall IR online
| Purchase Watson hydrocodone 540 securely | buy 30mg oxycodone near you | pharmacy grade Xanax 2mg for sale
| Secure store to buy dsuvia online | | buy patches fentanyl 100mcg | buy quality ketamine securely in the USA | buy pharmacy grade medications from saludwares secure online


https://www.saludwar..zolpidem/

https://www.saludwar..m-valium/

https://www.saludwar..n-online/

https://www.saludwar..a-online/

https://www.saludwar..e-online/

https://www.saludwar..r-online/

https://www.saludwar..r-online/

https://www.saludwar..e-online/

https://www.saludwar..e-online/

https://www.saludwar..e-online/

https://www.saludwar..n-online/

https://www.saludwar..d-online/

https://www.saludwar..x-online/

https://www.saludwar..e-online/

https://www.saludwar..l-online/

https://www.saludwar..for-sale/

https://www.saludwar..e-secure/

https://www.saludwar..prazolam/

https://www.saludwar..a-online/

https://www.saludwar..t-online/

https://www.saludwar..-patches/

https://www.saludwar..0mg-10ml/

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: