Commits

Bart van Strien committed a156e17

Add Source:isPlaying

  • Participants
  • Parent commits 6cccc07

Comments (0)

Files changed (2)

File src/modules/audio/wrap_Source.cpp

 	return 1;
 }
 
+int w_Source_isPlaying(lua_State *L)
+{
+	Source *t = luax_checksource(L, 1);
+	luax_pushboolean(L, !t->isStopped() && !t->isPaused());
+	return 1;
+}
+
 int w_Source_isStatic(lua_State *L)
 {
 	Source *t = luax_checksource(L, 1);
 	{ "isLooping", w_Source_isLooping },
 	{ "isStopped", w_Source_isStopped },
 	{ "isPaused", w_Source_isPaused },
+	{ "isPlaying", w_Source_isPlaying },
 	{ "isStatic", w_Source_isStatic },
 
 	{ "setVolumeLimits", w_Source_setVolumeLimits },

File src/modules/audio/wrap_Source.h

 int w_Source_isLooping(lua_State *L);
 int w_Source_isStopped(lua_State *L);
 int w_Source_isPaused(lua_State *L);
+int w_Source_isPlaying(lua_State *L);
 int w_Source_isStatic(lua_State *L);
 int w_Source_setVolumeLimits(lua_State *L);
 int w_Source_getVolumeLimits(lua_State *L);