[previous] [up] [next]     [contents] [index]
Next: End of Line Ambiguity Up: File Format Previous: Buffer Data

Global Data: Headers and Footers

The media file format provides for adding extra global data in special header and footer sections. To save and load special header and/or footer records:

  1. Pick a name for each header/footer record. This name should not conflict with any other header/footer record name in use, and no one else should use these names. All names beginning with ``wx'' are reserved for internal use. By tagging extra header and footer records with a unique name, the file can be safely loaded under a system that does not support the records.
  2. Derive a new class from the wx:media-edit% or wx:media-pasteboard% class, and override the write-headers-to-file, write-footers-to-file, read-header-from-file and/or read-footer-from-file methods.

When a buffer is saved, the methods write-headers-to-file and write-footers-to-file are invoked; this is when the derived wx:media-edit% or wx:media-pasteboard% object has a chance to save records. To write a header/footer record, first invoke the BeginWriteHeaderFooterToFile method, at which point the record name is provided. Once the record is written, call EndWriteHeaderFooterToFile.

When a buffer is loaded and a header/footer record is encountered, the read-header-from-file or read-footer-from-file method is invoked, with the record name as the parameter. If the name matches a known record type, then the data can be loaded.

See also write-headers-to-file and write-headers-to-file .



PLT