home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextLibrary / Frameworks / NEXTIME.framework / Versions / A / Headers / NTFileParser.h < prev    next >
Encoding:
Text File  |  1995-08-30  |  3.3 KB  |  100 lines

  1. /*
  2.  *  NTFileParser.h
  3.  *     Copyright 1994, NeXT Computer, Inc.
  4.  *    
  5.  *    API for objects which parse files into movie objects.
  6.  *
  7.  *    27 Jan 1994 mpaque Created.
  8.  *    28 Mar 1994 mpaque Add file write and copy/paste API.
  9.  */
  10. #import <Foundation/NSObject.h>
  11. #import <Foundation/NSDictionary.h>
  12. #import <Foundation/NSData.h>
  13. #import "NTMovie.h"
  14.  
  15. @protocol NTFileParser <NSObject>
  16. /*
  17.  * The parameters dictionary must contain a NTFilename key, specifying the 
  18.  * file data will be loaded from.
  19.  */
  20. - (id <NTMovie>)initMovieWithParameters:(bycopy NSDictionary *)parameters;
  21. @end
  22.  
  23. /*
  24.  * File parser extensions to support copy and paste operations
  25.  * capable of persisting beyond the life of an NTServer.
  26.  */
  27. @protocol NTPasteboardMovieParser <NSObject>
  28. /*
  29.  * Constructs and returns a memory object referencing "movie".
  30.  * 
  31.  * In the case of the QuickTime format file parser, the
  32.  * object contains a data reference for each media in the movie,
  33.  * along with detailed control information.
  34.  *
  35.  * The object can be placed on the pasteboard using the
  36.  * pasteboard writeType:data:length method. The returned
  37.  * data value should be marked for delayed free once it
  38.  * is passed over a DO connection.  This causes the
  39.  * server's copy of the data to be freed once the data has
  40.  * reached the client.
  41.  */
  42. - (NSData *)pasteboardImageFromMovie:(id <NTMovie>)movie;
  43.  
  44. /*
  45.  * Initialize a NTMovie from an NSData object built from
  46.  * the pasteboard.  The pasteboard data should have originated from
  47.  * a call to dataReferenceFromMovie:.  'data' is freed once the
  48.  * movie is initialized.
  49.  */
  50. - (id <NTMovie>)movieFromPasteboardImage:(NSData *)data;
  51.  
  52. @end
  53.  
  54. /*
  55.  * API to be used by components capable of saving movie data to a file.
  56.  */
  57. @protocol NTFileWriter <NSObject>
  58. /*
  59.  * Writes movie to a file.  Samples from active tracks
  60.  * within the active time range for each track are copied
  61.  * to the file, with interleaving between each track's data.
  62.  * The movie is saved to a "~" file which is renamed to file
  63.  * when writing is completed.
  64.  *
  65.  * This is the  preferred way to save a file after performing
  66.  * edits, to produce a result with good playback performance.
  67.  *
  68.  * The parameters dictionary must contain a NTFilename key, specifying the 
  69.  * file data will be saved to, and may also contain subdictionaries indicating
  70.  * how the media should be encoded.
  71.  */
  72. - (BOOL)writeAndFlattenMovie:(id <NTMovie>)movie
  73.     withParameters:(bycopy NSDictionary *)parameters;
  74.     
  75.  
  76. /*
  77.  * Write or update a movie to a file.  If the file exists,
  78.  * this method updates the file's control
  79.  * structures if possible.  In the case of a QuickTime movie,
  80.  * this rewrites the MooV atom in the file.  If the file does
  81.  * not exist, or cannot be updated or overwritten, then the movie is saved
  82.  * using an atomic write, as in writeAndFlattenMovie:toFile:
  83.  *
  84.  * The parameters dictionary must contain a NTFilename key, specifying the 
  85.  * file data will be saved to, and may also contain subdictionaries indicating
  86.  * how the media should be encoded.
  87.  */
  88. - (BOOL)writeMovie:(id <NTMovie>)movie
  89.     withParameters:(bycopy NSDictionary *)parameters;
  90.  
  91. /*
  92.  * Create a new movie file, reserving space for whatever header is needed.
  93.  * Destroys any existing file!
  94.  * The parameters dictionary must contain a NTFilename key, specifying the 
  95.  * file to be created.
  96.  */
  97. - (BOOL) newMovieFileWithParameters:(bycopy NSDictionary *)param;
  98.  
  99. @end
  100.