src/cdrom/macosx/SDL_syscdrom.c
author Sam Lantinga <slouken@libsdl.org>
Tue, 09 May 2006 07:52:04 +0000
changeset 1793 4d66375c2012
parent 1635 92947e3a18db
child 1662 782fd950bd46
child 1895 c121d94672cb
child 4159 a1b03ba2fcd0
permissions -rw-r--r--
Date: Mon, 8 May 2006 14:19:30 -0700
From: Bob Ippolito
Subject: SDL trunk (r2346) and Mac OS X

As for all the Carbon warnings.. the two File Manager ones should be
easy to get rid of, the QuickDraw ones won't be so easy since that
requires actual refactoring.

PBUnmountVol -> FSEjectVolumeSync
FSClose -> FSCloseFork
slouken@616
     1
/*
slouken@616
     2
    SDL - Simple DirectMedia Layer
slouken@1312
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@616
     4
slouken@616
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@616
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@616
     9
slouken@616
    10
    This library is distributed in the hope that it will be useful,
slouken@616
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@616
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1312
    13
    Lesser General Public License for more details.
slouken@616
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@616
    18
slouken@616
    19
    Sam Lantinga
slouken@616
    20
    slouken@libsdl.org
slouken@616
    21
*/
slouken@1402
    22
#include "SDL_config.h"
slouken@616
    23
slouken@1635
    24
#ifdef SDL_CDROM_MACOSX
slouken@1635
    25
slouken@616
    26
#include "SDL_syscdrom_c.h"
slouken@616
    27
slouken@616
    28
#pragma mark -- Globals --
slouken@616
    29
slouken@616
    30
static FSRef**         tracks;
slouken@616
    31
static FSVolumeRefNum* volumes;
slouken@616
    32
static CDstatus        status;
slouken@616
    33
static int             nextTrackFrame;
slouken@616
    34
static int             nextTrackFramesRemaining;
slouken@616
    35
static int             fakeCD;
slouken@616
    36
static int             currentTrack;
slouken@616
    37
static int             didReadTOC;
slouken@616
    38
static int             cacheTOCNumTracks;
slouken@616
    39
static int             currentDrive; /* Only allow 1 drive in use at a time */
slouken@616
    40
slouken@616
    41
#pragma mark -- Prototypes --
slouken@616
    42
slouken@616
    43
static const char *SDL_SYS_CDName   (int drive);
slouken@616
    44
static int         SDL_SYS_CDOpen   (int drive);
slouken@616
    45
static int         SDL_SYS_CDGetTOC (SDL_CD *cdrom);
slouken@616
    46
static CDstatus    SDL_SYS_CDStatus (SDL_CD *cdrom, int *position);
slouken@616
    47
static int         SDL_SYS_CDPlay   (SDL_CD *cdrom, int start, int length);
slouken@616
    48
static int         SDL_SYS_CDPause  (SDL_CD *cdrom);
slouken@616
    49
static int         SDL_SYS_CDResume (SDL_CD *cdrom);
slouken@616
    50
static int         SDL_SYS_CDStop   (SDL_CD *cdrom);
slouken@616
    51
static int         SDL_SYS_CDEject  (SDL_CD *cdrom);
slouken@616
    52
static void        SDL_SYS_CDClose  (SDL_CD *cdrom);
slouken@616
    53
slouken@616
    54
#pragma mark -- Helper Functions --
slouken@616
    55
slouken@616
    56
/* Read a list of tracks from the volume */
slouken@616
    57
static int LoadTracks (SDL_CD *cdrom)
slouken@616
    58
{
slouken@616
    59
    /* Check if tracks are already loaded */
slouken@616
    60
    if  ( tracks[cdrom->id] != NULL )
slouken@616
    61
        return 0;
slouken@616
    62
        
slouken@616
    63
    /* Allocate memory for tracks */
slouken@1338
    64
    tracks[cdrom->id] = (FSRef*) SDL_calloc (1, sizeof(**tracks) * cdrom->numtracks);
slouken@616
    65
    if (tracks[cdrom->id] == NULL) {
slouken@616
    66
        SDL_OutOfMemory ();
slouken@616
    67
        return -1;
slouken@616
    68
    }
slouken@616
    69
    
slouken@616
    70
    /* Load tracks */
slouken@616
    71
    if (ListTrackFiles (volumes[cdrom->id], tracks[cdrom->id], cdrom->numtracks) < 0)
slouken@616
    72
        return -1;
slouken@616
    73
slouken@616
    74
    return 0;
slouken@616
    75
}
slouken@616
    76
