Data references represent the mechanism used by QuickTime to access media from several sources. The most common of these sources are:
- Macintosh or Windows files on disk or CD-ROM
- Network sources, accessed through URLs
When a movie accesses a chunk of media, QuickTime uses the apppropriate functions to return a data handler component that can interpret the chunk. All data handlers identify their data with data references. Data references specify the location of the data and which data handler is able to interpret the data.
This utility class lets you:
- provide the locations of data to other plugin classes using this mechanism
- inspect the properties of data references returned from other plugin classes
Since version 6.7 of the plugin this class can be used in Console Applications
The QTPlgDataRef class constructors are called when you create a new instance of the class, while the ˜QTPlgDataRef class destructor, is called automatically when the class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to nil.
Once a new class instance is returned, it is good practice to check the class property to be sure that the new object can be used. A QTPlgDataRef object is valid if it referes to a valid data reference (that is the value of the property is not 0)
The class provides you with the following initializer methods:
(data as memoryblock, fileNameExtension as string)
build a data reference that is a pointer to some data in memory. You can specify the type of data pointed to by the data reference by tagging it
with a significative file name string (i.e "mydata.tif") and/or by adding an appropriate mime type (see the
class method) or file type
(see the
class method) extensions
(other as QTPlgDataRef)
This is the copy constructor. The properties of the object to be copied will be used to initialize the
new class instance properties
(f as folderitem)
use this constructor version to create a data reference object of
alias holding informations about the file pointed by the f
(url as string)
use this constructor version to create a data reference object of url
returns the handle to the information that identifies the destination container.
useful for toolbox programmers
(use with care: you could invalidate the handle causing unpredictable results
(probably an application crash))
a four characters string identifying the type of data reference; the type of information
stored in the class depends on this data reference type. For example, for a file this property is set to alis
indicating that the reference is an alias. Listed below are all the available data reference types:
'alis' : the data reference is a Macintosh alias handle. An alias handle contains information about the file'hndl' : the data reference is a Macintosh handle whose data is the handle containing the data. In addition to specifying movie data in memory, this handle may contain data reference extensions containing the file type, file name, MIME type etc.'rsrc' : the data reference is a Macintosh alias handle. However, appended to the end of the alias handle is the resource type (stored as a OSType) and ID (stored as a 16–bit signed integer) that identifies the resource within the specified file. Both these values must be big–endian format.'url ' :data reference is a handle whose data is a C-string (null-terminated) specifying a URL. This data reference type can have data reference extensions too. QuickTime supports the'file' ,'http' ,'ftp' URL types as well as the'rtsp' type in special cases when opening movies.'ptr ' : the data reference is a pointer to the data in memory plus a size value. In addition to specifying movie data in memory, the pointer data reference may contain data reference extensions
see the class property for more informations
[Deprecated]: since version 6.6 of the plugin this property is deprecated
and will be removed from a future plugin version; use the
class property instead
indicates whether the data reference refers to the movie resource’s data file. If this property is true, the data
reference identifies media data that is stored in the same file as the movie resource
this property makes sense only for class instances obtained from QTPlugin
classes
indicates whether the Movie Toolbox resolved the data reference. If this property is true,
the Movie Toolbox could not resolve the data reference. For example, the toolbox may be unable to resolve data references
because the required storage device is unavailable at the time a movie is loaded. If the data reference is unresolved, the Movie Toolbox
disables the corresponding track
this property makes sense only for class instances obtained from QTPlugin
classes
indicates whether the data reference refers to data that reside in memory. If this property is set to true,
the data reference identifies data that is stored either in a pointer or in a handle depending on the value of the
class property
indicates whether the data reference is a Macintosh alias handle. An alias handle contains information about the file
indicates whether the data reference is a handle whose data is a C-string (null-terminated) specifying a URL; for more information see the
class property
if the data reference is of appropriate type, specifies the location of data as folderitem, otherwise is set to
nil
if the data reference is of appropriate type, specifies the location of data as an url string, otherwise is set to
nil
(mimeType as string)
add the mime type extension specified by the mimeType parameter to the data reference. Using this method is meaningful for
memory data references only
(fileType as )
add the file type extension specified by the fileType parameter to the data reference. Using this method is meaningful for
memory data references only
(dest as folderitem) as boolean
use this method to create an alias file, specified by the
dest parameter,to the data reference in use.
If the data reference source is a , then this method will create an internet shortcut file instead
available on Macintosh platform only