ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be played."
{
if mmIsOpen of $$ClipRef -- not necessary, but nice
mmClose $$ClipRef wait
end if
mmOpen $$ClipRef wait
mmCue $$ClipRef wait
forward
}
ACTION "Cue and show the first frame"
BEHAVIOR "Cue and show the first frame of an animation or video in a stage object "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be played."
ARG StageObj OBJTYP "Stage" IS "myStage" help "Choose the stage object for showing"
{
if mmIsOpen of $$ClipRef -- not necessary, but nice
mmClose $$ClipRef wait
end if
mmOpen $$ClipRef wait
-- strictly speaking, not necessary, but to be on the safe side...
mmCue $$ClipRef wait
mmShow $$ClipRef in $$StageObj
}
ACTION "Show a frame"
BEHAVIOR "Show an arbitrary frame in a video or animation "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be played."
ARG FrameRef IS "50" help "Any integer value from 0 up to the frame count of the clip."
ARG StageObj OBJTYP "Stage" IS "myStage" help "Choose the stage object for showing"
{
-- script is as long as it is because of all the error
-- handling and "nice"ness
if mmIsOpen of $$ClipRef -- not necessary, but nice
mmClose $$ClipRef wait
end if
mmOpen $$ClipRef wait
oldMTF = mmTimeFormat of $$ClipRef
mmTimeFormat of $$ClipRef = "frames"
frameVar = $$FrameRef
-- if frameVar is inappropriate for mmSeek, ToolBook will
-- default to something reasonable.
maxFrame = mmLength of $$ClipRef
conditions
when frameVar < 0
frameVar = 0
when frameVar > maxFrame
frameVar = maxFrame
end conditions
mmSeek $$ClipRef to frameVar wait
mmShow $$ClipRef in $$StageObj wait
mmTimeFormat of $$ClipRef = oldMTF
}
ACTION "Hide a clip"
BEHAVIOR "Hide a video or animation "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be played."
{
mmHide $$ClipRef
}
ACTION "Close a clip"
BEHAVIOR "Closes any clip "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be played."
{
mmClose $$ClipRef
}
ACTION "Close all clips"
BEHAVIOR "Closes all open clips, optionally of a certain type "
CATEGORY Clips
ARG mediaType ONEOF "all,animation,bitmap,cdAudio,digitalVideo,overlay,sequencer,vcr,videodisc,waveAudio" IS "all" help "Select a device type to close."
{
mmClose $$mediaType
}
ACTION "Stop a clip"
BEHAVIOR "Stops any clip "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be stopped."
{
mmStop $$ClipRef
}
ACTION "Stop all clips"
BEHAVIOR "Stops all open clips, optionally of a certain type "
CATEGORY Clips
ARG mediaType ONEOF "all,animation,bitmap,cdAudio,digitalVideo,overlay,sequencer,vcr,videodisc,waveAudio" IS "all" help "Select a device type to stop."
{
mmStop $$mediaType
}
ACTION "Pause a clip"
BEHAVIOR "Pauses any clip "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be paused."
{
mmPause $$ClipRef
}
ACTION "Rewind a clip"
BEHAVIOR "Rewinds any clip "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be rewound."
{
mmRewind $$ClipRef
}
ACTION "Pause all clips"
BEHAVIOR "Pauses all open clips, optionally of a certain type "
CATEGORY Clips
ARG mediaType ONEOF "all,animation,bitmap,cdAudio,digitalVideo,overlay,sequencer,vcr,videodisc,waveAudio" IS "all" help "Select a device type to pause."
{
mmPause $$mediaType
}
ACTION "Restart a clip with 'release'"
BEHAVIOR "For restarting a clip that will be released from the system when it finishes playing "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be restarted."
{
mmPlay $$ClipRef release
}
ACTION "Restart a clip with 'hold'"
BEHAVIOR "For restarting a clip that will be held when it finishes playing "
CATEGORY Clips
ARG ClipRef CLIP IS "clip id 100" help "Select the clip to be restarted."
{
mmPlay $$ClipRef hold
}
ACTION "Bring up the clips db"
BEHAVIOR "A simple script to bring up the clip dialog box "
CATEGORY Clips
{
-- "to system" bypasses any custom handlers and sends the
-- message straight to ToolBook
send clips to system
}
ACTION "Bring up the resources db"
BEHAVIOR "A simple script to bring up the resource manager dialog box "
CATEGORY Resources
{
-- "to system" bypasses any custom handlers and sends the
-- message straight to ToolBook
send resources to system
}
ACTION "Get clip ref for a stage"
BEHAVIOR "Gets the reference for a clip or bitmap currently displayed in a stage "
CATEGORY Clips
ARG StageObj OBJTYP "Stage" IS "myStage" help "Choose the stage object for playback"
{
get mediaOpen of $$stageObj
request it
}
ACTION "Find out if a clip is open"
BEHAVIOR "Determines whether a clip or bitmap is currently open "
CATEGORY Clips
ARG clipRef CLIP IS "clip id 100" help "Choose the clip"
{
get mmIsOpen of $$clipRef
request it
}
ACTION "Find the length of a clip"
BEHAVIOR "Gets the length in time for a clip "
CATEGORY Clips
ARG clipRef CLIP IS "clip id 100" help "Choose the clip"
{
clipRef = $$clipRef -- cache the reference
mTF = mmTimeFormat of clipRef
mmTimeFormat of clipRef = "MSms" -- minutes:seconds:milliseconds
get mmLength of clipRef
request clipRef && "is" && char 1 of it && "minutes," \
&& chars 3 to 4 of it && "seconds, and" \
&& chars 6 to 8 of it && "milliseconds long."
mmTimeFormat of clipRef = mTF
}
ACTION "Find out if clip is playable"
BEHAVIOR "Determines whether the clip is playable on the current system "
CATEGORY Clips
ARG clipRef CLIP IS "clip id 100" help "Choose the clip"
{
clipRef = $$clipRef
get mmPlayable of clipRef
if it is TRUE
request clipRef && "is playable on this system."
else
request clipRef && "is not playable on this system."
end if
}
ACTION "Find a clip's source"
BEHAVIOR "Determines the source of a clip, either a file or a device "
CATEGORY Clips
ARG clipRef CLIP IS "clip id 100" help "Choose the clip"
{
clipRef = $$clipRef
get mmSource of clipRef
request "The source for" && clipRef && "is" && it
}
ACTION "Get the status of a clip"
BEHAVIOR "Get the current status of a clip "
CATEGORY Clips
ARG clipRef CLIP IS "clip id 100" help "Choose the clip"
{
get mmStatus of $$clipRef
request it
}
ACTION "Get the time format of a clip"
BEHAVIOR "Get the current time format of a clip "
CATEGORY Clips
ARG clipRef CLIP IS "clip id 100" help "Choose the clip"
{
get mmTimeFormat of $$clipRef
request it
}
ACTION "Get the size of a clip"
BEHAVIOR "Get the default size of a visual clip "
CATEGORY Clips
ARG clipRef CLIP IS "clip id 100" help "Choose the clip"
{
clear sysError
get mmVisualSize of $$clipRef
if sysError is NULL
request "The default width is" && item 1 of it \
& ", and the deafult height is" && item 2 of it
else
request "This property is only valid for visual media"
end if
}
ACTION "Find all open media"
BEHAVIOR "Reports a list of media that are open at any given time "
CATEGORY Multimedia
{
request sysOpenMedia
}
ACTION "Find all supported media"
BEHAVIOR "Reports a list of media that are supported at any given time "
CATEGORY Multimedia
{
request sysSupportedMedia
}
ACTION "Find capability of the timer device"
BEHAVIOR "Returns information about the capability of the timer "
CATEGORY Timers
{
get timerCapability()
if it <> NULL
request "Minimum resolution of this timer device is" && item 1 of it \
&& "and the maximum period for it is" && item 2 of it
end if
}
ACTION "Start a path animation - basic"
BEHAVIOR "Starts an already defined path animation. The script goes in the animated object. "
CATEGORY PathAnimation
{
send playAnimation
}
ACTION "Start a path animation - complete"
BEHAVIOR "Starts an already defined path animation. The script goes in the animated object. "
CATEGORY PathAnimation
ARG animation ONEOF "1,2,3,4,5,6" IS "1" help "Choose the path animation to play that you have already defined."
ARG notifyObj IS "self" help "Determine who will be notified when the path animation terminates. Leave blank for no notification."
ARG wait ONEOF "TRUE,FALSE" IS "FALSE" help "Set wait to true to prevent the user from any action while the path animation is going on."