Summary of Movie Controller Components
C Summary
Constants
enum {
kMCSetMovieSelect = 2, /* MCSetMovie */
kMCRemoveMovieSelect = 3, /* MCRemoveMovie */
kMCIsPlayerEventSelect = 7, /* MCIsPlayerEvent */
kMCSetActionFilterSelect = 8, /* MCSetActionFilter */
kMCDoActionSelect = 9, /* MCDoAction */
kMCSetControllerAttachedSelect= 10, /* MCSetControllerAttached */
kMCIsControllerAttachedSelect = 11, /* MCIsControllerAttached */
kMCSetControllerPortSelect = 12, /* MCSetControllerPort */
kMCGetControllerPortSelect = 13, /* MCGetControllerPort */
kMCGetVisibleSelect = 14, /* MCGetVisible */
kMCSetVisibleSelect = 15, /* MCSetVisible */
kMCGetControllerBoundsRectSelect
= 16, /* MCGetControllerBoundsRect */
kMCSetControllerBoundsRectSelect
= 17, /* MCSetControllerBoundsRect */
kMCGetControllerBoundsRgnSelect
= 18, /* MCGetControllerBoundsRgn */
kMCGetWindowRgnSelect = 19, /* MCGetWindowRgn */
kMCMovieChangedSelect = 20, /* MCMovieChanged */
kMCSetDurationSelect = 21, /* MCSetDuration */
kMCGetCurrentTimeSelect = 22, /* MCGetCurrentTime */
kMCNewAttachedControllerSelect= 23, /* MCNewAttachedController */
kMCDrawSelect = 24, /* MCDraw */
kMCActivateSelect = 25, /* MCActivate */
kMCIdleSelect = 26, /* MCIdle */
kMCKeySelect = 27, /* MCKey */
kMCClickSelect = 28, /* MCClick */
kMCEnableEditingSelect = 29, /* MCEnableEditing */
kMCIsEditingEnabledSelect = 30, /* MCIsEditingEnabled*/
kMCCopySelect = 31, /* MCCopy */
kMCCutSelect = 32, /* MCCut */
kMCPasteSelect = 33, /* MCPaste */
kMCClearSelect = 34, /* MCClear */
kMCUndoSelect = 35, /* MCUndo */
kMCPositionControllerSelect = 36, /* MCPositionController */
kMCGetControllerInfoSelect = 37, /* MCGetControllerInfo */
kMCSetClipSelect = 40, /* MCSetClip */
kMCGetClipSelect = 41, /* MCGetClip */
kMCDrawBadgeSelect = 42, /* MCDrawBadge */
kMCSetUpEditMenuSelect = 43, /* MCSetUpEditMenu */
kMCGetMenuStringSelect = 44, /* MCGetMenuString */
kMCSetActionFilterWithRefConSelect
= 45
/* SetActionFilterWithRefConSelect */
};
enum {
mcActionIdle = 1, /* give event-processing time to
movie controller */
mcActionDraw = 2, /* send update event to movie
controller */
mcActionActivate = 3, /* activate movie controller */
mcActionDeactivate = 4, /* deactivate controller */
mcActionMouseDown = 5, /* pass mouse-down event */
mcActionKey = 6, /* pass key-down or auto-key event */
mcActionPlay = 8, /* start playing movie */
mcActionGoToTime = 12, /* move to specific time in a movie */
mcActionSetVolume = 14, /* set a movie's volume */
mcActionGetVolume = 15, /* retrieve a movie's volume */
mcActionStep = 18, /* play a movie a specified number
of frames at a time */
mcActionSetLooping = 21, /* enable or disable looping */
mcActionGetLooping = 22, /* find out if movie is looping */
mcActionSetLoopIsPalindrome = 23, /* enable palindrome looping */
mcActionGetLoopIsPalindrome = 24, /* find out if palindrome looping
is on */
mcActionSetGrowBoxBounds = 25, /* set limits for resizing a movie */
mcActionControllerSizeChanged = 26, /* user has resized movie
controller */
mcActionSetSelectionBegin = 29, /* start time of movie's current
selection */
mcActionSetSelectionDuration = 30, /* set duration of movie's current
selection */
mcActionSetKeysEnabled = 32, /* enable or disable keystrokes for
movie */
mcActionGetKeysEnabled = 33, /* find out if keystrokes are
enabled */
mcActionSetPlaySelection = 34, /* constrain playing to the current
selection */
mcActionGetPlaySelection = 35, /* find out if movie is constrained to
playing within selection */
mcActionSetUseBadge = 36, /* enable or disable movie's
playback badge */
mcActionGetUseBadge = 37, /* find out if movie controller is
using playback badge */
mcActionSetFlags = 38, /* set movie's control flags */
mcActionGetFlags = 39, /* retrieve movie's control flags */
mcActionSetPlayEveryFrame = 40, /* instruct controller to play all
frames in movie */
mcActionGetPlayEveryFrame = 41, /* find out if controller is playing
every frame in movie */
mcActionGetPlayRate = 42, /* determine playback rate */
mcActionShowBalloon = 43, /* find out if controller wants to
display Balloon Help */
mcActionBadgeClick = 44, /* user clicked movie's badge */
mcActionMovieClick = 45, /* user clicked movie */
mcActionSuspend = 46, /* suspend action */
mcActionResume = 47 /* resume action */
};
enum {
mcTopLeftMovie = 1<<0, /* places movie in upper-left corner of
display rectangle */
mcScaleMovieToFit ` = 1<<1, /* resizes movie to fit into display
rectangle */
mcWithBadge = 1<<2, /* controls whether badge is displayed */
mcNotVisible = 1<<3, /* controls whether controller portion
is visible */
mcWithFrame = 1<<4 /* specifies whether component shows
frame around movie */
};
enum {
mcFlagSuppressMovieFrame = 1<<0, /* controls display of frame */
mcFlagSuppressStepButtons = 1<<1, /* controls display of step
buttons */
mcFlagSuppressSpeakerButton = 1<<2, /* controls display of speaker
button */
mcFlagsUseWindowPalette = 1<<3 /* controls display of window
palette */
};
enum {
mcInfoUndoAvailable = 1<<0, /* MCUndo function available */
mcInfoCutAvailable = 1<<1, /* MCCut function available */
mcInfoCopyAvailable = 1<<2, /* MCCopy function available */
mcInfoPasteAvailable = 1<<3, /* MCPaste function available */
mcInfoClearAvailable = 1<<4, /* MCClear function available */
mcInfoHasSound = 1<<5, /* controller can play movie's
sound */
mcInfoIsPlaying = 1<<6, /* movie is playing */
mcInfoIsLooping = 1<<7, /* movie is looping */
mcInfoIsInPalindrome = 1<<8, /* movie is alternating between
forward and backward playback */
mcInfoEditingEnabled = 1<<9 /* MCEnableEditing function
available */
};
enum {
mcMenuUndo = 1, /* Undo command */
mcMenuCut = 3, /* Cut command */
mcMenuCopy = 4, /* Copy command */
mcMenuPaste = 5, /* Paste command */
mcMenuClear = 6 /* Clear command */
};
enum {
mcPositionDontInvalidate = 1<<5 /* do not invalidate areas of window
changed due to repositioning of movie
or controller */
};
Data Types
typedef short mcAction;
typedef unsigned long MCFlags;
Movie Controller Functions
Associating Movies With Controllers
pascal MovieController NewMovieController
(Movie theMovie, const Rect *movieRect,
long someFlags);
pascal ComponentResult MCNewAttachedController
(MovieController mc, Movie theMovie,
WindowPtr w, Point where);
pascal ComponentResult MCSetMovie
(MovieController mc, Movie theMovie,
WindowPtr movieWindow, Point where);
pascal Movie MCGetMovie(MovieController mc);
pascal void DisposeMovieController
(MovieController mc);
Managing Controller Attributes
pascal ComponentResult MCPositionController
(MovieController mc, const Rect *movieRect, const Rect *controllerRect, long someFlags);
pascal ComponentResult MCSetControllerAttached
(MovieController mc, Boolean attach);
pascal ComponentResult MCIsControllerAttached
(MovieController mc);
pascal ComponentResult MCSetVisible
(MovieController mc, Boolean visible);
pascal ComponentResult MCGetVisible
(MovieController mc);
pascal ComponentResult MCDrawBadge
(MovieController mc, RgnHandle movieRgn, RgnHandle *badgeRgn);
pascal ComponentResult MCSetControllerBoundsRect
(MovieController mc, const Rect *bounds);
pascal ComponentResult MCGetControllerBoundsRect
(MovieController mc, Rect *bounds);
pascal RgnHandle MCGetControllerBoundsRgn
(MovieController mc);
pascal RgnHandle MCGetWindowRgn
(MovieController mc, WindowPtr w);
pascal ComponentResult MCSetClip
(MovieController mc, RgnHandle theClip, RgnHandle movieClip);
pascal ComponentResult MCGetClip
(MovieController mc, RgnHandle *theClip, RgnHandle *movieClip);
pascal ComponentResult MCSetControllerPort
(MovieController mc, CGrafPtr gp);
pascal CGrafPtr MCGetControllerPort
(MovieController mc);
Handling Movie Events
pascal ComponentResult MCIsPlayerEvent
(MovieController mc, const EventRecord *e);
pascal ComponentResult MCDoAction
(MovieController mc, short action,
void *params);
pascal ComponentResult MCSetActionFilterWithRefCon
(MovieController mc, MCActionFilter filter, long refCon);
pascal ComponentResult MCGetControllerInfo
(MovieController mc, long *someFlags);
pascal ComponentResult MCMovieChanged
(MovieController mc, Movie theMovie);
Editing Movies
pascal ComponentResult MCEnableEditing
(MovieController mc, Boolean enabled);
pascal long MCIsEditingEnabled
(MovieController mc);
pascal Movie MCCut(MovieController mc);
pascal Movie MCCopy(MovieController mc);
pascal ComponentResult MCPaste
(MovieController mc, Movie srcMovie);
pascal ComponentResult MCClear
(MovieController mc);
pascal ComponentResult MCUndo
(MovieController mc);
pascal ComponentResult MCSetUpEditMenu
(MovieController mc, long modifiers,
MenuHandle mh);
pascal ComponentResult MCGetMenuString
(MovieController mc, long modifiers, short item,
Str255 aString);
Getting and Setting Movie Controller Time
pascal ComponentResult MCSetDuration
(MovieController mc, TimeValue duration);
pascal TimeValue MCGetCurrentTime
(MovieController mc, TimeScale *scale);
Customizing Event Processing
pascal ComponentResult MCActivate
(MovieController mc, WindowPtr w,
Boolean activate);
pascal ComponentResult MCClick
(MovieController mc, WindowPtr w, Point where, long when, long modifiers);
pascal ComponentResult MCDraw
(MovieController mc, WindowPtr w);
pascal ComponentResult MCIdle
(MovieController mc);
pascal ComponentResult MCKey
(MovieController mc, char key, long modifiers);
Application-Defined Function
Boolean MyPlayerFilterWithRefCon
(MovieController mc, short *action,
void *params, long refCon);
Pascal Summary
Constants
CONST
MovieControllerComponentType = 'play';
{movie controller selectors}
kMCSetMovieSelect = 2; {MCSetMovie}
kMCGetMovie = 5; {MCGetMovie}
kMCIsPlayerEventSelect = 7; {MCIsPlayerEvent}
kMCSetActionFilterSelect = 8; {MCSetActionFilter}
kMCDoActionSelect = 9; {MCDoAction}
kMCSetControllerAttachedSelect = $A; {MCSetControllerAttached}
kMCIsControllerAttachedSelect = $B; {MCIsControllerAttached}
kMCSetControllerPortSelect = $C; {MCSetControllerPort}
kMCGetControllerPortSelect = $D; {MCGetControllerPort}
kMCGetVisibleSelect = $E; {MCGetVisible}
kMCSetVisibleSelect = $F; {MCSetVisible}
kMCGetControllerBoundsRectSelect = $10;{MCGetControllerBoundsRect}
kMCSetControllerBoundsRectSelect = $11;{MCSetControllerBoundsRect}
kMCGetControllerBoundsRgnSelect = $12;{MCGetControllerBoundsRgn}
kMCGetWindowRgnSelect = $13;{MCGetWindowRgn}
kMCMovieChangedSelect = $14;{MCMovieChanged}
kMCSetDurationSelect = $15;{MCSetDuration}
kMCGetCurrentTimeSelect = $16;{MCGetCurrentTime}
kMCNewAttachedControllerSelect = $17;{MCNewAttachedController}
kMCDrawSelect = $18;{MCDraw}
kMCActivateSelect = $19;{MCActivate}
kMCIdleSelect = $1A;{MCIdle}
kMCKeySelect = $1B;{MCKey}
kMCClickSelect = $1C;{MCClick}
kMCEnableEditingSelect = $1D;{MCEnableEditing}
kMCIsEditingEnabledSelect = $1E;{MCIsEditingEnabled}
kMCCopySelect = $1F;{MCCopy}
kMCCutSelect = $20;{MCCut}
kMCPasteSelect = $21;{MCPaste}
kMCClearSelect = $22;{MCClear}
kMCUndoSelect = $23;{MCUndo}
kMCPositionControllerSelect = $24;{MCPositionController}
kMCGetControllerInfoSelect = $25;{MCGetControllerInfo}
kMCSetClipSelect = $28;{MCSetClip}
kMCGetClipSelect = $29;{MCGetClip}
kMCDrawBadgeSelect = $2A;{MCDrawBadge}
kMCSetUpEditMenuSelect = $2B;{MCSetUpEditMenu}
kMCGetMenuStringSelect = $2C;{MCGetMenuString}
kMCSetActionFilterWithRefConSelect
= $2D;{MCSetActionFilterWithRefConSelect}
{movie controller actions}
mcActionIdle = 1; {give event-processing }
{ time to movie controller}
mcActionDraw = 2; {send update event to movie }
{ controller}
mcActionActivate = 3; {activate controller}
mcActionDeactivate = 4; {deactivate controller}
mcActionMouseDown = 5; {pass mouse-down event}
mcActionKey = 6; {pass key-down or auto-key event}
mcActionPlay = 8; {start playing movie}
mcActionGoToTime = 12; {move to specific time in }
{ a movie}
mcActionSetVolume = 14; {set a movie's volume}
mcActionGetVolume = 15; {retrieve a movie's volume}
mcActionStep = 18; {play movie skipping specified }
{ number of frames at a time}
mcActionSetLooping = 21; {enable/disable looping }
{ for a movie}
mcActionGetLooping = 22; {determine whether a }
{ movie is looping}
mcActionSetLoopIsPalindrome = 23; {enable palindrome looping}
mcActionGetLoopIsPalindrome = 24; {is palindrome looping on?}
mcActionSetGrowBoxBounds = 25; {set limits for resizing a movie}
mcActionControllerSizeChanged = 26; {user has resized movie controller}
mcActionSetSelectionBegin = 29; {start time of movie's }
{ current selection}
mcActionSetSelectionDuration = 30; {set duration of movie's }
{ current selection}
mcActionSetKeysEnabled = 32; {enable/disable }
{ keystrokes for movie}
mcActionGetKeysEnabled = 33; {are keystrokes enabled?}
mcActionSetPlaySelection = 34; {constrain playing to the }
{ current selection}
mcActionGetPlaySelection = 35; {is movie constrained to }
{ playing within selection}
mcActionSetUseBadge = 36; {enable/disable movie's }
{ playback badge}
mcActionGetUseBadge = 37; {is movie controller }
{ using playback badge?}
mcActionSetFlags = 38; {set movie's control flags}
mcActionGetFlags = 39; {get movie's control flags}
mcActionSetPlayEveryFrame = 40; {instruct controller to }
{ play all frames in movie}
mcActionGetPlayEveryFrame = 41; {is controller playing }
{ every frame in movie?}
mcActionGetPlayRate = 42; {determine playback rate}
mcActionShowBalloon = 43; {controller wants to }
{ display balloon help}
mcActionBadgeClick = 44; {user clicked movie's badge}
mcActionMovieClick = 45; {user clicked movie}
mcActionSuspend = 46; {suspend action}
mcActionResume = 47; {resume action}
{controller creation flags}
mcTopLeftMovie = $1; {places movie in upper-left }
{ corner of display rectangle}
mcScaleMovieToFit = $2; {resizes movie to fit into }
{ display rectangle}
mcWithBadge = $4; {controls whether badge }
{ is displayed}
mcNotVisible = $8; {controls whether controller }
{ portion is visible}
mcWithFrame = $10;{specifies whether component }
{ shows frame around movie}
{movie control flags}
mcFlagSuppressMovieFrame = $1; {controls display of frame}
mcFlagSuppressStepButtons = $2; {controls display of step buttons}
mcFlagSuppressSpeakerButton = $4; {controls display of speaker }
{ button}
mcFlagsUseWindowPalette = $5; {controls display of window }
{ palette}
(movie controller information flags}
mcInfoUndoAvailable = $1; {MCUndo function available}
mcInfoCutAvailable = $2; {MCCut function available}
mcInfoCopyAvailable = $4; {MCCopy function available}
mcInfoPasteAvailable = $8; {MCPaste function available}
mcInfoClearAvailable = $10; {MCClear function available}
mcInfoHasSound = $20; {controller can play movie's }
{ sound}
mcInfoIsPlaying = $40; {movie is playing}
mcInfoIsLooping = $80; {movie is looping}
mcInfoIsInPalindrome = $100; {movie is alternating between }
{ forward and backward playback}
mcInfoEditingEnabled = $200; {MCEnableEditing function }
{ available}
mcMenuUndo = 1; {Undo command}
mcMenuCut = 3; {Cut command}
mcMenuCopy = 4; {Copy command}
mcMenuPaste = 5; {Paste command}
mcMenuClear = 6; {Clear commmand}
mcPositionDontInvalidate = 32; {do not invalidate areas of window }
{ changed due to repositioning of }
{ movie or controller}
Data Types
TYPE
mcAction = Integer;
mcFlags = LongInt;
Movie Controller Routines
Associating Movies With Controllers
FUNCTION NewMovieController (theMovie: Movie; movieRect: Rect;
someFlags: LongInt): MovieController;
FUNCTION MCNewAttachedController
(mc: MovieController; theMovie: theMovie;
w: WindowPtr; where: Point): ComponentResult;
FUNCTION MCSetMovie (mc: MovieController; theMovie: Movie;
movieWindow: WindowPtr; where: Point):
ComponentResult;
FUNCTION MCGetMovie (mc: MovieController): Movie;
PROCEDURE DisposeMovieController
(mc: MovieController);
Managing Controller Attributes
FUNCTION MCPositionController
(mc: MovieController; VAR movieRect: Rect;
VAR controllerRect: Rect; someFlags: LongInt): ComponentResult;
FUNCTION MCSetControllerAttached
(mc: MovieController;
attach: Boolean): ComponentResult;
FUNCTION MCIsControllerAttached
(mc: MovieController): ComponentResult;
FUNCTION MCSetVisible (mc: MovieController; visible: Boolean):
ComponentResult;
FUNCTION MCGetVisible(mc: MovieController): ComponentResult;
FUNCTION MCDrawBadge (mc: MovieController; movieRgn: RgnHandle;
VAR badgeRgn: RgnHandle): ComponentResult;
FUNCTION MCSetControllerBoundsRect
(mc: MovieController; bounds: Rect): ComponentResult;
FUNCTION MCGetControllerBoundsRect
(mc: MovieController; VAR bounds: Rect): ComponentResult;
FUNCTION MCGetControllerBoundsRgn
(mc: MovieController): RgnHandle;
FUNCTION MCGetWindowRgn (mc: MovieController; w: WindowPtr): RgnHandle;
FUNCTION MCSetClip (mc: MovieController; theClip: RgnHandle;
movieClip: RgnHandle): ComponentResult;
FUNCTION MCGetClip (mc: MovieController; VAR theClip: RgnHandle;
VAR movieClip: RgnHandle): ComponentResult;
FUNCTION MCSetControllerPort
(mc: MovieController; gp: CGrafPtr): ComponentResult;
FUNCTION MCGetControllerPort
(mc: MovieController): CGrafPtr;
Handling Movie Events
FUNCTION MCIsPlayerEvent (mc: MovieController; e: EventRecord):
ComponentResult;
FUNCTION MCDoAction (mc: MovieController; action: Integer;
params: Ptr): ComponentResult;
PROCEDURE MCSetActionFilterWithRefCon
(mc: MovieController; filter: MCActionFilter; refCon: LongInt);
FUNCTION MCGetControllerInfo
(mc: MovieController; VAR someFlags: LongInt): ComponentResult;
FUNCTION MCMovieChanged (mc: MovieController; theMovie: Movie):
ComponentResult;
Editing Movies
FUNCTION MCEnableEditing (mc: MovieController; enabled: Boolean):
ComponentResult;
FUNCTION MCIsEditingEnabled
(mc: MovieController): LongInt;
FUNCTION MCCut (mc: MovieController): Movie;
FUNCTION MCCopy (mc: MovieController): Movie;
FUNCTION MCPaste (mc: MovieController; srcMovie: Movie):
ComponentResult;
FUNCTION MCClear (mc: MovieController): ComponentResult;
FUNCTION MCUndo (mc: MovieController): ComponentResult;
FUNCTION MCSetUpEditMenu(mc: MovieController; modifiers: LongInt;
mh: MenuHandle): ComponentResult;
FUNCTION MCGetMenuString(mc: MovieController; modifiers: LongInt;
item: Integer; VAR aString: Str255):
ComponentResult;
Getting and Setting Movie Controller Time
FUNCTION MCSetDuration (mc: MovieController; duration: TimeValue):
ComponentResult;
FUNCTION MCGetCurrentTime (mc: MovieController; VAR scale: TimeScale):
TimeValue;
Customizing Event Processing
FUNCTION MCActivate (mc: MovieController; w: WindowPtr;
activate: Boolean): ComponentResult;
FUNCTION MCClick (mc: MovieController; w: WindowPtr;
where: Point; when: LongInt;
modifiers: LongInt): ComponentResult;
FUNCTION MCDraw (mc: MovieController; w: WindowPtr):
ComponentResult;
FUNCTION MCIdle (mc: MovieController): ComponentResult;
FUNCTION MCKey (mc: MovieController; key: Byte;
modifiers: LongInt): ComponentResult;
Application-Defined Routine
FUNCTION MyPlayerFilterWithRefCon
(mc: MovieController; VAR action: Integer;
VAR params: LongInt; refCon: LongInt): Boolean;
Result Codes
| badControllerHeight | -9994 | Invalid height |
| editingNotAllowed | -9995 | Controller does not support editing |
| controllerBoundsNotExact | -9996 | Boundary rectangle not exact |
| cannotSetWidthOfAttachedController | -9997 | Cannot change controller width |
| controllerHasFixedHeight | -9998 | Cannot change controller height |
| cannotMoveAttachedController | -9999 | Cannot move attached controllers |