当前位置: 首页>>代码示例>>C++>>正文


C++ GetVolume函数代码示例

本文整理汇总了C++中GetVolume函数的典型用法代码示例。如果您正苦于以下问题:C++ GetVolume函数的具体用法?C++ GetVolume怎么用?C++ GetVolume使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetVolume函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetVolume

float FKAggregateGeom::GetVolume(const FVector& Scale) const
{
	float Volume = 0.0f;

	for ( auto SphereElemIt = SphereElems.CreateConstIterator(); SphereElemIt; ++SphereElemIt )
	{
		Volume += SphereElemIt->GetVolume(Scale);
	}

	for ( auto BoxElemIt = BoxElems.CreateConstIterator(); BoxElemIt; ++BoxElemIt )
	{
		Volume += BoxElemIt->GetVolume(Scale);
	}

	for ( auto SphylElemIt = SphylElems.CreateConstIterator(); SphylElemIt; ++SphylElemIt )
	{
		Volume += SphylElemIt->GetVolume(Scale);
	}

	for ( auto ConvexElemIt = ConvexElems.CreateConstIterator(); ConvexElemIt; ++ConvexElemIt )
	{
		Volume += ConvexElemIt->GetVolume(Scale);
	}

	return Volume;
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:26,代码来源:BodySetup.cpp

示例2: MakeShareable

void UBasicVolumeComponent::EnsureRendering()
{
	if (GetVolume() && !m_octree.IsValid())
	{
		m_octree = MakeShareable(new FSparseOctree(GetVolume(), this, EOctreeConstructionModes::BoundCells));
	}
}
开发者ID:ChillyFlashER,项目名称:Voreeal,代码行数:7,代码来源:VoreealBasicVolumeComponent.cpp

示例3: VOIP_DESTROY_MODULE

BOOL CAudioMixerControl::OpenDevice(const GUID* pGuid, BOOL bCaptureDevice, int nInput, BOOL bRealMixer)
{
	m_bRealMixer = bRealMixer;

	// virtual mixer
	if (!bRealMixer) {
		VOIP_DESTROY_MODULE(m_pMixer);
		memset(&m_guidDevice, 0, sizeof(m_guidDevice));
		m_nInput = -1;
		m_nVirtualVolume = 100;
		m_bVirtualMuted = FALSE;

		if (m_pCallback)
			m_pCallback->OnVolumeChanged(m_nId, TRUE, GetVolume(), m_bRealMixer, m_pvParam);

		return TRUE;
	}

	// real mixer
	if (m_pMixer && m_guidDevice == *pGuid) {
		if (m_nInput != nInput) {
			m_nInput = nInput;
			if (m_pCallback)
				m_pCallback->OnVolumeChanged(m_nId, TRUE, GetVolume(), m_bRealMixer, m_pvParam);
		}
		return TRUE;
	}

	do {
		VOIP_DESTROY_MODULE(m_pMixer);
		m_guidDevice = *pGuid;
		m_nInput = nInput;
		m_bCaptureDevice = bCaptureDevice;

		if (VOIP_FAILED(IAudioMixerModule::Create(m_guidDevice, bCaptureDevice, m_pMixer)))
			break;
		if (!m_bWinVista 
			&& bCaptureDevice
			&& m_pMixer->GetLineCount() <= nInput)
			break;

		m_pMixer->SetCallback(this, 0);

		if (m_pCallback)
			m_pCallback->OnVolumeChanged(m_nId, TRUE, GetVolume(), m_bRealMixer, m_pvParam);

		return TRUE;

	} while (0);

	VOIP_DESTROY_MODULE(m_pMixer);
	memset(&m_guidDevice, 0, sizeof(m_guidDevice));
	m_nInput = -1;
	if (m_pCallback)
		m_pCallback->OnVolumeChanged(m_nId, FALSE, 0, m_bRealMixer, m_pvParam);
	return FALSE;
}
开发者ID:chenboo,项目名称:code-refrence,代码行数:57,代码来源:AudioDeviceControl.cpp

示例4: GetVolume

void UBasicVolumeComponent::PostLoad()
{
	if (GetVolume())
	{
		GetVolume()->ConditionalPostLoad();
		EnsureRendering();
	}

	Super::PostLoad();
}
开发者ID:ChillyFlashER,项目名称:Voreeal,代码行数:10,代码来源:VoreealBasicVolumeComponent.cpp

示例5: Stop

void AudioDescriptor::_HandleFadeStates()
{
    if (_state == AUDIO_STATE_FADE_OUT) {
        // Hande when the effect time is very quick
        if( _fade_effect_time <= 10.0f) {
            Stop();
            SetVolume(0.0f);
            return;
        }

        float time_elapsed = (float)hoa_system::SystemManager->GetUpdateTime();
        float new_volume = GetVolume() - (_original_volume - (_original_volume - (time_elapsed / _fade_effect_time)));

        // Stop the audio, and terminate the effect if the volume drops to 0.0f or below
        if(new_volume <= 0.0f) {
            Stop();
            SetVolume(0.0f);
            return;
        }
        // Otherwise, update the volume for the audio
        else {
            SetVolume(new_volume);
            return;
        }
    }
    else if (_state == AUDIO_STATE_FADE_IN) {
        // Stop right away when the effect is less than a usual cpu cycle
        if(_fade_effect_time <= 10.0f) {
            SetVolume(1.0f);
            _state = AUDIO_STATE_PLAYING;
            return;
        }

        float time_elapsed = (float)hoa_system::SystemManager->GetUpdateTime();
        float new_volume = GetVolume() + (time_elapsed / _fade_effect_time);


        // If the volume has reached the maximum, mark the effect as over
        if(new_volume >= 1.0f) {
            SetVolume(1.0f);
            _state = AUDIO_STATE_PLAYING;
            return;
        }
        // Otherwise, update the volume for the audio
        else {
            SetVolume(new_volume);
        }
    }
}
开发者ID:grimreaper,项目名称:ValyriaTear,代码行数:49,代码来源:audio_descriptor.cpp

示例6: WorldPositionToVolumePosition

bool UBasicVolumeComponent::PickLastSolidVoxel(const FVector& Start, const FVector& End, FIntVector& HitPoint) const
{
	if (GetVolume() == nullptr)
	{
		return false;
	}

	FVector NewStart;
	FVector NewEnd;

	WorldPositionToVolumePosition(Start, NewStart);
	WorldPositionToVolumePosition(End, NewEnd);

	return GetVolume()->PickLastSolidVoxel(NewStart, NewEnd, HitPoint);
}
开发者ID:ChillyFlashER,项目名称:Voreeal,代码行数:15,代码来源:VoreealBasicVolumeComponent.cpp

示例7: Vec2DNormalize

//----------------------------------------------
TeffHit::TeffHit( TsceneGame *game, const Vector2D &pos, const Vector2D &velocity)
	:TobjEffect(
	game,
	pos,						// position
	0.5,						// radius
	velocity,					// velocity
	0.5,						// max_speed
	Vec2DNormalize(velocity),	// heading
	0.,							// mass
	Vector2D(0.08, 0.08),		// scale
	0,							// turn_rate
	1,							// max_force
	1							// vitality
	),
	FiTimer(0),
	FiAlpha(1.0)
{
	iImageWidth=TRIMMING__IMAGE_RBX - TRIMMING__IMAGE_LTX;
	iImageHeight=TRIMMING__IMAGE_RBY - TRIMMING__IMAGE_LTY;

	// ヒット時の効果音
	int ch = PlayDxSound( SND_SE_SHOT );
	int bgm_vol = GetVolume(ch);
	SetVolume(ch, -200);
}
开发者ID:kouh777,项目名称:myapp,代码行数:26,代码来源:effHit.cpp

示例8: Size

status_t
SymLink::WriteSymLink(const char* buffer, size_t toWrite,
	Transaction& transaction)
{
	uint64 size = Size();
	if (size > kMaxSymLinkSize)
		RETURN_ERROR(B_BAD_DATA);

	if (toWrite > kMaxSymLinkSize)
		RETURN_ERROR(B_NAME_TOO_LONG);

	if (toWrite == 0) {
		SetSize(0);
		return B_OK;
	}

	Block block;
	if (!block.GetWritable(GetVolume(), BlockIndex(), transaction))
		return B_ERROR;

	char* data = (char*)block.Data() + kSymLinkDataOffset;
	memcpy(data, buffer, toWrite);
	SetSize(toWrite);

	return B_OK;
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:26,代码来源:SymLink.cpp

示例9: Vec2DNormalize

//----------------------------------------------
TeffFinalBigExplosion::TeffFinalBigExplosion( TsceneGame *game, const Vector2D &pos, const Vector2D &velocity)
	:TobjEffect(
	game,
	pos,						// position
	0.5,						// radius
	velocity,					// velocity
	0.5,						// max_speed
	Vec2DNormalize(velocity),	// heading
	0.,							// mass
	Vector2D(5.0, 5.0),			// scale
	0,							// turn_rate
	1,							// max_force
	1							// vitality
	),
	FiTimer(0),
	FiAlpha(1.0),
	FiFrame(0)
{
	iImageWidth=TRIMMING__IMAGE_RBX - TRIMMING__IMAGE_LTX;
	iImageHeight=TRIMMING__IMAGE_RBY - TRIMMING__IMAGE_LTY;

	// ボス独自の爆発音を発生
	int ch = PlayDxSound( SND_SE_BOSS_DEATH );
	int bgm_vol = GetVolume(ch);
	SetVolume(ch, -300);
}
开发者ID:kouh777,项目名称:myapp,代码行数:27,代码来源:effFinalBigExplosion.cpp

示例10: PlaySoundClip

void CAudioManager::Fadein(int id, int targetVolume,  float time){
  if(m_bValidAudio == false)
    return;

  int currentVolume = 0;
  double timeStep = 0;
  double volumeStep = 0;

  for(int i = 0; i < m_AudioClip.size(); i++){
    if(m_AudioClip[i].AudioID == id){// && IsPlaying(id) == true){
      if(IsPlaying(i) == false){
        PlaySoundClip(i, 0);
        SetVolume(i, 0);
      }
      m_AudioClip[i].targetVolume = targetVolume;
      currentVolume = GetVolume(i);
      if(targetVolume > currentVolume && time > 0){
        timeStep = time/ 0.1;
        volumeStep = (double)(targetVolume - currentVolume) / timeStep;
        m_AudioClip[i].fadeStep = volumeStep;
        m_AudioClip[i].bFadein = true;
      }
    }
  }//for
}
开发者ID:ChuckBolin,项目名称:CookieStealingOgre,代码行数:25,代码来源:CAudioManager.cpp

示例11: GetKey

// WriteAt
status_t
Attribute::WriteAt(off_t offset, const void *buffer, size_t size,
				   size_t *bytesWritten)
{
	// get the current key for the attribute
	uint8 oldKey[kMaxIndexKeyLength];
	size_t oldLength;
	GetKey(oldKey, &oldLength);

	// write the new value
	status_t error = DataContainer::WriteAt(offset, buffer, size, bytesWritten);

	// If there is an index and a change has been made within the key, notify
	// the index.
	if (offset < kMaxIndexKeyLength && size > 0 && fIndex)
		fIndex->Changed(this, oldKey, oldLength);

	// update live queries
	const uint8* newKey;
	size_t newLength;
	GetKey(&newKey, &newLength);
	GetVolume()->UpdateLiveQueries(NULL, fNode, GetName(), fType, oldKey,
		oldLength, newKey, newLength);

	// node has been changed
	if (fNode && size > 0)
		fNode->MarkModified(B_STAT_MODIFICATION_TIME);

	return error;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:31,代码来源:Attribute.cpp

示例12: TBaseMovingObject

//----------------------------------------------
TobjShot::TobjShot(
			TsceneGame *game,
			Vector2D position,
            double   radius,
            Vector2D velocity,
            double   max_speed,
            Vector2D heading,
            double   mass,
            Vector2D scale,
            double   turn_rate,
            double   max_force,
			double   vitality) : TBaseMovingObject(	game,
													TBaseObject::shot,
													position,
													radius,
													velocity,
													max_speed,
													heading,
													mass,
													scale,
													turn_rate,
													max_force,
													vitality)
{
	// プレイヤーショットの効果音を再生
	int ch = PlayDxSound( SND_SE_SHOT );
	int bgm_vol = GetVolume(ch);
	SetVolume(ch, -300);
}
开发者ID:kouh777,项目名称:myapp,代码行数:30,代码来源:objShot.cpp

示例13: SetBasicVolume

bool UBasicVolumeComponent::SetBasicVolume(UBasicVolume* NewVolume)
{
	if (NewVolume == GetVolume() && NewVolume == nullptr)
		return false;

	AActor* Owner = GetOwner();
	if (!AreDynamicDataChangesAllowed() && Owner != NULL)
	{
		FMessageLog("PIE").Warning(FText::Format(
			FText::FromString(TEXT("Calling SetBasicVolume on '{0}' but Mobility is Static.")),
			FText::FromString(GetPathName())));
		return false;
	}

	if (m_octree.IsValid())
	{
		m_octree.Reset();
	}

	PRAGMA_DISABLE_DEPRECATION_WARNINGS
	Volume = NewVolume;
	PRAGMA_ENABLE_DEPRECATION_WARNINGS

	// If there were a volume before we call then we force gc
	UWorld* World = GetWorld();
	if (World)
	{
		World->ForceGarbageCollection(true);
	}

	EnsureRendering();

	return true;
}
开发者ID:ChillyFlashER,项目名称:Voreeal,代码行数:34,代码来源:VoreealBasicVolumeComponent.cpp

示例14: if

//---------------------------------------------------------------------------
void tTJSNI_BaseSoundBuffer::TimerBeatHandler()
{
	// fade handling

	if(!Owner) return;   // "Owner" indicates the owner object is valid

	if(!InFading) return;

	if(BlankLeft)
	{
		BlankLeft -= TVP_SB_BEAT_INTERVAL;
		if(BlankLeft < 0) BlankLeft = 0;
	}
	else if(FadeCount)
	{
		if(FadeCount == 1)
		{
			StopFade(true, true);
		}
		else
		{
			FadeCount--;
			tjs_int v;
			v = GetVolume();
			v += DeltaVolume;
			if(v<0) v = 0;
			if(v>100000) v = 100000;
			SetVolume(v);
		}
	}
}
开发者ID:John-He-928,项目名称:krkrz,代码行数:32,代码来源:SoundBufferBaseIntf.cpp

示例15: GetVolume

	void Output::saveVolume ()
	{
		SaveVolumeScheduled_ = false;

		XmlSettingsManager::Instance ().setProperty ("AudioVolume", GetVolume ());
		XmlSettingsManager::Instance ().setProperty ("AudioMuted", IsMuted ());
	}
开发者ID:SboichakovDmitriy,项目名称:leechcraft,代码行数:7,代码来源:output.cpp


注:本文中的GetVolume函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。