slouken@616
    77
/* Find a file for a given start frame and length */
slouken@616
    78
static FSRef* GetFileForOffset (SDL_CD *cdrom, int start, int length,  int *outStartFrame, int *outStopFrame)
slouken@616
    79
{
slouken@616
    80
    int i;
slouken@616
    81
    
slouken@616
    82
    for (i = 0; i < cdrom->numtracks; i++) {
slouken@616
    83
    
slouken@616
    84
        if (cdrom->track[i].offset <= start &&
slouken@616
    85
            start < (cdrom->track[i].offset + cdrom->track[i].length))
slouken@616
    86
            break;
slouken@616
    87
    }
slouken@616
    88
    
slouken@616
    89
    if (i == cdrom->numtracks)
slouken@616
    90
        return NULL;
slouken@616
    91
        
slouken@616
    92
    currentTrack = i;
slouken@616
    93
slouken@616
    94
    *outStartFrame = start - cdrom->track[i].offset;
slouken@616
    95
    
slouken@616
    96
    if ((*outStartFrame + length) < cdrom->track[i].length) {
slouken@616
    97
        *outStopFrame = *outStartFrame + length;
slouken@616
    98
        length = 0;
slouken@616
    99
        nextTrackFrame = -1;
slouken@616
   100
        nextTrackFramesRemaining = -1;
slouken@616
   101
    }
slouken@616
   102
    else {
slouken@616
   103
        *outStopFrame = -1;
slouken@616
   104
        length -= cdrom->track[i].length - *outStartFrame;
slouken@616
   105
        nextTrackFrame = cdrom->track[i+1].offset;
slouken@616
   106
        nextTrackFramesRemaining = length;
slouken@616
   107
    }
slouken@616
   108
    
slouken@616
   109
    return &tracks[cdrom->id][i];
slouken@616
   110
}
slouken@616
   111
slouken@616
   112
/* Setup another file for playback, or stop playback (called from another thread) */
slouken@616
   113
static void CompletionProc (SDL_CD *cdrom)
slouken@616
   114
{
slouken@616
   115
    
slouken@616
   116
    Lock ();
slouken@616
   117
    
slouken@616
   118
    if (nextTrackFrame > 0 && nextTrackFramesRemaining > 0) {
slouken@616
   119
    
slouken@616
   120
        /* Load the next file to play */
slouken@616
   121
        int startFrame, stopFrame;
slouken@616
   122
        FSRef *file;
slouken@616
   123
        
slouken@616
   124
        PauseFile ();
slouken@616
   125
        ReleaseFile ();
slouken@616
   126
                
slouken@616
   127
        file = GetFileForOffset (cdrom, nextTrackFrame, 
slouken@616
   128
            nextTrackFramesRemaining, &startFrame, &stopFrame);
slouken@616
   129
        
slouken@616
   130
        if (file == NULL) {
slouken@616
   131
            status = CD_STOPPED;
slouken@616
   132
            Unlock ();
slouken@616
   133
            return;
slouken@616
   134
        }
slouken@616
   135
        
slouken@616
   136
        LoadFile (file, startFrame, stopFrame);
slouken@616
   137
        
slouken@616
   138
        SetCompletionProc (CompletionProc, cdrom);
slouken@616
   139
        
slouken@616
   140
        PlayFile ();
slouken@616
   141
    }
slouken@616
   142
    else {
slouken@616
   143
    
slouken@616
   144
        /* Release the current file */
slouken@616
   145
        PauseFile ();
slouken@616
   146
        ReleaseFile ();
slouken@616
   147
        status = CD_STOPPED;
slouken@616
   148
    }
slouken@616
   149
    
slouken@616
   150
    Unlock ();
slouken@616
   151
}
slouken@616
   152
slouken@616
   153
slouken@616
   154
#pragma mark -- Driver Functions --
slouken@616
   155
