Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Rui 'Trovatore' Pires on Tue 20/12/2005 21:14:37

Title: Bug: CDAudio function doesn't return anything (FIXED)
Post by: Rui 'Trovatore' Pires on Tue 20/12/2005 21:14:37
From a thread in the "AGS Final" thread - I took it out because it was getting unrelated to the thread.

I noticed I couldn't do "game.score=CDAudio(eCDGetNumTracks,0);" - apparently it "can't convert void to int"?

EDIT - It's also unfortunate that even though I may change the number of the selected CD drive, it'll always eject/close the tray of the primary CD drive.

EDIT 2 - Ignore the previous edit. Either multiple CD drives don't work properly or I'm not making them work properly.

EDIT 3 - Hang on, I need clarification.

QuoteWindows: Yes, but supports 1 CD-ROM drive only

Does that mean that it only supports one CD-rom drive at a time, or only one drive period? I was reading it as the former, and hoping it was so, because my 1st CD-rom drive is screwed up and I have to use the second - except that now I see maybe I can't...

Edit by strazer:
Changes in 2.71 UPDATE:
* Fixed CDAudio not being able to return values.
Title: Re: Regarding CDAudio
Post by: Elliott Hird on Wed 21/12/2005 10:22:46
One, .(period)

CDAudio returns nothing, which makes it return void, which can't be used in any way unless you declare the varible as void and even then it's useless *gasp gasp*
Title: Re: Regarding CDAudio
Post by: Rui 'Trovatore' Pires on Wed 21/12/2005 10:31:12
Elliot, what are you talking about? CDAudio(eCDGetNumTracks,0); returns the number of tracks of the CD in drive. I could do

if (CDAudio(eCDGetNumTracks,0)==0) lblStatus.Text="No CD!";

What I COULDN't do was store the number in a variable.

About the multiple drives - in that case, could that be looked in, please, CJ? My primary drive is screwed up, and this means I can't use it, and have to select the 2nd drive, but if I can't use it... and furthermore, apparently only DOS accepted multiple CD-Drives, so currently the eCDSelectDrive thingy is obsolete. Not that it should go away, beacuse I kinda need it...

Irony of the thing: I'm making a quick-and-dirty application for me, but I'm one of the few people who can't use it. :P
Title: Re: Regarding CDAudio
Post by: Pumaman on Wed 21/12/2005 16:28:53
Well spotted, CDAudio is broken in that it can't return any values. Must have always been declared as void but it's only the new return type checking in 2.71 that has revealed this as a problem.

As for multiple CD drives, to be honest I don't think it's worth it. Apart from this thread I haven't heard of anyone seriously using the CD Audio commands for ages ... it's all MP3 and OGG these days.
Title: Re: Regarding CDAudio
Post by: Rui 'Trovatore' Pires on Wed 21/12/2005 23:41:58
Ah well. Guess I should just find myself a dirty CD player, then. :P Windows Media Player bugs the hell out of me when just playing CDs, so I wanted to make a quick and dirty app with AGS... heh. Or maybe I should fix my primary drive. There's a thought.

Still, if you're not going to add it, now you know you have a function that has become obsolete and can be removied.
Title: Re: Regarding CDAudio
Post by: Gilbert on Thu 22/12/2005 01:10:20
Well... you know... you can use other better ways to create a CD player than using AGS... Especially when hat feature was not proven to work perfectly in AGS...
Title: Re: Regarding CDAudio
Post by: Rui 'Trovatore' Pires on Thu 22/12/2005 10:01:38
Arr, but I'd have to know how to do it any other way. AGS is the only ray of literacy in the dark shadows of the corridors that are my knowledge of programming.
Title: Re: Regarding CDAudio
Post by: Shane 'ProgZmax' Stevens on Fri 23/12/2005 02:52:16
Or you could get winamp...Which plays cds in addition to just about everything else.
Title: Re: Regarding CDAudio
Post by: Rui 'Trovatore' Pires on Fri 23/12/2005 09:31:24
So does media player. I just don't like the way it handles it.

<waits for a mod to either warn, lock, or (this is more likely) split the thread>
Title: Re: Regarding CDAudio
Post by: Gilbert on Fri 23/12/2005 09:51:21
Don't know about Mplayer, but I think Winamp can play digitized CDA through your sound card, which may work better than dplaying directly using the CDA functions of the drive.

Anyway, I don't think it's really necessary to warn or split this thread (but locking, lemme think...)