ISample::ELoopMode AllegroMusicSample5::GetLoopMode() const { if ( !m_pInstance ) return ISample::LOOPMODE_ONCE; ALLEGRO_PLAYMODE alMode = al_get_audio_stream_playmode( m_pInstance ); switch( alMode ) { case ALLEGRO_PLAYMODE_ONCE: return ISample::LOOPMODE_ONCE; case ALLEGRO_PLAYMODE_LOOP: return ISample::LOOPMODE_LOOP; } return ISample::LOOPMODE_ONCE; }
static int allua_audio_stream_get_playmode(lua_State * L) { ALLUA_audio_stream audio_stream = allua_check_audio_stream(L, 1); lua_pushnumber(L, al_get_audio_stream_playmode(audio_stream)); return 1; }
bool is_sound_looping(sound_t* sound) { return al_get_audio_stream_playmode(sound->stream) == ALLEGRO_PLAYMODE_LOOP; }