Interface ID: IID_IMoaDrCastMem
Pointer type:
PIMoaDrCastMem
Inheritance: IMoaDrMediaOwner
Header file: driservc.h
Media | Label Description |
---|---|
Composite | Cast member media data in a portable (byte-swapped) opaque handle. |
Image | Primary image data (for a bitmap, PICT, and so on). |
Text | Text character string |
TextStyles | Text style run data |
Sound | Sound samples |
Palette | Palette entries |
Score | Score data for a movie or film loop |
The following table provides a brief summary of the media formats supported for Director cast members.
Media Format | Description |
---|---|
moaHandle | Generic MoaHandle of data |
moaTEStyles | textStyles stored in a MoaHandle |
macTEStyles | textStyles in TextEdit StScrpHandle format stored in a Macintosh handle |
macPICT | Macintosh PicHandle. Note that 32bit images have alpha channel data. |
macSnd | Macintosh sndHdl. Handle in Macintosh sound resource format. |
macColorTable | Macintosh CTabHandle . Handle to a ColorTable record |
winDIB | Windows packed DIB GlobalHandle with bitmap information, color table, and bits. Note that 32bit images have alpha channel data. |
winWAVE | Windows RIFF WAVE GlobalHandle . RIFF sound format. |
winPALETTE | Windows HPALETTE GlobalHandle . RIFF palette format |
All media types support the composite label; that is, you can get the media data for any cast member as a single, opaque portable MoaHandle . Because Director handles the byteswapping of these, they're safe to write out to disk and read back in on another platform. The format for composite media is always MoaHandle .
In addition to composite, each built-in cast member type supports one or more other labels or formats. For example, bitmaps, PICTs, Rich Text, and OLE support the image label (RichText and OLE are Get-only for this); the bitmap format supported depends on the platform (macPICT on mac, winDIB on Windows). In the future, we may add additional formats, such as a portable pixel map format which is identical on both platforms.
Text supports multiple labels: text to get or set the ASCII text, textStyles (Macintosh-only) to get or set the style data independently from the ASCII.
Both movies and cast members support the score media label, with the format MoaHandle . This lets you get and set the score data itself. You can attach a ScoreAccess interface to one of these data handles using IMoaDrUtils::NewScoreAccess() . However, if you want to edit the score of an existing movie or cast member, it's easier just to obtain the ScoreAccess interface directly from the object itself using IMoaDrCastMem::GetScoreAccess() ,
Here's a complete list of the media labels and formats supported by the Director cast member types:
Cast member type | Media label | Media format |
---|---|---|
BITMAP | Composite Image |
moaHandle mac: macPICT win: winDIB |
FILMLOOP | Composite Score |
moaHandle moaHandle |
TEXTFIELD | Composite Text TextStyles |
moaHandle moaHandle (null-terminated string) mac: macTEStyles mac & win: moaTEStyles |
PALETTE | Composite Palette |
moaHandle mac: macColorTable win: winPALETTE |
PICT | Composite Image |
moaHandle mac: macPICT win: winDIB |
SOUND | Composite Sound |
moaHandle mac: macSnd win: winWAVE |
BUTTON | Composite Text TextStyles |
moaHandle moaHandle (null-terminated string handle) mac: macTEStyles mac & win: moaTEStyles |
SHAPE | Composite | moaHandle |
MOVIE | Composite | moaHandle |
DIGITAL VIDEO | Composite | moaHandle |
SCRIPT | Composite | moaHandle NOTE: Script text can be accessed using GetProp() and SetProp() |
RICH TEXT | Composite Text Image (Get Only) |
moaHandle moaHandle (null-terminated string handle). Set allowed only in authoring applications mac: macPICT win: winDIB |
OLE | Composite Image (Get Only) |
moaHandle mac: macPICT win: winDIB |
XTRA | Composite | moaHandle |
TRANS | Composite | moaHandle |
Sprite Xtras, which provide cast members through extensions to Director, only support the composite media label, which is a combination of the Xtra's media, properties, and built-in properties combined in an opaque format. You can get or set the media data of any Xtra-based cast member type as a composite MoaHandle.
- AttachMedia(PMoaDrMediaInfo pMediaInfo)
pMediaInfo
PMoaDrMediaInfo
Pointer to a caller- owned media information structure
MoaError
CallFunction(MoaMmSymbol methodName, MoaLong nArgs, ConstPMoaMmValue pArgs, PMoaMmValue pResult)
methodName
MoaMmSymbol
Symbol of the method (function) to call nArgs
MoaLong
Number of arguments, excluding the Xtra instance in pArgs [0] pArgs
ConstPMoaMmValue
Array of arguments, with the first valid argument at pArgs [1]
pResult
PMoaMmValue
Pointer to a MoaMmValue to receive a result value, if any.
kMoaErr_NoErr | Successful |
kMoaMmErr_FunctionNotFound | Function not supported |
kMoaMmErr_WrongNumberOfArgs | Argument count wrong, |
Other Property/CallHandler errors | Also acceptable here |
CallHandler(MoaMmSymbol handlerName,
MoaLong nArgs,
PMoaMmValue pArgs,
PMoaMmValue pResult,
MoaBool FAR * pHandled)
handlerName
MoaMmSymbol
Symbol for handler (message) name nArgs
MoaLong
Number of arguments you're passing pArgs
PMoaMmValue
Pointer to an array of MoaMmValues containing arguments pResult
PMoaMmValue
Pointer to a caller-owned MoaMmValue to receive the return value pHandled
MoaBool FAR *
Pointer to a MoaBool to receive TRUE if the handler exists in the script (message
handled), or FALSE if it does not
MoaError
GetMedia(PMoaDrMediaInfo pMediaInfo)
pMediaInfo
PMoaDrMediaInfo
Pointer to a caller-owned media information structure
MoaError
GetMedia
call to get either a PICT (on Mac) or a DIB (on Win). If you're querying
a 32-bit member, you'll get back the alpha channel in the data. You can manipulate the image, and then set it back using
SetMedia
.
GetMemberIndex(MoaDrMemberIndex FAR * pMemberIndex)
pMemberIndex
MoaDrMemberIndex FAR *
Pointer to position of cast member in cast
MoaError
GetProp(MoaMmSymbol symbol, PMoaMmValue pPropValue)
symbol
MoaMmSymbol
The MoaMmSymbol for the property of interest pPropValue
PMoaMmValue
Pointer to a caller-owned MoaMmValue structure to receive the value of the property
kMoaErr_NoErr | Property exists and value was returned |
kMoaErr_BadParam | Invalid pPropValue passed in |
kMoaMmErr_PropertyNotFound | Property isn't supported by this class |
kMoaMmErr_InternalError | Property exists but couldn't get due to internal err |
kMoaMmErr_NoMemForString | Couldn't allocate memory for string value data |
kMoaErr_OutOfMem | Couldn't allocate memory for other value data |
GetScoreAccess(struct IMoaDrScoreAccess FAR * FAR * ppScore)
ppScore
MoaError
SetMedia(PMoaDrMediaInfo pMediaInfo)
pMediaInfo
PMoaDrMediaInfo
Pointer to a caller-owned media information structure
MoaError
SetProp(MoaMmSymbol symbol, ConstPMoaMmValue pPropValue)
symbol
MoaMmSymbol
The MoaMmSymbol for the property of interest pPropValue
ConstPMoaMmValue
Pointer to a caller-owned MoaMmValue structure to copy the new value for
the property from
kMoaErr_NoErr | Property exists and value was set |
kMoaErr_BadParam | Invalid pPropValue passed in |
kMoaMmErr_PropertyNotFound | Property isn't supported by this class |
kMoaMmErr_InternalError | Property exists, value ok, couldn't set--internal error |
kMoaMmErr_NoMemForString | Couldn't allocate memory for setting string value data |
kMoaErr_OutOfMem | Couldn't allocate memory for setting other value data |
kMoaMmErr_IntegerExpected | Type mismatch: integer value expected |
kMoaMmErr_SymbolExpected | Type mismatch: symbol value expected |
kMoaMmErr_FloatExpected | Type mismatch: float value expected |
kMoaMmErr_StringExpected | Type mismatch: string value expected |
kMoaMmErr_PointExpected | Type mismatch: point value expected |
kMoaMmErr_RectExpected | Type mismatch: rect value expected |
kMoaMmErr_ValueTypeMismatch | Type mismatch: other value expected (non-specific) |
kMoaDrErr_CastMemberExpected | Type mismatch: CMRef value expected |