Media Connection Runtime Functions

If you use Instructor, you can use two Media Connection OpenScript function calls to retrieve data at runtime for stored media. Note that these functions are in addition to the automatic functions that populate media when you swap sources at runtime. See Reading Media Data at Runtime for information on automatically populating media at runtime.

 

The two functions described here return values from the current source database or corresponding properties (depending on your read setting).

 

There are two functions available. The first, TBC_getMediaValue, returns a single piece of data for a specified record. The second, TBC_getAllMediaValues, returns all data for a specified record in a one-dimensional dynamic array (by reference).

 

TBC_getMediaValue Function Details

 

Syntax

TBC_getMediaValue(<mediaCategory>, <mediaType>, <mediaName>, <valueName>, [<skipPath>])

 

Parameters

<mediaCategory>

Specifies one of the media categories. Valid categories are: resources, clips, other.

 

 

<mediaType>

Specifies the media type within the media category.

 

For resources, valid media types are: bitmaps, cursors, icons, menubar, sharedScripts, palettes

 

For clips, valid media types are: animation, bitmap, cdAudio, digitalVideo, overlay, sequencer, vcr, videodisc, waveAudio

 

For other, media type can be any of the other media types stored to the source.

 

 

<mediaName>

Specifies the name of the media record (e.g., the name of the resource or clip).

 

 

<valueName>

Specifies the name of the data item you want to retrieve. This name corresponds to the field (column) name in the database table for the specified media category.

 

For resources, valid value names are: objectDBID, objectName, objectType, file, plainText, richText, storeRichText, useChromakey, keyColor

 

For clips, valid value names are: objectDBID, objectName, objectType, file, plainText, richText, storeRichText, replaceClip, mmBackgroundPalette, mmBeginPoint, mmEndPoint, mmPriority, mmSearchCD, mmSearchHD, mmTimeFormat, mmVolume

 

For other media types, valid value names are: objectDBID, objectName, objectType, file, plainText, richText, storeRichText, optional1, optional2, optional3, optional4

 

[<skipPath>]

Optional. When the <valueName> parameter is file and you do not include a <skipPath> parameter (the <skipPath> parameter is null), TBC_getMediaValue will attempt to locate the file specified in the database in the search paths for the mediaCategory. If it locates the file it will return the full file reference. If it does not locate the file it will return the file value as it appears in the database. When the <valueName> parameter is file and the <skipPath> parameter is not null, TBC_getMediaValue will return the exact file value from the database without attempting to locate the file. If the <valueName> parameter is anything other than file, the <skipPath> parameter is ignored.

 

Description

Returns the specified value for the specified record. Except when <valueName> is file, returns the value from the database field <valueName> for the media record of type and name specified from the database table <mediaCategory>. When <valueName> is file, return value depends on the <skipPath> parameter (see above).

 

Returns

The specified value if located; otherwise null.

 

 

TBC_getAllMediaValues Function Details

 

Syntax

TBC_getAllMediaValues(<mediaCategory>, <mediaType>, <mediaName>, <dataArray[] by reference>)

 

Parameters

<mediaCategory>

Specifies one of the media categories. Valid categories are: resources, clips, other.

 

 

<mediaType>

Specifies the media type within the media category.

 

For resources, valid media types are: bitmaps, cursors, icons, menubar, sharedScripts, palettes

 

For clips, valid media types are: animation, bitmap, cdAudio, digitalVideo, overlay, sequencer, vcr, videodisc, waveAudio

 

For other, media type can be any of the other media types stored to the source.

 

 

<mediaName>

Specifies the name of the media record (e.g., the name of the resource or clip).

 

 

<dataArray>

A one-dimensional untyped dynamic array. This array is received by reference, so any changes made to the array will appear in this array immediately after the function call. If the specified record is located, the first row of this array is filled with the data corresponding to the fields available for the record. A comma-delimited list of the field names corresponding to the data is returned from the function.

 

Description

Fills the first row of <dataArray> with all data available for the specified record. Returns a list of field names corresponding to the data.

 

Returns

If the specified record is located, fills the first row of <dataArray> with all stored data for the record and returns a list of field names corresponding to the data. If the specified record is not located, <dataArray> is unchanged and the function returns null.