PyJuggler.snx
index
/tmp/rpm/BUILD/PyJuggler-1.0.1-src/lib/python2.3/site-packages/PyJuggler/snx.so

PyJuggler.snx is an extension module written in Boost.Python that
exposes some C++ classes from the Sonix library.  The exposed classes
are those that tend to be of the most value for writing VR Juggler
application objects.
 
Refer to the Sonix and VR Juggler 2.0 C++ documentation for general
usage details:
   http://www.vrjuggler.org/sonix/docs.php
   http://www.vrjuggler.org/vrjuggler/docs.php

 
Classes
       
Boost.Python.instance(__builtin__.object)
SoundAPIInfo
SoundHandle
SoundImplementation
SoundInfo
sonix

 
class SoundAPIInfo(Boost.Python.instance)
    
Method resolution order:
SoundAPIInfo
Boost.Python.instance
__builtin__.object

Methods defined here:
__init__(...)

Properties defined here:
sampleRate
get = (...)
set = (...)
speakerConfig
get = (...)
set = (...)
voices
get = (...)
set = (...)

Data and other attributes defined here:
SampleRate = <class '__main__.PyJuggler.snx.SampleRate'>
SpeakerConfig = <class '__main__.PyJuggler.snx.SpeakerConfig'>
__instance_size__ = 20

Data and other attributes inherited from Boost.Python.instance:
__dict__ = <dictproxy object>
__new__ = <built-in method __new__ of Boost.Python.class object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
__weakref__ = <member '__weakref__' of 'Boost.Python.instance' objects>

 
class SoundHandle(Boost.Python.instance)
    A handle to a Sonix sound.  This is a convenient handle to a
sound, and it is the interface to using individual sounds in
Sonix.  Use configure() and remove() to manage the memory of a
sound handle.  Memory leaks could occur if remove() is not called.
This is because there may be more than one handle to a sound.
 
Note:
You may have to call snx.sonix.instance().changeAPI() to switch to
the sound API you want to use (such as OpenAL or AudioWorks).
 
 
Method resolution order:
SoundHandle
Boost.Python.instance
__builtin__.object

Methods defined here:
__init__(...)
__init__()
Default constructor.  Call init() after constructing to name
this handle.
 
Post-conditions:
This sound handle is not associated with any nae.  init() must
be called to assign a name to this handle.
 
__init__(name)
Name constructor.  This assigns the given name to this sound
handle.  This name is what is used in all snx.sonix class
calls.  (snx.SoundHandle is a wrapper for snx.sonix.)
 
Post-conditions:
This sound handle is associated with the given name, and there
is no need to call init().
configure(...)
configure(description)
Configures/reconfigures the sound by associating sound data
with this handle.  Afterwards, this sound handle can be used
to operate on this sound data.
 
Configure: associate a name (alias) with the description if
not already done.
Reconfigure: change properties of the sound to the description
provided.
 
Pre-condition:
Provide a snx.SoundInfo that describes the sound.
 
Post-condition:
This handle will point to loaded sound data.
 
Arguments:
description -- A snx.SoundInfo object that describes the sound
               for which this object will be a handle.
getListenerPosition(...)
getListenerPosition(matrix)
Gets the listeners's 3D position.
 
Arguments:
matrix -- A gmtl.Matrix44f object used to store the position
          of the listener.
getName(...)
getName() -> string object.
Gets the name of this handle.
getPosition(...)
getPosition() -> tuple
Gets the sound's 3D position.
 
Returns:
A tuple of floating-point values providing the (x, y, z)
position of the sound.
init(...)
init(uniqueName)
Initializes the name of this sound with the given name.  If
this name has not been configured before, then configure() must
be invoked on this handle after calling init().
isAmbient(...)
isAmbient() -> Boolean
Is the sound ambient?
isPaused(...)
isPaused() -> Boolean
If the sound is paused, then return True.
isPlaying(...)
isPlaying() -> Boolean
Is the sound currently playing?
isRetriggerable(...)
isRetriggerable() -> Boolean
Is the sound retriggerable?
pause(...)
pause()
Pauses the sound.  Use unpause() to return playback from where
the sound was paused.
remove(...)
remove()
Removes a configured sound.  Any future reference to the alias
will not cause an error, but it will not result in a rendered
sound.
setAmbient(...)
setAmbient(ambient)
Sets the sound as either ambient or positional depending on the
value of the given argument.  If the sound is ambient, it is
attached to the listener, and its volume does not change when
the listener moves.  If the sound is positional, the volume
changes when the listener moves.
 
