src/cdrom/SDL_syscdrom.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 29 Oct 2006 14:45:46 +0000
changeset 2063 dea73e1d07b0
parent 1978 542c78b6fb12
child 2859 99210400e8b9
permissions -rw-r--r--
Merged Ryan's fix, in case we need it later.
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@1312
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@0
     4
slouken@1336
     5
    This library is SDL_free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@0
     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@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1312
    13
    Lesser General Public License for more details.
slouken@0
    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@0
    18
slouken@0
    19
    Sam Lantinga
slouken@252
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@1402
    22
#include "SDL_config.h"
slouken@0
    23
slouken@0
    24
/* This is the system specific header for the SDL CD-ROM API */
slouken@0
    25
slouken@0
    26
/* Structure of CD audio control functions */
slouken@1895
    27
extern struct CDcaps
slouken@1895
    28
{
slouken@1895
    29
    /* Get the name of the specified drive */
slouken@1895
    30
    const char *(*Name) (int drive);
slouken@0
    31
slouken@1895
    32
    /* Open the specified drive, returning a drive id, or -1 on error */
slouken@1895
    33
    int (*Open) (int drive);
slouken@0
    34
slouken@1895
    35
    /* Get table-of-contents (number of tracks + track info) for disk.
slouken@1895
    36
       The TOC information should be stored in the cdrom structure.
slouken@1895
    37
       This function should return 0 on success, or -1 on error.
slouken@1895
    38
     */
slouken@1895
    39
    int (*GetTOC) (SDL_CD * cdrom);
slouken@0
    40
slouken@1895
    41
    /* Return the current status and play position, in frames, of the
slouken@1895
    42
       drive.  'position' may be NULL, and if so, should be ignored.
slouken@1895
    43
     */
slouken@1895
    44
      CDstatus(*Status) (SDL_CD * cdrom, int *position);
slouken@0
    45
slouken@1895
    46
    /* Play from frame 'start' to 'start+len' */
slouken@1895
    47
    int (*Play) (SDL_CD * cdrom, int start, int len);
slouken@0
    48
slouken@1895
    49
    /* Pause play */
slouken@1895
    50
    int (*Pause) (SDL_CD * cdrom);
slouken@0
    51
slouken@1895
    52
    /* Resume play */
slouken@1895
    53
    int (*Resume) (SDL_CD * cdrom);
slouken@0
    54
slouken@1895
    55
    /* Stop play */
slouken@1895
    56
    int (*Stop) (SDL_CD * cdrom);
slouken@0
    57
slouken@1895
    58
    /* Eject the current disk */
slouken@1895
    59
    int (*Eject) (SDL_CD * cdrom);
slouken@0
    60
slouken@1895
    61
    /* Close the specified drive */
slouken@1895
    62
    void (*Close) (SDL_CD * cdrom);
slouken@0
    63
} SDL_CDcaps;
slouken@0
    64
slouken@0
    65
/* The number of available CD-ROM drives on the system */
slouken@0
    66
extern int SDL_numcds;
slouken@0
    67
slouken@0
    68
/* Function to scan the system for CD-ROM drives and fill SDL_CDcaps.
slouken@0
    69
 * This function should set SDL_numcds to the number of available CD
slouken@0
    70
 * drives.  Drive 0 should be the system default CD-ROM.
slouken@0
    71
 * It should return 0, or -1 on an unrecoverable fatal error.
slouken@0
    72
*/
slouken@1895
    73
extern int SDL_SYS_CDInit(void);
slouken@0
    74
slouken@0
    75
/* Function to perform any system-specific CD-ROM related cleanup */
slouken@0
    76
extern void SDL_SYS_CDQuit(void);
slouken@1978
    77
slouken@1895
    78
/* vi: set ts=4 sw=4 expandtab: */