Mercurial > sdl-ios-xcode
annotate src/cdrom/macosx/CDPlayer.h @ 852:2651b6b43840
Quartz fix:
ut2004 makes a 2D window for the splash screen, which sets the screen
surface's pixels field. Then we tear down that video mode and create a GL
context, and the Quartz target isn't resetting the pixels field to NULL.
When you just create a GL window, the structure is memset'd to zero the
first time through, so unless you hit ut2004's codepath, you won't see the
bug. :)
Without this patch, quitting a windowed ut2003/ut2004 game makes the OS dump a
warning about a bogus free() to stderr, but it doesn't actually crash. All we
need to do is explicitly initialize the current->pixels field.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 24 Feb 2004 06:53:22 +0000 |
parents | 08b7fc2b5225 |
children | d910939febfa |
rev | line source |
---|---|
613
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
769
b8d311d90021
Updated copyright information for 2004 (Happy New Year!)
Sam Lantinga <slouken@libsdl.org>
parents:
768
diff
changeset
|
3 Copyright (C) 1997-2004 Sam Lantinga |
613
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Library General Public |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
8 version 2 of the License, or (at your option) any later version. |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
13 Library General Public License for more details. |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Library General Public |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
19 Sam Lantinga |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
20 slouken@libsdl.org |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
21 */ |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
22 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
23 #ifndef __CDPlayer__H__ |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
24 #define __CDPlayer__H__ 1 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
25 |
752
4bb432a0f6e0
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
613
diff
changeset
|
26 #include <string.h> |
4bb432a0f6e0
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
613
diff
changeset
|
27 |
768
de1b2c3063b9
Max has been reworking this code so it works on MacOS X 10.1
Sam Lantinga <slouken@libsdl.org>
parents:
752
diff
changeset
|
28 #include <Carbon/Carbon.h> |
613
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
29 #include <CoreFoundation/CoreFoundation.h> |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
30 #include <AudioUnit/AudioUnit.h> |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
31 |
752
4bb432a0f6e0
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
613
diff
changeset
|
32 #include "SDL.h" |
775
08b7fc2b5225
Fixed playback problems with MacOSX 10.1
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
33 #include "SDL_thread.h" |
08b7fc2b5225
Fixed playback problems with MacOSX 10.1
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
34 #include "SDL_mutex.h" |
613
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
35 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
36 #ifdef __cplusplus |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
37 extern "C" { |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
38 #endif |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
39 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
40 typedef void (*CDPlayerCompletionProc)(SDL_CD *cdrom) ; |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
41 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
42 void Lock (); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
43 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
44 void Unlock(); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
45 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
46 int LoadFile (const FSRef *ref, int startFrame, int endFrame); // pass -1 to do nothing |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
47 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
48 int ReleaseFile (); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
49 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
50 int PlayFile (); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
51 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
52 int PauseFile (); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
53 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
54 void SetCompletionProc (CDPlayerCompletionProc proc, SDL_CD *cdrom); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
55 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
56 int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
57 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
58 int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
59 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
60 int DetectAudioCDVolumes (FSVolumeRefNum *volumes, int numVolumes); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
61 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
62 int GetCurrentFrame (); |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
63 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
64 #ifdef __cplusplus |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
65 }; |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
66 #endif |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
67 |
9c6717a1c66f
Added MacOS X CD-ROM audio support (thanks Max and Darrell)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
68 #endif /* __CD_Player__H__ */ |