Arguments:
ambient -- A Boolean flag identifying whether this sound is
           ambient (True) or positional (False).
 
setAmbient()
Sets the sound as being positional.
setCutoff(...)
setCutoff(amount)
Sets the effect cutoff.  Set to a value in the range [0,1].
 
Arguments:
amount -- A floating-point value that determines the cutoff.
          The value must be between 0.0 and 1.0 inclusive.
          1.0 means no change; 0.0 is total cutoff.
setListenerPosition(...)
setListenerPosition(matrix)
Sets the position of the listener.
 
Arguments:
matrix -- A gmtl.Matrix44f object representing the position
          of the listener.
setPitchBend(...)
setPitchBend(amount)
Alters the frequency of the sample.
 
Arguments:
amount -- A floating-point value that determines the pitch
          bend.  1.0 means that there is no change.  A value
          less than 1.0 is low; a value greather than 1.0 is
          high.
setPosition(...)
setPosition(x, y, z)
Sets the sound's three-dimensional position.
 
Arguments:
x -- The X coordinate of the sound in 3D OpenGL coordinates.
y -- The Y coordinate of the sound in 3D OpenGL coordinates.
z -- The Z coordinate of the sound in 3D OpenGL coordinates.
setRetriggerable(...)
setRetriggerable(onOff)
Specifies whether the sound retriggers from the beginning when
triggered while playing.  In other words, when the sound is
already playing and trigger() is called, does the sound
restart from the beginning?
 
Arguments:
onOff -- A Boolean value enabling or disabling retriggering.
setVolume(...)
setVolume(amount)
Sets the effect volume.  The value must be in the range [0,1].
 
Argument:
amount -- A floating-point value that determines the volume.
          It must be between 0.0 and 1.0 inclusive.
stop(...)
stop()
Stops the sound.
trigger(...)
trigger(repeat)
Triggers a sound.
 
Pre-condition:
This object does not have to be a sound.
 
Post-condition:
If this object is a sound, then the loaded sound is triggered.
If this object is not a sound, then nothing happens.
 
Arguments:
repeat -- Number of times to play.  Use -1 to repeat forever.
 
trigger()
Triggers a sound once.
unpause(...)
unpause()
Resumes playback from a paused state.  This does nothing if the
sound was not paused.

Data and other attributes defined here:
__instance_size__ = 24

Data and other attributes inherited from Boost.Python.instance:
__dict__ = <dictproxy object>
__new__ = <built-in method __new__ of Boost.Python.class object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
__weakref__ = <member '__weakref__' of 'Boost.Python.instance' objects>

 
class SoundImplementation(Boost.Python.instance)
    
Method resolution order:
SoundImplementation
Boost.Python.instance
__builtin__.object

Methods defined here:
__init__(...)
__init__()
Default constructor.
bind(...)
bind(alias)
Loads/allocates the sound data this alias refers to in the
sound API.
 
Post-condition:
The sound API has the sound buffered.
 
Arguments:
alias -- The alias of the sound data to be bound.
bindAll(...)
bindAll()
Bind: load (or reload) all associated sounds.
 
Post-condition:
All sound associations are buffered by the sound API.
clear(...)
clear()
Clears all associations.
 
Post-conditions:
Any existing aliases will be stubbed.  Sounds will be unbound.
clone(...)
clone(newCopy)
Every implementation can return a new copy of itself.
configure(...)
configure(alais, description)
Configures/reconfigures the named sound by associating sound
data with the named sound.  Afterwards, the alias can be used
to operate on sound data.
 
Configure: associate a name (alias) with the description if
not already done.
Reconfigure: change properties of the sound to the description
provided.
 
Pre-condition:
Provide a snx.SoundInfo that describes the sound.
 
Post-condition:
This handle will point to loaded sound data.
 
Arguments:
alias       -- The alias of the sound to be associated with the
               given sound data.
description -- A snx.SoundInfo object that describes the sound
               for which this object will be a handle.
copy(...)
copy(si)
Copies the current state of the system from the given API into
this object.  This does not perform any binding.  That must be
done separately.
 
Arguments:
si -- A snx.SoundImplementation object from which the state
      will be copied into this object.
getListenerPosition(...)
getListenerPosition(matrix)
Gets the listeners's 3D position.
 
Arguments:
matrix -- A gmtl.Matrix44f object used to store the position
          of the listener.
getPosition(...)
getPosition(alias) -> tuple
Gets the named sound's 3D position.
 
