|
ObjectAL
2.1
ObjectAL API Reference (iOS) for Kobold2D developers
|
A context encompasses a single listener and a series of sources. More...
#include <ALContext.h>
Public Member Functions | |
| id | initOnDevice:outputFrequency:refreshIntervals:synchronousContext:monoSources:stereoSources: (ALDevice *device,[outputFrequency] int outputFrequency,[refreshIntervals] int refreshIntervals,[synchronousContext] bool synchronousContext,[monoSources] int monoSources,[stereoSources] int stereoSources) |
| Initialize this context on the specified device with attributes. | |
| id | initOnDevice:attributes: (ALDevice *device,[attributes] NSArray *attributes) |
| Initialize this context for the specified device and attributes. | |
| void | process () |
| Process this context. | |
| void | stopAllSounds () |
| Stop all sound sources in this context. | |
| void | clearBuffers () |
| Clear all buffers being used by sources in this context. | |
| void | ensureContextIsCurrent () |
| Make sure this context is the current context. | |
| bool | isExtensionPresent: (NSString *name) |
| Check if the specified extension is present in this context. | |
| void * | getProcAddress: (NSString *functionName) |
| Get the address of the specified procedure (C function address). | |
| void | notifySourceInitializing: (ALSource *source) |
| (INTERNAL USE) Used by ALSource to announce initialization. | |
| void | notifySourceDeallocating: (ALSource *source) |
| (INTERNAL USE) Used by ALSource to announce deallocation. | |
Static Public Member Functions | |
| id | contextOnDevice:attributes: (ALDevice *device,[attributes] NSArray *attributes) |
| Create a new context on the specified device. | |
| id | contextOnDevice:outputFrequency:refreshIntervals:synchronousContext:monoSources:stereoSources: (ALDevice *device,[outputFrequency] int outputFrequency,[refreshIntervals] int refreshIntervals,[synchronousContext] bool synchronousContext,[monoSources] int monoSources,[stereoSources] int stereoSources) |
| Create a new context on the specified device with attributes. | |
Protected Attributes | |
| NSMutableArray * | sources |
| All sound sources associated with this context. | |
| bool | suspended |
| If YES, this object is suspended. | |
| NSMutableArray * | attributes |
| This context's attributes. | |
| OALSuspendHandler * | suspendHandler |
| Handles suspending and interrupting for this object. | |
Properties | |
| NSString * | alVersion |
| OpenAL version string in format “[spec major number]. | |
| NSArray * | attributes |
| The current context's attribute list. | |
| ALCcontext * | context |
| The OpenAL context pointer. | |
| ALDevice * | device |
| The device this context was opened on. | |
| ALenum | distanceModel |
| The current distance model. | |
| float | dopplerFactor |
| Exaggeration factor for Doppler effect. | |
| NSArray * | extensions |
| List of available extensions (NSString*). | |
| ALListener * | listener |
| This context's listener. | |
| NSString * | renderer |
| Information about the specific renderer. | |
| NSArray * | sources |
| All sources associated with this context (ALSource*). | |
| float | speedOfSound |
| Speed of sound in same units as velocities. | |
| NSString * | vendor |
| Name of the vendor. | |
A context encompasses a single listener and a series of sources.
A context is created from a device, and many contexts may be created (though multiple contexts would be unusual in an iOS app).
Note: Some property values are only valid if this context is the current context.
| void ALContext::clearBuffers | ( | ) | [virtual] |
Clear all buffers being used by sources in this context.
| id ALContext::contextOnDevice:attributes: | ( | ALDevice * | device, |
| [attributes] NSArray* | attributes | ||
| ) | [static, virtual] |
Create a new context on the specified device.
| device | The device to open the context on. |
| attributes | An array of NSNumber in ordered pairs (attribute id followed by integer value). Posible attributes: ALC_FREQUENCY, ALC_REFRESH, ALC_SYNC, ALC_MONO_SOURCES, ALC_STEREO_SOURCES |
| id ALContext::contextOnDevice:outputFrequency:refreshIntervals:synchronousContext:monoSources:stereoSources: | ( | ALDevice* | device, |
| [outputFrequency] int | outputFrequency, | ||
| [refreshIntervals] int | refreshIntervals, | ||
| [synchronousContext] bool | synchronousContext, | ||
| [monoSources] int | monoSources, | ||
| [stereoSources] int | stereoSources | ||
| ) | [static, virtual] |
Create a new context on the specified device with attributes.
| device | The device to open the context on. |
| outputFrequency | The frequency to mix all sources to before outputting (ignored by iOS). |
| refreshIntervals | The number of passes per second used to mix the audio sources. For games this can be 5-15. For audio intensive apps, it should be higher (ignored by iOS). |
| synchronousContext | If true, this context runs on the main thread and depends on you calling alcUpdateContext (ignored by iOS). |
| monoSources | A hint indicating how many sources should support mono (default 28 on iOS). |
| stereoSources | A hint indicating how many sources should support stereo (default 4 on iOS). |
| void ALContext::ensureContextIsCurrent | ( | ) | [virtual] |
Make sure this context is the current context.
This method is used to work around iOS 4.0 and 4.2 bugs that could cause the context to be lost.
| void * ALContext::getProcAddress: | ( | NSString* | functionName | ) | [virtual] |
Get the address of the specified procedure (C function address).
Only valid when this is the current context.
Note: The OpenAL implementation is free to return a pointer even if it is not valid for this context. Always call isExtensionPresent first.
| functionName | the name of the procedure to get. |
| id ALContext::initOnDevice:attributes: | ( | ALDevice * | device, |
| [attributes] NSArray* | attributes | ||
| ) | [virtual] |
Initialize this context for the specified device and attributes.
| device | The device to open the context on. |
| attributes | An array of NSNumber in ordered pairs (attribute id followed by integer value). Posible attributes: ALC_FREQUENCY, ALC_REFRESH, ALC_SYNC, ALC_MONO_SOURCES, ALC_STEREO_SOURCES |
| id ALContext::initOnDevice:outputFrequency:refreshIntervals:synchronousContext:monoSources:stereoSources: | ( | ALDevice* | device, |
| [outputFrequency] int | outputFrequency, | ||
| [refreshIntervals] int | refreshIntervals, | ||
| [synchronousContext] bool | synchronousContext, | ||
| [monoSources] int | monoSources, | ||
| [stereoSources] int | stereoSources | ||
| ) | [virtual] |
Initialize this context on the specified device with attributes.
| device | The device to open the context on. |
| outputFrequency | The frequency to mix all sources to before outputting (ignored by iOS). |
| refreshIntervals | The number of passes per second used to mix the audio sources. For games this can be 5-15. For audio intensive apps, it should be higher (ignored by iOS). |
| synchronousContext | If true, this context runs on the main thread and depends on you calling alcUpdateContext (ignored by iOS). |
| monoSources | A hint indicating how many sources should support mono (default 28 on iOS). |
| stereoSources | A hint indicating how many sources should support stereo (default 4 on iOS). |
| bool ALContext::isExtensionPresent: | ( | NSString* | name | ) | [virtual] |
Check if the specified extension is present in this context.
Only valid when this is the current context.
| name | The name of the extension to check. |
| void ALContext::notifySourceDeallocating: | ( | ALSource* | source | ) | [virtual] |
(INTERNAL USE) Used by ALSource to announce deallocation.
| source | the source that is deallocating. |
| void ALContext::notifySourceInitializing: | ( | ALSource* | source | ) | [virtual] |
(INTERNAL USE) Used by ALSource to announce initialization.
| source | the source that is initializing. |
| void ALContext::process | ( | ) | [virtual] |
Process this context.
| void ALContext::stopAllSounds | ( | ) | [virtual] |
Stop all sound sources in this context.
NSMutableArray* ALContext::attributes [protected] |
This context's attributes.
NSMutableArray* ALContext::sources [protected] |
All sound sources associated with this context.
bool ALContext::suspended [protected] |
If YES, this object is suspended.
Reimplemented from <OALSuspendManager>.
OALSuspendHandler* ALContext::suspendHandler [protected] |
Handles suspending and interrupting for this object.
NSString * ALContext::alVersion [read, assign] |
OpenAL version string in format “[spec major number].
[spec minor number] [optional vendor version information]” Only valid when this is the current context.
NSArray* ALContext::attributes [read, assign] |
The current context's attribute list.
Only valid when this is the current context.
ALCcontext * ALContext::context [read, assign] |
The OpenAL context pointer.
ALDevice * ALContext::device [read, assign] |
The device this context was opened on.
ALenum ALContext::distanceModel [read, write, assign] |
The current distance model.
Legal values are AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED, AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED, AL_EXPONENT_DISTANCE, and AL_EXPONENT_DISTANCE_CLAMPED. See the OpenAL spec for detailed information.
Only valid when this is the current context.
float ALContext::dopplerFactor [read, write, assign] |
Exaggeration factor for Doppler effect.
Only valid when this is the current context.
NSArray * ALContext::extensions [read, assign] |
List of available extensions (NSString*).
Only valid when this is the current context.
ALListener * ALContext::listener [read, assign] |
This context's listener.
NSString * ALContext::renderer [read, assign] |
Information about the specific renderer.
Only valid when this is the current context.
NSArray* ALContext::sources [read, assign] |
All sources associated with this context (ALSource*).
float ALContext::speedOfSound [read, write, assign] |
Speed of sound in same units as velocities.
Only valid when this is the current context.
NSString * ALContext::vendor [read, assign] |
Name of the vendor.
Only valid when this is the current context.