diff options
author | Stijn Buys <ingar@osirion.org> | 2010-10-09 22:05:46 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-10-09 22:05:46 +0000 |
commit | 43927cc52bdd7e44d62b0e6309612558f565b70f (patch) | |
tree | a3e9ccf69d6ab03c8444b78ac53d49529a52e675 /src/audio/audio.cc | |
parent | 0ecdd8bc98ba583bbee801b838d785c6f881d7df (diff) |
fix crash introduced with inventory transfer, buywindow credits indicator,
removed impulse drive initialization delay.
Diffstat (limited to 'src/audio/audio.cc')
-rw-r--r-- | src/audio/audio.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc index b7a79d7..46d3a67 100644 --- a/src/audio/audio.cc +++ b/src/audio/audio.cc @@ -212,4 +212,16 @@ void update_source(size_t source_index, math::Vector3f const & location, math::V alSourcef(source, AL_GAIN, gain); } +bool is_playing(const size_t source_index) +{ + if (!audio_context) + return false; + + ALuint source = Sources::source(source_index); + ALint srcstate = 0; + alGetSourcei(source , AL_SOURCE_STATE , &srcstate); + + return (srcstate == AL_PLAYING); +} + } |