1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qmovie.cpp:61 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQMovie Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQMovie Class Reference</h1>
<p>The TQMovie class provides incremental loading of animations or images, signalling as it progresses.
<a href="#details">More...</a>
<p><tt>#include <<a href="qmovie-h.html">ntqmovie.h</a>></tt>
<p><a href="qmovie-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQMovie"><b>TQMovie</b></a> ()</li>
<li class=fn><a href="#TQMovie-2"><b>TQMovie</b></a> ( int bufsize )</li>
<li class=fn><a href="#TQMovie-3"><b>TQMovie</b></a> ( TQDataSource * src, int bufsize = 1024 )</li>
<li class=fn><a href="#TQMovie-4"><b>TQMovie</b></a> ( const TQString & fileName, int bufsize = 1024 )</li>
<li class=fn><a href="#TQMovie-5"><b>TQMovie</b></a> ( TQByteArray data, int bufsize = 1024 )</li>
<li class=fn><a href="#TQMovie-6"><b>TQMovie</b></a> ( const TQMovie & movie )</li>
<li class=fn><a href="#~TQMovie"><b>~TQMovie</b></a> ()</li>
<li class=fn>TQMovie & <a href="#operator-eq"><b>operator=</b></a> ( const TQMovie & movie )</li>
<li class=fn>int <a href="#pushSpace"><b>pushSpace</b></a> () const</li>
<li class=fn>void <a href="#pushData"><b>pushData</b></a> ( const uchar * data, int length )</li>
<li class=fn>const TQColor & <a href="#backgroundColor"><b>backgroundColor</b></a> () const</li>
<li class=fn>void <a href="#setBackgroundColor"><b>setBackgroundColor</b></a> ( const TQColor & c )</li>
<li class=fn>const TQRect & <a href="#getValidRect"><b>getValidRect</b></a> () const</li>
<li class=fn>const TQPixmap & <a href="#framePixmap"><b>framePixmap</b></a> () const</li>
<li class=fn>const TQImage & <a href="#frameImage"><b>frameImage</b></a> () const</li>
<li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li>
<li class=fn>int <a href="#frameNumber"><b>frameNumber</b></a> () const</li>
<li class=fn>int <a href="#steps"><b>steps</b></a> () const</li>
<li class=fn>bool <a href="#paused"><b>paused</b></a> () const</li>
<li class=fn>bool <a href="#finished"><b>finished</b></a> () const</li>
<li class=fn>bool <a href="#running"><b>running</b></a> () const</li>
<li class=fn>void <a href="#unpause"><b>unpause</b></a> ()</li>
<li class=fn>void <a href="#pause"><b>pause</b></a> ()</li>
<li class=fn>void <a href="#step"><b>step</b></a> ()</li>
<li class=fn>void <a href="#step-2"><b>step</b></a> ( int steps )</li>
<li class=fn>void <a href="#restart"><b>restart</b></a> ()</li>
<li class=fn>int <a href="#speed"><b>speed</b></a> () const</li>
<li class=fn>void <a href="#setSpeed"><b>setSpeed</b></a> ( int percent )</li>
<li class=fn>void <a href="#connectResize"><b>connectResize</b></a> ( TQObject * receiver, const char * member )</li>
<li class=fn>void <a href="#disconnectResize"><b>disconnectResize</b></a> ( TQObject * receiver, const char * member = 0 )</li>
<li class=fn>void <a href="#connectUpdate"><b>connectUpdate</b></a> ( TQObject * receiver, const char * member )</li>
<li class=fn>void <a href="#disconnectUpdate"><b>disconnectUpdate</b></a> ( TQObject * receiver, const char * member = 0 )</li>
<li class=fn>enum <a href="#Status-enum"><b>Status</b></a> { SourceEmpty = -2, UnrecognizedFormat = -1, Paused = 1, EndOfFrame = 2, EndOfLoop = 3, EndOfMovie = 4, SpeedChanged = 5 }</li>
<li class=fn>void <a href="#connectStatus"><b>connectStatus</b></a> ( TQObject * receiver, const char * member )</li>
<li class=fn>void <a href="#disconnectStatus"><b>disconnectStatus</b></a> ( TQObject * receiver, const char * member = 0 )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The TQMovie class provides incremental loading of animations or images, signalling as it progresses.
<p>
<p> The simplest way to display a TQMovie is to use a <a href="ntqlabel.html">TQLabel</a> and
<a href="ntqlabel.html#setMovie">TQLabel::setMovie</a>().
<p> A TQMovie provides a <a href="ntqpixmap.html">TQPixmap</a> as the <a href="#framePixmap">framePixmap</a>(); connections can
be made via <a href="#connectResize">connectResize</a>() and <a href="#connectUpdate">connectUpdate</a>() to receive
notification of size and pixmap changes. All decoding is driven
by the normal event-processing mechanisms.
<p> The movie begins playing as soon as the TQMovie is created
(actually, once control returns to the event loop). When the last
frame in the movie has been played, it may loop back to the start
if such looping is defined in the input source.
<p> TQMovie objects are <a href="shclass.html#explicitly-shared">explicitly shared</a>. This means that a TQMovie
copied from another TQMovie will be displaying the same frame at
all times. If one shared movie pauses, all pause. To make <em>independent</em> movies, they must be constructed separately.
<p> The set of data formats supported by TQMovie is determined by the
decoder factories that have been installed; the format of the
input is determined as the input is decoded.
<p> The supported formats are MNG (if TQt is configured with MNG
support enabled) and GIF (if TQt is configured with GIF support
enabled, see ntqgif.h).
<p> If TQt is configured to support GIF reading, we are required to
state that "The Graphics Interchange Format(c) is the Copyright
property of CompuServe Incorporated. GIF(sm) is a Service Mark
property of CompuServe Incorporated.
<p> <b>Warning:</b> If you are in a country that recognizes software patents
and in which Unisys holds a patent on LZW compression and/or
decompression and you want to use GIF, Unisys may require you to
license that technology. Such countries include Canada, Japan,
the USA, France, Germany, Italy and the UK.
<p> GIF support may be removed completely in a future version of TQt.
We recommend using the MNG or PNG format.
<p> <center><img src="qmovie.png" alt="TQMovie"></center>
<p> <p>See also <a href="ntqlabel.html#setMovie">TQLabel::setMovie</a>(), <a href="graphics.html">Graphics Classes</a>, <a href="images.html">Image Processing Classes</a>, and <a href="multimedia.html">Multimedia Classes</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Status-enum"></a>TQMovie::Status</h3>
<ul>
<li><tt>TQMovie::SourceEmpty</tt>
<li><tt>TQMovie::UnrecognizedFormat</tt>
<li><tt>TQMovie::Paused</tt>
<li><tt>TQMovie::EndOfFrame</tt>
<li><tt>TQMovie::EndOfLoop</tt>
<li><tt>TQMovie::EndOfMovie</tt>
<li><tt>TQMovie::SpeedChanged</tt>
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQMovie"></a>TQMovie::TQMovie ()
</h3>
Constructs a null TQMovie. The only interesting thing to do with
such a movie is to assign another movie to it.
<p> <p>See also <a href="#isNull">isNull</a>().
<h3 class=fn><a name="TQMovie-2"></a>TQMovie::TQMovie ( int bufsize )
</h3>
Constructs a TQMovie with an external data source. You should later
call <a href="#pushData">pushData</a>() to send incoming animation data to the movie.
<p> The <em>bufsize</em> argument sets the maximum amount of data the movie
will transfer from the data source per event loop. The lower this
value, the better interleaved the movie playback will be with
other event processing, but the slower the overall processing will
be.
<p> <p>See also <a href="#pushData">pushData</a>().
<h3 class=fn><a name="TQMovie-3"></a>TQMovie::TQMovie ( <a href="tqdatasource.html">TQDataSource</a> * src, int bufsize = 1024 )
</h3>
Constructs a TQMovie that reads an image sequence from the given
data source, <em>src</em>. The source must be allocated dynamically,
because TQMovie will take ownership of it and will destroy it when
the movie is destroyed. The movie starts playing as soon as event
processing continues.
<p> The <em>bufsize</em> argument sets the maximum amount of data the movie
will transfer from the data source per event loop. The lower this
value, the better interleaved the movie playback will be with
other event processing, but the slower the overall processing will
be.
<h3 class=fn><a name="TQMovie-4"></a>TQMovie::TQMovie ( const <a href="tqstring.html">TQString</a> & fileName, int bufsize = 1024 )
</h3>
Constructs a TQMovie that reads an image sequence from the file, <em>fileName</em>.
<p> The <em>bufsize</em> argument sets the maximum amount of data the movie
will transfer from the data source per event loop. The lower this
value, the better interleaved the movie playback will be with
other event processing, but the slower the overall processing will
be.
<h3 class=fn><a name="TQMovie-5"></a>TQMovie::TQMovie ( <a href="tqbytearray.html">TQByteArray</a> data, int bufsize = 1024 )
</h3>
Constructs a TQMovie that reads an image sequence from the byte
array, <em>data</em>.
<p> The <em>bufsize</em> argument sets the maximum amount of data the movie
will transfer from the data source per event loop. The lower this
value, the better interleaved the movie playback will be with
other event processing, but the slower the overall processing will
be.
<h3 class=fn><a name="TQMovie-6"></a>TQMovie::TQMovie ( const <a href="ntqmovie.html">TQMovie</a> & movie )
</h3>
Constructs a movie that uses the same data as movie <em>movie</em>.
TQMovies use <a href="shclass.html#explicit-sharing">explicit sharing</a>, so operations on the copy will
affect both.
<h3 class=fn><a name="~TQMovie"></a>TQMovie::~TQMovie ()
</h3>
Destroys the TQMovie. If this is the last reference to the data of
the movie, the data is deallocated.
<h3 class=fn>const <a href="ntqcolor.html">TQColor</a> & <a name="backgroundColor"></a>TQMovie::backgroundColor () const
</h3>
Returns the background color of the movie set by
<a href="#setBackgroundColor">setBackgroundColor</a>().
<h3 class=fn>void <a name="connectResize"></a>TQMovie::connectResize ( <a href="tqobject.html">TQObject</a> * receiver, const char * member )
</h3>
Connects the <em>receiver</em>'s <em>member</em> of type <tt>void member(const TQSize&)</tt> so that it is signalled when the movie changes size.
<p> Note that due to the <a href="shclass.html#explicit-sharing">explicit sharing</a> of TQMovie objects, these
connections persist until they are explicitly disconnected with
<a href="#disconnectResize">disconnectResize</a>() or until <em>every</em> shared copy of the movie is
deleted.
<p>Example: <a href="movies-example.html#x498">movies/main.cpp</a>.
<h3 class=fn>void <a name="connectStatus"></a>TQMovie::connectStatus ( <a href="tqobject.html">TQObject</a> * receiver, const char * member )
</h3>
Connects the <em>receiver</em>'s <em>member</em>, of type <tt>void member(int)</tt> so that it is signalled when the movie changes
status. The status codes are negative for errors and positive for
information.
<p> <center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Status Code <th valign="top">Meaning
<tr bgcolor="#f0f0f0"> <td valign="top">TQMovie::SourceEmpty
<td valign="top">signalled if the input cannot be read.
<tr bgcolor="#d0d0d0"> <td valign="top">TQMovie::UnrecognizedFormat
<td valign="top">signalled if the input data is unrecognized.
<tr bgcolor="#f0f0f0"> <td valign="top">TQMovie::Paused
<td valign="top">signalled when the movie is paused by a call to <a href="#paused">paused</a>()
or by after <a href="#step">stepping</a> pauses.
<tr bgcolor="#d0d0d0"> <td valign="top">TQMovie::EndOfFrame
<td valign="top">signalled at end-of-frame after any update and Paused signals.
<tr bgcolor="#f0f0f0"> <td valign="top">TQMovie::EndOfLoop
<td valign="top">signalled at end-of-loop, after any update signals,
EndOfFrame - but before EndOfMovie.
<tr bgcolor="#d0d0d0"> <td valign="top">TQMovie::EndOfMovie
<td valign="top">signalled when the movie completes and is not about to loop.
</table></center>
<p> More status messages may be added in the future, so a general test
for errors would test for negative.
<p> Note that due to the <a href="shclass.html#explicit-sharing">explicit sharing</a> of TQMovie objects, these
connections persist until they are explicitly disconnected with
<a href="#disconnectStatus">disconnectStatus</a>() or until <em>every</em> shared copy of the movie is
deleted.
<p>Example: <a href="movies-example.html#x499">movies/main.cpp</a>.
<h3 class=fn>void <a name="connectUpdate"></a>TQMovie::connectUpdate ( <a href="tqobject.html">TQObject</a> * receiver, const char * member )
</h3>
Connects the <em>receiver</em>'s <em>member</em> of type <tt>void member(const TQRect&)</tt> so that it is signalled when an area of the <a href="#framePixmap">framePixmap</a>()
has changed since the previous frame.
<p> Note that due to the <a href="shclass.html#explicit-sharing">explicit sharing</a> of TQMovie objects, these
connections persist until they are explicitly disconnected with
<a href="#disconnectUpdate">disconnectUpdate</a>() or until <em>every</em> shared copy of the movie is
deleted.
<p>Example: <a href="movies-example.html#x500">movies/main.cpp</a>.
<h3 class=fn>void <a name="disconnectResize"></a>TQMovie::disconnectResize ( <a href="tqobject.html">TQObject</a> * receiver, const char * member = 0 )
</h3>
Disconnects the <em>receiver</em>'s <em>member</em> (or all members if <em>member</em> is zero) that were previously connected by <a href="#connectResize">connectResize</a>().
<h3 class=fn>void <a name="disconnectStatus"></a>TQMovie::disconnectStatus ( <a href="tqobject.html">TQObject</a> * receiver, const char * member = 0 )
</h3>
Disconnects the <em>receiver</em>'s <em>member</em> (or all members if <em>member</em> is zero) that were previously connected by <a href="#connectStatus">connectStatus</a>().
<h3 class=fn>void <a name="disconnectUpdate"></a>TQMovie::disconnectUpdate ( <a href="tqobject.html">TQObject</a> * receiver, const char * member = 0 )
</h3>
Disconnects the <em>receiver</em>'s <em>member</em> (or all members if \q
member is zero) that were previously connected by <a href="#connectUpdate">connectUpdate</a>().
<h3 class=fn>bool <a name="finished"></a>TQMovie::finished () const
</h3>
Returns TRUE if the image is no longer playing: this happens when
all loops of all frames are complete; otherwise returns FALSE.
<p>Example: <a href="movies-example.html#x501">movies/main.cpp</a>.
<h3 class=fn>const <a href="tqimage.html">TQImage</a> & <a name="frameImage"></a>TQMovie::frameImage () const
</h3>
Returns the current frame of the movie, as a <a href="tqimage.html">TQImage</a>. It is not
generally useful to keep a copy of this image. Also note that you
must not call this function if the movie is <a href="#finished">finished</a>(), since by
then the image will not be available.
<p> <p>See also <a href="#framePixmap">framePixmap</a>().
<h3 class=fn>int <a name="frameNumber"></a>TQMovie::frameNumber () const
</h3>
Returns the number of times EndOfFrame has been emitted since the
start of the current loop of the movie. Thus, before any
EndOfFrame has been emitted the value will be 0; within slots
processing the first signal, <a href="#frameNumber">frameNumber</a>() will be 1, and so on.
<h3 class=fn>const <a href="ntqpixmap.html">TQPixmap</a> & <a name="framePixmap"></a>TQMovie::framePixmap () const
</h3>
Returns the current frame of the movie, as a <a href="ntqpixmap.html">TQPixmap</a>. It is not
generally useful to keep a copy of this pixmap. It is better to
keep a copy of the TQMovie and get the <a href="#framePixmap">framePixmap</a>() only when
needed for drawing.
<p> <p>See also <a href="#frameImage">frameImage</a>().
<p>Example: <a href="movies-example.html#x502">movies/main.cpp</a>.
<h3 class=fn>const <a href="ntqrect.html">TQRect</a> & <a name="getValidRect"></a>TQMovie::getValidRect () const
</h3>
Returns the area of the pixmap for which pixels have been
generated.
<h3 class=fn>bool <a name="isNull"></a>TQMovie::isNull () const
</h3>
Returns TRUE if the movie is null; otherwise returns FALSE.
<h3 class=fn><a href="ntqmovie.html">TQMovie</a> & <a name="operator-eq"></a>TQMovie::operator= ( const <a href="ntqmovie.html">TQMovie</a> & movie )
</h3>
Makes this movie use the same data as movie <em>movie</em>. TQMovies use
<a href="shclass.html#explicit-sharing">explicit sharing</a>.
<h3 class=fn>void <a name="pause"></a>TQMovie::pause ()
</h3>
Pauses the progress of the animation.
<p> <p>See also <a href="#unpause">unpause</a>().
<p>Example: <a href="movies-example.html#x503">movies/main.cpp</a>.
<h3 class=fn>bool <a name="paused"></a>TQMovie::paused () const
</h3>
Returns TRUE if the image is paused; otherwise returns FALSE.
<p>Example: <a href="movies-example.html#x504">movies/main.cpp</a>.
<h3 class=fn>void <a name="pushData"></a>TQMovie::pushData ( const uchar * data, int length )
</h3>
Pushes <em>length</em> bytes from <em>data</em> into the movie. <em>length</em> must
be no more than the amount returned by <a href="#pushSpace">pushSpace</a>() since the
previous call to <a href="#pushData">pushData</a>().
<h3 class=fn>int <a name="pushSpace"></a>TQMovie::pushSpace () const
</h3>
Returns the maximum amount of data that can currently be pushed
into the movie by a call to <a href="#pushData">pushData</a>(). This is affected by the
initial buffer size, but varies as the movie plays and data is
consumed.
<h3 class=fn>void <a name="restart"></a>TQMovie::restart ()
</h3>
Rewinds the movie to the beginning. If the movie has not been
paused, it begins playing again.
<p>Example: <a href="movies-example.html#x505">movies/main.cpp</a>.
<h3 class=fn>bool <a name="running"></a>TQMovie::running () const
</h3>
Returns TRUE if the image is not single-stepping, not paused, and
not finished; otherwise returns FALSE.
<h3 class=fn>void <a name="setBackgroundColor"></a>TQMovie::setBackgroundColor ( const <a href="ntqcolor.html">TQColor</a> & c )
</h3>
Sets the background color of the pixmap to <em>c</em>. If the background
color isValid(), the pixmap will never have a mask because the
background color will be used in transparent regions of the image.
<p> <p>See also <a href="#backgroundColor">backgroundColor</a>().
<h3 class=fn>void <a name="setSpeed"></a>TQMovie::setSpeed ( int percent )
</h3>
Sets the movie's play speed as a percentage, to <em>percent</em>. This
is a percentage of the speed dictated by the input data format.
The default is 100 percent.
<h3 class=fn>int <a name="speed"></a>TQMovie::speed () const
</h3>
Returns the movie's play speed as a percentage. The default is 100
percent.
<p> <p>See also <a href="#setSpeed">setSpeed</a>().
<h3 class=fn>void <a name="step"></a>TQMovie::step ()
</h3>
Steps forward 1 frame and then pauses.
<p>Example: <a href="movies-example.html#x506">movies/main.cpp</a>.
<h3 class=fn>void <a name="step-2"></a>TQMovie::step ( int steps )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Steps forward, showing <em>steps</em> frames, and then pauses.
<h3 class=fn>int <a name="steps"></a>TQMovie::steps () const
</h3>
Returns the number of steps remaining after a call to <a href="#step">step</a>(). If
the movie is paused, <a href="#steps">steps</a>() returns 0. If it's running normally
or is finished, steps() returns a negative number.
<p>Example: <a href="movies-example.html#x507">movies/main.cpp</a>.
<h3 class=fn>void <a name="unpause"></a>TQMovie::unpause ()
</h3>
Unpauses the progress of the animation.
<p> <p>See also <a href="#pause">pause</a>().
<p>Example: <a href="movies-example.html#x508">movies/main.cpp</a>.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright © 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>
|