mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
parent
847ebf667f
commit
bbb334abea
@ -47,11 +47,9 @@ PUBLISHED:
|
||||
* concept) to the seek position within a file. The value starts at 0.0 (the
|
||||
* default) and ends at the value given by the length() method.
|
||||
*
|
||||
* The current time position will not change while the sound is playing; you
|
||||
* must call play() again to effect the change. To play the same sound from
|
||||
* a time offset a second time, explicitly set the time position again. When
|
||||
* looping, the second and later loops will start from the beginning of the
|
||||
* sound.
|
||||
* In the past, this call did nothing if the sound was currently playing, and
|
||||
* it was necessary to call play() to effect the change. This is no longer
|
||||
* the case; the time change takes effect immediately.
|
||||
*
|
||||
* If a sound is playing, calling get_time() repeatedly will return different
|
||||
* results over time. e.g.
|
||||
|
@ -564,13 +564,18 @@ push_fresh_buffers() {
|
||||
}
|
||||
|
||||
/**
|
||||
* The next time you call play, the sound will start from the specified
|
||||
* offset.
|
||||
* Sets the offset within the sound. If the sound is currently playing, its
|
||||
* position is updated immediately.
|
||||
*/
|
||||
void OpenALAudioSound::
|
||||
set_time(PN_stdfloat time) {
|
||||
ReMutexHolder holder(OpenALAudioManager::_lock);
|
||||
_start_time = time;
|
||||
|
||||
if (is_playing()) {
|
||||
// Ensure that the position is updated immediately.
|
||||
play();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user