Ejemplo n.º 1
0
// virtual
void LLAudioEngine::startInternetStream(const std::string& url)
{
	llinfos << "entered startInternetStream()" << llendl;

	if (!mInternetStreamMedia)
	{
		LLMediaManager* mgr = LLMediaManager::getInstance();
		if (mgr)
		{
			mInternetStreamMedia = mgr->createSourceFromMimeType(LLURI(url).scheme(), "audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
			llinfos << "mInternetStreamMedia is now " << mInternetStreamMedia << llendl;
		}
	}

	if(!mInternetStreamMedia)
		return;
	
	if (!url.empty()) {
		llinfos << "Starting internet stream: " << url << llendl;
		mInternetStreamURL = url;
#if LL_QUICKTIME_ENABLED
		mInternetStreamMedia->navigateTo ( createListenPls(url) );
#else
		mInternetStreamMedia->navigateTo ( url );
#endif
		llinfos << "Playing....." << llendl;		
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START);
		mInternetStreamMedia->updateMedia();
	} else {
		llinfos << "setting stream to NULL"<< llendl;
		mInternetStreamURL.clear();
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP);
		mInternetStreamMedia->updateMedia();
	}
}
Ejemplo n.º 2
0
LLWebBrowserCtrl::LLWebBrowserCtrl( const std::string& name, const LLRect& rect ) :
	LLUICtrl( name, rect, FALSE, NULL, NULL ),
	mTextureDepthBytes( 4 ),
	mWebBrowserImage( 0 ),
	mEmbeddedBrowserWindowId( 0 ),
	mBorder(NULL),
	mFrequentUpdates( true ),
	mForceUpdate( false ),
	mOpenLinksInExternalBrowser( false ),
	mOpenLinksInInternalBrowser( false ),
	mTrusted( false ),
	mHomePageUrl( "" ),
	mIgnoreUIScale( true ),
	mAlwaysRefresh( false ),
	mExternalUrl( "" ),
	mMediaSource( 0 ),
	mTakeFocusOnClick( true ),
	mCurrentNavUrl( "about:blank" )
{
	S32 screen_width = mIgnoreUIScale ? 
		llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]) : getRect().getWidth();
	S32 screen_height = mIgnoreUIScale ? 
		llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight();


	LLMediaManager *mgr = LLMediaManager::getInstance();

	if (!mgr)
	{
		llwarns << "cannot get media manager" << llendl;
		return;
	}
		
	mMediaSource = mgr->createSourceFromMimeType("http", "text/html" );
	if ( !mMediaSource )
	{
		llwarns << "media source create failed " << llendl;
		// return;
	}
	else
	{

		// mMediaSource->init();
		mMediaSource->addCommand( LLMediaBase::COMMAND_START );

		// observe the browser so we can trap HREF events)
		mMediaSource->addObserver(this);

		// create a new texture (based on LLDynamic texture) that will be used to display the output
		mWebBrowserImage = new LLWebBrowserTexture( screen_width, screen_height, this, mMediaSource );
	}

	LLRect border_rect( 0, getRect().getHeight() + 2, getRect().getWidth() + 2, 0 );
	mBorder = new LLViewBorder( std::string("web control border"), border_rect, LLViewBorder::BEVEL_IN );
	addChild( mBorder );
}
Ejemplo n.º 3
0
// virtual
void LLAudioEngine::startInternetStream(const std::string& url)
{
	llinfos << "entered startInternetStream()" << llendl;

	if (!mInternetStreamMedia)
	{
		LLMediaManager* mgr = LLMediaManager::getInstance();
		if (mgr)
		{
			mInternetStreamMedia = mgr->createSourceFromMimeType(LLURI(url).scheme(), "audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
			llinfos << "mInternetStreamMedia is now " << mInternetStreamMedia << llendl;
		}
	}

	if(!mInternetStreamMedia)
	{
		return;
	}
	// Check for a dead stream from gstreamer, just in case
	else if(getStatus() == LLMediaBase::STATUS_DEAD)
	{
		llinfos << "don't play dead stream urls"<< llendl;
		mInternetStreamURL.clear();
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP);
		mInternetStreamMedia->updateMedia();
		stopInternetStream();
	}
	else if (url.empty())
	{
		llinfos << "url is emptly. Setting stream to NULL"<< llendl;
		mInternetStreamURL.clear();
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP);
		mInternetStreamMedia->updateMedia();
	}
	// Stream appears to be good, attempting to play
	else
	{
		// stop any other stream first
		stopInternetStream();

		llinfos << "Starting internet stream: " << url << llendl;
		mInternetStreamURL = url;
		mInternetStreamMedia->navigateTo(url);
		//llinfos << "Playing....." << llendl;		
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START);
		mInternetStreamMedia->updateMedia();
		mStatus = LLMediaBase::STATUS_STARTED;
	}
}
Ejemplo n.º 4
0
void LLViewerMediaImpl::play(const std::string& media_url,
							 const std::string& mime_type,
							 const LLUUID& placeholder_texture_id,
							 S32 media_width, S32 media_height, U8 media_auto_scale,
							 U8 media_loop)
{
	// first stop any previously playing media
	stop();

	// Save this first, as init/load below may fire events
	mMovieImageID = placeholder_texture_id;

	// If the mime_type passed in is different than the cached one, and
	// Auto-discovery is turned OFF, replace the cached mime_type with the new one.
	if(mime_type != mMimeType &&
		! gSavedSettings.getBOOL("AutoMimeDiscovery"))
	{
		mMimeType = mime_type;
	}
	LLURI url(media_url);
	std::string scheme = url.scheme() != "" ? url.scheme() : "http";

	LLMediaManager* mgr = LLMediaManager::getInstance();
	mMediaSource = mgr->createSourceFromMimeType(scheme, mMimeType );
	if ( !mMediaSource )
	{
		if (mMimeType != "none/none")
		{
			llwarns << "media source create failed " << media_url
					<< " type " << mMimeType
					<< llendl;
		}
		return;
	}

	// Store the URL and Mime Type
	mMediaURL = media_url;

	if ((media_width != 0) && (media_height != 0))
	{
		mMediaSource->setRequestedMediaSize(media_width, media_height);
	}

	mMediaSource->setLooping(media_loop);
	mMediaSource->setAutoScaled(media_auto_scale);
	mMediaSource->addObserver( this );
	mMediaSource->navigateTo( media_url );
	mMediaSource->addCommand(LLMediaBase::COMMAND_START);
}
Ejemplo n.º 5
0
// Default constructor
LLFloaterAbout::LLFloaterAbout()
    :	LLFloater(std::string("floater_about"), std::string("FloaterAboutRect"), LLStringUtil::null)
{
    LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");

    // Support for changing product name.
    std::string title("About ");
    title += LLAppViewer::instance()->getSecondLifeTitle();
    setTitle(title);

    LLViewerTextEditor *support_widget =
        getChild<LLViewerTextEditor>("support_editor", true);

    LLViewerTextEditor *credits_widget =
        getChild<LLViewerTextEditor>("credits_editor", true);


    if (!support_widget || !credits_widget)
    {
        return;
    }

    // For some reason, adding style doesn't work unless this is true.
    support_widget->setParseHTML(TRUE);

    // Text styles for release notes hyperlinks
    LLStyleSP viewer_link_style(new LLStyle);
    viewer_link_style->setVisible(true);
    viewer_link_style->setFontName(LLStringUtil::null);
    viewer_link_style->setLinkHREF(get_viewer_release_notes_url());
    viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));

    // Version string
    std::string version = llformat(
                              "%s %d.%d.%d %s / %s %d.%d.%d (%d), %s %s\n",
                              IMP_VIEWER_NAME,
                              IMP_VERSION_MAJOR, IMP_VERSION_MINOR, IMP_VERSION_PATCH, IMP_VERSION_TEST,
                              LL_VIEWER_NAME,
                              LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
                              __DATE__, __TIME__);

    support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
    support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);

    std::string support;
    support.append("\n\n");

