home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / SoundMusicDSP / Resound-2.5-MIHS / APIExamples / Math / ModuleProtocol.h < prev    next >
Encoding:
Text File  |  1997-12-05  |  5.3 KB  |  170 lines

  1.  
  2. /* 
  3.  
  4. ModuleProtocol (version 2.4)
  5.  
  6. Part of the Resound 2.4 API
  7. Sean Luke
  8. Last Revision: January 19, 1996
  9.  
  10. Copyright 1996, Sean Luke
  11. This code may be used, modified, or distributed freely without 
  12. permission of the author.
  13.  
  14.  
  15.  
  16. This protocol lists current methods available to modules. It is
  17. backward-compatible with Resound versions from 2.0a to 2.4.
  18. I informally promise that modules adhering to this version
  19. of the protocol will be compatible with all Resound versions
  20. including and beyond 2.4.
  21.  
  22. Each module has an id called TheModuleController.  This is the
  23. instance that should receive the messages below.  For more
  24. information, see Module.h.
  25.  
  26. */
  27.  
  28.  
  29. @protocol ModuleProtocol
  30.  
  31. /* SPECIAL PANELS 
  32.  
  33.     The following method brings up a common alert panel with OK and Cancel.
  34.     For other panels, I suggest using NXRunAlertPanel().  This method is
  35.     for backward-compatibility only.
  36. */
  37.  
  38.  
  39. - (BOOL) runLongTimePanel;    /* Runs a standard panel saying something to the 
  40.                                effect of "This operation will take a long
  41.                                time to perform on this sound.  Proceed?"
  42.                                Returns YES if the user pressed "Okay"
  43.                                (wants to proceed), NO if the user pressed
  44.                                "Cancel". */
  45.                                    
  46.  
  47.  
  48.  
  49. /* SOUND ACCESS METHODS 
  50.  
  51.     The following methods return the current sound, soundview,
  52.     or window.  If no sound's window is a key or main window, or
  53.     some other problem has arisen that prevents the module from
  54.     accessing a sound and soundview, these methods return NULL.
  55. */
  56.  
  57.  
  58. - currentSound;                /* Returns the Current Sound, NULL if none */
  59.  
  60. - currentSoundView;            /* Returns the Current SoundView, NULL if none */
  61.  
  62. - currentWindow;            /* Returns the Current Window, NULL if none */
  63.             
  64.     
  65. - currentPlayingSound;        /* Returns Current Playing Sound, or NULL */
  66.  
  67. - currentPlayingSoundView;    /* Returns Current Playing SoundView, or NULL */
  68.  
  69. - currentPlayingWindow;        /* Returns Current Playing Window, or NULL */
  70.     
  71. - (BOOL) isOwner:this_sound_or_soundview;
  72.                                /* Returns YES if this_sound_or_soundview
  73.                                is the owner of the pasteboard or its
  74.                                internal sound is the owner of the pasteboard.
  75.                                */
  76. - (BOOL) stillExists;       /* Returns YES if pasteboard owner is NULL or 
  77.                                         still a valid sound, soundview, or
  78.                                            sound window in Resound's sound
  79.                                            table.  This is useful to determine
  80.                                            if the owner of a pboard hasn't been
  81.                                            freed before you try to paste data
  82.                                            into a sound or soundview. */
  83.             
  84. /* SOUND MODIFICATION METHODS 
  85.  
  86.     The following methods will replace a sound in a soundview,
  87.     or generate a new soundview, sound, and window.
  88. */
  89.             
  90.             
  91.             
  92.                                    
  93. - brandNewSound: thisSound;        /* Tells the program to create a new soundview
  94.                                    for a brand new sound generated by the 
  95.                                    module.*/       
  96. - newSound: thisSound for
  97.     : thisSoundView;            /* Informs the program that a SoundView
  98.                                    (typically the current SoundView) has been 
  99.                                    given a new associated sound. Also calls 
  100.                                    SoundChanged.  This procedure does NOT
  101.                                    actually put the sound in the new soundview,
  102.                                    but merely informs the program.  You must 
  103.                                    set the soundview's new sound and free the 
  104.                                    old one. */
  105.  
  106. - invalidatePasteboard;                    /* Invalidates the pasteboard */
  107.  
  108. /* SOUND UPDATE METHODS
  109.  
  110.     The following methods inform Resound that various aspects
  111.     of a sound have changed.
  112. */
  113.  
  114.  
  115. - soundTouched;                    /* compatibility update method:  same as
  116.                                    soundChanged */
  117. - soundChanged;                    /* Informs the program that a sound has been 
  118.                                    changed in some way or edited.  This sets 
  119.                                    the X on the top right of the window to a 
  120.                                    broken X, and makes the program pull up a 
  121.                                    "Save Before Close?" panel when the file 
  122.                                    is closed, or when the program quits.  */
  123.                        
  124. - selectionChanged;                /* Informs the program that the selection of a
  125.                                    soundview has been changed. (Through a 
  126.                                    "Select All", for instance. Requires 
  127.                                    selection to be for Current Sound.  */
  128.                                                                       
  129. - infoChanged;                    /* Informs the program that any sound 
  130.                                    information has been changed (sampling rate,
  131.                                    number of samples, sample size--8 or 16 
  132.                                    bits, fragmentation, info string, etc. */
  133.  
  134. - zoomChanged;                    /* Informs the program that the reduction 
  135.                                    factor for a soundview has been changed. 
  136.                                    Requires zoom to be for Current Sound. */
  137.  
  138.  
  139. /*    PLAY/RECORD METHODS
  140.  
  141.     These methods determine if a sound is playing or recording.
  142.     This sound does NOT have to be the current sound.  If your
  143.     module modifies a sound, stop recording and playing first.
  144.     If your module just examines from a sound, you should stop
  145.     recording, though playing is probably insignificant.
  146. */                
  147.                    
  148.                    
  149. - stop;                            /* Stops whatever sound is playing 
  150.                                    or recording */
  151.                                    
  152. - (BOOL) isPlaying;                /* Returns TRUE if a sound is playing */
  153.  
  154. - (BOOL) isRecording;            /* Returns TRUE if a sound is recording */
  155.  
  156.  
  157. /* WINDOW METHODS
  158.  
  159.     In general, it's best if your module doesn't use Windows--use Panels
  160.     instead.  But in the off chance that you need to use windows, Resound 
  161.     needs to know so it can set the CurrentSound, CurrentSoundView,
  162.     and CurrentWindow to NULL, and update its inspector accordingly.
  163.     When a window of yours becomes main, please call the following:
  164.  
  165. */
  166.  
  167. - moduleWindowDidBecomeMain;
  168.  
  169.  
  170. @end