Indigo Rose Software
  #1  
Old 09-27-2005
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
SAMPLE: CDAudio

Hello,

This sample project showcases the CDAudio plugin.

Skills Used: CD, CDA, CDAudio, Timer.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP

Last edited by Desmond; 09-27-2005 at 10:10 AM.
Reply With Quote
  #2  
Old 10-05-2005
rhosk's Avatar
rhosk rhosk is offline
Indigo Rose Customer
 
Join Date: Aug 2003
Location: Maine, USA
Posts: 1,692
I've been playing around with this, and although it works great...on my system, I have 2 CDROM drives and it has a hard time determining which drive a CD is in.

Is there a way to enumerate the drives and actually choose the one (automatically) that has a CD inserted? I tried to break out of the for loop, but it still won't recognize that a CD is/is not inserted. Nothing urgent, just messin' around.
__________________
Regards,

-Ron

Music | Video | Pictures
Reply With Quote
  #3  
Old 10-05-2005
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Hello rhosk,

Try this:

Code:
-- Get all system drives
tDrives = Drive.Enumerate();

-- Initialize loaded variable
bLoaded = false;

-- Loop through drive table
for nIndex, sDrive in tDrives do
	-- Get the type of the current drive
	nType = Drive.GetType(sDrive);
	
	-- Check if the current drive is a CD drive
	if nType == DRIVE_CDROM then
		-- Attempt to load a CD from the current drive
		CDAudio.LoadCD(sDrive);
		
		-- Get the last reported error
		err = Application.GetLastError();
		
		-- Check if the error is related to the load failing
		if (err == CDAudio.ERR_NOT_CD_DRIVE) or (err == CDAudio.ERR_NO_CD_IN_DRIVE) then
			-- The specified drive either has no cd, or is not a cd drive, do whatever here
		elseif (err == CDAudio.OK) then
			-- The cd was loaded successfully
			bLoaded = true;
		else
			-- The CD was not loaded successfully
		end
	end
end

if bLoaded then
	-- There is a CD that has been loaded by the CDAudio plugin, do whatever here
else
	-- NO CD IS LOADED, ALERT THE USER
	Dialog.Message("ERROR", "No CD was found.");
end
I don't have an audio CD here to test with, so the above has only been tested with the base-case (ie. no CD). Give 'er a shot and let me know!
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
Reply With Quote
  #4  
Old 10-05-2005
rhosk's Avatar
rhosk rhosk is offline
Indigo Rose Customer
 
Join Date: Aug 2003
Location: Maine, USA
Posts: 1,692
That worked perfect, thanks
__________________
Regards,

-Ron

Music | Video | Pictures
Reply With Quote
  #5  
Old 10-05-2005
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Excellent. Happy to help!
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
Reply With Quote
  #6  
Old 12-31-2005
Schmidl Schmidl is offline
Forum Member
 
Join Date: Apr 2004
Location: Bavaria (Germany)
Posts: 91
Thanks to Desmond for the sample. But I always get that error attached . Why?

And where do I have to put the CD check script?

Cheers
Schmidl
Reply With Quote
  #7  
Old 12-31-2005
rhosk's Avatar
rhosk rhosk is offline
Indigo Rose Customer
 
Join Date: Aug 2003
Location: Maine, USA
Posts: 1,692
Make sure you have the plugin "CDAudio" checked
__________________
Regards,

-Ron

Music | Video | Pictures
Reply With Quote
  #8  
Old 12-31-2005
Schmidl Schmidl is offline
Forum Member
 
Join Date: Apr 2004
Location: Bavaria (Germany)
Posts: 91
Oops

thank you (I should think before I write )

Schmidl
Reply With Quote
  #9  
Old 12-31-2005
Schmidl Schmidl is offline
Forum Member
 
Join Date: Apr 2004
Location: Bavaria (Germany)
Posts: 91
But there is still the last question: Where do I have to put the drive-check-code from Desmond postet on 10-05-2005? Page on show, before the script of the play button...

Schmidl
Reply With Quote
  #10  
Old 12-31-2005
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
I guess it depends on when the Audio will start to play. You could place that code in the On Show event and then if an Audio CD is not detected you can disable the Play Audio button. Or you can have it on the Play button and if no Audio CD is found then serve back an error to the user.

Tigg
__________________
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine
Reply With Quote
  #11  
Old 01-24-2007
markczajka markczajka is offline
Forum Member
 
Join Date: Nov 2003
Posts: 35
Can the CD Audio sample be reposted?

Can the CD Audio sample be reposted?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My Native Indian Flute sample... Intrigued General Chat 9 10-28-2004 09:32 PM
New Sample Project Available Darryl Setup Factory 7.0 Discussion 1 09-27-2004 05:00 PM
Sample project TABLE2HTML Corey AutoPlay Media Studio 5.0 1 04-26-2004 08:37 PM
Newbie Question re: Media Player "Sample Video" videoman AutoPlay Media Studio 4.0 20 02-17-2003 03:37 PM
Are the Templates for the 5 Sample Applications available for download? francisq AutoPlay Media Studio 4.0 2 12-17-2002 11:22 PM


All times are GMT -6. The time now is 11:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software