Bug: CDAudio function doesn't return anything (FIXED)

Started by Rui 'Trovatore' Pires, Tue 20/12/2005 21:14:37

Previous topic - Next topic

Rui 'Trovatore' Pires

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.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Elliott Hird

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*

Rui 'Trovatore' Pires

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
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

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.

Rui 'Trovatore' Pires

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.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gilbert

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...

Rui 'Trovatore' Pires

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.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Shane 'ProgZmax' Stevens

Or you could get winamp...Which plays cds in addition to just about everything else.

Rui 'Trovatore' Pires

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>
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gilbert

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...)

SMF spam blocked by CleanTalk