Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rate Thread Display Modes
Old 03-11-2008, 04:54 AM   #1
Amit Jain
Prospect
 
Join Date: Dec 2006
Location: India(pune)
Posts: 48
Arrow How to detect programmatically that Audio CD is inserted.

How to detect programmatically that Audio CD is inserted in CD Drive on macintosh?
__________________
Regards..
@mit..
Amit Jain is offline   Reply With Quote
Old 03-11-2008, 06:16 AM   #2
VirtualTracy
Major Leaguer
 
Join Date: Dec 2007
Location: Oceania
Posts: 395
iTunes has a preference that can take care of this ...



Most audio players will do this AFAIK.
VirtualTracy is offline   Reply With Quote
Old 03-11-2008, 07:23 AM   #3
Lutin
Major Leaguer
 
Join Date: May 2006
Location: Paris, France
Posts: 311
I just did that two days ago.

Send me your email by pm and I will send you the piece of code on thursday.

If you need it before, look for a code sample published by Apple. It has most of the code needed. I don't recall the name, but that should be easy to find.
Lutin is offline   Reply With Quote
Old 03-11-2008, 10:07 AM   #4
Mikey-San
Hall of Famer
 
Join Date: Jan 2002
Posts: 3,541
Quote:
Originally Posted by Serge_N_Gin
iTunes has a preference that can take care of this ...



Most audio players will do this AFAIK.

How do you think this answers his question?
__________________
COMPUTER TYPE
SOME SPECIFICATIONS I COPIED FROM THE BOX
STUFF I INSTALLED ALL BY MYSELF
"WITTY QUOTE"
Mikey-San is offline   Reply With Quote
Old 03-11-2008, 07:13 PM   #5
Red_Menace
All Star
 
Join Date: Mar 2006
Location: Littleton, Colorado, USA
Posts: 506
You didn't mention what programming you are using, but all mounted drives get an alias put in the /Volumes folder - you could periodically check the folder or use a folder action script.
Red_Menace is offline   Reply With Quote
Old 03-11-2008, 07:26 PM   #6
Mikey-San
Hall of Famer
 
Join Date: Jan 2002
Posts: 3,541
Quote:
Originally Posted by Red_Menace
You didn't mention what programming you are using, but all mounted drives get an alias put in the /Volumes folder - you could periodically check the folder or use a folder action script.

He'd have to install a folder action script, and have the user enable it for a folder the user can't normally see. What if his application is a GUI-less application that runs when there is no user logged into the GUI? (And as such, the Finder won't be running.)

Anyway, there are ways to be notified when a device is mounted than continual polling. See:

http://developer.apple.com/documenta...00391-BCIIDEAI

As you say, however, not knowing the programming environment, we can't point anyone in the right direction.

It'd be interesting to know the higher-level goal.
__________________
COMPUTER TYPE
SOME SPECIFICATIONS I COPIED FROM THE BOX
STUFF I INSTALLED ALL BY MYSELF
"WITTY QUOTE"
Mikey-San is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump



All times are GMT -5. The time now is 03:19 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.