slouken@616
   156
/* Initialize */
slouken@616
   157
int SDL_SYS_CDInit (void) 
slouken@616
   158
{
slouken@616
   159
    /* Initialize globals */
slouken@616
   160
    volumes = NULL;
slouken@616
   161
    tracks  = NULL;
slouken@616
   162
    status  = CD_STOPPED;
slouken@616
   163
    nextTrackFrame = -1;
slouken@616
   164
    nextTrackFramesRemaining = -1;
slouken@616
   165
    fakeCD  = SDL_FALSE;
slouken@616
   166
    currentTrack = -1;
slouken@616
   167
    didReadTOC = SDL_FALSE;
slouken@616
   168
    cacheTOCNumTracks = -1;
slouken@616
   169
    currentDrive = -1;
slouken@616
   170
    
slouken@616
   171
    /* Fill in function pointers */
slouken@616
   172
    SDL_CDcaps.Name   = SDL_SYS_CDName;
slouken@616
   173
    SDL_CDcaps.Open   = SDL_SYS_CDOpen;
slouken@616
   174
    SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
slouken@616
   175
    SDL_CDcaps.Status = SDL_SYS_CDStatus;
slouken@616
   176
    SDL_CDcaps.Play   = SDL_SYS_CDPlay;
slouken@616
   177
    SDL_CDcaps.Pause  = SDL_SYS_CDPause;
slouken@616
   178
    SDL_CDcaps.Resume = SDL_SYS_CDResume;
slouken@616
   179
    SDL_CDcaps.Stop   = SDL_SYS_CDStop;
slouken@616
   180
    SDL_CDcaps.Eject  = SDL_SYS_CDEject;
slouken@616
   181
    SDL_CDcaps.Close  = SDL_SYS_CDClose;
slouken@616
   182
slouken@616
   183
    /* 
slouken@616
   184
        Read the list of "drives"
slouken@616
   185
        
slouken@616
   186
        This is currently a hack that infers drives from
slouken@616
   187
        mounted audio CD volumes, rather than
slouken@616
   188
        actual CD-ROM devices - which means it may not
slouken@616
   189
        act as expected sometimes.
slouken@616
   190
    */
slouken@616
   191
    
slouken@616
   192
    /* Find out how many cd volumes are mounted */
slouken@616
   193
    SDL_numcds = DetectAudioCDVolumes (NULL, 0);
slouken@616
   194
slouken@616
   195
    /*
slouken@616
   196
        If there are no volumes, fake a cd device
slouken@616
   197
        so tray empty can be reported.
slouken@616
   198
    */
slouken@616
   199
    if (SDL_numcds == 0) {
slouken@616
   200
    
slouken@616
   201
        fakeCD = SDL_TRUE;
slouken@616
   202
        SDL_numcds = 1;
slouken@616
   203
        status = CD_TRAYEMPTY;
slouken@616
   204
        
slouken@616
   205
        return 0;
slouken@616
   206
    }
slouken@616
   207
    
slouken@616
   208
    /* Allocate space for volumes */
slouken@1338
   209
    volumes = (FSVolumeRefNum*) SDL_calloc (1, sizeof(*volumes) * SDL_numcds);
slouken@616
   210
    if (volumes == NULL) {
slouken@616
   211
        SDL_OutOfMemory ();
slouken@616
   212
        return -1;
slouken@616
   213
    }
slouken@616
   214
    
slouken@616
   215
    /* Allocate space for tracks */
slouken@1338
   216
    tracks = (FSRef**) SDL_calloc (1, sizeof(*tracks) * (SDL_numcds + 1));
slouken@616
   217
    if (tracks == NULL) {
slouken@616
   218
        SDL_OutOfMemory ();
slouken@616
   219
        return -1;
slouken@616
   220
    }
slouken@616
   221
    
slouken@616
   222
    /* Mark the end of the tracks array */
slouken@616
   223
    tracks[ SDL_numcds ] = (FSRef*)-1;
slouken@616
   224
    
slouken@616
   225
    /* 
slouken@616
   226
        Redetect, now save all volumes for later
slouken@616
   227
        Update SDL_numcds just in case it changed
slouken@616
   228
    */
slouken@616
   229
    {
slouken@616
   230
        int numVolumes = SDL_numcds;
slouken@616
   231
        
slouken@616
   232
        SDL_numcds = DetectAudioCDVolumes (volumes, numVolumes);
slouken@616
   233
        
slouken@616
   234
        /* If more cds suddenly show up, ignore them */
slouken@616
   235
        if (SDL_numcds > numVolumes) {
slouken@616
   236
            SDL_SetError ("Some CD's were added but they will be ignored");
slouken@616
   237
            SDL_numcds = numVolumes;
slouken@616
   238
        }
slouken@616
   239
    }
slouken@616
   240
    
slouken@616
   241
    return 0;
slouken@616
   242
}
slouken@616
   243
