Solved

Edit Play List

Posted on 1998-09-22
8
142 Views
Last Modified: 2010-04-06
How could I make the cd play the tracks in the order i tell it to. When one track is done playing, it should go on to the next track in a string of number or something
0
Comment
Question by:spat
8 Comments
 

Expert Comment

by:9pep
ID: 1340593
I really don't know.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340594
HeLlO yOu TwO! jUsT wOnDeRiNg WhY aRe YoU pLaYiNg TrIcKs On EaCh OtHeR???

ReGaRdS,
ViKtOr IvAnOv
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1340595
0
 
LVL 2

Accepted Solution

by:
333 earned 80 total points
ID: 1340596
Hi,
I did it this way:
Let's say MP is TMediaPlayer, NowPlaying is track number, EndPosition is end position of track, track list is in ListBox1 (track list is just tracks numbers, i.e 01,02,03), CurTrack is track list's index, CDTimer is TTimer (interval=100).
.
{Set positions and track number for first track in a ListBox1}
CurTrack:=0;
NowPlaying:=strtoint(ListBox1.Items[CurTrack]);
MP.Position:=MP.TrackPosition[NowPlaying];
EndPosition:=MP.TrackPosition[NowPlaying]+MP.TrackLength[NowPlaying];
.
procedure TForm1.CDTimerTimer(Sender: TObject);
begin
  if MP.Position>=EndPosition then begin
    CDTimer.Enabled:=false;
    if MP.Mode=mpPlaying then MP.Pause;
    inc(CurTrack);
    NowPlaying:=strtoint(ListBox1.Items[CurTrack]);
    MP.Position:=MP.TrackPosition[NowPlaying];
    EndPosition:=MP.TrackPosition[NowPlaying]+MP.TrackLength[NowPlaying];
    if MP.Mode=mpPaused then MP.Resume;
    CDTimer.Enabled:=true;
  end;
end;

A.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:spat
ID: 1340597
I almost got your code to work but it play about the first second and then stops.
what do think i should do?
0
 
LVL 2

Expert Comment

by:333
ID: 1340598
Set MP.TimeFormat to tfMilliseconds.
0
 

Author Comment

by:spat
ID: 1340599
it seems to work now but when you change tracks, it stops and you have to press play again.
0
 
LVL 2

Expert Comment

by:333
ID: 1340600
The problem is with this line:

if MP.Mode=mpPaused then MP.Resume;

The point is, that when you call MP.Pause, MP.Mode sets to mpStopped, not mpPaused.
You must add some variable (i.e PlayPressed:boolean), that indicates that Play button was pressed by user. Set PlayPressed to true, when user presses Play button. Set PlayPressed to false, when user presses Stop button. Then change the line to

if (MP.Mode=mpStopped) and PlayPressed then MP.Resume;

A.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now