Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/sources.cc')
-rw-r--r--src/audio/sources.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/audio/sources.cc b/src/audio/sources.cc
index 241332b..a3d7a8f 100644
--- a/src/audio/sources.cc
+++ b/src/audio/sources.cc
@@ -85,4 +85,16 @@ void Sources::remove(size_t index)
//con_debug << "removed source " << index << std::endl;
}
+bool Sources::is_playing(size_t index)
+{
+
+ if ((index < MAXUISOURCES) || (MAXSOURCES <= index))
+ return false;
+
+ ALint srcstate = 0;
+ alGetSourcei(sources[index] , AL_SOURCE_STATE , &srcstate);
+
+ return (srcstate == AL_PLAYING);
+}
+
}