DR Developer's Guide
DR Interfaces | DR Methods | DR Types and Misc API

IMoaDrCast

Interface ID: IID_IMoaDrCast
Pointer type: PIMoaDrCast
Inheritance: IMoaMmPropOwner
Header file: driservc.h
Description
The IMoaDrCast interface represents a cast in a movie. This interface can be acquired by calling the IMoaDrMovie methods NewCast(), GetCastFromName() and GetNthCast(). This file now uses C++ style syntax.
Cast properties
IMoaDrCast inherits from the IMoaMmPropOwner interface, providing for access to data through the properties mechanism described in the IMoaMmPropOwner section. The properties defined for objects providing the IMoaDrCast interface are listed here.

Methods

Property owner methods
GetProp()
SetProp()
Movie Interaction
GetIndexInMovie()
Cast member access
GetFirstUsedMemberIndex()
GetNextUsedMemberIndex()
GetLastUsedMemberIndex()
GetFirstFreeMemberIndex()
GetNextFreeMemberIndex()
GetLastFreeMemberIndex()
GetMemberIndexFromName()
GetCastMem()
Cast member management
CreateCastMem()
DeleteCastMem()
DuplicateCastMem()
Cast management
Save()

CreateCastMem()

Syntax
CreateCastMem(MoaDrMemberIndex memberIndex, MoaMmSymbol typeSymbol)
Parameters
memberIndex
Index of the cast member slot into which the newly created cast member will be placed
typeSymbol
The MoaMmSymbol of the type of cast member to create
Returns
MoaError
Description
Creates a new cast member of the specified type in the specified cast member slot. The caller must provide the symbol of the type to create. Symbols of all registered types can be obtained from the Player cast member type methods (GetNthCastMemTypeSymbol). If you know that the type is registered and the text string for the type, you can get the symbol directly using IMoaMmUtils::StringToSymbol(). If the specified cast member slot is occupied, the existing cast member is deleted. At the time of creation, the cast member probably will not have any media associated with it; use the IMoaDrCastMem::SetMedia() (or its media accessor interface) to supply it.

DeleteCastMem()

Syntax
DeleteCastMem(MoaDrMemberIndex memberIndex)
Parameters
memberIndex
Index of the cast member to delete
Returns
MoaError
Description
Deletes the cast member in the specified slot. The cast member is removed immediately. Any references to the cast member in the score will be dangling.

DuplicateCastMem()

Syntax
DuplicateCastMem(MoaDrMemberIndex sourceMemberIndex, struct IMoaDrCast * pDestCast, MoaDrMemberIndex destMemberIndex)
Parameters
sourceMemberIndex
Index of the cast member in this cast to duplicate
pDestCast
Pointer to a caller-owned IMoaDrCast interface for the destination cast
destMemberIndex
Index in pDestCast of the cast member slot in which to place the copied cast member
Returns
MoaError
Description
Duplicates a cast member, placing the copy in the specified slot within the specified cast. The caller must pass in an interface to the destination cast; this interface continues to be owned by the caller. This method duplicates the cast member entirely, including its properties (name, and so on) and media data. If the destination cast member slot is occupied, the existing cast member is deleted.

GetCastMem()

Syntax
GetCastMem(MoaDrMemberIndex memberIndex, PIMoaDrCastMem * ppIMoaDrCastMem)
Parameters
memberIndex
Index of the cast member of interest. This must be an occupied cast member slot.
ppIMoaDrCastMem
Pointer to a PIMoaDrCastMem to receive a pointer to the cast member's interface. Interface is then owned by caller which must dispose when no longer needed
Returns
MoaError
Description
Obtains a cast member interface for the specified cast member. The caller subsequently owns the interface and is responsible for releasing it when it is no longer needed. A cast member interface may no longer be valid if the associated cast member is moved or deleted from the cast. You should always release the cast member interface before returning from the method implementation that calls this method.

GetFirstFreeMemberIndex()

Syntax
GetFirstFreeMemberIndex(MoaDrMemberIndex * pMemberIndex)
Parameters
pMemberIndex
Pointer to a MoaDrMemberIndex to receive the memberIndex
Returns
MoaError
Description
Obtains the index of the first empty cast member slot in the cast. Returns a NULL member index if there are no empty cast member slots remaining in the cast.

GetFirstUsedMemberIndex()

Syntax
GetFirstUsedMemberIndex(MoaDrMemberIndex * pMemberIndex)
Parameters
pMemberIndex
Pointer to a MoaDrMemberIndex to receive the memberIndex.
Returns
MoaError
Description
Obtains the index of the first occupied (non-empty) cast member slot in the cast. Returns a NULL member index if there are no cast members in the cast.

