Exemplo n.º 1
0
AudioStream::~AudioStream()
{
	//al_set_audio_stream_playing(m_stream, false);
	al_detach_audio_stream(m_stream);
	al_destroy_audio_stream(m_stream);
	al_destroy_voice(m_voice);
}
void removeStage(stage *s){
	al_set_audio_stream_playing(s -> stageAudio, false);
	al_set_audio_stream_playing(s -> bossAudio, false);

	al_drain_audio_stream(s -> stageAudio);
	al_drain_audio_stream(s -> bossAudio);

	al_detach_audio_stream(s -> stageAudio);
	al_detach_audio_stream(s -> bossAudio);

	al_destroy_bitmap(s -> stageBackground);
	al_destroy_audio_stream(s -> stageAudio);
	al_destroy_audio_stream(s -> bossAudio);

	free(s);
}
Exemplo n.º 3
0
inline void SoundManager::DestroyMusic()
{
	if(music!=NULL)
	{
		al_detach_audio_stream(music);
		al_destroy_audio_stream(music);
	}
}
Exemplo n.º 4
0
bool AllegroMusicSample5::Load( const std::string & path )
{
	if ( m_pInstance )
	{
		al_detach_audio_stream( m_pInstance );
		al_destroy_audio_stream( m_pInstance );
	}

	m_pInstance = al_load_audio_stream( path.c_str(), 10, 1024 );
	if ( m_pInstance )
		al_attach_audio_stream_to_mixer( m_pInstance,  ((AllegroSound5&)GetSound()).GetMusicMixer() );

	return ( m_pInstance != 0 );
}
Exemplo n.º 5
0
void Audio::StopMusic()
{
	if( audioVoice == 0 || audioMixer == 0 )
	{
		return;
	}

#ifdef WRITE_LOG
  fprintf( FRAMEWORK->LogFile, "Framework: Stop audio\n" );
#endif
	if( musicStream != nullptr )
	{
		FRAMEWORK->UnregisterEventSource( al_get_audio_stream_event_source( musicStream ) );
		al_set_audio_stream_playing( musicStream, false );
		al_detach_audio_stream( musicStream );
		// Causes game to hang!?
		// al_destroy_audio_stream( musicStream );
		musicStream = nullptr;
	}
}
Exemplo n.º 6
0
static int allua_audio_stream_detach(lua_State * L)
{
   ALLUA_audio_stream audio_stream = allua_check_audio_stream(L, 1);
   lua_pushboolean(L, al_detach_audio_stream(audio_stream));
   return 1;
}
Exemplo n.º 7
0
void stopBGM_Stream()
{
    if (!stream)
        return;
    al_detach_audio_stream(stream);
}