Arguments:
alias  -- The alias of the sound to change.
 
Returns:
A tuple of floating-point values providing the (x, y, z)
position of the named sound.
isAmbient(...)
isAmbient(alias) -> Boolean
Is the named sound ambient?
 
Arguments:
alias -- The name of the sound to query.
isPaused(...)
isPaused(alias) -> Boolean
If the sound is paused, then return True.
 
Arguments:
alias -- The alias of the sound to query.
isPlaying(...)
isPlaying(alias) -> Boolean
Is the named sound currently playing?
 
Arguments:
alias -- The alias of the sound to query.
isRetriggerable(...)
isRetriggerable(alais) -> Boolean
Is the named sound retriggerable?
 
Arguments:
alias -- The alias of the sound to query.
isStarted(...)
isStarted() -> Boolean
Queries whether the API has been started.
 
Returns:
True if the API has been started, False otherwise.
lookup(...)
name(...)
pause(...)
pause(alias)
Pauses the sound.  Use unpause() to return playback from where
the sound was paused.
 
Arguments:
alias -- The alias of the sound to pause.
remove(...)
remove(alias)
Removes a configured sound.  Any future reference to the alias
will not cause an error, but it will not result in a rendered
sound.
 
Arguments:
alias -- The alias of the sound to remove.
setAmbient(...)
setAmbient(alias, ambient)
Sets the named sound as either ambient or positional depending
on the value of the given argument.  If the sound is ambient,
it is attached to the listener, and its volume does not change
when the listener moves.  If the sound is positional, the
volume changes when the listener moves.
 
Arguments:
alias   -- The alias of the sound to change
ambient -- A Boolean flag identifying whether this sound is
           ambient (True) or positional (False).
 
setAmbient(alias)
Sets the sound as being positional.
 
Arguments:
alias -- The alias of the sound to change
setCutoff(...)
setCutoff(alias, amount)
Sets the effect cutoff of the named sound.  Set to a value in
the range [0,1].
 
Arguments:
alias  -- The alias of the sound to change.
amount -- A floating-point value that determines the cutoff.
          The value must be between 0.0 and 1.0 inclusive.
          1.0 means no change; 0.0 is total cutoff.
setListenerPosition(...)
setListenerPosition(matrix)
Sets the position of the listener.
 
Arguments:
matrix -- A gmtl.Matrix44f object representing the position
          of the listener.
setName(...)
setPitchBend(...)
setPitchBend(alias, amount)
Alters the frequency of the named sound.
 
Arguments:
alias  -- The alias of the sound to change.
amount -- A floating-point value that determines the pitch
          bend.  1.0 means that there is no change.  A value
          less than 1.0 is low; a value greather than 1.0 is
          high.
setPosition(...)
setPosition(alias, x, y, z)
Sets the named sound's three-dimensional position.
 
Arguments:
alias -- The alias of the sound to change.
x     -- The X coordinate of the sound in 3D OpenGL coordinates.
y     -- The Y coordinate of the sound in 3D OpenGL coordinates.
z     -- The Z coordinate of the sound in 3D OpenGL coordinates.
setRetriggerable(...)
setRetriggerable(alias, onOff)
Specifies whether the named sound retriggers from the beginning
when triggered while playing.  In other words, when the named
sound is already playing and trigger() is called, does the
sound restart from the beginning?
 
Arguments:
alias -- The alias of the sound to change.
onOff -- A Boolean value enabling or disabling retriggering.
setVolume(...)
setVolume(alias, amount)
Sets the effect volume of the named sound.  The value must be
in the range [0,1].
 
Argument:
alias  -- The alias of the sound to change.
amount -- A floating-point value that determines the volume.
          It must be between 0.0 and 1.0 inclusive.
shutdownAPI(...)
shutdownAPI()
Kills the sound API, deallocating any sounds, etc.  This
function could be called any time.  The function could be
called multiple times, so it should be smart.
 
Post-condition:
The sound API is no longer running or available for use.
startAPI(...)
startAPI() -> integer
Starts the sound API, creating any contexts or other
configurations at startup.  This function should be callled
before using the other functions in the class.
 
Post-condition:
Sound APi is ready to go.
 
Returns:
1 if success, 0 otherwise.
step(...)
step(timeElapsed)
Call once per sound frame (which does not have to be the same
as the graphics frame).
 
Arguments:
timeElapsed -- A floating-point value giving the time elapsed
               since the last sound frame.
stop(...)
stop(alias)
Stops the named sound.
 
