From da3ca7c5b9ce3493e99aa261a075dbc2ca16b5c9 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 14 Dec 2009 12:03:44 -0800 Subject: Allow selection of media faces even if there is no impl. We record the target object and use that fact to raise its interest level. This is mostly a pass-off for monroe to take and run with --- indra/newview/llmediadataclient.cpp | 2 +- indra/newview/lltoolpie.cpp | 8 +++----- indra/newview/llviewermedia.cpp | 14 ++++++++++++++ indra/newview/llviewermedia.h | 2 ++ indra/newview/llviewermediafocus.cpp | 16 +++++++++++++--- indra/newview/llvovolume.cpp | 7 +++++-- 6 files changed, 38 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 2694075a58..91064eea6b 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -402,7 +402,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue LLMediaDataClient::request_queue_t::const_iterator end = q.end(); while (iter != end) { - s << "\t" << i << "]: " << (*iter)->getObject()->getID().asString(); + s << "\t" << i << "]: " << (*iter)->getObject()->getID().asString() << "(" << (*iter)->getObject()->getMediaInterest() << ")"; iter++; i++; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 5ed8dc5fb9..f88de20242 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1243,8 +1243,6 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) return false; } - - // Does this face have media? const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace); if(!tep) @@ -1257,11 +1255,11 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) viewer_media_t media_impl = mep ? LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()) : NULL; - if (gSavedSettings.getBOOL("MediaOnAPrimUI") - && media_impl.notNull()) + if (gSavedSettings.getBOOL("MediaOnAPrimUI")) { - if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) ) + if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) || media_impl.isNull()) { + // It's okay to give this a null impl LLViewerMediaFocus::getInstance()->setFocusFace(pick.getObject(), pick.mObjectFace, media_impl, pick.mNormal); } else diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 57e4ed0c1e..7c5b360b92 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -558,6 +558,20 @@ bool LLViewerMedia::getInWorldMediaDisabled() return sInWorldMediaDisabled; } +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::isInterestingEnough(const LLUUID &object_id, const F64 &object_interest) +{ + if (LLViewerMediaFocus::getInstance()->getFocusedObjectID() == object_id) + { + return true; + } + else { + // XXX HACK + return object_interest > 1023;// INTEREST_THRESHHOLD; + } +} + LLViewerMedia::impl_list &LLViewerMedia::getPriorityList() { return sViewerMediaImplList; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 349a66867a..26b822aba6 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -112,6 +112,8 @@ class LLViewerMedia static void setInWorldMediaDisabled(bool disabled); static bool getInWorldMediaDisabled(); + static bool isInterestingEnough(const LLUUID& object_id, const F64 &object_interest); + // Returns the priority-sorted list of all media impls. static impl_list &getPriorityList(); diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index f639c841e7..e04a54fbd6 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -144,9 +144,19 @@ void LLViewerMediaFocus::setFocusFace(LLPointer objectp, S32 fac } mFocusedImplID = LLUUID::null; - mFocusedObjectID = LLUUID::null; - mFocusedObjectFace = 0; + if (objectp.notNull()) + { + // Still record the focused object...it may mean we need to load media data. + // This will aid us in determining this object is "important enough" + mFocusedObjectID = objectp->getID(); + mFocusedObjectFace = face; + } + else { + mFocusedObjectID = LLUUID::null; + mFocusedObjectFace = 0; + } } + } void LLViewerMediaFocus::clearFocus() @@ -336,7 +346,7 @@ BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks) void LLViewerMediaFocus::update() { - if(mFocusedImplID.notNull() || mFocusedObjectID.notNull()) + if(mFocusedImplID.notNull()) { // We have a focused impl/face. if(!getFocus()) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b92d024ac9..822fcf1e7e 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -68,6 +68,7 @@ #include "llmediaentry.h" #include "llmediadataclient.h" #include "llagent.h" +#include "llviewermediafocus.h" const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; @@ -138,8 +139,7 @@ public: } virtual bool isInterestingEnough() const { - // TODO: use performance manager to control this - return true; + return LLViewerMedia::isInterestingEnough(mObject->getID(), getMediaInterest()); } virtual std::string getCapabilityUrl(const std::string &name) const @@ -2089,6 +2089,9 @@ viewer_media_t LLVOVolume::getMediaImpl(U8 face_id) const F64 LLVOVolume::getTotalMediaInterest() const { + if (LLViewerMediaFocus::getInstance()->getFocusedObjectID() == getID()) + return F64_MAX; + F64 interest = (F64)-1.0; // means not interested; int i = 0; const int end = getNumTEs(); -- cgit v1.2.3 From 894a5006b3e5b4c725060443dab34491b0da3a4d Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 14 Dec 2009 13:20:23 -0800 Subject: Fix for DEV-44045 "Update text, checkbox & layout changes for Build : Media Settings : Controls tab" --- indra/newview/llpanelmediasettingsgeneral.cpp | 6 --- indra/newview/llpanelmediasettingsgeneral.h | 2 - indra/newview/llpanelmediasettingspermissions.cpp | 46 +++++++++++++--------- indra/newview/llpanelmediasettingspermissions.h | 1 + .../xui/en/panel_media_settings_general.xml | 30 -------------- .../xui/en/panel_media_settings_permissions.xml | 43 ++++++++++++++++---- 6 files changed, 65 insertions(+), 63 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 88eba14553..f574f55beb 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -67,7 +67,6 @@ const char *CHECKERBOARD_DATA_URL = "data:image/svg+xml,%3Csvg xmlns=%22http://w //////////////////////////////////////////////////////////////////////////////// // LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() : - mControls( NULL ), mAutoLoop( NULL ), mFirstClick( NULL ), mAutoZoom( NULL ), @@ -93,7 +92,6 @@ BOOL LLPanelMediaSettingsGeneral::postBuild() mAutoPlay = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_PLAY_KEY ); mAutoScale = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_SCALE_KEY ); mAutoZoom = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_ZOOM_KEY ); - mControls = getChild< LLComboBox >( LLMediaEntry::CONTROLS_KEY ); mCurrentURL = getChild< LLTextBox >( LLMediaEntry::CURRENT_URL_KEY ); mFirstClick = getChild< LLCheckBoxCtrl >( LLMediaEntry::FIRST_CLICK_INTERACT_KEY ); mHeightPixels = getChild< LLSpinCtrl >( LLMediaEntry::HEIGHT_PIXELS_KEY ); @@ -211,7 +209,6 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) self->mAutoPlay->clear(); self->mAutoScale->clear(); self->mAutoZoom ->clear(); - self->mControls->clear(); self->mCurrentURL->clear(); self->mFirstClick->clear(); self->mHeightPixels->clear(); @@ -221,7 +218,6 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) self->mAutoPlay ->setEnabled(editable); self->mAutoScale ->setEnabled(editable); self->mAutoZoom ->setEnabled(editable); - self->mControls ->setEnabled(editable); self->mCurrentURL ->setEnabled(editable); self->mFirstClick ->setEnabled(editable); self->mHeightPixels ->setEnabled(editable); @@ -283,7 +279,6 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_ { LLMediaEntry::AUTO_PLAY_KEY, self->mAutoPlay, "LLCheckBoxCtrl" }, { LLMediaEntry::AUTO_SCALE_KEY, self->mAutoScale, "LLCheckBoxCtrl" }, { LLMediaEntry::AUTO_ZOOM_KEY, self->mAutoZoom, "LLCheckBoxCtrl" }, - { LLMediaEntry::CONTROLS_KEY, self->mControls, "LLComboBox" }, { LLMediaEntry::CURRENT_URL_KEY, self->mCurrentURL, "LLTextBox" }, { LLMediaEntry::HEIGHT_PIXELS_KEY, self->mHeightPixels, "LLSpinCtrl" }, { LLMediaEntry::HOME_URL_KEY, self->mHomeURL, "LLLineEditor" }, @@ -416,7 +411,6 @@ void LLPanelMediaSettingsGeneral::getValues( LLSD &fill_me_in ) fill_me_in[LLMediaEntry::AUTO_PLAY_KEY] = (LLSD::Boolean)mAutoPlay->getValue(); fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = (LLSD::Boolean)mAutoScale->getValue(); fill_me_in[LLMediaEntry::AUTO_ZOOM_KEY] = (LLSD::Boolean)mAutoZoom->getValue(); - fill_me_in[LLMediaEntry::CONTROLS_KEY] = (LLSD::Integer)mControls->getCurrentIndex(); //Don't fill in current URL: this is only supposed to get changed via navigate // fill_me_in[LLMediaEntry::CURRENT_URL_KEY] = mCurrentURL->getValue(); fill_me_in[LLMediaEntry::HEIGHT_PIXELS_KEY] = (LLSD::Integer)mHeightPixels->getValue(); diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h index c6895b1dc9..5f90321362 100644 --- a/indra/newview/llpanelmediasettingsgeneral.h +++ b/indra/newview/llpanelmediasettingsgeneral.h @@ -37,7 +37,6 @@ class LLButton; class LLCheckBoxCtrl; -class LLComboBox; class LLLineEditor; class LLSpinCtrl; class LLTextureCtrl; @@ -90,7 +89,6 @@ private: void checkHomeUrlPassesWhitelist(); - LLComboBox* mControls; LLCheckBoxCtrl* mAutoLoop; LLCheckBoxCtrl* mFirstClick; LLCheckBoxCtrl* mAutoZoom; diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index 2f3f550e35..1fadb41c18 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -51,9 +51,11 @@ #include "llnamebox.h" #include "lltrans.h" #include "llfloatermediasettings.h" + //////////////////////////////////////////////////////////////////////////////// // LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() : + mControls( NULL ), mPermsOwnerInteract( 0 ), mPermsOwnerControl( 0 ), mPermsGroupName( 0 ), @@ -71,6 +73,7 @@ LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() : BOOL LLPanelMediaSettingsPermissions::postBuild() { // connect member vars with UI widgets + mControls = getChild< LLComboBox >( LLMediaEntry::CONTROLS_KEY ); mPermsOwnerInteract = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_OWNER_INTERACT_KEY ); mPermsOwnerControl = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_OWNER_CONTROL_KEY ); mPermsGroupInteract = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_GROUP_INTERACT_KEY ); @@ -123,19 +126,22 @@ void LLPanelMediaSettingsPermissions::draw() void LLPanelMediaSettingsPermissions::clearValues( void* userdata, bool editable) { LLPanelMediaSettingsPermissions *self =(LLPanelMediaSettingsPermissions *)userdata; + + self->mControls->clear(); self->mPermsOwnerInteract->clear(); self->mPermsOwnerControl->clear(); - self->mPermsGroupInteract ->clear(); + self->mPermsGroupInteract->clear(); self->mPermsGroupControl->clear(); - self->mPermsWorldInteract ->clear(); - self->mPermsWorldControl ->clear(); + self->mPermsWorldInteract->clear(); + self->mPermsWorldControl->clear(); + self->mControls->setEnabled(editable); self->mPermsOwnerInteract->setEnabled(editable); - self->mPermsOwnerControl ->setEnabled(editable); + self->mPermsOwnerControl->setEnabled(editable); self->mPermsGroupInteract->setEnabled(editable); - self->mPermsGroupControl ->setEnabled(editable); + self->mPermsGroupControl->setEnabled(editable); self->mPermsWorldInteract->setEnabled(editable); - self->mPermsWorldControl ->setEnabled(editable); + self->mPermsWorldControl->setEnabled(editable); } //////////////////////////////////////////////////////////////////////////////// @@ -175,6 +181,7 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me } data_set [] = { + { LLMediaEntry::CONTROLS_KEY, self->mControls, "LLComboBox" }, { LLPanelContents::PERMS_OWNER_INTERACT_KEY, self->mPermsOwnerInteract, "LLCheckBoxCtrl" }, { LLPanelContents::PERMS_OWNER_CONTROL_KEY, self->mPermsOwnerControl, "LLCheckBoxCtrl" }, { LLPanelContents::PERMS_GROUP_INTERACT_KEY, self->mPermsGroupInteract, "LLCheckBoxCtrl" }, @@ -194,27 +201,27 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me { if ( data_set[ i ].ctrl_type == "LLCheckBoxCtrl" ) { - // the sense of the checkboxes changed and it made sense - // to just reverse their sense back again here and avoid - // changing server code. + // Most recent change to the "sense" of these checkboxes + // means the value in the checkbox matches that on the server static_cast< LLCheckBoxCtrl* >( data_set[ i ].ctrl_ptr )-> - setValue( ! media_settings[ base_key ].asBoolean() ); + setValue( media_settings[ base_key ].asBoolean() ); } else if ( data_set[ i ].ctrl_type == "LLComboBox" ) static_cast< LLComboBox* >( data_set[ i ].ctrl_ptr )-> setCurrentByIndex( media_settings[ base_key ].asInteger() ); + data_set[ i ].ctrl_ptr->setEnabled(editable); data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() ); }; }; + self->childSetEnabled("media_perms_label_owner", editable ); self->childSetText("media_perms_label_owner", LLTrans::getString("Media Perms Owner") ); self->childSetEnabled("media_perms_label_group", editable ); self->childSetText("media_perms_label_group", LLTrans::getString("Media Perms Group") ); self->childSetEnabled("media_perms_label_anyone", editable ); self->childSetText("media_perms_label_anyone", LLTrans::getString("Media Perms Anyone") ); - } //////////////////////////////////////////////////////////////////////////////// @@ -228,6 +235,9 @@ void LLPanelMediaSettingsPermissions::preApply() // void LLPanelMediaSettingsPermissions::getValues( LLSD &fill_me_in ) { + // moved over from the 'General settings' tab + fill_me_in[LLMediaEntry::CONTROLS_KEY] = (LLSD::Integer)mControls->getCurrentIndex(); + // *NOTE: For some reason, gcc does not like these symbol references in the // expressions below (inside the static_casts). I have NO idea why :(. // For some reason, assigning them to const temp vars here fixes the link @@ -237,13 +247,13 @@ void LLPanelMediaSettingsPermissions::getValues( LLSD &fill_me_in ) const U8 group = LLMediaEntry::PERM_GROUP; const U8 anyone = LLMediaEntry::PERM_ANYONE; const LLSD::Integer control = static_cast( - (mPermsOwnerControl->getValue() ? none : owner ) | - (mPermsGroupControl->getValue() ? none : group ) | - (mPermsWorldControl->getValue() ? none : anyone )); + (mPermsOwnerControl->getValue() ? owner : none ) | + (mPermsGroupControl->getValue() ? group: none ) | + (mPermsWorldControl->getValue() ? anyone : none )); const LLSD::Integer interact = static_cast( - (mPermsOwnerInteract->getValue() ? none : owner ) | - (mPermsGroupInteract->getValue() ? none : group ) | - (mPermsWorldInteract->getValue() ? none : anyone )); + (mPermsOwnerInteract->getValue() ? owner: none ) | + (mPermsGroupInteract->getValue() ? group : none ) | + (mPermsWorldInteract->getValue() ? anyone : none )); fill_me_in[LLMediaEntry::PERMS_CONTROL_KEY] = control; fill_me_in[LLMediaEntry::PERMS_INTERACT_KEY] = interact; } @@ -254,4 +264,4 @@ void LLPanelMediaSettingsPermissions::getValues( LLSD &fill_me_in ) void LLPanelMediaSettingsPermissions::postApply() { // no-op -} +} \ No newline at end of file diff --git a/indra/newview/llpanelmediasettingspermissions.h b/indra/newview/llpanelmediasettingspermissions.h index 45a596c615..bd0c3b8ab5 100644 --- a/indra/newview/llpanelmediasettingspermissions.h +++ b/indra/newview/llpanelmediasettingspermissions.h @@ -65,6 +65,7 @@ public: static void clearValues( void* userdata, bool editable); private: + LLComboBox* mControls; LLCheckBoxCtrl* mPermsOwnerInteract; LLCheckBoxCtrl* mPermsOwnerControl; LLNameBox* mPermsGroupName; diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml index 24c40b32fb..c8ec515e6d 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml @@ -93,35 +93,6 @@ - - Controls: - - - - Standard - - - Mini - - - - + + Controls: + + + + Standard + + + Mini + + + Date: Mon, 14 Dec 2009 14:13:55 -0800 Subject: Added EOL to file for Mac/Linux platforms --- indra/newview/llpanelmediasettingspermissions.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index a3c0e872d2..a23aed2e98 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -265,3 +265,5 @@ void LLPanelMediaSettingsPermissions::postApply() { // no-op } + + -- cgit v1.2.3