slouken@616
   244
/* Shutdown and cleanup */
slouken@616
   245
void SDL_SYS_CDQuit(void)
slouken@616
   246
{
slouken@616
   247
    ReleaseFile();
slouken@616
   248
    
slouken@616
   249
    if (volumes != NULL)
slouken@616
   250
        free (volumes);
slouken@616
   251
        
slouken@616
   252
    if (tracks != NULL) {
slouken@616
   253
    
slouken@616
   254
        FSRef **ptr;
slouken@616
   255
        for (ptr = tracks; *ptr != (FSRef*)-1; ptr++)
slouken@616
   256
            if (*ptr != NULL)
slouken@616
   257
                free (*ptr);
slouken@616
   258
            
slouken@616
   259
        free (tracks);
slouken@616
   260
    }
slouken@616
   261
}
slouken@616
   262
slouken@616
   263
/* Get the Unix disk name of the volume */
slouken@616
   264
static const char *SDL_SYS_CDName (int drive)
slouken@616
   265
{
slouken@616
   266
    OSStatus     err = noErr;
slouken@768
   267
    HParamBlockRec  pb;
slouken@768
   268
    GetVolParmsInfoBuffer   volParmsInfo;
slouken@768
   269
   
slouken@616
   270
    if (fakeCD)
slouken@616
   271
        return "Fake CD-ROM Device";
slouken@768
   272
slouken@768
   273
    pb.ioParam.ioNamePtr = NULL;
slouken@768
   274
    pb.ioParam.ioVRefNum = volumes[drive];
slouken@768
   275
    pb.ioParam.ioBuffer = (Ptr)&volParmsInfo;
slouken@768
   276
    pb.ioParam.ioReqCount = (SInt32)sizeof(volParmsInfo);
slouken@768
   277
    err = PBHGetVolParmsSync(&pb);
slouken@768
   278
slouken@616
   279
    if (err != noErr) {
slouken@768
   280
        SDL_SetError ("PBHGetVolParmsSync returned %d", err);
slouken@616
   281
        return NULL;
slouken@616
   282
    }
slouken@768
   283
slouken@768
   284
    return volParmsInfo.vMDeviceID;
slouken@616
   285
}
slouken@616
   286
slouken@616
   287
/* Open the "device" */
slouken@616
   288
static int SDL_SYS_CDOpen (int drive)
slouken@616
   289
{
slouken@616
   290
    /* Only allow 1 device to be open */
slouken@616
   291
    if (currentDrive >= 0) {
slouken@616
   292
        SDL_SetError ("Only one cdrom is supported");
slouken@616
   293
        return -1;
slouken@616
   294
    }
slouken@616
   295
    else
slouken@616
   296
        currentDrive = drive;
slouken@616
   297
slouken@616
   298
    return drive;
slouken@616
   299
}
slouken@616
   300
slouken@616
   301
/* Get the table of contents */
slouken@616
   302
static int SDL_SYS_CDGetTOC (SDL_CD *cdrom)
slouken@616
   303
{
slouken@616
   304
    if (fakeCD) {
slouken@616
   305
        SDL_SetError (kErrorFakeDevice);
slouken@616
   306
        return -1;
slouken@616
   307
    }
slouken@616
   308
    
slouken@616
   309
    if (didReadTOC) {
slouken@616
   310
        cdrom->numtracks = cacheTOCNumTracks;
slouken@616
   311
        return 0;
slouken@616
   312
    }
slouken@616
   313
    
slouken@616
   314
    
slouken@616
   315
    ReadTOCData (volumes[cdrom->id], cdrom);
slouken@616
   316
    didReadTOC = SDL_TRUE;
slouken@616
   317
    cacheTOCNumTracks = cdrom->numtracks;
slouken@616
   318
    
slouken@616
   319
    return 0;
slouken@616
   320
}
slouken@616
   321
