void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
{
	// Old and new stream are identical
	if (mNextStreamURI == streamURI)
	{
		/// <FS:CR> FIRE-8419 - Don't return here. It can keep the user from toggling audio streams off/on.
		/// We handle identical stream URIs with FIRE-7093 anyways.
		//return;
		lldebugs << "Identical URI's: " << mNextStreamURI << " and " << streamURI << llendl;
		// </FS:CR>
	}

	// Record the URI we are going to be switching to	
	mNextStreamURI = streamURI;

	// <FS:Ansariel> Optional audio stream fading
	if (!gSavedSettings.getBOOL("FSFadeAudioStream"))
	{
		gAudiop->startInternetStream(mNextStreamURI);
		return;
	}
	// </FS:Ansariel>

	switch (mFadeState)
	{
		case FADE_IDLE:
		// If a stream is playing fade it out first
		if (!gAudiop->getInternetStreamURL().empty())
		{
			// The order of these tests is important, state FADE_OUT will be processed below
			mFadeState = FADE_OUT;
		}
		// Otherwise the new stream can be faded in
		else
		{
			mFadeState = FADE_IN;
			gAudiop->startInternetStream(mNextStreamURI);
			startFading();
			registerIdleListener();
			break;
		}

		case FADE_OUT:
			startFading();
			registerIdleListener();
			break;

		case FADE_IN:
			registerIdleListener();
			break;

		default:
			llwarns << "Unknown fading state: " << mFadeState << llendl;
			break;
	}
}
Esempio n. 2
0
void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
{
    // Old and new stream are identical
    if (mNextStreamURI == streamURI)
    {
        return;
    }

    // Record the URI we are going to be switching to
    mNextStreamURI = streamURI;

    switch (mFadeState)
    {
    case FADE_IDLE:
        // If a stream is playing fade it out first
        if (!gAudiop->getInternetStreamURL().empty())
        {
            // The order of these tests is important, state FADE_OUT will be processed below
            mFadeState = FADE_OUT;
        }
        // Otherwise the new stream can be faded in
        else
        {
            mFadeState = FADE_IN;
            gAudiop->startInternetStream(mNextStreamURI);
            startFading();
            registerIdleListener();
            break;
        }

    case FADE_OUT:
        startFading();
        registerIdleListener();
        break;

    case FADE_IN:
        registerIdleListener();
        break;

    default:
        llwarns << "Unknown fading state: " << mFadeState << llendl;
        break;
    }
}