LoadMediaIntoRam
TheLoadMediaIntoRamfunction loads a media's data into memory.The exact behavior of
LoadMediaIntoRamis dependent on the media handler.
pascal OSErr LoadMediaIntoRam (Media theMedia, TimeValue time, TimeValue duration, long flags);
theMedia- Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as
NewTrackMediaandGetTrackMedia(described on page 2-138 and page 2-190, respectively).time- Allows you to specify a portion of the media to load. The
timeparameter contains the starting time of the media segment to load. Thedurationparameter specifies the length of the segment to load. This time value must be expressed in the media's time coordinate system.duration- Allows you to specify a portion of the media to load. The
timeparameter contains the starting time of the media segment to load. Thedurationparameter specifies the length of the segment to load. You can use theGetMediaDurationfunction (described on page 2-179) to determine the length of the entire media. Note that the media handler may load more data than you specify if the media data was added in larger pieces.flags- Gives you explicit control over what is loaded into memory and how long to keep it around. The following constants are provided:
enum { keepInRam = 1<<0, unkeepInRam = 1<<1, flushFromRam = 1<<2, };
- You can set these flags in any combination that makes sense. For descriptions of the individual flag constants, see the description of the
LoadMovieIntoRamfunction on page 2-125.DESCRIPTION
If theLoadMediaIntoRamfunction fails because it is out of memory, no data is purged.ERROR CODES
File Manager errors
invalidMedia -2008 This media is corrupted or invalid invalidDuration -2014 This duration value is invalid invalidTime -2015 This time value is invalid progressProcAborted -2019 Your progress function returned an error
Memory Manager errors