Arguments:
alias -- The alias of the sound to stop.
trigger(...)
trigger(alias, repeat)
Triggers a sound.
 
Pre-condition:
alias does not have to be associated with a loaded sound.
 
Post-condition:
If allias is associated with a loaded sound, then the loaded
sound is triggered.  If not, nothing happens.
 
Arguments:
alias  -- Alias of the sound to trigger.
repeat -- The number of times to play.  Use -1 to repeat
 
          forever.
 
trigger(alias)
Triggers a sound once.
unbind(...)
unbind(alias)
Unloads/deallocates the sound data this alias refers to in the
sound API.
 
Post-condition:
The sound API no longer has the sound buffered.
 
Arguments:
alias -- The alias of the sound data to be unbound.
unbindAll(...)
unbindAll()
Unbind: unload/deallocate all associated sounds.
 
Post-conditions:
All sound associations are unbuffered by the sound API.
unpause(...)
unpause(alias)
Resumes playback of the named sound from a paused state.  This
does nothing if the sound was not paused.
 
Arguments:
alias -- The alias of the sound to unpause.

Data and other attributes defined here:
__instance_size__ = 124

Data and other attributes inherited from Boost.Python.instance:
__dict__ = <dictproxy object>
__new__ = <built-in method __new__ of Boost.Python.class object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
__weakref__ = <member '__weakref__' of 'Boost.Python.instance' objects>

 
class SoundInfo(Boost.Python.instance)
    Informational type that describes one sound entry.  Typically, user
code will fill in the properties of an instance and pass it to a
snx.SoundHandle object to configure the sound.
 
 
Method resolution order:
SoundInfo
Boost.Python.instance
__builtin__.object

Methods defined here:
__init__(...)

Properties defined here:
alias
get = (...)
set = (...)
ambient
get = (...)
set = (...)
cutoff
get = (...)
set = (...)
datasource
get = (...)
set = (...)
filename
get = (...)
set = (...)
pitchbend
get = (...)
set = (...)
position
get = (...)
set = (...)
repeat
get = (...)
set = (...)
retriggerable
get = (...)
set = (...)
streaming
get = (...)
set = (...)
volume
get = (...)
set = (...)

Data and other attributes defined here:
DataSource = <class '__main__.PyJuggler.snx.DataSource'>
__instance_size__ = 60

Data and other attributes inherited from Boost.Python.instance:
__dict__ = <dictproxy object>
__new__ = <built-in method __new__ of Boost.Python.class object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
__weakref__ = <member '__weakref__' of 'Boost.Python.instance' objects>

 
class sonix(Boost.Python.instance)
    
Method resolution order:
sonix
Boost.Python.instance
__builtin__.object

Methods defined here:
changeAPI(...)
changeAPI(apiName)
Changes the underlying sound API to something else.  This
function is safe.  It always changes to a valid implementation.
It runs in O(1) (constant) time.
 
Pre-condition:
The named sound implementation should be registered.
 
Post-condition:
The underlying API is chagned to the named API.  If apiName's
implementation is not registered, then the underlying API is
changed to the stub version.
 
Arguments:
apiName -- Usually a name of a valid, registered sound API
           implementation.
configure(...)
configure(alais, description)
Configures/reconfigures the named sound by associating sound
data with the named sound.  Afterwards, the alias can be used
to operate on sound data.
 
Configure: associate a name (alias) with the description if
not already done.
Reconfigure: change properties of the sound to the description
provided.
 
Pre-condition:
Provide a snx.SoundInfo that describes the sound.
 
Post-condition:
This handle will point to loaded sound data.
 
Arguments:
alias       -- The alias of the sound to be associated with the
               given sound data.
description -- A snx.SoundInfo object that describes the sound
               for which this object will be a handle.
getListenerPosition(...)
getListenerPosition(matrix)
Gets the listeners's 3D position.
 
Arguments:
matrix -- A gmtl.Matrix44f object used to store the position
          of the listener.
getPosition(...)
getPosition(alias) -> tuple
Gets the named sound's 3D position.
 
Arguments:
alias  -- The alias of the sound to change.
 
Returns:
A tuple of floating-point values providing the (x, y, z)
position of the named sound.
isAmbient(...)
isAmbient(alias) -> Boolean
Is the named sound ambient?
 
Arguments:
alias -- The name of the sound to query.
isPaused(...)
isPaused(alias) -> Boolean
If the sound is paused, then return True.
 
Arguments:
alias -- The alias of the sound to query.
isPlaying(...)
isPlaying(alias) -> Boolean
Is the named sound currently playing?
 
