本文整理汇总了C++中LLViewerMediaImpl::getVolume方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerMediaImpl::getVolume方法的具体用法?C++ LLViewerMediaImpl::getVolume怎么用?C++ LLViewerMediaImpl::getVolume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerMediaImpl
的用法示例。
在下文中一共展示了LLViewerMediaImpl::getVolume方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClickSelectedMediaMute
void LLPanelNearByMedia::onClickSelectedMediaMute()
{
LLUUID selected_media_id = mMediaList->getValue().asUUID();
if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID)
{
gSavedSettings.setBOOL("MuteMusic", mMuteBtn->getValue());
}
else {
LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ?
((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
if (NULL != impl)
{
F32 volume = impl->getVolume();
if(volume > 0.0)
{
impl->setVolume(0.0);
}
else if (mVolumeSlider->getValueF32() == 0.0)
{
impl->setVolume(1.0);
mVolumeSlider->setValue(1.0);
}
else
{
impl->setVolume(mVolumeSlider->getValueF32());
}
}
}
}
示例2: updateControls
void LLPanelNearByMedia::updateControls()
{
LLUUID selected_media_id = mMediaList->getValue().asUUID();
if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID)
{
if (!LLViewerMedia::hasParcelAudio() || !gSavedSettings.getBOOL("AudioStreamingMusic"))
{
// disable controls if audio streaming music is disabled from preference
showDisabledControls();
}
else {
showTimeBasedControls(LLViewerMedia::isParcelAudioPlaying(),
false, // include_zoom
false, // is_zoomed
gSavedSettings.getBOOL("MuteMusic"),
gSavedSettings.getF32("AudioLevelMusic") );
}
}
else if (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID)
{
if (!LLViewerMedia::hasParcelMedia() || !gSavedSettings.getBOOL("AudioStreamingMedia"))
{
// disable controls if audio streaming media is disabled from preference
showDisabledControls();
}
else {
LLViewerMediaImpl* impl = LLViewerParcelMedia::getParcelMedia();
if (NULL == impl)
{
// Just means it hasn't started yet
showBasicControls(false, false, false, false, 0);
}
else if (impl->isMediaTimeBased())
{
showTimeBasedControls(impl->isMediaPlaying(),
false, // include_zoom
false, // is_zoomed
impl->getVolume() == 0.0,
impl->getVolume() );
}
else {
// non-time-based parcel media
showBasicControls(LLViewerMedia::isParcelMediaPlaying(),
false,
false,
impl->getVolume() == 0.0,
impl->getVolume());
}
}
}
else {
LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
if (NULL == impl || !gSavedSettings.getBOOL("AudioStreamingMedia"))
{
showDisabledControls();
}
else {
if (impl->isMediaTimeBased())
{
showTimeBasedControls(impl->isMediaPlaying(),
! impl->isParcelMedia(), // include_zoom
LLViewerMediaFocus::getInstance()->isZoomed(),
impl->getVolume() == 0.0,
impl->getVolume());
}
else {
showBasicControls(!impl->isMediaDisabled(),
! impl->isParcelMedia(), // include_zoom
LLViewerMediaFocus::getInstance()->isZoomed(),
impl->getVolume() == 0.0,
impl->getVolume());
}
}
}
}