GetIndexInMovie()

Syntax
GetIndexInMovie(struct IMoaDrMovie * pIMoaDirMovie, MoaDrCastIndex * pCastIndex)
Parameters
pIMoaDirMovie
Pointer to a caller-owned interface for the movie of interest.
pCastIndex
Pointer to a MoaDrCastIndex to receive the index of the cast in the specified movie
Returns
MoaError
Description
Obtains the index of the cast in the specified movie's cast list. Casts can be shared among several simultaneously-playing movies; each cast can have a different position within each movie's cast list. The caller must supply an interface to the movie of interest, which continues to be owned by the caller.

GetLastFreeMemberIndex()

Syntax
GetLastFreeMemberIndex(MoaDrMemberIndex * pMemberIndex)
Parameters
pMemberIndex
Pointer to a MoaDrMemberIndex to receive the memberIndex
Returns
MoaError
Description
Obtains the index of the last empty cast member slot in the cast. Returns a NULL member index if there are no empty cast member slots remaining in the cast.

GetLastUsedMemberIndex()

Syntax
GetLastUsedMemberIndex(MoaDrMemberIndex * pMemberIndex)
Parameters
pMemberIndex
Pointer to a MoaDrMemberIndex to receive the memberIndex
Returns
MoaError
Description
Obtains the index of the last occupied (non-empty) cast member slot in the cast. Returns a NULL member index if there are no cast members in the cast.

GetMemberIndexFromName()

Syntax
GetMemberIndexFromName(PMoaChar pCastMemName, MoaDrMemberIndex * pMemberIndex)
Parameters
This
pCastMemName
Pointer to a C string buffer containing the name of the cast member of interest
pMemberIndex
Pointer to a MoaDrMemberIndex to receive the index of the cast member
Returns
MoaError
Description
Obtains the index of a cast member in the cast given the cast member name. Returns 0 if the cast member cannot be found in the cast. Name comparisons are case-insensitive.

GetNextFreeMemberIndex()

Syntax
GetNextFreeMemberIndex(MoaDrMemberIndex afterMemberIndex, MoaDrMemberIndex * pMemberIndex)
Parameters
afterMemberIndex
Index of cast member slot after which to begin searching for an empty cast member slot.
pMemberIndex
Pointer to a MoaDrMemberIndex to receive the member index
Returns
MoaError
Description
Obtains the index of the next empty cast member slot in the cast after the specified cast member slot. Returns a NULL member index if there are no empty cast member slots in the cast after afterMemberIndex.

GetNextUsedMemberIndex()

Syntax
GetNextUsedMemberIndex(MoaDrMemberIndex afterMemberIndex, MoaDrMemberIndex * pMemberIndex)
Parameters
afterMemberIndex
Index of cast member slot after which to begin search for a non-empty cast member
pMemberIndex
Pointer to a MoaDrMemberIndex to receive the member index
Returns
MoaError
Description
Obtains the index of the next occupied (non-empty) cast member slot in the cast after the specified cast member slot. Returns a NULL member index if there are no cast members in the cast after afterMemberIndex.

GetProp()

Syntax
GetProp(MoaMmSymbol symbol, PMoaMmValue pPropValue)
Parameters
symbol
The MoaMmSymbol for the property of interest
pPropValue
Pointer to a MoaMmValue structure to receive the value

Returns

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
Description
Obtains the value of the specified cast property. To get the symbol from a string, use the IMoaMmUtils::StringToSymbol(). The caller is responsible for releasing the value referenced by pPropValue with IMoaMmUtils::ValueRelease() when it is no longer needed. The properties defined for objects providing the IMoaDrCast interface are listed here.

Save()

Syntax
Save(PMoaChar pNewPathName)
Parameters
pNewPathName
Pointer to a specified path

Returns

kMoaErr_NoErr Successful
kMoaDrErr_DiskIO IO error encountered during file access.
Description
Saves the cast to the specified path, which should include the filename. This method applies only to external cast members.

SetProp()

Syntax
SetProp(MoaMmSymbol symbol, ConstPMoaMmValue pPropValue)
Parameters
symbol
The MoaMmSymbol for the property of interest
pPropValue
Pointer to a caller-owned ConstPMoaMmValue structure containing the new value

Returns

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
Description
Sets a cast property to a new value. The caller continues to maintain ownership of the value passed in, and should release it using IMoaMmUtils::ValueRelease() when it is no longer needed. The properties defined for objects providing the IMoaDrCast interface are listed here.

Copyright © 1995-2008 Adobe Macromedia Software LLC, Inc.