|
#1
|
||||
|
||||
|
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. |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
||||
|
||||
|
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
|
|
#4
|
||||
|
||||
|
That worked perfect, thanks
|
|
#6
|
|||
|
|||
|
Thanks to Desmond for the sample. But I always get that error attached
And where do I have to put the CD check script? Cheers Schmidl |
|
#7
|
||||
|
||||
|
Make sure you have the plugin "CDAudio" checked
|
|
#8
|
|||
|
|||
thank you Schmidl |
|
#9
|
|||
|
|||
|
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 |
|
#10
|
||||
|
||||
|
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 |
|
#11
|
|||
|
|||
|
Can the CD Audio sample be reposted?
Can the CD Audio sample be reposted?
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
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.








thank you
Linear Mode

