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

  1. /*
  2.  *  NTMediaHandler.h
  3.  *     Copyright 1994, NeXT Computer, Inc.
  4.  *    
  5.  *    A set of protocols defining expected API in components used to
  6.  *    manage media sample streams.
  7.  *
  8.  *    27 Jan 1994 mpaque Created.
  9.  */
  10. #import <Foundation/NSObject.h>
  11. #import "NTSampleProcessor.h"
  12. #import "NTMediaController.h"
  13. #import "NTTrack.h"
  14. #import "NTMovie.h"
  15. #import "NTClock.h"
  16.  
  17. /*
  18.  * A generic media handler provides the interface between stored samples
  19.  * and a serialized stream of timestamped samples .
  20.  * The sample store, or track, is explicitly specified.
  21.  * The source or destination is established as part of the configuration
  22.  * process.
  23.  */
  24. @protocol NTMediaHandler <NTConfiguration>
  25. - (void)setTrack:(id <NTTrack>)track;
  26. - (id <NTTrack>)track;
  27. - (void)setMasterClock:(id <NTClock>)clock;
  28. - (id <NTClock>)masterClock;
  29. - (void)writeSample: (NTSampleBuffer *) sample; 
  30. @end
  31.  
  32. /*
  33.  * A playback media handler is driven by clock events to fetch samples from the
  34.  * track store and pass them into the sample processing pipeline.  It receives
  35.  * clock events as a delegate of it's clock, which is in turn slaved to the
  36.  * session master clock.
  37.  *
  38.  * Some basic behavior of a NTPlaybackMediaHandler is defined for any media
  39.  * type.  All media handlers will start playing samples on a
  40.  * 'clockWillStart:' message, and stop on a 'clockDidStop:' message.
  41.  * A 'clockDidSetCurrentTime:' or 'clockDidChangeDirection:'
  42.  * message should be treated as indicating a discontinuity, and the
  43.  * handler should discard prerolled or buffered data from the old time value.
  44.  *
  45.  * Handlers which process imaging samples (video, PS, RIB, etc.) must also
  46.  * correctly update the display on receipt of 'clockDidSetCurrentTime:', even
  47.  * if the clock is stopped.  This is done to provide visual feedback to the
  48.  * user when the "current time" slider is manipulated.
  49.  * 
  50.  * Preroll, or cueing, is done in the 'clockWillStart:' method.
  51.  * 'clockWillStart:' is sent before the timer is initialized.
  52.  * The timer won't start running until all 'clockWillStart:'
  53.  * messages have been delivered and returned by all slaves of
  54.  * the master clock.
  55.  *
  56.  * The playback media handler can run asynchronously.  Rather than relying
  57.  * on the clockDidStop: message to halt it cleanly at the end of a performance,
  58.  * we provide API to set the stopping time explicitly.  This way, delays in
  59.  * propagating clockDidStop: on completion of a performance will not affect
  60.  * the actual stopping time of individual handlers.  clockDidStop: is still
  61.  * needed to support stopping from the GUI.
  62.  */
  63. @protocol NTPlaybackMediaHandler <NTMediaHandler, NTClockDelegate>
  64. - (void)setStopTime:(double)stop;
  65. - (double)stopTime;
  66. @end
  67. /*
  68.  * The Video Playback Media Handler has one additional piece of API, used
  69.  * to display still frames independent of the current clock time.  This is
  70.  * used by the NTPlaybackSession to display poster frames.
  71.  */
  72. @protocol NTVideoPlaybackMediaHandler <NTPlaybackMediaHandler>
  73. - (void)showFrameForTime: (double) aTime;
  74. @end
  75.  
  76. /*
  77.  * The Sound Playback Media Handler has additional  API, used
  78.  * to control the sound focus, mute, and set volume.
  79.  */
  80. @protocol NTSoundPlaybackMediaHandler <NTPlaybackMediaHandler,
  81.                     NTAudioMediaControl>
  82. @end
  83.  
  84. /*
  85.  * The NTPlaybackMovieHandler is a specialized component that fans out control
  86.  * messages and movie samples to playback media handlers.  It reads all samples
  87.  * due at a particular time from the movie file, and sends the samples to the
  88.  * media handlers for further processing.
  89.  * 
  90.  * This object creates and owns the media handler objects.
  91.  */
  92. @protocol NTPlaybackMovieHandler <NTConfiguration, NTAudioMediaControl>
  93. - (void)setMovie:(id <NTMovie>)movie;
  94. - (id <NTMovie>)movie;
  95. - (void)movieDidChange:sender;        // Notify that the movie was modified
  96. - (void)setMasterClock:(id <NTClock>)clock;
  97. - (id <NTClock>)masterClock;
  98. - (void)setStopTime:(double)stop;
  99. - (double)stopTime;
  100. - (void)showFrameForTime: (double) aTime;
  101. - (void)setPrerollDuration:(double)preroll;
  102. - (double)prerollDuration;
  103. @end
  104.