Copyright ©1995 by NeXT Computer, Inc. All Rights Reserved.
| 16 |
Sound
| Classes
NXPlayStream |
| Inherits From: | NXSoundStream : Object |
| Initializing an NXPlayStream |
| Initializes a newly allocated NXPlayStream |
| Activating and Playing |
| Prepares the NXPlayStream for playback | ||
| Plays a buffer of sound | ||
| Setting Gain and Peak Detection |
| Sets the NXPlayStream's stereo gain | ||
| Returns the NXPlayStream's gain by reference | ||
| right:(float *)rightAmp | Returns the most recent peak amplitudes by reference |
| Delegate Methods |
| Invoked when the sound driver underruns |
| NXRecordStream |
| Inherits From: | NXSoundStream : Object |
| Enqueueing Buffers |
| tag:(int)anInt | Enqueues a recording buffer |
| Requesting Data |
| Sends the current buffer to the delegate |
| Delegate Methods |
| Invoked when the sound driver overruns | ||
| Delivers a buffer of recorded data | ||
| NXSoundDevice |
| Inherits From: | Object | |
| Conforms To: | NXSoundParameters |
| Initializing and Freeing an NXSoundDevice |
| Initializes a newly allocated NXSoundDevice | ||
| Initializes a new NXSoundDevice on the given host | ||
| Frees the NXSoundDevice |
| Using a Separate Thread |
| + (cthread_t)replyThread | Returns the thread in which driver messages are sent | |
| + setUseSeparateThread:(BOOL)flag | Sets whether a separate thread is used for driver messages | |
| + (BOOL)isUsingSeparateThread | Returns whether a separate thread is used for driver messages | |
| + setThreadThreshold:(int)threshold | Sets the message-reception threshold | |
| + (int)threadThreshold | Returns the message-reception threshold |
| Examining Ports |
| Returns the port used to communicate with the sound driver | ||
| + (port_t)replyPort | Returns the port to which the sound driver sends messages | |
| Returns the port used to connect to the sound driver |
| Identifying the Host Computer |
| Returns the name of the computer on which the NXSoundDevice was initialized |
| Configuring the Object |
| Returns the object's parameters |
|
| high:(float *)highRate; |
| count:(unsigned int *)numRates; |
| count:(unsigned int *)numEncodings |
| Sets whether the underlying device is reserved |
| Returns whether the underlying device is reserved |
| + setTimeout:(unsigned int)milliseconds | Sets the timeout period | |
| + (unsigned int)timeout | Returns the timeout period |
| Finding Peak Amplitudes |
| right:(float *)rightAmp | Returns the most recent peak amplitudes by reference |
| Controlling Streams |
| Aborts all streams connected to this NXSoundDevice | ||
| Pauses all streams connected to this NXSoundDevice | ||
| Resumes all streams connected to this NXSoundDevice |
| Handling errors |
| Returns the most recent error |
| + (const char *)textForError:(NXSoundDeviceError)errorCode |
| Returns a string that describes the given error |
| NXSoundIn |
| Inherits From: | NXSoundDevice : Object |
| No methods |
| NXSoundOut |
| Inherits From: | NXSoundDevice : Object |
| No methods |
| NXSoundParameters |
| Inherits From: | Object | |
| Conforms To: | NXSoundParameters (the protocol) |
| + (const char *)localizedNameForParameter:(NXSoundParameterTag)ptag
|
| NXSoundStream |
| Inherits From: | Object |
| Initializing and Freeing an NXSoundStream |
| Initializes the NXSoundStream | ||
| Initializes the NXSoundStream and connects it to aDevice | ||
| Deactivates and frees the NXSoundStream. |
| Setting the Device |
| Connects the NXSoundStream to aDevice | ||
| Returns the NXSoundDevice that the NXSoundStream is connected to. |
| Activating and Deactivating |
| Adds the NXSoundStream to the list of active streams | ||
| Aborts the NXSoundStream's current activity |
| Controlling the stream |
| Stops the NXSoundStream's playback or recording |
| Schedules the NXSoundStream to be aborted |
| Pauses the NXSoundStream's recording or playback |
| Schedules the NXSoundStream to be paused |
| Resumes the NXSoundStream's recording or playback |
| Schedules the NXSoundStream to be resumed |
| Querying the Object |
| Returns the number of bytes of sound that the NXSoundStream has recorded or played | ||
| Returns whether the NXSoundStream is currently activate | ||
| Returns whether the NXSoundStream is currently paused | ||
| Returns the port used to connect to the sound driver | ||
| Returns the most recent sound device error |
| Assigning a Delegate |
| Sets the NXSoundStream's delegate. | ||
| Returns the NXSoundStream's delegate. |
| Delegate Methods |
| Invoked when the driver finishes playing or recording |
| Invoked when the driver starts playing or recording | ||
| Invoked when the driver aborts the stream | ||
| Invoked when the NXSoundStream is paused | ||
| Invoked when the NXSoundStream is resumed |
| Sound |
| Inherits From: | Object | |
| Conforms To: | soundkit/Sound.h |
| Creating and Freeing a Sound Object |
| + addName:(const char *)name | Creates a Sound object from the sound resource named | |
| + addName:(const char *)name | Creates a Sound object from the sectionName section | |
| + addName:(const char *)name | Creates a Sound object from filename | |
| Creates a Sound object from the sectionName section of the sound segment in the application executable file | ||
| Creates a Sound object from the named pasteboard | ||
| Creates a Sound object from filename | ||
| Frees the Sound object |
| Accessing the Sound Name Table |
| + addName:(const char *)name sound:aSound | Assigns the name name to the Sound aSound and adds it to the name table | |
| + findSoundFor:(const char *)aName | Finds and returns the named Sound object | |
| + removeSoundForName:(const char *)name | Removes the named Sound from the name table |
| Accessing the Sound's Name |
| Set's the Sound object's name | ||
| Return's the Sound object's name |
| Reading and Writing Sound Data |
| Replaces the Sound's data with that in filename | ||
| Replaces the Sound's data with that read from stream | ||
| Writes the Sound's data to filename | ||
| Writes the Sound's data to stream | ||
| Writes the Sound's data to the named pasteboard |
| Modifying Sound Data |
| Converts the Sound's data to the specified format, | ||
| Convert's the Sound's data to the specified format | ||
| Set's the Sound's data as specified | ||
| Set's the Sound's sound structure | ||
| Querying the Sound Data |
| Returns the Sound's sound structure | ||
| Gives the size of the Sound's sound structure | ||
| Returns a pointer to the Sound's sound data | ||
| Returns the Sound's data format | ||
| Returns the size in bytes of the Sound's data | ||
| Returns the number of channels of sound | ||
| Returns the sound data's sampling rate | ||
| Returns the number of sample frames in the sound data | ||
| Returns the sound's length in seconds | ||
| Returns a pointer to the Sound's info string | ||
| Returns the length in bytes of the Sound's info string | ||
| Returns whether the Sound contains any sound data | ||
| Returns whether the Sound's format is compatiable with that of aSound |
| Recording and playing |
| Pauses the Sound's activity | ||
| Pauses the Sound's activity | ||
| Returns whether the Sound can be played | ||
| Plays the Sound | ||
| Plays the Sound | ||
| Records into the Sound | ||
| Records into the Sound | ||
| Resumes the Sound's activity | ||
| Resumes the Sound's activity | ||
| Stops the Sound's activity | ||
| Stops the Sound's activity | ||
| Returns the number of sample frames played or recorded | ||
| Returns the Sound's activity code | ||
| Returns self |
| Returns the sound structure that's being played or recorded |
| Returns the last error code that was generated |
| Editing Sound Data |
| Returns whether the Sound's data can be edited | ||
| Copies a range of samples from aSound into the receiver | ||
| Replaces the Sound's data with that in aSound | ||
| Removes the Sound's data | ||
| Removes a range of samples from the Sound's data | ||
| Inserts aSound's data into the Sound's data | ||
| Returns whether the Sound's data needs to be compacted | ||
| Compacts the Sound's data |
| Archiving the Object |
| Invoked automatically after unarchiving | ||
| Unarchives the Sound from stream | ||
| Archives the Sound to stream |
| Accessing the Delegate |
| Sets the Sound's delegate object | ||
| Returns the Sound's delegate | ||
| Sends theMessage to the delegate |
| Accessing the Sound Hardware |
| + getVolume:(float *)left :(float *)right | Returns the left and right volume settings by reference | |
| + setVolume:(float)left :(float)right | Sets the left and right volumes (0.0 to 1.0) | |
| + (BOOL)isMuted | Returns whether the internal speaker is muted | |
| + setMute:(BOOL)aFlag | Sets whether the internal speaker is muted |
| Delegate Methods |
| Sent to the delegate when the Sound stops playing | ||
| Sent to the delegate when the Sound stops recording | ||
| Sent to the delegate if an error occurs during recording or playback | ||
| Sent to the delegate when the Sound begins to play | ||
| Sent to the delegate when the Sound begins to record |
| SoundMeter |
| Inherits From: | View : Responder : Object |
| Initializing a SoundMeter |
| Initializes the SoundMeter |
| Graphic Attributes |
| Sets the SoundMeter's background color | ||
| Returns the SoundMeter's background color | ||
| Sets the SoundMeter's running bar color | ||
| Returns the color of the running bar | ||
| Sets whether a bezeled border is drawn | ||
| Returns whether the SoundMeter has a border | ||
| Sets the SoundMeter's peak bubble color | ||
| Returns the SoundMeter's peak bubble gray |
| Metering Attributes |
| Sets the SoundMeter's Sound object | ||
| Returns the Sound object that the SoundMeter is metering | ||
| Sets the current running value | ||
| Sets the SoundMeter's peak value hold time in seconds | ||
| Returns the SoundMeter's peak hold time |
| Retrieving Meter Values |
| Returns the current running amplitude value | ||
| Returns the maximum running value so far | ||
| Returns the minimum running value so far | ||
| Returns the most recently detected peak value |
| Operating the Object |
| Starts the SoundMeter running | ||
| Returns whether the SoundMeter is currently running | ||
| Stops the SoundMeter's metering activity |
| Drawing the Object |
| Draws the SoundMeter's running bar and peak bubble | ||
| Draws all the components of the SoundMeter |
| Archiving |
| Unarchives the SoundMeter by reading it from aStream | ||
| Archives the SoundMeter by writing it to aStream |
| SoundView |
| Inherits From: | View : Responder : Object |
| Initializing and Freeing a SoundView |
| Initializes the SoundView | ||
| Frees the SoundView |
| Modifying the Object |
| Fits the sound data within the current frame | ||
| Sets the SoundView's background gray | ||
| Sets whether the SoundView has a bezeled border | ||
| Sets the state of continuous action messages. | ||
| Sets the SoundView's delegate | ||
| Sets the SoundView's display mode | ||
| Enables or disables the SoundView | ||
| Sets the SoundView's foreground gray | ||
| Sets whether the SoundView's display mechanism is optimized | ||
| Sets the SoundView's Sound object | ||
| Resizes the SoundView's frame to maintain a constant reduction factor |
| Querying the Object |
| Returns the SoundView's background gray | ||
| Returns the SoundView's delegate | ||
| Returns the SoundView's display mode | ||
| Returns the SoundView's foreground gray |
| size:(int *)sampleCount | Returns the selection by reference |
| Returns whether the SoundView is in autoscaling mode | ||
| Returns whether the SoundView has a bezeled border | ||
| Returns whether the SoundView responds to mouse-dragged events | ||
| Returns whether the SoundView is enabled | ||
| Returns whether the SoundView is optimized for speedy display | ||
| Returns the SoundView's reduction factor | ||
| Returns the SoundView's Sound object. |
| Selecting and Editing the Sound Data |
| Copies the current selection to the pasteboard | ||
| Deletes the current selection | ||
| Deletes the current selection | ||
| Allows a selection to be defined | ||
| Replaces the current selection | ||
| Creates a selection over the SoundView's entire sound |
| Sets the selection |
| Returns whether the SoundView's data can be edited. | ||
| Sets whether the SoundView can be edited |
| Pasteboard and Services Support |
| *)pboardType |
| Places the SoundView's sound on the given pasteboard |
| Replaces the SoundView's current selection |
| andReturnType:(NXAtom)returnType | You never invoke this method |
| Places a copy of the SoundView's current selection | ||
| Modifying the Display Coordinates |
| Sets the SoundView's automatic scaling mode | ||
| Recomputes the size of the SoundView's frame |
| Drawing the Object |
| Displays the SoundView's sound data | ||
| Redisplays the given range of samples | ||
| Hides the SoundView's cursor | ||
| Displays the SoundView's cursor | ||
| Sets the width and height of the SoundView's frame |
| Responding to Events |
| Returns YES | ||
| Promotes the SoundView to first responder | ||
| Resigns the position of first responder |
| Performing the Sound Data |
| Returns whether the SoundView's sound can be played | ||
| Play the current selection | ||
| Replaces the SoundView's current selection | ||
| Pauses the current playback or recording | ||
| Resumes the current playback or recording | ||
| Stops the SoundView's current recording or playback | ||
| Returns the Sound object that's currently being played or recorded into |
| Archiving the Object |
| Unarchives the SoundView by reading it from stream | ||
| Archives the SoundView by writing it to stream |
| Accessing the Delegate |
| Used to redirect delegate messages | ||
| Used to redirect delegate messages | ||
| Used to redirect delegate messages | ||
| Sends theMessage to the SoundView's delegate | ||
| Used to redirect delegate messages | ||
| Used to redirect delegate messages |
| Delegate Methods |
| Sent to the delegate just after the SoundView is played. | ||
| Sent to the delegate just after the SoundView is recorded into. | ||
| Sent to the delegate if an error is encountered . | ||
| Sent to the delegate when the SoundView's selection changes. | ||
| Sent to the delegate when the SoundView's sound is edited | ||
| Sent to the delegate when the SoundView is freed. | ||
| Sent to the delegate just before the SoundView's sound is played. | ||
| Sent to the delegate just before the SoundView's sound is recorded into. |