本文整理汇总了C++中LLViewerMediaImpl::getCurrentNotification方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerMediaImpl::getCurrentNotification方法的具体用法?C++ LLViewerMediaImpl::getCurrentNotification怎么用?C++ LLViewerMediaImpl::getCurrentNotification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerMediaImpl
的用法示例。
在下文中一共展示了LLViewerMediaImpl::getCurrentNotification方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
/*virtual*/
void LLPanelPrimMediaControls::draw()
{
LLViewerMediaImpl* impl = getTargetMediaImpl();
if (impl)
{
LLNotificationPtr notification = impl->getCurrentNotification();
if (notification != mActiveNotification)
{
mActiveNotification = notification;
if (notification)
{
showNotification(notification);
}
else
{
hideNotification();
}
}
}
F32 alpha = getDrawContext().mAlpha;
if(mHideImmediately)
{
//hide this panel
clearFaceOnFade();
mHideImmediately = false;
}
else if(mFadeTimer.getStarted())
{
F32 time = mFadeTimer.getElapsedTimeF32();
alpha *= llmax(lerp(1.0, 0.0, time / mControlFadeTime), 0.0f);
if(time >= mControlFadeTime)
{
//hide this panel
clearFaceOnFade();
}
}
// Build rect for icon area in coord system of this panel
// Assumes layout_stack is a direct child of this panel
mMediaControlsStack->updateLayout();
// adjust for layout stack spacing
S32 space = mMediaControlsStack->getPanelSpacing() + 2;
LLRect controls_bg_area = mMediaControlsStack->getRect();
controls_bg_area.mTop += space + 2;
// adjust to ignore space from volume slider
controls_bg_area.mBottom += mVolumeSliderCtrl->getRect().getHeight();
// adjust to ignore space from left bookend padding
controls_bg_area.mLeft += mLeftBookend->getRect().getWidth() - space;
// ignore space from right bookend padding
controls_bg_area.mRight -= mRightBookend->getRect().getWidth() - space - 2;
// draw control background UI image
mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha);
// draw volume slider background UI image
if (mVolumeSliderCtrl->getVisible())
{
LLRect volume_slider_rect;
screenRectToLocal(mVolumeSliderCtrl->calcScreenRect(), &volume_slider_rect);
mVolumeSliderBackgroundImage->draw(volume_slider_rect, UI_VERTEX_COLOR % alpha);
}
{
LLViewDrawContext context(alpha);
LLPanel::draw();
}
}
示例2: draw
/*virtual*/
void LLPanelPrimMediaControls::draw()
{
LLViewerMediaImpl* impl = getTargetMediaImpl();
if (impl)
{
LLNotificationPtr notification = impl->getCurrentNotification();
if (notification != mActiveNotification)
{
mActiveNotification = notification;
if (notification)
{
showNotification(notification);
}
else
{
hideNotification();
}
}
}
F32 alpha = getDrawContext().mAlpha;
if(mHideImmediately)
{
//hide this panel
clearFaceOnFade();
mHideImmediately = false;
}
else if(mFadeTimer.getStarted())
{
F32 time = mFadeTimer.getElapsedTimeF32();
alpha *= llmax(lerp(1.0, 0.0, time / mControlFadeTime), 0.0f);
if(time >= mControlFadeTime)
{
//hide this panel
clearFaceOnFade();
}
}
// Show/hide the lock icon for secure browsing
mSecureLockIcon->setVisible(mSecureURL && !mMediaAddress->hasFocus());
// Build rect for icon area in coord system of this panel
// Assumes layout_stack is a direct child of this panel
mMediaControlsStack->updateLayout();
// adjust for layout stack spacing
S32 space = mMediaControlsStack->getPanelSpacing() + 2;
LLRect controls_bg_area = mMediaControlsStack->getRect();
controls_bg_area.mTop += space + 2;
// adjust to ignore space from volume slider
controls_bg_area.mBottom += mVolumeSliderCtrl->getRect().getHeight();
// adjust to ignore space from left bookend padding
controls_bg_area.mLeft += mLeftBookend->getRect().getWidth() - space;
// ignore space from right bookend padding
controls_bg_area.mRight -= mRightBookend->getRect().getWidth() - space - 2;
// draw control background UI image
// <FS:ND> VWR-29449; Only draw mBackgroundImage when the user has MEDIA_PERM_CONTROL. Otherwise we did hide all media controls above and drawing mBackgroundImage draws a useless grey square.
// mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha);
LLViewerObject* objectp = getTargetObject();
LLMediaEntry *media_data(0);
if( objectp )
media_data = objectp->getTE(mTargetObjectFace)->getMediaData();
if( !dynamic_cast<LLVOVolume*>(objectp) || !media_data || dynamic_cast<LLVOVolume*>(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL) )
mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha);
// </FS:ND>
// draw volume slider background UI image
if (mVolumeSliderCtrl->getVisible())
{
LLRect volume_slider_rect;
screenRectToLocal(mVolumeSliderCtrl->calcScreenRect(), &volume_slider_rect);
mVolumeSliderBackgroundImage->draw(volume_slider_rect, UI_VERTEX_COLOR % alpha);
}
{
LLViewDrawContext context(alpha);
LLPanel::draw();
}
}