AddTESample
The AddTESample function allows you to specify a TextEdit handle (which may contain multiple style runs) to be added to the specified media.
pascal ComponentResult AddTESample (MediaHandler mh, TEHandle hTE,
RGBColor *backColor,
short textJustification,
Rect *textBox,
long displayFlags,
TimeValue scrollDelay,
short hiliteStart,
short hiliteEnd,
RGBColor *rgbHiliteColor,
TimeValue duration,
TimeValue *sampleTime);
mh
- Specifies the media handler for the text media obtained by the
GetMediaHandler function.
hTE
- A handle to a styled TextEdit structure.
backColor
- Contains a pointer to an RGB color structure specifying the text background color.
textJustification
- Indicates the justification of the text. The following constants are available:
teFlushDefault, teCenter, teFlushRight, or teFlushLeft. See Inside Macintosh: Text for details on these constants and on text alignment.
textBox
- Contains a pointer to the box within which the text is to be displayed. The box is relative to the track bounds.
displayFlags
- Contains the text display flags.
dfDontDisplay
- Does not display the specified sample.
dfDontAutoScale
-
Does not scale the text if the track bounds increase.
dfClipToTextBox
- Clips to the text box only. (This is useful if the text overlays the video.)
dfShrinkTextBoxToFit
-
Recalculates size of the textBox parameter to just fit the given text and stores this rectangle with the text data.
dfScrollIn
-
Scrolls the text in until the last of the text is in view.
dfScrollOut
- Scrolls text out until the last of the text is out of view. If both
dfScrollIn and dfScrollOut are set, the text is scrolled in, then out.
dfHorizScroll
- Scrolls a single line of text horizontally. If the
dfHorizScroll flag is not set, then the scrolling is vertical.
dfReverseScroll
- If set, scrolls vertically down, rather than up. If not set, horizontal scrolling proceeds toward the left rather than toward the right.
scrollDelay
-
Indicates the delay in scrolling associated with the setting of the dfScrollIn and dfScrollOut display flags. If the value of the scrollDelay parameter is greater than 0 and the dfScrollIn flag is set, the text pauses when it has scrolled all the way in for the amount of time specified by scrollDelay. If the dfScrollOut flag is set, the pause occurs first before the text scrolls out. If both these flags are set, the pause occurs at the midpoint between scrolling in and scrolling out.
hiliteStart
-
Specifies the beginning of the text to be highlighted.
hiliteEnd
- Specifies the end of the text to be highlighted. If the
hiliteEnd parameter is greater than the hiliteStart parameter, then the text is highlighted from the selection specified by hiliteStart to hiliteEnd. To specify additional highlighting, you can use the AddHiliteSample function, described in the next section.
rgbHiliteColor
- Contains a pointer to the RGB color for highlighting. If this parameter is not
nil, then the specified color is used when highlighting the text indicated by the hiliteStart and hiliteEnd parameters. Otherwise, the default system highlight color is used.
duration
- Specifies how long the text sample should last. This duration is expressed in the media's time base.
sampleTime
-
Contains a pointer to a TimeValue structure. The actual media time at which the sample was added is returned here.
ERROR CODES
| invalidMedia | -2008 | This media is corrupted or invalid |
File Manager errors
Memory Manager errors