#if LL_MSVC
    support.append(llformat("Built with MSVC version %d\n\n", _MSC_VER));
#endif

#if LL_GNUC
    support.append(llformat("Built with GCC version %d\n\n", GCC_VERSION));
#endif

    // Position
    LLViewerRegion* region = gAgent.getRegion();
// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-04 (RLVa-1.0.0a)
    if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
    {
        support.append(rlv_handler_t::cstrHidden);
        support.append("\n\n");
    }
    else if (region)
// [/RLVa:KB]
//	if (region)
    {
        LLStyleSP server_link_style(new LLStyle);
        server_link_style->setVisible(true);
        server_link_style->setFontName(LLStringUtil::null);
        server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes"));
        server_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));

        const LLVector3d &pos = gAgent.getPositionGlobal();
        LLUIString pos_text = getString("you_are_at");
        pos_text.setArg("[POSITION]",
                        llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]));
        support.append(pos_text);

        std::string region_text = llformat("in %s located at ",
                                           gAgent.getRegion()->getName().c_str());
        support.append(region_text);

        std::string buffer;
        buffer = gAgent.getRegion()->getHost().getHostName();
        support.append(buffer);
        support.append(" (");
        buffer = gAgent.getRegion()->getHost().getString();
        support.append(buffer);
        support.append(")\n");
        support.append(gLastVersionChannel);
        support.append("\n");

        support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
        support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);

        support = "\n\n";
    }

    // *NOTE: Do not translate text like GPU, Graphics Card, etc -
    //  Most PC users that know what these mean will be used to the english versions,
    //  and this info sometimes gets sent to support

    // CPU
    support.append("CPU: ");
    support.append( gSysCPU.getCPUString() );
    support.append("\n");

    U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024;
    // Moved hack adjustment to Windows memory size into llsys.cpp

    std::string mem_text = llformat("Memory: %u MB\n", memory );
    support.append(mem_text);

    support.append("OS Version: ");
    support.append( LLAppViewer::instance()->getOSInfo().getOSString() );
    support.append("\n");

    support.append("Graphics Card Vendor: ");
    support.append( (const char*) glGetString(GL_VENDOR) );
    support.append("\n");

    support.append("Graphics Card: ");
    support.append( (const char*) glGetString(GL_RENDERER) );
    support.append("\n");