slouken@616
   322
/* Get CD-ROM status */
slouken@616
   323
static CDstatus SDL_SYS_CDStatus (SDL_CD *cdrom, int *position)
slouken@616
   324
{
slouken@768
   325
    if (position) {
slouken@768
   326
        int trackFrame;
slouken@768
   327
        
slouken@768
   328
        Lock ();
slouken@768
   329
        trackFrame = GetCurrentFrame ();
slouken@768
   330
        Unlock ();
slouken@616
   331
    
slouken@768
   332
        *position = cdrom->track[currentTrack].offset + trackFrame;
slouken@768
   333
    }
slouken@616
   334
    
slouken@616
   335
    return status;
slouken@616
   336
}
slouken@616
   337
slouken@616
   338
/* Start playback */
slouken@616
   339
static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
slouken@616
   340
{
slouken@616
   341
    int startFrame, stopFrame;
slouken@616
   342
    FSRef *ref;
slouken@616
   343
    
slouken@616
   344
    if (fakeCD) {
slouken@616
   345
        SDL_SetError (kErrorFakeDevice);
slouken@616
   346
        return -1;
slouken@616
   347
    }
slouken@616
   348
    
slouken@616
   349
    Lock();
slouken@616
   350
    
slouken@616
   351
    if (LoadTracks (cdrom) < 0)
slouken@616
   352
        return -2;
slouken@616
   353
    
slouken@616
   354
    if (PauseFile () < 0)
slouken@616
   355
        return -3;
slouken@616
   356
        
slouken@616
   357
    if (ReleaseFile () < 0)
slouken@616
   358
        return -4;
slouken@616
   359
    
slouken@616
   360
    ref = GetFileForOffset (cdrom, start, length, &startFrame, &stopFrame);
slouken@616
   361
    if (ref == NULL) {
slouken@616
   362
        SDL_SetError ("SDL_SYS_CDPlay: No file for start=%d, length=%d", start, length);
slouken@616
   363
        return -5;
slouken@616
   364
    }
slouken@616
   365
    
slouken@616
   366
    if (LoadFile (ref, startFrame, stopFrame) < 0)
slouken@616
   367
        return -6;
slouken@616
   368
    
slouken@616
   369
    SetCompletionProc (CompletionProc, cdrom);
slouken@616
   370
    
slouken@616
   371
    if (PlayFile () < 0)
slouken@616
   372
        return -7;
slouken@616
   373
    
slouken@616
   374
    status = CD_PLAYING;
slouken@616
   375
    
slouken@616
   376
    Unlock();
slouken@616
   377
    
slouken@616
   378
    return 0;
slouken@616
   379
}
slouken@616
   380
slouken@616
   381
/* Pause playback */
slouken@616
   382
static int SDL_SYS_CDPause(SDL_CD *cdrom)
slouken@616
   383
{
slouken@616
   384
    if (fakeCD) {
slouken@616
   385
        SDL_SetError (kErrorFakeDevice);
slouken@616
   386
        return -1;
slouken@616
   387
    }
slouken@616
   388
    
slouken@616
   389
    Lock ();
slouken@616
   390
    
slouken@768
   391
    if (PauseFile () < 0) {
slouken@768
   392
        Unlock ();
slouken@616
   393
        return -2;
slouken@768
   394
    }
slouken@616
   395
    
slouken@616
   396
    status = CD_PAUSED;
slouken@616
   397
    
slouken@616
   398
    Unlock ();
slouken@616
   399
    
slouken@616
   400
    return 0;
slouken@616
   401
}
slouken@616
   402
slouken@616
   403
/* Resume playback */
slouken@616
   404
