1 /* 2 * cdrom.h cdrom control 3 * 4 * Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp> 5 * 1998- <masaki-c@is.aist-nara.ac.jp> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * 21 */ 22 /* $Id: cdrom.h,v 1.14 2002/08/18 09:35:29 chikama Exp $ */ 23 24 #ifndef __CDROM_H__ 25 #define __CDROM_H__ 26 27 /* 28 * CD-ROM �ؤΥ�������������ʾ��ϼ�����������䤷�ƤߤƲ����� 29 */ 30 /* ioctrole retry times */ 31 #define CDROM_IOCTL_RETRY_TIME 3 32 /* ioctrole retry interval (100ms unit) */ 33 #define CDROM_IOCTL_RETRY_INTERVAL 1 34 35 typedef struct { 36 int t,m,s,f; 37 } cd_time; 38 39 struct _cdromdevice { 40 int (* init)(char *); 41 int (* exit)(void); 42 int (* start)(int trk); 43 int (* stop)(void); 44 int (* getpos)(cd_time *); 45 int (* setvol)(int); 46 int (* getvol)(void); 47 }; 48 typedef struct _cdromdevice cdromdevice_t; 49 50 extern int cd_init(cdromdevice_t *); 51 extern void cd_set_devicename(char *); 52 53 #define CD_FPS 75 54 #define FRAMES_TO_MSF(f, M,S,F) { \ 55 int value = f; \ 56 *(F) = value%CD_FPS; \ 57 value /= CD_FPS; \ 58 *(S) = value%60; \ 59 value /= 60; \ 60 *(M) = value; \ 61 } 62 #define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) 63 64 #endif /* __CDROM_H__ */ 65