GluonAudio::Sound Class Reference
#include <sound.h>
List of all members.
Detailed Description
Definition at line 34 of file sound.h.
Constructor & Destructor Documentation
Sound::Sound |
( |
QObject * |
parent = 0 |
) |
|
Sound::Sound |
( |
const QString & |
soundFile, |
|
|
QObject * |
parent = 0 | |
|
) |
| | [explicit] |
This is the default constructor
- Parameters:
-
| soundFile | the path of the file to play |
Definition at line 73 of file sound.cpp.
Sound::Sound |
( |
Buffer * |
buffer, |
|
|
QObject * |
parent = 0 | |
|
) |
| | [explicit] |
This is the default constructor
- Parameters:
-
Definition at line 80 of file sound.cpp.
Sound::Sound |
( |
ALuint |
buffer, |
|
|
QObject * |
parent = 0 | |
|
) |
| | [explicit] |
This is the default constructor
- Parameters:
-
Definition at line 87 of file sound.cpp.
Member Function Documentation
ALfloat Sound::duration |
( |
|
) |
const |
ALfloat Sound::elapsedTime |
( |
|
) |
const |
- Returns:
- the time since the sound started playing
Definition at line 135 of file sound.cpp.
bool Sound::isLooping |
( |
|
) |
|
bool Sound::isPlaying |
( |
|
) |
|
QString GluonAudio::Sound::lastError |
( |
|
) |
const |
- Todo:
- this function isn't defined!
- Returns:
- the last error reported
void Sound::load |
( |
ALuint |
buffer |
) |
|
void Sound::load |
( |
Buffer * |
buffer |
) |
|
void Sound::load |
( |
const QString & |
soundFile |
) |
|
void Sound::pause |
( |
|
) |
[slot] |
ALfloat Sound::pitch |
( |
|
) |
const |
void Sound::play |
( |
|
) |
[slot] |
QVector3D Sound::position |
( |
|
) |
const |
- Returns:
- the coordinates of the sound postion relative to the listener
- See also:
- setPosition, x ,y ,z
Definition at line 169 of file sound.cpp.
ALfloat Sound::radius |
( |
|
) |
const |
void Sound::rewind |
( |
|
) |
[slot] |
If the sound was paused, this will rewind it so that next time play() is called, it will play from the start
Definition at line 250 of file sound.cpp.
void Sound::setDirection |
( |
ALfloat |
dx, |
|
|
ALfloat |
dy, |
|
|
ALfloat |
dz | |
|
) |
| | [slot] |
void Sound::setLoop |
( |
bool |
enabled = true |
) |
[slot] |
Makes the sound play in a loop when play() is called enabled
play in a loop if set to true
- See also:
- play
Definition at line 164 of file sound.cpp.
void Sound::setMaxVolume |
( |
ALfloat |
max = 10.0f |
) |
[slot] |
Specify the maximum index value of the volume,
- Parameters:
-
Definition at line 260 of file sound.cpp.
void Sound::setMinVolume |
( |
ALfloat |
min = 0.0f |
) |
[slot] |
Specify the minimum index value of the volume,
- Parameters:
-
Definition at line 255 of file sound.cpp.
void Sound::setPitch |
( |
ALfloat |
pitch = 1.0f |
) |
[slot] |
Specify the pitch to be applied, either at source, or on mixer results, at listener.
- Parameters:
-
| pitch | a value between 0.5 and 2.0 |
Definition at line 223 of file sound.cpp.
void Sound::setPosition |
( |
ALfloat |
x = 0.0 , |
|
|
ALfloat |
y = 0.0 , |
|
|
ALfloat |
z = 0.0 | |
|
) |
| | [slot] |
void Sound::setPosition |
( |
QVector3D |
position |
) |
[slot] |
Set the position of the sound relative to the listener. This is used to create 3D sounds using effects to alter the perception of the sound origin. The three scalars of the vector correspond to x, y and z in the coordinate system.
The OpenAL documentation defines the underlying variable as: "Specify the current location in three dimensional space. OpenAL, like OpenGL, uses a right handed coordinate system, where in a frontal default view x (thumb) points right, y points up (index finger), and z points towards the viewer/camera (middle finger). To switch from a left handed coordinate system, flip the sign on the Z coordinate. Listener position is always in the world coordinate system."
Definition at line 210 of file sound.cpp.
void Sound::setRadius |
( |
ALfloat |
radius = 10000.0f |
) |
[slot] |
Specify the distance from which the sound can no longer be heard
- Parameters:
-
Definition at line 229 of file sound.cpp.
void Sound::setTimePosition |
( |
ALfloat |
time |
) |
[slot] |
Specify the current time position.
- Parameters:
-
| time | must be inferior than duration. - See also:
- duration()
|
Definition at line 277 of file sound.cpp.
void Sound::setupSource |
( |
|
) |
[protected] |
void Sound::setVelocity |
( |
ALfloat |
vx, |
|
|
ALfloat |
vy, |
|
|
ALfloat |
vz | |
|
) |
| | [slot] |
void Sound::setVolume |
( |
ALfloat |
volume = 1.0f |
) |
[slot] |
Change the volume (volume amplification) applied
The OpenAL documentation defines the underlying variable as: "A value of 1.0 means un-attenuated/unchanged. Each division by 2 equals an attenuation of -6dB. Each multiplicaton with 2 equals an amplification of +6dB. A value of 0.0 is meaningless with respect to a logarithmic scale; it is interpreted as zero volume - the channel is effectively disabled."
- See also:
- volume
Definition at line 217 of file sound.cpp.
ALuint Sound::source |
( |
|
) |
const |
ALint Sound::status |
( |
|
) |
const |
- Returns:
- the sound status
Definition at line 142 of file sound.cpp.
void Sound::stop |
( |
|
) |
[slot] |
ALfloat Sound::volume |
( |
|
) |
const |
- Returns:
- the volume currently applied
- See also:
- setvolume
Definition at line 189 of file sound.cpp.
ALfloat Sound::x |
( |
|
) |
const |
- Returns:
- the x coordinate of the sound position relative to the listener
- See also:
- setPosition, y, z
Definition at line 174 of file sound.cpp.
ALfloat Sound::y |
( |
|
) |
const |
- Returns:
- the y coordinate of the sound position relative to the listener
- See also:
- setPosition, x, z
Definition at line 179 of file sound.cpp.
ALfloat Sound::z |
( |
|
) |
const |
- Returns:
- the z coordinate of the sound position relative to the listener
- See also:
- setPosition, x, y
Definition at line 184 of file sound.cpp.
The documentation for this class was generated from the following files: