Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Dec 2000 09:37:28 -0600
From:      "Michael C . Wu" <keichii@iteration.net>
To:        Artem Koutchine <matrix@ipform.ru>
Cc:        questions@FreeBSD.ORG, hardware@FreeBSD.ORG
Subject:   Re: CD detection from a c program
Message-ID:  <20001218093728.B66439@peorth.iteration.net>
In-Reply-To: <003e01c0683a$cfad3200$0c00a8c0@ipform.ru>; from matrix@ipform.ru on Sun, Dec 17, 2000 at 06:05:29PM %2B0300
References:  <003e01c0683a$cfad3200$0c00a8c0@ipform.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 17, 2000 at 06:05:29PM +0300, Artem Koutchine scribbled:
| 1) Sit and wait for a CD to be inserted
| 2) If CD is an AUDIO cd then DO THING1 (play cd)
| 3) if a CD is a DATA cd then DO THING2 (scan for mp3s, run mp3 player)
| 4) is a CD is an OTHER cd type the DO THING3 (play video?, nuts..)
| 5) If CD is ejected then do THING4
| 
| I have no problems with the THINGS :) But i do have
| trouble with
| 1) Detecting the moment when a cd is inserted. Is there some
| kind of event? Or must I poll the drive every second?
| 2) Detecting the type of CD. I have no clue how to do it.
| 3)  Detecting the moment when the user press the eject button

Please see the cdcontrol(8) source, or the code in ports/audio/grip
and the code in mount(8)

-- 
+------------------------------------------------------------------+
| keichii@peorth.iteration.net         | keichii@bsdconspiracy.net |
| http://peorth.iteration.net/~keichii | Yes, BSD is a conspiracy. |
+------------------------------------------------------------------+


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hardware" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001218093728.B66439>