void LLAudioChannel::setSource(LLAudioSource *sourcep)
{
	//llinfos << this << ": setSource(" << sourcep << ")" << llendl;

	if (!sourcep)
	{
		// Clearing the source for this channel, don't need to do anything.
		//llinfos << "Clearing source for channel" << llendl;
		cleanup();
		mCurrentSourcep = NULL;
		mWaiting = false;
		return;
	}

	if (sourcep == mCurrentSourcep)
	{
		// Don't reallocate the channel, this will make FMOD goofy.
		//llinfos << "Calling setSource with same source!" << llendl;
	}

	mCurrentSourcep = sourcep;


	updateBuffer();
	update3DPosition();
}
Esempio n. 2
0
void LLAudioChannel::setSource(LLAudioSource *sourcep)
{
	//LL_INFOS() << this << ": setSource(" << sourcep << ")" << LL_ENDL;

	if (!sourcep)
	{
		// Clearing the source for this channel, don't need to do anything.
		//LL_INFOS() << "Clearing source for channel" << LL_ENDL;
		cleanup();
		mCurrentSourcep = NULL;
		mWaiting = false;
	}
	else
	{
		LL_DEBUGS("AudioEngine") << "( id: " << sourcep->getID() << ")" << LL_ENDL;

	if (sourcep == mCurrentSourcep)
	{
		// Don't reallocate the channel, this will make FMOD goofy.
		//LL_INFOS() << "Calling setSource with same source!" << LL_ENDL;
	}

	mCurrentSourcep = sourcep;

	updateBuffer();
	update3DPosition();
}
}
void LLAudioChannel::setSource(LLAudioSource *sourcep)
{
	//llinfos << this << ": setSource(" << sourcep << ")" << llendl;

	if (!sourcep)
	{
		// Clearing the source for this channel, don't need to do anything.
		LL_DEBUGS("AudioEngine") << "Clearing source for channel" << llendl;
		cleanup();
		return;
	}

	if (sourcep == mCurrentSourcep)
	{
		// Don't reallocate the channel, this will make FMOD goofy.
		LL_DEBUGS("AudioEngine") << "Calling setSource with same source!" << llendl;
	}

	cleanup();
	mCurrentSourcep = sourcep;
	mCurrentSourcep->setChannel(this);
	
	updateBuffer();
	update3DPosition();
}
void LLAudioChannel::setSource(LLAudioSource *sourcep)
{
	llassert_always(sourcep);
	llassert_always(!mCurrentSourcep);

	mCurrentSourcep = sourcep;
	mCurrentSourcep->setChannel(this);
	
	updateBuffer();
	update3DPosition();
}