Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
ALAW.r
/* |
File: ALAW.r |
Contains: Defines needed to make a fat sound decompressor and compressor 'thng' resource. |
Written by: Mark Cookson |
Copyright: Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved. |
You may incorporate this Apple sample source code into your program(s) without |
restriction. This Apple sample source code has been provided "AS IS" and the |
responsibility for its operation is yours. You are not permitted to redistribute |
this Apple sample source code as "Apple sample source code" after having made |
changes. If you're going to re-distribute the source, we require that you make |
it clear in the source that the code was descended from Apple sample source |
code, but that you've made changes. |
Change History (most recent first): |
8/13/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1 |
*/ |
#define UseExtendedThingResource 1 // we want the extended thng resource |
#define SystemSevenOrLater 1 // we only run with System 7, right? |
#define FATCOMPONENT 1 |
#include "Types.r" |
#include "SysTypes.r" |
#define kSoundDecompressor 'sdec' |
#define kSoundCompressor 'scom' |
#define k16BitIn (1 << 2) |
#define k16BitOut (1 << 10) |
//#define kRequiredSndMgrMajorRev = 0x03, // 3.0 or later required |
//#define kRequiredSndMgrMinorRev = 0x00 |
#define kALAWVersion 0x00010000 // version for this sound component |
#define kALAWSubType 'ALAW' // codec type |
#define kManufacturerType 'appl' // manufacturer |
#define ALAWDecompressorID 911 // resource ID for MSG decompressor |
#define ALAWCompressorID 912 // resource ID for MSG compressor |
#define k68KCodeResType 'cdec' // resource type for 68K code |
#define kPPCCodeResType 'cdek' // resource type for PowerPC code |
#define kDecompressorFlags (cmpWantsRegisterMessage | k16BitIn | k16BitOut) |
#define kCompressorFlags (cmpWantsRegisterMessage | k16BitIn | k16BitOut) |
// A-Law Decompressor, 68K, PPC |
resource 'thng' (ALAWDecompressorID, "A-Law decompressor") { |
kSoundDecompressor, kALAWSubType, kManufacturerType, // types |
kDecompressorFlags, kAnyComponentFlagsMask, // flags |
#if FATCOMPONENT |
k68KCodeResType, ALAWDecompressorID, // code |
#else |
0, 0, // no 68K code |
#endif |
'STR ', ALAWDecompressorID, // name |
'STR ', ALAWDecompressorID+1, // info |
'ICON', ALAWDecompressorID, // icon |
kALAWVersion, // version |
componentDoAutoVersion | componentHasMultiplePlatforms, // registration flags |
0, // icon |
{ |
#if FATCOMPONENT |
kDecompressorFlags, // flags |
k68KCodeResType, ALAWDecompressorID, // code |
platform68k, // platform |
#endif |
kDecompressorFlags, // flags |
kPPCCodeResType, ALAWDecompressorID, // code |
platformPowerPC // platform |
}; |
}; |
// A-Law Compressor, 68K, PPC |
resource 'thng' (ALAWCompressorID, "A-Law compressor") { |
kSoundCompressor, kALAWSubType, kManufacturerType, // types |
kCompressorFlags, kAnyComponentFlagsMask, // flags |
#if FATCOMPONENT |
k68KCodeResType, ALAWCompressorID, // code |
#else |
0, 0, // no 68K code |
#endif |
'STR ', ALAWDecompressorID, // name |
'STR ', ALAWDecompressorID+1, // info |
'ICON', ALAWDecompressorID, // icon |
kALAWVersion, // version |
componentDoAutoVersion | componentHasMultiplePlatforms, // registration flags |
0, // icon |
{ |
#if FATCOMPONENT |
kCompressorFlags, // flags |
k68KCodeResType, ALAWCompressorID, // code |
platform68k, // platform |
#endif |
kCompressorFlags, // flags |
kPPCCodeResType, ALAWCompressorID, // code |
platformPowerPC // platform |
}; |
}; |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-03-14