SndView Class Reference

SndView is responsible for displaying a amplitude/time plot of Snd data. More...

#import <SndView.h>

List of all members.

Public Member Functions

(id) - showCursor
 Displays the SndView's cursor.
(BOOL) - resignFirstResponder
 Resigns the position of first responder.
(BOOL) - becomeFirstResponder
 Promotes the SndView to first responder, and returns YES.
(void) - copy:
 Copies the current selection to the pasteboard.
(void) - cut:
 Deletes the current selection from the SndView, copies it to the pasteboard, and sends a soundDidChange: message to the delegate.
(void) - delete:
 Deletes the current selection from the SndView's Snd and sends the soundDidChange: message to the delegate.
(void) - paste:
 Replaces the current selection with a copy of the sound data currently on the pasteboard.
(void) - selectAll:
 Creates a selection over the SndView's entire Snd.
(id) - delegate
 Returns the SndView's delegate object.
(id) - didPlay:duringPerformance:
 Sent to the delegate just after the SndView's sound is played.
(id) - didRecord:
 Sent to the delegate just after the SndView's sound is recorded into.
(int) - displayMode
 Returns the SndView's display mode, one of SND_SOUNDVIEW_WAVE (oscilloscopic display) or SND_SOUNDVIEW_MINMAX (minimum/maximum display; this is the default).
(void) - drawRect:
 Displays the SndView's sound data.
(void) - getSelection:size:
 Returns the selection by reference.
(void) - setSelection:size:
 Sets the selection to be sampleCount samples wide, starting with sample firstSample (samples are counted from 0).
(id) - hadError:
 Sent to the delegate if an error is encountered during recording or playback of the SndView's sound.
(id) - initWithFrame:
 Initializes the SndView, fitting the object within the rectangle given by frameRect.
(BOOL) - isAutoScale
 Returns YES if the SndView is in autoscaling mode, otherwise returns NO.
(BOOL) - isBezeled
 Returns YES if the SndView has a bezeled border, otherwise returns NO (the default).
(BOOL) - isContinuousSelectionUpdates
 Returns YES if the SndView responds to mouse-dragged events (as set through setContinuousSelectionUpdates:).
(BOOL) - isEditable
 Returns YES if the SndView's sound data can be edited.
(BOOL) - isEnabled
 Returns YES if the SndView is enabled, otherwise returns NO.
(BOOL) - isOptimizedForSpeed
 Returns YES if the SndView is optimized for speedy display.
(BOOL) - isPlayable
 Returns YES if the SndView's sound data can be played without first being converted.
(BOOL) - isEntireSoundVisible
 Returns YES if the receiver is displaying the entire sound within the visible rectangle of it's enclosing scrollview.
(void) - selectionChanged
 Not normally messaged directly by a client class, it's default operation is to inform the delegate that the selection changed if setContinuousSelectionUpdates was set to YES.
(void) - mouseDown:
 Allows a selection to be defined by clicking and dragging the mouse.
(void) - pasteboard:provideDataForType:
 Places the SndView's entire sound on the given pasteboard.
(void) - pause:
 Pauses the current playback or recording session by invoking Snd's pause: method.
(void) - play:
 Play the current selection by invoking Snd's play: method.
(void) - resume:
 Resumes the current playback or recording session by invoking Snd's resume: method.
(void) - record:
 Replaces the SndView's current selection with newly recorded material.
(void) - stop:
 Stops the SndView's current recording or playback.
(BOOL) - readSelectionFromPasteboard:
 Replaces the SndView's current selection with the sound data on the given pasteboard.
(void) - setAmplitudeZoom:
 Sets the current vertical amplitude axis zoom factor.
(float) - amplitudeZoom
 Returns the current vertical amplitude axis zoom factor.
(float) - reductionFactor
 Returns the SndView's reduction factor in the horizontal time axis.
(BOOL) - setReductionFactor:
 Assigns the reduction factor in the horizontal time axis.
(void) - scaleTo:
 Sets the proportion of the sound displayed within the SndView frame.
