Annotation of XNU/iokit/Families/IOCDDrive/IOCDAudioNub.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * The contents of this file constitute Original Code as defined in and
                      7:  * are subject to the Apple Public Source License Version 1.1 (the
                      8:  * "License").  You may not use this file except in compliance with the
                      9:  * License.  Please obtain a copy of the License at
                     10:  * http://www.apple.com/publicsource and read it before using this file.
                     11:  * 
                     12:  * This Original Code and all software distributed under the License are
                     13:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     14:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     15:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     16:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     17:  * License for the specific language governing rights and limitations
                     18:  * under the License.
                     19:  * 
                     20:  * @APPLE_LICENSE_HEADER_END@
                     21:  */
                     22: /* IOCDAudioNub.h created by rick on Mon 22-Mar-1999
                     23:  *
                     24:  * This class is the protocol for  CD Audio control functionality, independent of
                     25:  * the physical connection protocol (e.g. SCSI, ATA, USB).
                     26:  *
                     27:  * Any methods that deal with audio play mode and/or volume are here. By having
                     28:  * clients call through this nub, we can implement a local communication with
                     29:  * the audio subsystem as well as the CD device.
                     30:  *
                     31:  * A subclass implements relay methods that translate our requests into
                     32:  * calls to a protocol- and device-specific provider.
                     33:  */
                     34: 
                     35: #ifndef        _IOCDAUDIONUB_H
                     36: #define        _IOCDAUDIONUB_H
                     37: 
                     38: #include <IOKit/IOService.h>
                     39: #include <IOKit/storage/IOCDTypes.h>
                     40: 
                     41: class IOCDDrive;
                     42: 
                     43: class IOCDAudioNub : public IOService {
                     44: 
                     45:     OSDeclareDefaultStructors(IOCDAudioNub)
                     46: 
                     47: protected:
                     48:  
                     49:     virtual IOReturn newUserClient( task_t              owningTask,
                     50:                          void *              security_id,
                     51:                          UInt32              type,
                     52:                          IOUserClient **     handler ); 
                     53: 
                     54: public:
                     55: 
                     56:     /* Overrides from IOService: */
                     57: 
                     58:     virtual bool       attach(IOService *provider);
                     59: 
                     60:     /* end of IOService overrides */
                     61: 
                     62:     /* Position the head at the specified address and begin audio playback. */
                     63: 
                     64:     virtual IOReturn   audioPlay(positioningType addressType,cdAddress address,audioPlayMode mode);
                     65: 
                     66:     /* Pause or release the drive. */
                     67: 
                     68:     virtual IOReturn   audioPause(bool pause);
                     69: 
                     70:     /* Perform a fast-forward (reverse) operation starting at the specified address. */
                     71: 
                     72:     virtual IOReturn   audioScan(positioningType addressType,cdAddress address,
                     73:                                                bool reverse);
                     74: 
                     75:     /* Get the current audio play status and the Q-subcode for the current track. */
                     76: 
                     77:     virtual IOReturn   getAudioStatus(struct audioStatus *status);
                     78: 
                     79:     /* Position the head at the specified address and optionally begin audio play. */
                     80: 
                     81:     virtual IOReturn   audioTrackSearch(positioningType addressType,cdAddress address,
                     82:                                                bool startPlay,audioPlayMode mode);
                     83:     
                     84:     /* Read audio data only.
                     85:      * Equivalent to MacOS ReadAudio type 0.
                     86:      */
                     87:     
                     88:     virtual IOReturn   readAudioData(positioningType addressType,cdAddress address,
                     89:                                        UInt8 blockCount,UInt8 *buffer);
                     90: 
                     91:     /* Read audio subcodes (P-W) only.
                     92:      * Equivalent to MacOS ReadAudio type 3.
                     93:      */
                     94:     
                     95:     virtual IOReturn   readAudioSubcodes(positioningType addressType,cdAddress address,
                     96:                                        UInt8 blockCount,UInt8 *buffer);
                     97:     
                     98:     /* Read audio data with Q-subcode.
                     99:      * Equivalent to MacOS ReadAudio type 1.
                    100:      */
                    101:     
                    102:     virtual IOReturn   readAudioWithQSubcode(positioningType addressType,cdAddress address,
                    103:                                        UInt8 blockCount,UInt8 *buffer);
                    104: 
                    105:     /* Read audio data with all subcodes (P-W).
                    106:      * Equivalent to MacOS ReadAudio type 2.
                    107:      */
                    108:     
                    109:     virtual IOReturn   readAudioWithAllSubcodes(positioningType addressType,cdAddress address,
                    110:                                        UInt8 blockCount,UInt8 *buffer);
                    111:     
                    112:     /* Read the raw Table of Contents.
                    113:      * Equivalent to MacOS ReadToc type 4.
                    114:      */
                    115:     
                    116:     virtual IOReturn   readEntireTOC(struct macEntireToc *buffer);
                    117: 
                    118:     /* Read the header information for the specified logical block. */
                    119:     
                    120:     virtual IOReturn   readHeader(UInt32 blockAddress,struct headerInfo *buffer);
                    121: 
                    122:     /* Read the International Standard Recording Code (ISRC) for a track. THe
                    123:      * "found" boolean is set true if an ISRC was found, meaning the returned
                    124:      * bytes are valid.
                    125:      */
                    126: 
                    127:     virtual IOReturn   readISRC(UInt32 track,UInt8 *buffer,bool *found);
                    128:     
                    129:     /* Read the mm:ss:ff address of the lead-out for the last session.
                    130:      * Equivalent to MacOS ReadToc type 2.
                    131:      */
                    132: 
                    133:     virtual IOReturn   readLeadOutAddress(cdAddress *buffer);
                    134: 
                    135:     /* Read the Media Catalog Number (MCN). The "found" boolean is set true
                    136:      * if an MCN was found, meaning the returned bytes are valid.
                    137:      */
                    138: 
                    139:     virtual IOReturn   readMCN(UInt8 *buffer,bool *found);
                    140: 
                    141:     /* Read all Q-subcode entries in the lead-in areas (including TOC info),
                    142:      * starting from the specified session. We stop at the last session or the
                    143:      * buffer limit, whichever occurs fist.
                    144:      * Equivalent to MacOS ReadToc type 6.
                    145:      */
                    146: 
                    147:     virtual IOReturn   readQSubcodes(struct qSubcodeTocInfo *buffer,UInt32 bufSize);
                    148:     
                    149:     /* Read session information: number of sessions & location of last session.
                    150:      * Equivalent to MacOS ReadToc type 5.
                    151:      */
                    152: 
                    153:     virtual IOReturn   readSessionInfo(struct sessionInfo *info);
                    154: 
                    155:     /* Read the subcode buffer from the drive while it's playing audio. If purge
                    156:      * is true, we instruct the drive to purge the buffer first.
                    157:      * Equivalent to MacOS ReadAllSubcodes.
                    158:      */
                    159: 
                    160:     virtual IOReturn   readSubcodeBuffer(UInt8 *buffer,bool purge,UInt32 entryCount);
                    161:     
                    162:     /* Read the Q subcode information for the current track being accessed or played. */
                    163:     
                    164:     virtual IOReturn   readTheQSubcode(struct qSubcode *buffer);
                    165: 
                    166:     /* Read the track type and address, starting at the specified track. We
                    167:      * stop at the last track or the buffer limit, whichever occurs first.
                    168:      * Equivalent to MacOS ReadToc type 3.
                    169:      */
                    170: 
                    171:     virtual IOReturn   readTrackInfo(UInt32 startingTrack,
                    172:                                        struct trackTypeInfo *buf,UInt32 bufSize);
                    173:     
                    174:     /* Read the track numbers of the first and last tracks.
                    175:      * Equivalent to MacOS ReadToc type 1.
                    176:      */
                    177: 
                    178:     virtual IOReturn   readTrackLimits(UInt32 *first,UInt32 *last);
                    179: 
                    180:     /* Set the audio-play stop address. An address of blockAddress==zero will cause
                    181:      * any current audio play operation to be immediately stopped. The address can
                    182:      * also be set via an audioPlay operation that specifies a stop address.
                    183:      */
                    184:     
                    185:     virtual IOReturn   setAudioStopAddress(positioningType addressType,cdAddress address);
                    186: 
                    187:     /* Get the current volume settings. */
                    188: 
                    189:     virtual IOReturn   readAudioVolume(UInt8 *leftVolume,UInt8 *rightVolume);
                    190: 
                    191:     /* Set the audio play volume for the drive's audio channels. */
                    192: 
                    193:     virtual IOReturn   setVolume(UInt8 leftVolume,UInt8 rightVolume);
                    194: 
                    195: protected:
                    196: 
                    197:     IOCDDrive *        _provider;
                    198: };
                    199: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.