Class: SoundView

Environment: Siren
Superclass: Siren.DisplayListView
Category: MusicUI-Sound

Instances of SoundView are used for displaying samples sound objects in R4.
They can do horizontal scrolling and scaling.

Instance variables:
step the step size for displaying--show every n'th sample
scale the vertical scale for multiplying the sample's value

converting indeces

sampleForX: xValue
Answer the sample under the point with x = xValue.

xForSample: sample
Answer the xValue of the sample with the given index.

accessing

bounds: aRectangle
Set the receiver's bounds.

markerColor
Answer the color for selection markers.

preferredBounds
Answer the extent of the receiver's display object bounding box.

scale
Return the vertical scale.

scale: theScale
Accept the argument, 'theScale', as the new instance variable 'scale'.

sound
Answer the model's sound.

sound: aSound
Set the model's sound.

step
Return the horizontal sample-per-pixel scale

step: theStep
Accept the argument, 'theStep', as the new instance variable 'step'.

text
Answer the default display text for the receiver's sound.

viewExtent
Answer the extent of the receiver's display object bounding box.

selection

eraseMarkerAt: xValue
take a mouse point and place a marker on the sound sample there

selectBetween: startValue and: stopValue
take a mouse region and place a marker on the sound sample there

showMarkerAt: xValue
take a mouse point and place a marker on the sound sample there

displaying

displayMarkersOn: aGC
Show the selections (up to 2 markers) in the current sound

displayOn: aGraphicsContext
Display the receiver's sound on the argument

displayOnGC: aGC
Show the receiver's sound on the GC.

displayPosition: pos
Display the mouse pos in the corner of my display

invalidate
Redisplay the receiver's sound

redraw
Redisplay the receiver's sound

initialize-release

initialize
Set up the proper default values for the receiver.

controller access

defaultControllerClass
Answer the default controller class for use with the receiver.

private

scrollableExtent
Answer the extent of the receiver's display object bounding box.

visibleExtent
Answer the extent of the receiver's clipping box.

MetaClass: SoundView class

instance creation

componentOnSound: aSound
Answer a DLView for use as a component.

componentOnSoundNoFrills: aSound
Answer a DLView for use as a component.

openOn: aSound
Take the sound as model and open a SoundView

soundViewOn: aSound
Take the sound as model and open a SoundView

examples

example1
Open a sound view on the example sound file.

example2
Open a sound view on the a sound from a file.

exampleLong
Open a sound view on the a sound from a file.

exampleRamp
Open a sound view on the a sound with a slow ramp.