本文整理汇总了C++中LLParcel::getMediaAllowNavigate方法的典型用法代码示例。如果您正苦于以下问题:C++ LLParcel::getMediaAllowNavigate方法的具体用法?C++ LLParcel::getMediaAllowNavigate怎么用?C++ LLParcel::getMediaAllowNavigate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLParcel
的用法示例。
在下文中一共展示了LLParcel::getMediaAllowNavigate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refresh
// public
void LLPanelLandMedia::refresh()
{
LLParcel *parcel = mParcel->getParcel();
if (!parcel)
{
clearCtrls();
}
else
{
// something selected, hooray!
// Display options
BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA);
mMediaURLEdit->setText(parcel->getMediaURL());
mMediaURLEdit->setEnabled( FALSE );
childSetText("current_url", parcel->getMediaCurrentURL());
mMediaDescEdit->setText(parcel->getMediaDesc());
mMediaDescEdit->setEnabled( can_change_media );
std::string mime_type = parcel->getMediaType();
if (mime_type.empty())
{
mime_type = "none/none";
}
setMediaType(mime_type);
mMediaTypeCombo->setEnabled( can_change_media );
childSetText("mime_type", mime_type);
mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () );
mMediaAutoScaleCheck->setEnabled ( can_change_media );
// Special code to disable looping checkbox for HTML MIME type
// (DEV-10042 -- Parcel Media: "Loop Media" should be disabled for static media types)
bool allow_looping = LLMIMETypes::findAllowLooping( mime_type );
if ( allow_looping )
mMediaLoopCheck->set( parcel->getMediaLoop () );
else
mMediaLoopCheck->set( false );
mMediaLoopCheck->setEnabled ( can_change_media && allow_looping );
mMediaResetCtrl->set( parcel->getMediaURLTimeout() );
mMediaResetCtrl->setEnabled( can_change_media );
mMediaResetCtrlLabel->setEnabled( can_change_media );
// disallow media size change for mime types that don't allow it
bool allow_resize = LLMIMETypes::findAllowResize( mime_type );
if ( allow_resize )
mMediaWidthCtrl->setValue( parcel->getMediaWidth() );
else
mMediaWidthCtrl->setValue( 0 );
mMediaWidthCtrl->setEnabled ( can_change_media && allow_resize );
if ( allow_resize )
mMediaHeightCtrl->setValue( parcel->getMediaHeight() );
else
mMediaHeightCtrl->setValue( 0 );
mMediaHeightCtrl->setEnabled ( can_change_media && allow_resize );
// enable/disable for text label for completeness
mMediaSizeCtrlLabel->setEnabled( can_change_media && allow_resize );
LLUUID tmp = parcel->getMediaID();
mMediaTextureCtrl->setImageAssetID ( parcel->getMediaID() );
mMediaTextureCtrl->setEnabled( can_change_media );
mSetURLButton->setEnabled( can_change_media );
mResetURLButton->setEnabled( can_change_media );
mMediaURLFilterCheck->set( parcel->getMediaURLFilterEnable() );
mMediaURLFilterCheck->setEnabled( can_change_media );
LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get();
if (floater_url_entry)
{
floater_url_entry->updateFromLandMediaPanel();
}
// This radial control is really just an inverse mapping to the boolean allow_navigate value.
// It is set as a radial merely for user readability.
mRadioNavigateControl->setSelectedIndex(! parcel->getMediaAllowNavigate());
mRadioNavigateControl->setEnabled( can_change_media );
mMediaURLFilterDomainEdit->setEnabled( can_change_media );
mMediaURLFilterAddButton->setEnabled( can_change_media );
mMediaURLFilterRemoveButton->setEnabled( can_change_media );
if (mURLFilterList)
{
mURLFilterList->setEnabled( can_change_media );
mURLFilterList->deleteAllItems();
LLSD list = parcel->getMediaURLFilterList();
for (LLSD::array_iterator i = list.beginArray(); i != list.endArray(); ++i)
//.........这里部分代码省略.........
示例2: updateShape
void LLPanelPrimMediaControls::updateShape()
{
LLViewerMediaImpl* media_impl = getTargetMediaImpl();
LLViewerObject* objectp = getTargetObject();
if(!media_impl || gFloaterTools->getVisible())
{
setVisible(FALSE);
return;
}
LLPluginClassMedia* media_plugin = NULL;
if(media_impl->hasMedia())
{
media_plugin = media_impl->getMediaPlugin();
}
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
bool can_navigate = parcel->getMediaAllowNavigate();
bool enabled = false;
bool is_zoomed = (mCurrentZoom != ZOOM_NONE) && (mTargetObjectID == mZoomObjectID) && (mTargetObjectFace == mZoomObjectFace);
// There is no such thing as "has_focus" being different from normal controls set
// anymore (as of user feedback from bri 10/09). So we cheat here and force 'has_focus'
// to 'true' (or, actually, we use a setting)
bool has_focus = (gSavedSettings.getBOOL("PrimMediaControlsUseHoverControlSet")) ? media_impl->hasFocus() : true;
setVisible(enabled);
if (objectp)
{
bool mini_controls = false;
LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData();
if (media_data && NULL != dynamic_cast<LLVOVolume*>(objectp))
{
// Don't show the media controls if we do not have permissions
enabled = dynamic_cast<LLVOVolume*>(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL);
mini_controls = (LLMediaEntry::MINI == media_data->getControls());
}
const bool is_hud = objectp->isHUDAttachment();
//
// Set the state of the buttons
//
// XXX RSP: TODO: FIXME: clean this up so that it is clearer what mode we are in,
// and that only the proper controls get made visible/enabled according to that mode.
mBackCtrl->setVisible(has_focus);
mFwdCtrl->setVisible(has_focus);
mReloadCtrl->setVisible(has_focus);
mStopCtrl->setVisible(false);
mHomeCtrl->setVisible(has_focus);
mZoomCtrl->setVisible(!is_zoomed);
mUnzoomCtrl->setVisible(is_zoomed);
mOpenCtrl->setVisible(true);
mMediaAddressCtrl->setVisible(has_focus && !mini_controls);
mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls);
mVolumeCtrl->setVisible(false);
mWhitelistIcon->setVisible(!mini_controls && (media_data)?media_data->getWhiteListEnable():false);
// Disable zoom if HUD
mZoomCtrl->setEnabled(!is_hud);
mUnzoomCtrl->setEnabled(!is_hud);
mSecureLockIcon->setVisible(false);
mCurrentURL = media_impl->getCurrentMediaURL();
mBackCtrl->setEnabled((media_impl != NULL) && media_impl->canNavigateBack() && can_navigate);
mFwdCtrl->setEnabled((media_impl != NULL) && media_impl->canNavigateForward() && can_navigate);
mStopCtrl->setEnabled(has_focus && can_navigate);
mHomeCtrl->setEnabled(has_focus && can_navigate);
LLPluginClassMediaOwner::EMediaStatus result = ((media_impl != NULL) && media_impl->hasMedia()) ? media_plugin->getStatus() : LLPluginClassMediaOwner::MEDIA_NONE;
mVolumeCtrl->setVisible(has_focus);
mVolumeCtrl->setEnabled(has_focus);
mVolumeSliderCtrl->setEnabled(has_focus && shouldVolumeSliderBeVisible());
mVolumeSliderCtrl->setVisible(has_focus && shouldVolumeSliderBeVisible());
if(media_plugin && media_plugin->pluginSupportsMediaTime())
{
mReloadCtrl->setEnabled(false);
mReloadCtrl->setVisible(false);
mMediaStopCtrl->setVisible(has_focus);
mHomeCtrl->setVisible(has_focus);
mBackCtrl->setVisible(false);
mFwdCtrl->setVisible(false);
mMediaAddressCtrl->setVisible(false);
mMediaAddressCtrl->setEnabled(false);
mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls);
mMediaPlaySliderPanel->setEnabled(has_focus && !mini_controls);
mSkipFwdCtrl->setVisible(has_focus && !mini_controls);
mSkipFwdCtrl->setEnabled(has_focus && !mini_controls);
mSkipBackCtrl->setVisible(has_focus && !mini_controls);
mSkipBackCtrl->setEnabled(has_focus && !mini_controls);
mVolumeCtrl->setVisible(has_focus);
mVolumeCtrl->setEnabled(has_focus);
mVolumeSliderCtrl->setEnabled(has_focus && shouldVolumeSliderBeVisible());
mVolumeSliderCtrl->setVisible(has_focus && shouldVolumeSliderBeVisible());
mWhitelistIcon->setVisible(false);
mSecureLockIcon->setVisible(false);
//.........这里部分代码省略.........
示例3: updateShape
void LLPanelMediaHUD::updateShape()
{
const S32 MIN_HUD_WIDTH=200;
const S32 MIN_HUD_HEIGHT=120;
LLPluginClassMedia* media_plugin = NULL;
if(mMediaImpl.notNull() && mMediaImpl->hasMedia())
{
media_plugin = mMediaImpl->getMediaPlugin();
}
// Early out for no media plugin
if(media_plugin == NULL)
{
setVisible(FALSE);
return;
}
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
bool can_navigate = parcel->getMediaAllowNavigate();
// LLObjectSelectionHandle selection = LLViewerMediaFocus::getInstance()->getSelection();
LLSelectNode* nodep = mMediaFocus ? LLSelectMgr::getInstance()->getSelection()->getFirstNode() : LLSelectMgr::getInstance()->getHoverNode();
if(! nodep)
{
return;
}
setVisible(FALSE);
LLViewerObject* objectp = nodep->getObject();
if (objectp)
{
// Set the state of the buttons
LLButton* back_btn = getChild<LLButton>("back");
LLButton* fwd_btn = getChild<LLButton>("fwd");
LLButton* reload_btn = getChild<LLButton>("reload");
LLButton* play_btn = getChild<LLButton>("play");
LLButton* pause_btn = getChild<LLButton>("pause");
LLButton* stop_btn = getChild<LLButton>("stop");
LLButton* media_stop_btn = getChild<LLButton>("media_stop");
LLButton* home_btn = getChild<LLButton>("home");
LLButton* close_btn = getChild<LLButton>("close");
LLButton* open_btn = getChild<LLButton>("new_window");
LLPanel* media_focused_panel = getChild<LLPanel>("media_focused_controls");
LLPanel* media_hover_panel = getChild<LLPanel>("media_hover_controls");
back_btn->setVisible(true);
fwd_btn->setVisible(true);
reload_btn->setVisible(true);
stop_btn->setVisible(false);
home_btn->setVisible(true);
close_btn->setVisible(true);
open_btn->setVisible(true);
if(mMediaFocus)
{
back_btn->setEnabled(mMediaImpl->canNavigateBack() && can_navigate);
fwd_btn->setEnabled(mMediaImpl->canNavigateForward() && can_navigate);
stop_btn->setEnabled(can_navigate);
home_btn->setEnabled(can_navigate);
LLPluginClassMediaOwner::EMediaStatus result = media_plugin->getStatus();
if(media_plugin->pluginSupportsMediaTime())
{
reload_btn->setEnabled(FALSE);
reload_btn->setVisible(FALSE);
media_stop_btn->setVisible(TRUE);
home_btn->setVisible(FALSE);
back_btn->setEnabled(TRUE);
fwd_btn->setEnabled(TRUE);
switch(result)
{
case LLPluginClassMediaOwner::MEDIA_PLAYING:
play_btn->setEnabled(FALSE);
play_btn->setVisible(FALSE);
pause_btn->setEnabled(TRUE);
pause_btn->setVisible(TRUE);
media_stop_btn->setEnabled(TRUE);
break;
case LLPluginClassMediaOwner::MEDIA_PAUSED:
default:
pause_btn->setEnabled(FALSE);
pause_btn->setVisible(FALSE);
play_btn->setEnabled(TRUE);
play_btn->setVisible(TRUE);
media_stop_btn->setEnabled(FALSE);
break;
}
}
else
{
play_btn->setVisible(FALSE);
pause_btn->setVisible(FALSE);
media_stop_btn->setVisible(FALSE);
if(result == LLPluginClassMediaOwner::MEDIA_LOADING)
{
reload_btn->setEnabled(FALSE);
//.........这里部分代码省略.........