(void) - scaleToFit
 Recomputes the SndView's reduction factor to fit the sound data (horizontally) within the current frame.
(void) - resizeToFit
 Resizes the SndView's frame (horizontally) to maintain a constant reduction factor.
(void) - resizeToFit:
 Resizes the SndView's frame (horizontally) to maintain a constant reduction factor.
(void) - resizeToScale:
 Resizes the sound within the frame to a normalized scale.
(id) - setAutoscale:
 Sets the SndView's automatic scaling mode, used to determine how the SndView is redisplayed when its data changes.
(void) - setBezeled:
 If aFlag is YES, the display is given a bezeled border.
(void) - setContinuousSelectionUpdates:
 Sets the state of continuous action messages.
(void) - setDelegate:
 Sets the SndView's delegate to anObject.
(void) - setDisplayMode:
 Sets the SndView's display mode, either SND_SOUNDVIEW_WAVE or SND_SOUNDVIEW_MINMAX (the default).
(void) - setEditable:
 Enables or disables editing in the SndView as aFlag is YES or NO.
(void) - setEnabled:
 Enables or disables the SndView as aFlag is YES or NO.
(void) - setOptimizedForSpeed:
 Sets the SndView to optimize its display mechanism.
(void) - setSound:
 Sets the SndView's Snd object to aSound.
(Snd *) - sound
 Returns the SndView's Snd object being displayed.
(void) - setFrameSize:
 Sets the width and height of the SndView's frame.
(Snd *) - soundBeingProcessed
 Returns the Snd object that's currently being played or recorded into.
(void) - tellDelegate:
 Sends theMessage to the SndView's delegate with the SndView as the argument.
(void) - tellDelegate:duringPerformance:
 Sends theMessage to the SndView's delegate with the SndView as the argument.
(id) - validRequestorForSendType:returnType:
 You never invoke this method; it's implemented to support services that act on sound data.
(void) - willPlay:duringPerformance:
 Sent to the delegate just before the SndView's sound is played.
(void) - willRecord:
 Sent to the delegate just before the SndView's sound is recorded into.
(BOOL) - writeSelectionToPasteboard:types:
 write the selected region of sound to the pasteboard.
(void) - invalidateCache
 Used if you change the data of a sound which is being used in a SndView in any way, to inform the SndView.
(void) - setDrawsCrosses:
 Determines whether individual samples should be drawn as crosses when displaying sounds at extreme magnification.
(BOOL) - drawsCrosses
 Returns whether individual samples are drawn as crosses at extreme magnification.
(BOOL) - setStereoMode:
 Determines how to draw multichannel sounds.
(enum SndViewStereoMode) - getStereoMode
 Returns the mode of drawing multichannel sounds.
(void) - setSelectionColor:
 Sets the selection colour.
(NSColor *) - selectionColor
 Returns the current selection colour.
(void) - setBackgroundColor:
 Sets the background colour.
(NSColor *) - backgroundColor
 Returns the current background colour.
(void) - setForegroundColor:
 Sets the foreground colour.
(NSColor *) - foregroundColor
 Returns the current foreground colour.
(void) - setDragIcon:
 Sets the icon used when dragging selections from the SndView.
(NSImage *) - dragIcon
 Returns the current NSImage instance used when dragging a selection from the receiver.


Detailed Description

SndView is responsible for displaying a amplitude/time plot of Snd data.

A SndView object provides a graphical representation of sound data. This data is taken from an associated Snd object. In addition to displaying a Snd object's data, a SndView provides methods that let you play and record into the Snd object, and perform simple cut, copy, and paste editing of its data. A cursor into the display is provided, allowing the user to set the insertion point and to create a selection over the sound data.

Sound Display

Sounds are displayed on a two-dimensional graph. The amplitudes of individual samples are measured vertically and plotted against time, which proceeds left to right along the horizontal axis. A SndView's coordinate system is scaled and translated (vertically) so full amplitude fits within the bounds rectangle with 0.0 amplitude running through the center of the view.