#if LL_WINDOWS
    getWindow()->incBusyCount();
    getWindow()->setCursor(UI_CURSOR_ARROW);
    support.append("Windows Graphics Driver Version: ");
    LLSD driver_info = gDXHardware.getDisplayInfo();
    if (driver_info.has("DriverVersion"))
    {
        support.append(driver_info["DriverVersion"]);
    }
    support.append("\n");
    getWindow()->decBusyCount();
    getWindow()->setCursor(UI_CURSOR_ARROW);
#endif

    support.append("OpenGL Version: ");
    support.append( (const char*) glGetString(GL_VERSION) );
    support.append("\n");

    support.append("\n");

    support.append("libcurl Version: ");
    support.append( LLCurl::getVersionString() );
    support.append("\n");

    support.append("J2C Decoder Version: ");
    support.append( LLImageJ2C::getEngineInfo() );
    support.append("\n");

    support.append("Audio Driver Version: ");
    bool want_fullname = true;
    support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : "(none)" );

    support.append("\n");

    LLMediaManager *mgr = LLMediaManager::getInstance();
    if (mgr)
    {
        LLMediaBase *gstreamer = mgr->createSourceFromMimeType("http", "audio/mpeg");
        if (gstreamer)
        {
            support.append("GStreamer Version: ");
            support.append( gstreamer->getVersion() );
            support.append("\n");
        }

        LLMediaBase *media_source = mgr->createSourceFromMimeType("http", "text/html");
        if (media_source)
        {
            support.append("LLMozLib Version: ");
            support.append(media_source->getVersion());
            support.append("\n");
            mgr->destroySource(media_source);
        }
    }

    if (gPacketsIn > 0)
    {
        std::string packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)",
                                           LLViewerStats::getInstance()->mPacketsLostStat.getCurrent(),
                                           F32(gPacketsIn),
                                           100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
        support.append(packet_loss);
        support.append("\n");
    }

    support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));

    // Fix views
    support_widget->setCursorPos(0);
    support_widget->setEnabled(FALSE);
    support_widget->setTakesFocus(TRUE);
    support_widget->setHandleEditKeysDirectly(TRUE);

    credits_widget->setCursorPos(0);
    credits_widget->setEnabled(FALSE);
    credits_widget->setTakesFocus(TRUE);
    credits_widget->setHandleEditKeysDirectly(TRUE);

    center();

    sInstance = this;
}