-
Notifications
You must be signed in to change notification settings - Fork 3
/
listing11.html
executable file
·634 lines (548 loc) · 26.1 KB
/
listing11.html
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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<!-- BEGIN META TAG INFO -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="home" href="http://developer.apple.com/">
<link rel="find" href="http://developer.apple.com/search/">
<link rel="stylesheet" type="text/css" href="../../documentation/css/adcstyle.css" title="fonts">
<script language="JavaScript" src="../../documentation/js/adc.js" type="text/javascript"></script>
<!-- END META TAG INFO -->
<!-- BEGIN TITLE -->
<title>Dimmer2Effect - /EffectFramework/Effect.r</title>
<!-- END TITLE -->
<script language="JavaScript">
function JumpToNewPage() {
window.location=document.scpopupmenu.gotop.value;
return true;
}
</script>
</head>
<!-- BEGIN BODY OPEN -->
<body>
<!--END BODY OPEN -->
<!-- START CENTER OPEN -->
<center>
<!-- END CENTER OPEN -->
<!-- BEGIN LOGO AND SEARCH -->
<!--#include virtual="/includes/adcnavbar"-->
<!-- END LOGO AND SEARCH -->
<!-- START BREADCRUMB -->
<div id="breadcrumb">
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr>
<td scope="row"><img width="340" height="10" src="images/1dot.gif" alt=""></td>
<td><img width="340" height="10" src="images/1dot.gif" alt=""></td>
</tr>
<tr valign="middle">
<td align="left" colspan="2">
<a href="http://developer.apple.com/">ADC Home</a> > <a href="../../referencelibrary/index.html">Reference Library</a> > <a href="../../samplecode/index.html">Sample Code</a> > <a href="../../samplecode/QuickTime/index.html">QuickTime</a> > <a href="../../samplecode/QuickTime/idxVideoEffectsTransitions-date.html">Video Effects & Transitions</a> > <A HREF="javascript:location.replace('index.html');">Dimmer2Effect</A> >
</td>
</tr>
<tr>
<td colspan="2" scope="row"><img width="680" height="35" src="images/1dot.gif" alt=""></td>
</tr>
</table>
</div>
<!-- END BREADCRUMB -->
<!-- START MAIN CONTENT -->
<!-- START TITLE GRAPHIC AND INTRO-->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr align="left" valign="top">
<td><h1><div id="pagehead">Dimmer2Effect</div></h1></td>
</tr>
</table>
<!-- END TITLE GRAPHIC AND INTRO -->
<!-- START WIDE COLUMN -->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr align="left" valign="top">
<td id="scdetails">
<h2>/EffectFramework/Effect.r</h2>
<form name="scpopupmenu" onSubmit="return false;" method=post>
<p><strong>View Source Code:</strong>
<select name="gotop" onChange="JumpToNewPage();" style="width:340px"><option selected value="ingnore">Select File</option>
<option value="listing1.html">/ComponentIncludes/ComponentDispatchHelper.c</option>
<option value="listing2.html">/ComponentIncludes/ComponentIncludes.txt</option>
<option value="listing3.html">/ComponentIncludes/Components.k.h</option>
<option value="listing4.html">/ComponentIncludes/ImageCodec.k.h</option>
<option value="listing5.html">/ComponentIncludes/ImageCompression.k.h</option>
<option value="listing6.html">/ComponentIncludes/QuickTimeComponents.k.h</option>
<option value="listing7.html">/Effect/EffectFilter16.c</option>
<option value="listing8.html">/Effect/EffectFilter32.c</option>
<option value="listing9.html">/EffectFramework/BltMacros.h</option>
<option value="listing10.html">/EffectFramework/Effect.c</option>
<option value="listing11.html">/EffectFramework/Effect.r</option>
<option value="listing12.html">/EffectFramework/EffectDefinitions.h</option>
<option value="listing13.html">/EffectFramework/EffectDispatch.h</option>
<option value="listing14.html">/EffectFramework/EffectRezPB.r</option>
<option value="listing15.html">/EffectFramework/EffectUtilities.c</option>
<option value="listing16.html">/EffectFramework/EffectUtilities.h</option>
<option value="listing17.html">/PrefixIncludes/PrefixCarbon.h</option>
<option value="listing18.html">/PrefixIncludes/PrefixCarbonCFM.r</option>
<option value="listing19.html">/PrefixIncludes/PrefixCarbonMachO.r</option>
<option value="listing20.html">/PrefixIncludes/PrefixPPC.h</option>
<option value="listing21.html">/PrefixIncludes/PrefixPPC.r</option></select>
</p>
</form>
<p><strong><a href="Dimmer2Effect.zip">Download Sample</a></strong> (“Dimmer2Effect.zip”, 291.2K)<BR>
<strong><a href="Dimmer2Effect.dmg">Download Sample</a></strong> (“Dimmer2Effect.dmg”, 375.6K)</p>
<!--
<p><strong><a href="#">Download Sample</a></strong> (“filename.sit”, 500K)</p>
-->
</td>
</tr>
<tr>
<td scope="row"><img width="680" height="10" src="images/1dot.gif" alt=""><br>
<img height="1" width="680" src="images/1dot_919699.gif" alt=""><br>
<img width="680" height="20" src="images/1dot.gif" alt=""></td>
</tr>
<tr>
<td scope="row">
<!--googleon: index -->
<pre class="sourcecodebox">/*
File: Effect.r
Description: Effect Resources
Author: QuickTime Engineering
Copyright: © Copyright 1997-2002 Apple Computer, Inc. All rights reserved.
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
("Apple") in consideration of your agreement to the following terms, and your
use, installation, modification or redistribution of this Apple software
constitutes acceptance of these terms. If you do not agree with these terms,
please do not use, install, modify or redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and subject
to these terms, Apple grants you a personal, non-exclusive license, under Apple's
copyrights in this original Apple software (the "Apple Software"), to use,
reproduce, modify and redistribute the Apple Software, with or without
modifications, in source and/or binary forms; provided that if you redistribute
the Apple Software in its entirety and without modifications, you must retain
this notice and the following text and disclaimers in all such redistributions of
the Apple Software. Neither the name, trademarks, service marks or logos of
Apple Computer, Inc. may be used to endorse or promote products derived from the
Apple Software without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or implied,
are granted by Apple herein, including but not limited to any patent rights that
may be infringed by your derivative works or by other works in which the Apple
Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
(INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Change History (most recent first):
<1> 05/10/02 era updated for X
*/
/*
thng_RezTemplateVersion:
0 - original 'thng' template <-- default
1 - extended 'thng' template <-- used for multiplatform things
2 - extended 'thng' template including resource map id
*/
#define thng_RezTemplateVersion 1
/*
cfrg_RezTemplateVersion:
0 - original <-- default
1 - extended <-- we use the extended version
*/
#define cfrg_RezTemplateVersion 1
#if TARGET_REZ_CARBON_MACHO
#include <Carbon/Carbon.r>
#include <QuickTime/QuickTime.r>
#elif TARGET_REZ_CARBON_CFM
#include <Carbon.r>
#include <QuickTime.r>
#else
#include "ConditionalMacros.r"
#include "MacTypes.r"
#include "Components.r"
#include "ImageCodec.r"
#include "CodeFragments.r"
#endif
#include "EffectDefinitions.h"
#define kEffectCodecRezInfo "Dimmer2 Effect Codec Info"
#define kEffectCodecFormatName "Dimmer2 Effect"
#define kEffectCodecFormatType 'dimt'
#define kEffectCodecWhatName OSType { "dimt" }
// These flags specify information about the capabilities of the component
// Works with 1-bit, 2-bit, 4-bit, 8-bit, 16-bit and 32-bit Pixel Maps
// It can spool image data and the codec implements get effects parameter list call
#define kDecoFlags (codecInfoDoes32 + codecInfoDoes16 + codecInfoDoes8 + codecInfoDoes4 + codecInfoDoes2 + codecInfoDoes1 + codecInfoDoesSpool + codecInfoHasEffectParameterList)
// These flags specify the possible format of compressed data produced by the component
// and the format of compressed files that the component can handle during decompression
// The component can decompress from files at 1-bit, 2-bit, 4-bit, 8-bit, 16-bit and 32-bit,
// 1-bit monochrome, 2-bit grayscale, 4-bit grayscale, 8-bit grayscale and the data can be stored in lossless format
#define kDataFormatFlags (codecInfoDepth1 + codecInfoDepth2 + codecInfoDepth4 + codecInfoDepth8 + codecInfoDepth16 + codecInfoDepth32 + codecInfoDepth33 + codecInfoDepth34 + codecInfoDepth36 + codecInfoDepth40 + codecInfoDoesLossless)
// This structure defines the capabilities of the codec.
// Component Description
resource 'cdci' (kEffect_cdci_ResID, kEffectCodecRezInfo, locked) {
kEffectCodecFormatName, // Type
kVersionNumber, // Version
0, // Revision level
'appl', // Manufacturer
kDecoFlags, // Decompression Flags - depth and etc. supported directly on decompress
0, // Compression Flags - depth and etc. supported directly on compress
kDataFormatFlags, // Format Flags - which data formats do we understand
100, // Compression Accuracy - compress accuracy (0-255) (relative to format)
100, // Decomression Accuracy - decompress accuracy (0-255) (relative to format)
100, // Compression Speed - millisecs to compress 320x240 image on base Mac
100, // Decompression Speed - millisecs to compress 320x240 image on base Mac
100, // Compression Level - compression level (0-255) (relative to format)
0, // Reserved
2, // Minimum Height
2, // Minimum Width
0, // Decompression Pipeline Latency
0, // Compression Pipeline Latency
0 // Private Data
};
// ====================================================================================
// The Thing resources
// ====================================================================================
resource 'thng' (kEffect_thng_ResID, "Dimmer2 Effect", locked) {
decompressorComponentType, // Type - always 'imdc' for effects
kEffectCodecFormatType, // SubType - your format
'appl', // Manufacturer
kDecoFlags, // Component flags
0, // Component flags Mask
0, // - use componentHasMultiplePlatforms
0,
'STR ', // Name Type
kEffectNameResID, // Name ID
'STR ', // Info Type
kEffectDescriptionResID, // Info ID
0, // Icon Type
0, // Icon ID
kDimmerEffectVersion, // Version
componentHasMultiplePlatforms + // Registration Flags
componentDoAutoVersion,
0, // Resource ID of Icon Family
{
#if TARGET_OS_MAC
#if TARGET_REZ_CARBON_CFM
#define USE_CUSTOM_CFRG_RESOURCE 0 // Single component in file - Custom 'cfrg' not used
kDecoFlags, // Component Flags
'cfrg', // Special Case: data-fork based code fragment
0, /* Code ID usage for CFM components:
0 (kCFragResourceID) - This means the first member in the code fragment;
Should only be used when building a single component per file. When doing so
using kCFragResourceID simplifies things because a custom 'cfrg' resource is not required
n - This value must match the special 'cpnt' qualifier 1 in the custom 'cfrg' resource */
platformPowerPCNativeEntryPoint, // Platform Type (response from gestaltComponentPlatform or failing that, gestaltSysArchitecture)
#elif TARGET_REZ_CARBON_MACHO
kDecoFlags,
'dlle', // Code Resource type - Entry point found by symbol name 'dlle' resource
kEffect_dlle_ResID, // ID of 'dlle' resource
platformPowerPCNativeEntryPoint,
#elif TARGET_REZ_MAC_PPC
kDecoFlags,
'imdc', // Code Type
kEffectCodeID, // Code ID
platformPowerPC,
#elif TARGET_REZ_MAC_68K
#error "TARGET_REZ_MAC_68K not supported."
#else
#error "At least one TARGET_REZ_XXX_XXX platform must be defined."
#endif
#elif TARGET_OS_WIN32
kDecoFlags,
'dlle',
kEffect_dlle_ResID,
platformWin32,
#else
#error "At least one TARGET_OS_XXX platform must be defined."
#endif
};
};
#if TARGET_REZ_CARBON_CFM
#if USE_CUSTOM_CFRG_RESOURCE
// Custom extended code fragment resource
// CodeWarrior will correctly adjust the offset and length of each
// code fragment when building a MacOS Merge target
resource 'cfrg' (0) {
{
extendedEntry {
kPowerPCCFragArch, // archType
kIsCompleteCFrag, // updateLevel
kNoVersionNum, // currentVersion
kNoVersionNum, // oldDefVersion
kDefaultStackSize, // appStackSize
kNoAppSubFolder, // appSubFolderID
kImportLibraryCFrag, // usage
kDataForkCFragLocator, // where
kZeroOffset, // offset
kCFragGoesToEOF, // length
"Dimmer2 Effect", // member name
// Start of extended info.
'cpnt', // libKind (not kFragComponentMgrComponent == 'comp' as you might expect)
"\0x00\0x82", // qualifier 1 - hex 0x0082 (130) must match Code ID in 'thng'
"", // qualifier 2
"", // qualifier 3
"Dimmer2 QuickTime Effect", // intlName, localised
};
};
};
#endif
#endif
#if TARGET_REZ_CARBON_MACHO || TARGET_OS_WIN32
// Code Entry Point for Mach-O and Windows
resource 'dlle' (kEffect_dlle_ResID) {
"EffectsFrameComponentDispatch"
};
#endif
// ====================================================================================
// Name and description strings
// ====================================================================================
resource 'STR ' (kEffectNameResID) {
"Dimmer2 Effect"
};
resource 'STR ' (kEffectDescriptionResID) {
"Fades down from one source, then fades up on a second source"
};
resource 'vers' (1) {
0x01, 0x01, release, 0x00,
verUS,
"1.0.1",
"1.0.1 ©1997-2002 Apple Computer Inc."
};
// ====================================================================================
// The parameter descriptions
// You must change these to reflect the paramaters that your effect takes.
// Each effect has a set of standard resources that must be present.
// A set of optional resources is required for each parameter your effect has.
// ====================================================================================
/*
The standard information stored in an 'atms' resource is made up of three required atoms
and seven optional atoms.
The three required atoms are:
kParameterTitleName
A string used as the title of the standard parameters dialog box.
kParameterWhatName
An OSType containing the name of this effect component.
kParameterSourceCountName
A long integer containing the maximum number of sources that the effect can take.
The seven optional atoms are
kParameterAlternateCodecName
An OSType containing the unique identifier of another effect component that should be
used to replace this effect if this effect cannot be used.
kParameterInfoLongName
A string containing the long version of the name of the effect.
kParameterInfoCopyright
A string containing a copyright statement for the effect.
kParameterInfoDescription
A string containing a brief description of what the effect does.
kParameterInfoWindowTitle
A string containing the title of the window that displays the information contained in the optional atoms.
kEffectMajorClassType (added in QuickTime 6)
The Major Class for an effect defines the purpose of an effect to allow applications to perform better
filtering. It is not intended that the user see effects grouped by major class. Effects that fail to
include a kEffectMajorClassType will be classified as Miscellaneous.
kEffectMinorClassType (added in QuickTime 6)
Like the Major Class, the Minor Class of an effect serves to group the effect into a more refined
definition. Unlike the Major Class, however, the Minor Class is intended to be used for grouping for
the purposes of User Interface presentation. Effects that fail to include a kEffectMinorClassType
will be classified as Miscellaneous.
The Parameter Information in an 'atms' Resource
For each parameter of the effect, your 'atms' resource must contain a set of atoms in the 'atms'
resource that describes that parameter. This description includes the name of the parameter, the
type and range of values it can take, and hints on appropriate user interface element for setting
this parameter.
A complete description of the information you need to provide for each parameter can be found in
"The Parameter Description Format".
http://developer.apple.com/techpubs/quicktime/qtdevdocs/REF/refEffects.35.htm
For a basic parameter, there are five atoms that you should supply:
kParameterAtomTypeAndID
Contains the type and ID of the parameter (an OSType and a long integer, respectively),
the atom flags for the parameter, and a string containing the name of the parameter.
kParameterDataType
A long integer containing the type of the parameter, such as kParameterTypeDataFixed.
kParameterDataRange
A set of typed values describing the range of values the parameter can take. The number
and type of values you supply depend on the value of the kParameterDataType atom.
kParameterDataBehavior
two long integer values containing the behavior type, such as kParameterItemControl for a
slider, and any flags, such as kAtomNotInterpolated for a parameter that cannot be tweened.
kParameterDataDefaultItem
the default value of the parameter. Again, the type of this value will depend on the type of
the kParameterDataType atom. This atom must be a correctly-formatted parameter atom that can
be passed back to your component by client software without modification.
*/
#define kCrossFadeTransitionType OSType { "dslv" }
resource 'atms' (kEffect_atms_ResID)
{
// number of root atoms
10 + 6, // 10 Standard Atoms + 6 Parameter Atoms
{
// ---------------------------------------
// The Standard Resources
// These must be present - they describe your effect
// ---------------------------------------
// The name of the parameters - Required
kParameterTitleName, kParameterTitleID, noChildren,
{
string { "Dimmer2 Effect Parameters" };
};
// The name (subType) of the effect component - Required
kParameterWhatName, kParameterWhatID, noChildren,
{
kEffectCodecWhatName;
};
// The maximum number of sources the effect takes - Required
kParameterSourceCountName, kParameterSourceCountID, noChildren,
{
long { "2" };
};
// Alternate Codec - Optional
// If this codec can't be found, try this other one as a replacement
kParameterAlternateCodecName, kParameterAlternateCodecID, noChildren,
{
kCrossFadeTransitionType;
};
// Information atoms - Optional
kParameterInfoLongName, kParameterInfoIDs, noChildren,
{
string { "Dimmer2 Effect" };
};
kParameterInfoCopyright, kParameterInfoIDs, noChildren,
{
string { "Sample QuickTime Effect by Apple Computer, Inc." };
};
kParameterInfoDescription, kParameterInfoIDs, noChildren,
{
string { "Fades down from one source, then fades up on a second source." };
};
kParameterInfoWindowTitle, kParameterInfoIDs, noChildren,
{
string { "Dimmer2 Effect Information" };
};
// QuickTime 6 Effect Classes
// With an ever increasing number of effect components, it has become difficult for applications and
// users to navigate through the effect list. The effect class atoms can be used for tagging
// effects into useful catagories. These atoms do nothing in previous version of QuickTime.
#if (UNIVERSAL_INTERFACES_VERSION <= 0x0341) || (UNIVERSAL_INTERFACES_VERSION == 0x0400)
// Older interfaces so define this stuff
#define kEffectMajorClassType 'clsa'
#define kEffectMajorClassID (1)
#define kTransitionMajorClass OSType { "tran" } // multisource morph effects
#define kEffectMinorClassType 'clsi'
#define kEffectMinorClassID (1)
#define kTransitionMinorClass OSType { "tran" } // "Transitions"
#endif
// Major Class of effect - Optional but a good thing to have for QT 6+
kEffectMajorClassType, kEffectMajorClassID, noChildren,
{
kTransitionMajorClass;
};
// Minor Class of effect - Option but a good thing to have for QT 6+
kEffectMinorClassType, kEffectMinorClassID, noChildren,
{
kTransitionMinorClass;
};
// ---------------------------------------
// Optional Resources
// There is a standard set of resources
// for each parameter your effect takes.
// See the QuickTime Documentation for
// descriptions of the resources you must
// supply for your effect
// ---------------------------------------
// The percentage parameter defines the starting and end
// point of the effect. For example, instead of fading down
// from full intensity to black, then up again, you could
// fade down from a medium intensity, then back up to full
// intensity by specifying a starting percentage of 25% and
// an ending percentage of 100%
// The general information about the parameter
kParameterAtomTypeAndID, 1, noChildren,
{
OSType { "pcnt" }; // The parameter code
long { "1" }; // The parameter ID
kAtomNoFlags; // Parameter flags
string { "Percentage" }; // The parameter name
};
// The data type of the parameter
kParameterDataType, 1, noChildren,
{
kParameterTypeDataFixed;
};
// The range of values the parameter can take
kParameterDataRange, 1, noChildren,
{
long { "0" }; // Minimum value (0.0 fixed)
long { "65536" }; // Maximum value (1.0 fixed)
long { "6553600" }; // Scale. This value will scale the value set
// by the user into the range 0\xC9100 (100.0 fixed)
long { "0" }; // Precision
};
// The parameter's "behavior"
kParameterDataBehavior, 1, noChildren,
{
kParameterItemControl; // Display this item using a control. In the case
// of a parameter of data type Fixed, this will result
// (in the standard parameters dialog box) in a slider
// being displayed which the user can use to set the
// value of the parameter.
long { "0" }; // Flags
};
// How the parameter's value will be used.
kParameterDataUsage, 1, noChildren,
{
kParameterUsagePercent; // The parameter stores a percentage
};
// The default value for the parameter.
// In this case this is a tween record
kParameterDataDefaultItem, 1, 2,
{
};
// The tween record
'twnt', 1, noChildren,
{
kParameterTypeDataFixed; // This is a fixed-point tween
};
'data', 1, noChildren,
{
long { "0" }; // The default lower value (0%)
long { "65536" }; // The default upper value (100%)
};
};
};</pre>
<!--googleoff: index -->
</td>
</tr>
</table>
<!-- END WIDE COLUMN -->
<!-- END MAIN CONTENT -->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div style="width: 100%; height: 1px; background-color: #919699; margin-top: 5px; margin-bottom: 15px"></div></td>
</tr>
<tr>
<td align="center"><br/>
<table border="0" cellpadding="0" cellspacing="0" class="graybox">
<tr>
<th>Did this document help you?</th>
</tr>
<tr>
<td>
<div style="margin-bottom: 8px"><a href="http://developer.apple.com/feedback/?v=1&url=/samplecode/Dimmer2Effect/listing11.html%3Fid%3DDTS10000825-1.0&media=dvd" target=_new>Yes</a>: Tell us what works for you.</div>
<div style="margin-bottom: 8px"><a href="http://developer.apple.com/feedback/?v=2&url=/samplecode/Dimmer2Effect/listing11.html%3Fid%3DDTS10000825-1.0&media=dvd" target=_new>It’s good, but:</a> Report typos, inaccuracies, and so forth.</div>
<div><a href="http://developer.apple.com/feedback/?v=3&url=/samplecode/Dimmer2Effect/listing11.html%3Fid%3DDTS10000825-1.0&media=dvd" target=_new>It wasn’t helpful</a>: Tell us what would have helped.</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- START BOTTOM APPLE NAVIGATION -->
<!--#include virtual="/includes/footer"-->
<!-- END BOTTOM APPLE NAVIGATION -->
<!-- START CENTER CLOSE -->
</center>
<!-- END CENTER CLOSE -->
</body>
</html>