home *** CD-ROM | disk | FTP | other *** search
-
- /*
-
- ModuleProtocol (version 2.4)
-
- Part of the Resound 2.4 API
- Sean Luke
- Last Revision: January 19, 1996
-
- Copyright 1996, Sean Luke
- This code may be used, modified, or distributed freely without
- permission of the author.
-
-
-
- This protocol lists current methods available to modules. It is
- backward-compatible with Resound versions from 2.0a to 2.4.
- I informally promise that modules adhering to this version
- of the protocol will be compatible with all Resound versions
- including and beyond 2.4.
-
- Each module has an id called TheModuleController. This is the
- instance that should receive the messages below. For more
- information, see Module.h.
-
- */
-
-
- @protocol ModuleProtocol
-
- /* SPECIAL PANELS
-
- The following method brings up a common alert panel with OK and Cancel.
- For other panels, I suggest using NXRunAlertPanel(). This method is
- for backward-compatibility only.
- */
-
-
- - (BOOL) runLongTimePanel; /* Runs a standard panel saying something to the
- effect of "This operation will take a long
- time to perform on this sound. Proceed?"
- Returns YES if the user pressed "Okay"
- (wants to proceed), NO if the user pressed
- "Cancel". */
-
-
-
-
- /* SOUND ACCESS METHODS
-
- The following methods return the current sound, soundview,
- or window. If no sound's window is a key or main window, or
- some other problem has arisen that prevents the module from
- accessing a sound and soundview, these methods return NULL.
- */
-
-
- - currentSound; /* Returns the Current Sound, NULL if none */
-
- - currentSoundView; /* Returns the Current SoundView, NULL if none */
-
- - currentWindow; /* Returns the Current Window, NULL if none */
-
-
- - currentPlayingSound; /* Returns Current Playing Sound, or NULL */
-
- - currentPlayingSoundView; /* Returns Current Playing SoundView, or NULL */
-
- - currentPlayingWindow; /* Returns Current Playing Window, or NULL */
-
- - (BOOL) isOwner:this_sound_or_soundview;
- /* Returns YES if this_sound_or_soundview
- is the owner of the pasteboard or its
- internal sound is the owner of the pasteboard.
- */
- - (BOOL) stillExists; /* Returns YES if pasteboard owner is NULL or
- still a valid sound, soundview, or
- sound window in Resound's sound
- table. This is useful to determine
- if the owner of a pboard hasn't been
- freed before you try to paste data
- into a sound or soundview. */
-
- /* SOUND MODIFICATION METHODS
-
- The following methods will replace a sound in a soundview,
- or generate a new soundview, sound, and window.
- */
-
-
-
-
- - brandNewSound: thisSound; /* Tells the program to create a new soundview
- for a brand new sound generated by the
- module.*/
- - newSound: thisSound for
- : thisSoundView; /* Informs the program that a SoundView
- (typically the current SoundView) has been
- given a new associated sound. Also calls
- SoundChanged. This procedure does NOT
- actually put the sound in the new soundview,
- but merely informs the program. You must
- set the soundview's new sound and free the
- old one. */
-
- - invalidatePasteboard; /* Invalidates the pasteboard */
-
- /* SOUND UPDATE METHODS
-
- The following methods inform Resound that various aspects
- of a sound have changed.
- */
-
-
- - soundTouched; /* compatibility update method: same as
- soundChanged */
- - soundChanged; /* Informs the program that a sound has been
- changed in some way or edited. This sets
- the X on the top right of the window to a
- broken X, and makes the program pull up a
- "Save Before Close?" panel when the file
- is closed, or when the program quits. */
-
- - selectionChanged; /* Informs the program that the selection of a
- soundview has been changed. (Through a
- "Select All", for instance. Requires
- selection to be for Current Sound. */
-
- - infoChanged; /* Informs the program that any sound
- information has been changed (sampling rate,
- number of samples, sample size--8 or 16
- bits, fragmentation, info string, etc. */
-
- - zoomChanged; /* Informs the program that the reduction
- factor for a soundview has been changed.
- Requires zoom to be for Current Sound. */
-
-
- /* PLAY/RECORD METHODS
-
- These methods determine if a sound is playing or recording.
- This sound does NOT have to be the current sound. If your
- module modifies a sound, stop recording and playing first.
- If your module just examines from a sound, you should stop
- recording, though playing is probably insignificant.
- */
-
-
- - stop; /* Stops whatever sound is playing
- or recording */
-
- - (BOOL) isPlaying; /* Returns TRUE if a sound is playing */
-
- - (BOOL) isRecording; /* Returns TRUE if a sound is recording */
-
-
- /* WINDOW METHODS
-
- In general, it's best if your module doesn't use Windows--use Panels
- instead. But in the off chance that you need to use windows, Resound
- needs to know so it can set the CurrentSound, CurrentSoundView,
- and CurrentWindow to NULL, and update its inspector accordingly.
- When a window of yours becomes main, please call the following:
-
- */
-
- - moduleWindowDidBecomeMain;
-
-
- @end