Release 3.0, Copyright ©1998 by Sean Luke. All Rights Reserved.
ModuleProtocol
Declared In: ModuleProtocol.h
Protocol Description
This protocol lists current methods available to modules. It is reasonably backward-compatible with Resound versions from 2.0a to 2.5. I'll try to keep it forward-compatible with future versions of Resound.
Each module has an id called moduleController. This is the instance that should receive the messages below. For more information, see Module.rtf.
It is important to note that you should not access a sound's info string. Due to bugs in the SoundKit, Resound must maintain the Sound object's Info String separately in Resound's custom SoundView. There are access and modification methods there; see ModuleSoundView.rtf.
Your module should ordinarily not use any private Windows at all, only Panels. But if in the off chance it must use a Window, call ModuleMenuProtocol's moduleWindowDidBecomeMain whenever your private Window becomes main.
Method Types
Sound Access - currentSound
- currentSoundView
- currentWindow
- currentPlayingSound
- currentPlayingSoundView
- currentPlayingWindow
Making a special SoundView - newWindow:::
New Sounds - brandNewSound:
Backward Compatibility Only - isOwner:
Instance Methods
brandNewSound:
- brandNewSound:(Sound*)thisSound
Tells Resound to register and create a new SoundView for the brand new sound thisSound generated by the module.
currentPlayingSound
- currentPlayingSound
Returns the Sound currently playing, or nil if there is none.
currentPlayingSoundView
- currentPlayingSoundView
Returns the SoundView currently playing, or nil if there is none.
currentPlayingWindow
- currentPlayingWindow
Returns the sound Window currently playing, or nil if there is none.
currentSound
- currentSound
Returns the Sound currently being selected and used, or nil if there is none.
currentSoundView
- currentSoundView
Returns the SoundView currently being selected and used, or nil if there is none.
currentWindow
- currentWindow
Returns the sound's Window currently being selected and used, or nil if there is none.
fragmentationChanged
- fragmentationChanged
Tells Resound that the current Sound may have been fragmented or compacted.
invalidatePasteboard
- invalidatePasteboard
Invalidates the pasteboard, that is, removes any cut or copied sound on the pasteboard that belongs to Resound's SoundViews. This was to get around an evil NeXTSTEP Pasteboard bug which does not appear to affect Rhapsody/OPENSTEP. Do not use it any more. The default version now does nothing.
isOwner:
- (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. This was to get around an evil NeXTSTEP Pasteboard bug which does not appear to affect Rhapsody/OPENSTEP. Do not use it any more. The default version now always returns YES.
isPlaying
- (BOOL) isPlaying
Returns 1 a sound is playing, else 0.
isRecording
- (BOOL) isRecording
Returns 1 a sound is recording, else 0.
moduleWindowDidBecomeMain
- moduleWindowDidBecomeMain
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 nil, and update its inspector accordingly. Whenever a Window owned by your module becomes main, make certain to call this method.
newSound:for:
- newSound:(Sound*)thisSound for:(SoundView*)thisSoundView
Informs Resound that thisSoundView (typically the current SoundView) has been given a new associated sound thisSound. This method automatically calls SoundChanged. This procedure does not actually put the Sound in the new SoundView, but merely informs the program. Prior to calling this method, you yourself must set the SoundView's new Sound using setSound:.
newWindow:::
- (void)newWindow:(NSWindow**) theWindowPointer:(NSScrollView**) theScrollViewPointer:(SoundView**)theSoundViewPointer
Creates a new window similar to Resound's standard sound windows, containing an NSScrollView, which contains a SoundView. Note that the ScrollView and SoundView are special subclasses that Resound uses to fix various bugs (see ModuleSoundView.rtf for example). Pointers to the three objects are returned.
The window is not "hooked" into Resound's tracking mechanism, so updating it won't change inspectors, and it won't be auto-saved, closed, etc. You're responsible for managing this window yourself; similarly, you don't need to call the appropriate ModuleProtocol methods (selectionChanged:, zoomChanged:, etc.) for this SoundView, as Resound doesn't care about it. But remember that this window is a NSWindow, not an NSPanel, which means you have to call moduleWindowDidBecomeMain appropriately. Also see ModuleSoundView.rtf for some bug workarounds you'll need to know about when handling these objects.
The main reason why you'd want to call this method is to get access to copies of Resound's special subclasses of NSScrollView and SoundView, for some unusual purpose. Other than that, you shouldn't use this method. Use newSoundFor: or brandNewSound: instead.
selectionChanged
- selectionChanged
Tells Resound that the current SoundView has had its selection changed.
soundChanged
- soundChanged
Tells Resound that the current Sound has been modified.
stillExists
- (BOOL) stillExists
Returns YES if pasteboard owner is nil 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. This was to get around an evil NeXTSTEP Pasteboard bug which does not appear to affect Rhapsody/OPENSTEP. Do not use it any more. The default version now just returns YES.
zoomChanged
- zoomChanged
Tells Resound that the current SoundView has had its zoom changed.
stop
- stop
Stops any currently playing or recording sound.