Arguments:
alias -- The alias of the sound to query.
isRetriggerable(...)
isRetriggerable(alais) -> Boolean
Is the named sound retriggerable?
 
Arguments:
alias -- The alias of the sound to query.
pause(...)
pause(alias)
Pauses the sound.  Use unpause() to return playback from where
the sound was paused.
 
Arguments:
alias -- The alias of the sound to pause.
remove(...)
remove(alias)
Removes a configured sound.  Any future reference to the alias
will not cause an error, but it will not result in a rendered
sound.
 
Arguments:
alias -- The alias of the sound to remove.
setAmbient(...)
setAmbient(alias, ambient)
Sets the named sound as either ambient or positional depending
on the value of the given argument.  If the sound is ambient,
it is attached to the listener, and its volume does not change
when the listener moves.  If the sound is positional, the
volume changes when the listener moves.
 
Arguments:
alias   -- The alias of the sound to change
ambient -- A Boolean flag identifying whether this sound is
           ambient (True) or positional (False).
 
setAmbient(alias)
Sets the sound as being positional.
 
Arguments:
alias -- The alias of the sound to change
setCutoff(...)
setCutoff(alias, amount)
Sets the effect cutoff of the named sound.  Set to a value in
the range [0,1].
 
Arguments:
alias  -- The alias of the sound to change.
amount -- A floating-point value that determines the cutoff.
          The value must be between 0.0 and 1.0 inclusive.
          1.0 means no change; 0.0 is total cutoff.
setListenerPosition(...)
setListenerPosition(matrix)
Sets the position of the listener.
 
Arguments:
matrix -- A gmtl.Matrix44f object representing the position
          of the listener.
setPitchBend(...)
setPitchBend(alias, amount)
Alters the frequency of the named sound.
 
Arguments:
alias  -- The alias of the sound to change.
amount -- A floating-point value that determines the pitch
          bend.  1.0 means that there is no change.  A value
          less than 1.0 is low; a value greather than 1.0 is
          high.
setPosition(...)
setPosition(alias, x, y, z)
Sets the named sound's three-dimensional position.
 
Arguments:
alias -- The alias of the sound to change.
x     -- The X coordinate of the sound in 3D OpenGL coordinates.
y     -- The Y coordinate of the sound in 3D OpenGL coordinates.
z     -- The Z coordinate of the sound in 3D OpenGL coordinates.
setRetriggerable(...)
setRetriggerable(alias, onOff)
Specifies whether the named sound retriggers from the beginning
when triggered while playing.  In other words, when the named
sound is already playing and trigger() is called, does the
sound restart from the beginning?
 
Arguments:
alias -- The alias of the sound to change.
onOff -- A Boolean value enabling or disabling retriggering.
setVolume(...)
setVolume(alias, amount)
Sets the effect volume of the named sound.  The value must be
in the range [0,1].
 
Argument:
alias  -- The alias of the sound to change.
amount -- A floating-point value that determines the volume.
          It must be between 0.0 and 1.0 inclusive.
step(...)
step(timeElapsed)
Call once per sound frame (which does not have to be the same
as the graphics frame).
 
Arguments:
timeElapsed -- A floating-point value giving the time elapsed
               since the last sound frame.
stop(...)
stop(alias)
Stops the named sound.
 
Arguments:
alias -- The alias of the sound to stop.
trigger(...)
trigger(alias, repeat)
Triggers a sound.
 
Pre-condition:
alias does not have to be associated with a loaded sound.
 
Post-condition:
If allias is associated with a loaded sound, then the loaded
sound is triggered.  If not, nothing happens.
 
Arguments:
alias  -- Alias of the sound to trigger.
repeat -- The number of times to play.  Use -1 to repeat
 
          forever.
 
trigger(alias)
Triggers a sound once.
unpause(...)
unpause(alias)
Resumes playback of the named sound from a paused state.  This
does nothing if the sound was not paused.
 
Arguments:
alias -- The alias of the sound to unpause.

Static methods defined here:
instance(...)
instance() -> snx.sonix object
Retruns the singleton snx.sonix object.

Data and other attributes defined here:
__init__ = <built-in function __init__>
Raises an exception
This class cannot be instantiated from Python

Data and other attributes inherited from Boost.Python.instance:
__dict__ = <dictproxy object>
__new__ = <built-in method __new__ of Boost.Python.class object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
__weakref__ = <member '__weakref__' of 'Boost.Python.instance' objects>