For many sounds, the length of the sound data in samples is greater than the horizontal measure of the bounds rectangle. A SndView employs a reduction factor to determine the ratio of samples to display units and plots the minimum and maximum amplitude values of the samples within that ratio. For example, a reduction factor of 10.0 means that the minimum and maximum values among the first ten samples are plotted in the first display unit, the minimum and maximum values of the next ten samples are displayed in the second display unit and so on.

Lines are drawn between the chosen values to yield a continuous shape. Two drawing modes are provided:

As you zoom in (as the reduction factor decreases), the two drawing modes become indistinguishable.

Autoscaling the Display

When a SndView's sound data changes (due to editing or recording), the manner in which the SndView is redisplayed depends on its autoscale flag. With autoscaling disabled, the SndView's frame grows or shrinks (horizontally) to fit the new sound data and the reduction factor is unchanged. If autoscaling is enabled, the reduction factor is automatically recomputed to maintain a constant frame size. By default, autoscaling is disabled; this is to accommodate the use of a SndView object as the document of an NSScrollView.

Methods Implemented by the Delegate

SndView Adds These Features:

SndView fixes these bugs:

SndView has these bugs:

SndView is incompatible in these ways:

The optimization mechanism:

When the reductionFactor starts to climb, more samples are crammed into each horizontal pixel in the view. Each pixel shows the maximum and minimum value represented within that number of samples.

To display a very large sound in a small view, the reductionFactor may be in the 1000's. This means that eg 10,000 samples may need to be read, times the width of the view (perhaps 300). SndView seeks to reduce this number of reads by skipping samples when they are nowhere near its current maximum or minimum.

The caching mechanism

Other Features of the Source Code

Future Enhancements for SndView


Member Function Documentation

- (BOOL) resignFirstResponder  

Resigns the position of first responder.

Returns:
Returns a BOOL. Returns YES.

- (BOOL) becomeFirstResponder  

Promotes the SndView to first responder, and returns YES.

Returns:
Returns a BOOL. You never invoke this method directly.

- (void) copy: (id)  sender  

Copies the current selection to the pasteboard.

Parameters:
sender is an id.

- (void) cut: (id)  sender  

Deletes the current selection from the SndView, copies it to the pasteboard, and sends a soundDidChange: message to the delegate.

Parameters:
sender is an id. The insertion point is positioned to where the selection used to start.

- (void) delete: (id)  sender  

Deletes the current selection from the SndView's Snd and sends the soundDidChange: message to the delegate.

Parameters:
sender is an id. The deletion isn't placed on the pasteboard.

- (void) paste: (id)  sender  

Replaces the current selection with a copy of the sound data currently on the pasteboard.

Parameters:
sender is an id. If there is no selection the pasteboard data is inserted at the cursor position. The pasteboard data must be compatible with the SndView's data, as determined by the Snd method compatibleWithSound:. If the paste is successful, the soundDidChange: message is sent to the delegate.

- (void) selectAll: (id)  sender  

Creates a selection over the SndView's entire Snd.

Parameters:
sender is an id.

- (id) delegate  

Returns the SndView's delegate object.

Returns:
Returns an id.

- (id) didPlay: (id)  sender
duringPerformance: (SndPerformance *)  performance 

Sent to the delegate just after the SndView's sound is played.

Method implemented by the delegate. Used to redirect delegate messages from the SndView's Snd object; you never invoke this method directly.

Parameters:
sender is an id.
performance is a SndPerformance.

- (id) didRecord: (id)  sender  

Sent to the delegate just after the SndView's sound is recorded into.

Method implemented by the delegate. Used to redirect delegate messages from the SndView's Snd object; you never invoke this method directly.

Parameters:
sender is an id.

- (int) displayMode  

Returns the SndView's display mode, one of SND_SOUNDVIEW_WAVE (oscilloscopic display) or SND_SOUNDVIEW_MINMAX (minimum/maximum display; this is the default).

Returns:
Returns an int.

- (void) drawRect: (NSRect)  rects  

Displays the SndView's sound data.

Parameters:
rects is a NSRect. The selection is highlighted and the cursor is drawn (if it isn't currently hidden).
You never send the drawRect: message directly to a SndView object. To cause a SndView to draw itself, send it one of the display messages defined by the NSView class.

- (void) getSelection: (unsigned int *)  firstSample
size: (unsigned int *)  sampleCount 

Returns the selection by reference.

Parameters:
firstSample is an unsigned int *.
sampleCount is an unsigned int *. The index of the selection's first sample (counting from 0) is returned in firstSample. The size of the selection in samples is returned in sampleCount.

- (void) setSelection: (int)  firstSample
size: (int)  sampleCount 

Sets the selection to be sampleCount samples wide, starting with sample firstSample (samples are counted from 0).

Parameters:
firstSample is an int.
sampleCount is an int.

- (id) hadError: (id)  sender  

Sent to the delegate if an error is encountered during recording or playback of the SndView's sound.

Used to redirect delegate messages from the SndView's Snd object; you never invoke this method directly.

Parameters:
sender is an id.

- (id) initWithFrame: (NSRect)  frameRect  

Initializes the SndView, fitting the object within the rectangle given by frameRect.

The initialized SndView doesn't contain any sound data.

Parameters:
frameRect is a NSRect.
Returns:
Returns self.

- (BOOL) isAutoScale  

Returns YES if the SndView is in autoscaling mode, otherwise returns NO.

Returns:
Returns a BOOL.

- (BOOL) isBezeled  

Returns YES if the SndView has a bezeled border, otherwise returns NO (the default).

Returns:
Returns a BOOL.

- (BOOL) isContinuousSelectionUpdates  

Returns YES if the SndView responds to mouse-dragged events (as set through setContinuousSelectionUpdates:).

Returns:
Returns a BOOL. The default is NO.

- (BOOL) isEditable  

Returns YES if the SndView's sound data can be edited.

Returns:
Returns a BOOL.

- (BOOL) isEnabled  

Returns YES if the SndView is enabled, otherwise returns NO.

Returns:
Returns a BOOL. The mouse has no effect in a disabled SndView. By default, a SndView is enabled.

- (BOOL) isOptimizedForSpeed  

Returns YES if the SndView is optimized for speedy display.

Returns:
Returns a BOOL. SndViews are optimized by default.

- (BOOL) isPlayable  

Returns YES if the SndView's sound data can be played without first being converted.

Returns:
Returns a BOOL.

- (BOOL) isEntireSoundVisible  

Returns YES if the receiver is displaying the entire sound within the visible rectangle of it's enclosing scrollview.

Returns:
Returns a BOOL

- (void) selectionChanged  

Not normally messaged directly by a client class, it's default operation is to inform the delegate that the selection changed if setContinuousSelectionUpdates was set to YES.

This allows subclasses to know when selections change and override default behaviour.

- (void) mouseDown: (NSEvent *)  theEvent  

Allows a selection to be defined by clicking and dragging the mouse.

Parameters:
theEvent is an NSEvent instance. This method takes control until a mouse-up occurs. While dragging, the selected region is highlighted. On mouse up, the delegate is sent the selectionChanged: message. If isContinuous is YES, selectionChanged: messages are also sent while the mouse is being dragged. You never invoke this method; it's invoked automatically in response to the user's actions.

- (void) pasteboard: (NSPasteboard *)  thePasteboard
provideDataForType: (NSString *)  pboardType 

Places the SndView's entire sound on the given pasteboard.

Parameters:
thePasteboard is a NSPasteboard instance.
pboardType is a NSString instance. Currently, the type argument must be “SndPasteboardType”, the pasteboard type that represents sound data.

- (void) pause: (id)  sender  

Pauses the current playback or recording session by invoking Snd's pause: method.

Parameters:
sender is an id.

- (void) play: (id)  sender  

Play the current selection by invoking Snd's play: method.

If there is no selection, the SndView's entire Snd is played. The willPlay: message is sent to the delegate before the selection is played; didPlay: is sent when the selection is done playing.

Parameters:
sender is an id.

- (void) resume: (id)  sender  

Resumes the current playback or recording session by invoking Snd's resume: method.

Parameters:
sender is an id.

- (void) record: (id)  sender  

Replaces the SndView's current selection with newly recorded material.

Parameters:
sender is an id. If there is no selection, the recording is inserted at the cursor. The willRecord: message is sent to the delegate before the recording is started; didRecord: is sent after the recording has completed. Recorded data is always taken from the CODEC microphone input.

- (void) stop: (id)  sender  

Stops the SndView's current recording or playback.

Parameters:
sender is an id.

- (BOOL) readSelectionFromPasteboard: (NSPasteboard *)  thePasteboard  

Replaces the SndView's current selection with the sound data on the given pasteboard.

Parameters:
thePasteboard is a NSPasteboard instance.
Returns:
Returns a BOOL. The pasteboard data is converted to the format of the data in the SndView (if possible). If the SndView has no selection, the pasteboard data is inserted at the cursor position. Sets the current error code for the SndView's Snd object (which you can retrieve by sending processingError to the Snd) and returns YES.

- (void) setAmplitudeZoom: (float)  newAmplitudeZoom  

Sets the current vertical amplitude axis zoom factor.

Parameters:
newAmplitudeZoom The new amplitude zoom factor. If 1.0, this displays a full amplitude signal in the maximum vertical view width. If greater than 1.0 a signal will be zoomed and clipped against the view. If less than 1.0 the signal will be reduced within the view. Values less than or equal to zero are not set.

- (float) amplitudeZoom  

Returns the current vertical amplitude axis zoom factor.

Returns:
Returns a float.

- (float) reductionFactor  

Returns the SndView's reduction factor in the horizontal time axis.

Returns:
Returns a float. Computed as follows: reductionFactor = sampleCount / displayUnits

- (BOOL) setReductionFactor: (float)  reductionFactor  

Assigns the reduction factor in the horizontal time axis.

Parameters:
reductionFactor is a float.
Returns:
Returns a BOOL. Recomputes the size of the SndView's frame, if autoscaling is disabled. The frame's size (in display units) is set according to the following formula:
displayUnits = sampleCount / reductionFactor

Increasing the reduction factor zooms out, decreasing zooms in on the data. If autodisplaying is enabled, the Snd is automatically redisplayed.

If the SndView is in autoscaling mode, or reductionFactor is less than 1.0, the method avoids computing the frame size and returns NO. (In autoscaling mode, the reduction factor is automatically recomputed when the sound data changes - see scaleToFit:.) Otherwise, the method returns YES. If reductionFactor is the same as the current reduction factor, the method returns immediately without recomputing the frame size.

- (void) scaleTo: (float)  scaleRatio  

Sets the proportion of the sound displayed within the SndView frame.

Recomputes the SndViews reduction factor to fit a portion of the sound data (horizontally) within the views frame.

Parameters:
scaleRatio The ratio of displayed content within the frame 1.0 = entire sound, 0.5 = half the sound etc.

- (void) scaleToFit  

Recomputes the SndView's reduction factor to fit the sound data (horizontally) within the current frame.

Invoked automatically when the SndView's data changes and the SndView is in autoscale mode. If the SndView isn't in autoscale mode, resizeToFit is invoked when the data changes. You never invoke this method directly; a subclass can reimplement this method to provide specialized behavior.

- (void) resizeToFit  

Resizes the SndView's frame (horizontally) to maintain a constant reduction factor.

This method is invoked automatically when the SndView's data changes and the SndView isn't in autoscale mode. If the SndView is in autoscale mode, scaleToFit is invoked when the data changes. You never invoke this method directly; a subclass can reimplement this method to provide specialized behavior.

- (void) resizeToFit: (BOOL)  withAutoscaling  

Resizes the SndView's frame (horizontally) to maintain a constant reduction factor.

Parameters:
withAutoscaling is a BOOL. This method is invoked automatically when the SndView's data changes and the SndView isn't in autoscale mode. If the SndView is in autoscale mode, scaleToFit is invoked when the data changes. You never invoke this method directly; a subclass can reimplement this method to provide specialized behavior.

- (void) resizeToScale: (float)  scaleRatio  

Resizes the sound within the frame to a normalized scale.

Parameters:
scaleRatio Scaling of the sound within the frame: 0 > scaleRatio <= 1.0

- (id) setAutoscale: (BOOL)  aFlag  

Sets the SndView's automatic scaling mode, used to determine how the SndView is redisplayed when its data changes.

Parameters:
aFlag is a BOOL. With autoscaling enabled (aFlag is YES), the SndView's reduction factor is recomputed so the sound data fits within the view frame. If it's disabled (aFlag is NO), the frame is resized and the reduction factor is unchanged. If the SndView is in an NSScrollView, autoscaling should be disabled (autoscaling is disabled by default).

- (void) setBezeled: (BOOL)  aFlag  

If aFlag is YES, the display is given a bezeled border.

Parameters:
aFlag is a BOOL. By default, the border of a SndView display isn't bezeled. If autodisplay is enabled, the Snd is automatically redisplayed.

- (void) setContinuousSelectionUpdates: (BOOL)  aFlag  

Sets the state of continuous action messages.

Parameters:
aFlag is a BOOL. If aFlag is YES, selectionChanged: messages are sent to the delegate as the mouse is being dragged. If NO, the message is sent only on mouse up. The default is NO.

- (void) setDelegate: (id)  anObject  

Sets the SndView's delegate to anObject.

Parameters:
anObject is an id. The delegate is sent messages when the user changes or acts on the selection.

- (void) setDisplayMode: (int)  aMode  

Sets the SndView's display mode, either SND_SOUNDVIEW_WAVE or SND_SOUNDVIEW_MINMAX (the default).

Parameters:
aMode is an int. If autodisplaying is enabled, the Snd is automatically redisplayed.

- (void) setEditable: (BOOL)  aFlag  

Enables or disables editing in the SndView as aFlag is YES or NO.

Parameters:
aFlag is a BOOL. By default, a SndView is editable.

- (void) setEnabled: (BOOL)  aFlag  

Enables or disables the SndView as aFlag is YES or NO.

Parameters:
aFlag is a BOOL. The mouse has no effect in a disabled SndView. By default, a SndView is enabled.

- (void) setOptimizedForSpeed: (BOOL)  flag  

Sets the SndView to optimize its display mechanism.

Parameters:
flag is a BOOL. Optimization greatly increases the speed with which data can be drawn, particularly for large sounds. It does so at the loss of some precision in representing the sound data; however, these inaccuracies are corrected as you zoom in on the data. All SndView's are optimized by default.

- (void) setSound: (Snd *)  aSound  

Sets the SndView's Snd object to aSound.

Parameters:
aSound is a Snd instance. If autoscaling is enabled, the drawing coordinate system is adjusted so aSound's data fits within the current frame. Otherwise, the frame is resized to accommodate the length of the data. If autodisplaying is enabled, the SndView is automatically redisplayed.

- (Snd *) sound  

Returns the SndView's Snd object being displayed.

Returns:
Returns a Snd instance.

- (void) setFrameSize: (NSSize)  newSize  

Sets the width and height of the SndView's frame.

If autodisplaying is enabled, the SndView is automatically redisplayed.

Parameters:
newSize is a NSSize.

- (Snd *) soundBeingProcessed  

Returns the Snd object that's currently being played or recorded into.

Returns:
Returns an Snd. Note that the actual Snd object that's being performed isn't necessarily the object returned by SndView's sound method; for efficiency, SndView creates a private performance Snd object. While this is generally an implementation detail, this method is supplied in case the SndView's delegate needs to know exactly which object will be (or was) performed.

- (void) tellDelegate: (SEL)  theMessage  

Sends theMessage to the SndView's delegate with the SndView as the argument.

Parameters:
theMessage is a SEL. If the delegate doesn't respond to the message, then it isn't sent. You normally never invoke this method; it's invoked automatically when an action, such as playing or editing, is performed. However, you can invoke it in the design of a SndView subclass.

- (void) tellDelegate: (SEL)  theMessage
duringPerformance: (SndPerformance *)  performance 

Sends theMessage to the SndView's delegate with the SndView as the argument.

If the delegate doesn't respond to the message, then it isn't sent. You normally never invoke this method; it's invoked automatically when an action, such as playing or editing, is performed. However, you can invoke it in the design of a SndView subclass.

Parameters:
theMessage is a SEL.
performance The SndPerformance instance performing when the message is sent.

- (id) validRequestorForSendType: (NSString *)  sendType
returnType: (NSString *)  returnType 

You never invoke this method; it's implemented to support services that act on sound data.

Parameters:
sendType is a NSString instance.
returnType is a NSString instance.
Returns:
Returns an id.

- (void) willPlay: (id)  sender
duringPerformance: (SndPerformance *)  performance 

Sent to the delegate just before the SndView's sound is played.

Parameters:
sender is an id.
performance A SndPerformance instance indicating which performance is about to play.
Method implemented by the delegate. Used to redirect delegate messages from the SndView's Snd object; you never invoke this method directly.

- (void) willRecord: (id)  sender  

Sent to the delegate just before the SndView's sound is recorded into.

Parameters:
sender is an id.
Method implemented by the delegate. Used to redirect delegate messages from the SndView's Snd object; you never invoke this method directly.

- (BOOL) writeSelectionToPasteboard: (NSPasteboard *)  thePasteboard
types: (NSArray *)  pboardTypes 

write the selected region of sound to the pasteboard.

Parameters:
thePasteboard The pasteboard to receive the sound region.
pboardTypes An array of ? sound formats?

- (void) invalidateCache  

Used if you change the data of a sound which is being used in a SndView in any way, to inform the SndView.

The easiest message to use is -invalidateCache, but you can be more specific and tell it the exact sample number with -invalidateCacheStartSample:end:

- (void) setDrawsCrosses: (BOOL)  aFlag  

Determines whether individual samples should be drawn as crosses when displaying sounds at extreme magnification.

Defaults to YES.

Parameters:
aFlag YES to draw crosses linked by line segments, NO to draw samples as points linked by line segments.

- (BOOL) drawsCrosses  

Returns whether individual samples are drawn as crosses at extreme magnification.

Returns:
Returns YES if samples are drawn with a cross, NO if they are drawn as points.

- (BOOL) setStereoMode: (enum SndViewStereoMode)  stereoMode  

Determines how to draw multichannel sounds.

Parameters:
stereoMode one of the values SV_LEFTONLY, SV_RIGHTONLY, SV_STEREOMODE

- (enum SndViewStereoMode) getStereoMode  

Returns the mode of drawing multichannel sounds.

Returns:
Returns

- (void) setSelectionColor: (NSColor *)  color  

Sets the selection colour.

Parameters:
color An NSColor.

- (NSColor *) selectionColor  

Returns the current selection colour.

Returns:
Returns an NSColor.

- (void) setBackgroundColor: (NSColor *)  color  

Sets the background colour.

Parameters:
color An NSColor.

- (NSColor *) backgroundColor  

Returns the current background colour.

Returns:
Returns an NSColor.

- (void) setForegroundColor: (NSColor *)  color  

Sets the foreground colour.

Parameters:
color An NSColor instance.

- (NSColor *) foregroundColor  

Returns the current foreground colour.

Returns:
Returns an NSColor instance.

- (void) setDragIcon: (NSImage *)  newDragIcon  

Sets the icon used when dragging selections from the SndView.

If the default workspace image icon is desired, use: [sndView setDragIcon: [[NSWorkspace sharedWorkspace] iconForFileType: [Snd defaultFileExtension]]];

Parameters:
newDragIcon An NSImage instance to be used as the drag image. If nil, the icon to appear will be the visible region of the selected SndView.

- (NSImage *) dragIcon  

Returns the current NSImage instance used when dragging a selection from the receiver.

If nil, the icon to appear will be the visible region of the selected SndView.

Returns:
Returns an NSImage instance.


The documentation for this class was generated from the following file:

Generated on Sat Dec 5 17:01:17 2009 for MusicKit by  doxygen 1.5.6