Mercurial > sdl-ios-xcode
annotate docs/html/wm.html @ 773:da0a2ad35bf4
Date: Sun, 4 Jan 2004 23:48:19 +0100
From: Max Horn
Subject: Re: Again Audio CD patch
Am 04.01.2004 um 22:38 schrieb Sam Lantinga:
>
> Okay, I fixed the buffering problems by simply using a 4 second buffer
> instead of a 1 second buffer. However, using your code I can't play an
> entire CD - the playback stops after the first song.
>
Found the problem: FSReadFork returns eofErr when the file is finished.
However, we check its return value for errors, and if anything but
noErr occurs, the reader thread aborts its current iteration. That is
bad, because it aborts before it can ever set the flag which tells that
the file is over (also, any remaining data which FSRead did return is
lost - so you'd not hear about to 4 seconds from the end of the file.
Furthermore, the computed data size was 8 bytes to high (I forgot to
account for the fact that the size of an (A)IFF chunk always contains
the chunk header & size fields, too). This is enough to make it work.
However, the end condition is rather fragile, so I tuned some other
things to be pessimistic (check for <= 0 instead of == 0, when eofErr
is encountered enforce mReadFilePosition == mFileLength). You never
know...
The attached patch fixes the issue for me.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 05 Jan 2004 00:57:51 +0000 |
parents | 55f1f1b3e27d |
children | 355632dca928 |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >Window Management</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
0 | 8 "><LINK |
9 REL="HOME" | |
10 TITLE="SDL Library Documentation" | |
11 HREF="index.html"><LINK | |
12 REL="UP" | |
13 TITLE="SDL Reference" | |
14 HREF="reference.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="SDL_Overlay" | |
17 HREF="sdloverlay.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_WM_SetCaption" | |
20 HREF="sdlwmsetcaption.html"><META | |
21 NAME="KEYWORD" | |
22 CONTENT="wm"><META | |
23 NAME="KEYWORD" | |
24 CONTENT="function"></HEAD | |
25 ><BODY | |
26 CLASS="CHAPTER" | |
27 BGCOLOR="#FFF8DC" | |
28 TEXT="#000000" | |
29 LINK="#0000ee" | |
30 VLINK="#551a8b" | |
31 ALINK="#ff0000" | |
32 ><DIV | |
33 CLASS="NAVHEADER" | |
34 ><TABLE | |
35 WIDTH="100%" | |
36 BORDER="0" | |
37 CELLPADDING="0" | |
38 CELLSPACING="0" | |
39 ><TR | |
40 ><TH | |
41 COLSPAN="3" | |
42 ALIGN="center" | |
43 >SDL Library Documentation</TH | |
44 ></TR | |
45 ><TR | |
46 ><TD | |
47 WIDTH="10%" | |
48 ALIGN="left" | |
49 VALIGN="bottom" | |
50 ><A | |
51 HREF="sdloverlay.html" | |
52 >Prev</A | |
53 ></TD | |
54 ><TD | |
55 WIDTH="80%" | |
56 ALIGN="center" | |
57 VALIGN="bottom" | |
58 ></TD | |
59 ><TD | |
60 WIDTH="10%" | |
61 ALIGN="right" | |
62 VALIGN="bottom" | |
63 ><A | |
64 HREF="sdlwmsetcaption.html" | |
65 >Next</A | |
66 ></TD | |
67 ></TR | |
68 ></TABLE | |
69 ><HR | |
70 ALIGN="LEFT" | |
71 WIDTH="100%"></DIV | |
72 ><DIV | |
73 CLASS="CHAPTER" | |
74 ><H1 | |
75 ><A | |
76 NAME="WM" | |
77 >Chapter 7. Window Management</A | |
78 ></H1 | |
79 ><DIV | |
80 CLASS="TOC" | |
81 ><DL | |
82 ><DT | |
83 ><B | |
84 >Table of Contents</B | |
85 ></DT | |
86 ><DT | |
87 ><A | |
88 HREF="sdlwmsetcaption.html" | |
89 >SDL_WM_SetCaption</A | |
90 > — Sets the window tile and icon name.</DT | |
91 ><DT | |
92 ><A | |
93 HREF="sdlwmgetcaption.html" | |
94 >SDL_WM_GetCaption</A | |
95 > — Gets the window title and icon name.</DT | |
96 ><DT | |
97 ><A | |
98 HREF="sdlwmseticon.html" | |
99 >SDL_WM_SetIcon</A | |
100 > — Sets the icon for the display window.</DT | |
101 ><DT | |
102 ><A | |
103 HREF="sdlwmiconifywindow.html" | |
104 >SDL_WM_IconifyWindow</A | |
105 > — Iconify/Minimise the window</DT | |
106 ><DT | |
107 ><A | |
108 HREF="sdlwmtogglefullscreen.html" | |
109 >SDL_WM_ToggleFullScreen</A | |
110 > — Toggles fullscreen mode</DT | |
111 ><DT | |
112 ><A | |
113 HREF="sdlwmgrabinput.html" | |
114 >SDL_WM_GrabInput</A | |
115 > — Grabs mouse and keyboard input.</DT | |
116 ></DL | |
117 ></DIV | |
118 ><P | |
119 >SDL provides a small set of window management functions which allow applications to change their title and toggle from windowed mode to fullscreen (if available)</P | |
120 ></DIV | |
121 ><DIV | |
122 CLASS="NAVFOOTER" | |
123 ><HR | |
124 ALIGN="LEFT" | |
125 WIDTH="100%"><TABLE | |
126 WIDTH="100%" | |
127 BORDER="0" | |
128 CELLPADDING="0" | |
129 CELLSPACING="0" | |
130 ><TR | |
131 ><TD | |
132 WIDTH="33%" | |
133 ALIGN="left" | |
134 VALIGN="top" | |
135 ><A | |
136 HREF="sdloverlay.html" | |
137 >Prev</A | |
138 ></TD | |
139 ><TD | |
140 WIDTH="34%" | |
141 ALIGN="center" | |
142 VALIGN="top" | |
143 ><A | |
144 HREF="index.html" | |
145 >Home</A | |
146 ></TD | |
147 ><TD | |
148 WIDTH="33%" | |
149 ALIGN="right" | |
150 VALIGN="top" | |
151 ><A | |
152 HREF="sdlwmsetcaption.html" | |
153 >Next</A | |
154 ></TD | |
155 ></TR | |
156 ><TR | |
157 ><TD | |
158 WIDTH="33%" | |
159 ALIGN="left" | |
160 VALIGN="top" | |
161 >SDL_Overlay</TD | |
162 ><TD | |
163 WIDTH="34%" | |
164 ALIGN="center" | |
165 VALIGN="top" | |
166 ><A | |
167 HREF="reference.html" | |
168 >Up</A | |
169 ></TD | |
170 ><TD | |
171 WIDTH="33%" | |
172 ALIGN="right" | |
173 VALIGN="top" | |
174 >SDL_WM_SetCaption</TD | |
175 ></TR | |
176 ></TABLE | |
177 ></DIV | |
178 ></BODY | |
179 ></HTML | |
180 > |