Up
Authors
- Enrico Sersale (
enrico@imago.ro
)
-
Load, manipulate and play sounds
Copyright: (C) 2002, 2009 Free Software Foundation, Inc.
- Declared in:
- AppKit/NSSound.h
- Conforms to:
- NSCoding
- NSCopying
Availability: OpenStep
Description forthcoming.
Instance Variables
Method summary
+ (BOOL)
canInitWithPasteboard: (
NSPasteboard*)pasteboard;
Availability: OpenStep
Description forthcoming.
+ (id)
soundNamed: (
NSString*)name;
Availability: OpenStep
Description forthcoming.
+ (
NSArray*)
soundUnfilteredFileTypes;
Availability: OpenStep
Provides an array of file types that NSSound can
understand. The returning array may be directly
passed to [NSOpenPanel -runModalForTypes:].
Built with libsndfile:
wav, aiff, aifc, aif, au, snd, mat, mat4, mat5, paf,
sf, voc, w64, xi, caf, sd2, flac, ogg, oga
Built without libsndfile:
wav, aiff, aifc, aif, au, snd
+ (
NSArray*)
soundUnfilteredPasteboardTypes;
Availability: OpenStep
Description forthcoming.
+ (
NSArray*)
soundUnfilteredTypes;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (
NSArray*)
channelMapping;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (
NSTimeInterval)
currentTime;
Availability: MacOS-X 10.5.0
Returns the current position of the audio playback.
- (id)
delegate;
Availability: OpenStep
Returns the receiver's delegate
- (
NSTimeInterval)
duration;
Availability: MacOS-X 10.5.0
Returns the length, in seconds, of the receiver.
- (id)
initWithContentsOfFile: (
NSString*)path
byReference: (BOOL)byRef;
Availability: OpenStep
This is a designated initialiser for the class.
Initalizes the receiver object with the contents
of file located at
path. If
byRef
is set to
YES
only the name of the NSSound
is encoded with
-encodeWithCoder:
; if set to
NO
the data is encoded.
See Also:
- (id)
initWithContentsOfURL: (
NSURL*)url
byReference: (BOOL)byRef;
Availability: OpenStep
This is a designated initialiser for the class.
Initializes the receiver object with the
contents of the data located in
url. If
byRef is set to
YES
only the
name of the NSSound is encoded with
-encodeWithCoder:
; if set to
NO
the data is encoded.
See Also:
- (id)
initWithData: (
NSData*)data;
Availability: OpenStep
This is a designated initialiser for the class.
Initializes the receiver object with the
contents of
data with a valid magic
number.
See Also:
- (id)
initWithPasteboard: (
NSPasteboard*)pasteboard;
Availability: OpenStep
Description forthcoming.
- (BOOL)
isPlaying;
Availability: OpenStep
Description forthcoming.
- (BOOL)
loops;
Availability: MacOS-X 10.5.0
Returns the current loop property of the receiver.
YES
indicates this NSSound will restart
once it reaches the end, otherwise NO
.
- (
NSString*)
name;
Availability: OpenStep
Returns the name of the receiver. Use
-setName:
to set the name.
- (BOOL)
pause;
Availability: OpenStep
Pauses audio playback.
Returns NO
if receiver could not be
paused or is already paused, and YES
if receiver was successfully paused.
- (BOOL)
play;
Availability: OpenStep
Start audio playback. Playback is done
asynchronously.
Returns NO
if receiver is already
playing or if an error occurred, and
YES
if receiver was started
successfully.
- (
NSString*)
playbackDeviceIdentifier;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (BOOL)
resume;
Availability: OpenStep
Resume audio playback after a
-pause
.
Returns NO
if receiver is already
playing or if an error occurred, and
YES
if receiver was successfully
restarted/resumed.
- (void)
setChannelMapping: (
NSArray*)channelMapping;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (void)
setCurrentTime: (
NSTimeInterval)currentTime;
Availability: MacOS-X 10.5.0
Sets the current time of the audio playback.
- (void)
setDelegate: (id)aDelegate;
Availability: OpenStep
Sets the receiver's delegate
- (void)
setLoops: (BOOL)loops;
Availability: MacOS-X 10.5.0
Sets the loop property of the receiver.
YES
indicates this NSSound will restart
once it reaches the end, otherwise NO
.
- (BOOL)
setName: (
NSString*)aName;
Availability: OpenStep
Sets the receiver's name. Method
-name
will return
aName.
- (void)
setPlaybackDeviceIdentifier: (
NSString*)playbackDeviceIdentifier;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (void)
setVolume: (float)volume;
Availability: MacOS-X 10.5.0
Sets the volume of the receiver. Volume
must be between 0.0 and 1.0.
- (BOOL)
stop;
Availability: OpenStep
Stop audio playback.
Return YES
if receiver was
successfully stopped.
This method will close the playback device.
- (float)
volume;
Availability: MacOS-X 10.5.0
Returns the volume of the receiver. Volume will be
between 0.0 and 1.0.
- (void)
writeToPasteboard: (
NSPasteboard*)pasteboard;
Availability: OpenStep
Description forthcoming.
Instance Variables for NSSound Class
@protected NSArray* _channelMapping;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSData* _data;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id _delegate;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSString* _name;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected BOOL _onlyReference;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSString* _playbackDeviceIdentifier;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSLock* _playbackLock;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSConditionLock* _readLock;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected BOOL _shouldLoop;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected BOOL _shouldStop;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id _sink;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id _source;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
- Declared in:
- AppKit/NSSound.h
Availability: OpenStep
Description forthcoming.
Method summary
- (
NSString*)
pathForSoundResource: (
NSString*)name;
Availability: OpenStep
Description forthcoming.
- Declared in:
- AppKit/NSSound.h
Availability: OpenStep
Description forthcoming.
Method summary
- (void)
sound: (
NSSound*)sound
didFinishPlaying: (BOOL)aBool;
Availability: OpenStep
Method called when sound has finished
playing. Currently this method is not called.
Up