Article View: borland.public.cppbuilder.multimedia
Article #89Re: Playing Audio CD
From: Stefano Bonifazi
Date: Wed, 02 Nov 2005 11:21
Date: Wed, 02 Nov 2005 11:21
70 lines
3674 bytes
3674 bytes
Sorry Mr. Gambit :( I really can't manage to get anything :(
By using the following code:
MCI_SYSINFO_PARMS mcisysinfo;
char Buffer[256];
ZeroMemory(&mcisysinfo,sizeof(MCI_SYSINFO_PARMS));
mcisysinfo.lpstrReturn=Buffer;
mcisysinfo.dwRetSize=256;
mcisysinfo.wDeviceType=MCI_DEVTYPE_CD_AUDIO;
MCIERROR
errcode=mciSendCommand(NULL,MCI_SYSINFO,MCI_SYSINFO_QUANTITY,(DWORD)&mcisysinfo);
if(errcode==0)
{
RichEdit1->Lines->Add("Number of CD_ROM: "+IntToStr(Buffer));
}
else
{
mciGetErrorString(errcode,Buffer,256);
RichEdit1->Lines->Add(AnsiString(Buffer));
}
I get "Number of CD_ROM: 1" while I have 3 CDRoms (2 physique and one
virtual) in my (WInXP Pro) system.
If I try to get the name by MCI_SYSINFO_NAME i get "cdaudio" and not
something like "Plextor DVDR ..." :(
Please Can You be so kind to write 2 lines of code showing how to get a
list of my CD-Drives and how to open a selected one?
Thank You very much in advance,
Stefano B.
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> ha scritto nel messaggio
news:4367fa1f@newsgroups.borland.com...
>
> "Stefano Bonifazi" <stefboombastic@libero.it> wrote in message
> news:4367e9aa@newsgroups.borland.com...
>
>> I need to play audio-cds from within my application. The problem
>> is that both TMediaPlayer and mci APIs seem to open always a
>> "default" CD-ROM drive, that is I cannot set the CD-ROM drive
>> in which the Audio cd is :-(
>
> TMediaPlayer does not support what you are looking for.
>
> The MCI API, on the other hand, has an MCI_OPEN_TYPE_ID flag available for
> the MCI_OPEN command. That flag will allow you to specify the index of
> the
> specific CD-ROM drive that you want to use. You can use the MCI_SYSINFO
> command to determine how many CD-ROM drives are available to MCI. If
> successful, the MCI_OPEN command returns the ID of the device, which you
> can
> then use to send other commands to that same device.
>
>> I'd need seek capabilities into the played track too
>
> There is an MCI_SEEK command available for that. Make sure to use the
> MCI_SET command after opening the CD-ROM drive to set the device's time
> format to MCI_FORMAT_TMSF (track/minute/second/frame).
>
> You can use the MCI_MAKE_TMSF() macro when specifying time stamps to the
> MCI_PLAY and MCI_SEEK commands. Use the MCI_TMSF_TRACK(),
> MCI_TMSF_MINUTE(), MCI_TMSF_SECOND(), and MCI_TMSF_FRAME() macros when
> retreiving the individual values from time stamps that you obtain.
>
> You can use the MCI_STATUS command to query information about the
> individual
> tracks, such as their lengths.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<4368a145@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4367e9aa@newsgroups.borland.com> <4367fa1f@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,b7a843302d134117 X-Google-Attributes: gid10d0fc,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Stefano Bonifazi" <stefboombastic@libero.it> Newsgroups: borland.public.cppbuilder.multimedia References: <4367e9aa@newsgroups.borland.com> <4367fa1f@newsgroups.borland.com> Subject: Re: Playing Audio CD Date: Wed, 2 Nov 2005 12:21:54 +0100 Lines: 72 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 81.211.154.246 Message-ID: <4368a145@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130930501 81.211.154.246 (2 Nov 2005 03:21:41 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail