?
Solved

Edit Play List

Posted on 1998-09-22
8
Medium Priority
?
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Accepted Solution

by:
333 earned 160 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
 

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! 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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

765 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