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 wxMediaEdit or wxMediaPasteboard class, and override the WriteHeadersToFile, WriteFootersToFile, ReadHeaderFromFile and/or ReadFooterFromFile methods.

When a buffer is saved, the methods WriteHeadersToFile and WriteFootersToFile are invoked; this is when the derived wxMediaEdit or wxMediaPasteBoard 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 ReadHeaderFromFile or ReadFooterFromFile 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 WriteHeadersToFile and ReadHeadersFromFile .



PLT