static int SDL_SYS_CDResume(SDL_CD *cdrom)
slouken@616
   405
{
slouken@616
   406
    if (fakeCD) {
slouken@616
   407
        SDL_SetError (kErrorFakeDevice);
slouken@616
   408
        return -1;
slouken@616
   409
    }
slouken@616
   410
    
slouken@616
   411
    Lock ();
slouken@616
   412
    
icculus@1126
   413
    if (PlayFile () < 0) {
slouken@768
   414
        Unlock ();
slouken@616
   415
        return -2;
slouken@768
   416
    }
slouken@616
   417
        
slouken@616
   418
    status = CD_PLAYING;
slouken@616
   419
    
slouken@616
   420
    Unlock ();
slouken@616
   421
    
slouken@616
   422
    return 0;
slouken@616
   423
}
slouken@616
   424
slouken@616
   425
/* Stop playback */
slouken@616
   426
static int SDL_SYS_CDStop(SDL_CD *cdrom)
slouken@616
   427
{
slouken@616
   428
    if (fakeCD) {
slouken@616
   429
        SDL_SetError (kErrorFakeDevice);
slouken@616
   430
        return -1;
slouken@616
   431
    }
slouken@616
   432
    
slouken@616
   433
    Lock ();
slouken@616
   434
    
slouken@768
   435
    if (PauseFile () < 0) {
slouken@768
   436
        Unlock ();
slouken@616
   437
        return -2;
slouken@768
   438
    }
slouken@616
   439
        
slouken@768
   440
    if (ReleaseFile () < 0) {
slouken@768
   441
        Unlock ();
slouken@616
   442
        return -3;
slouken@768
   443
    }
slouken@616
   444
        
slouken@616
   445
    status = CD_STOPPED;
slouken@616
   446
    
slouken@616
   447
    Unlock ();
slouken@616
   448
    
slouken@616
   449
    return 0;
slouken@616
   450
}
slouken@616
   451
slouken@616
   452
/* Eject the CD-ROM (Unmount the volume) */
slouken@616
   453
static int SDL_SYS_CDEject(SDL_CD *cdrom)
slouken@616
   454
{
slouken@616
   455
    OSStatus err;
slouken@1793
   456
    pid_t dissenter;
slouken@1793
   457
slouken@616
   458
    if (fakeCD) {
slouken@616
   459
        SDL_SetError (kErrorFakeDevice);
slouken@616
   460
        return -1;
slouken@616
   461
    }
slouken@616
   462
    
slouken@616
   463
    Lock ();
slouken@616
   464
    
slouken@768
   465
    if (PauseFile () < 0) {
slouken@768
   466
        Unlock ();
slouken@616
   467
        return -2;
slouken@768
   468
    }
slouken@616
   469
        
slouken@768
   470
    if (ReleaseFile () < 0) {
slouken@768
   471
        Unlock ();
slouken@616
   472
        return -3;
slouken@768
   473
    }
slouken@616
   474
    
slouken@616
   475
    status = CD_STOPPED;
slouken@616
   476
    
slouken@1487
   477
	/* Eject the volume */
slouken@1793
   478
	err = FSEjectVolumeSync(volumes[cdrom->id], kNilOptions, &dissenter);
slouken@768
   479
slouken@768
   480
	if (err != noErr) {
slouken@768
   481
        Unlock ();
slouken@768
   482
		SDL_SetError ("PBUnmountVol returned %d", err);
slouken@768
   483
		return -4;
slouken@768
   484
	}
slouken@616
   485
    
slouken@616
   486
    status = CD_TRAYEMPTY;
slouken@616
   487
slouken@616
   488
    /* Invalidate volume and track info */
slouken@616
   489
    volumes[cdrom->id] = 0;
slouken@616
   490
    free (tracks[cdrom->id]);
slouken@616
   491
    tracks[cdrom->id] = NULL;
slouken@616
   492
    
slouken@616
   493
    Unlock ();
slouken@616
   494
    
slouken@616
   495
    return 0;
slouken@616
   496
}
slouken@616
   497
slouken@616
   498
/* Close the CD-ROM */
slouken@616
   499
static void SDL_SYS_CDClose(SDL_CD *cdrom)
slouken@616
   500
{
slouken@616
   501
    currentDrive = -1;
slouken@616
   502
    return;
slouken@616
   503
}
slouken@616
   504
slouken@1635
   505
#endif /* SDL_CDROM_MACOSX */