MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / OnUpdateValue

Method OnUpdateValue

Editor/TVSoundKeyDialog.cpp:97–123  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

95
96//////////////////////////////////////////////////////////////////////////
97void CTVSoundKeyDialog::OnUpdateValue()
98{
99 ISoundKey key;
100 CString sFilename;
101 m_track->GetKey( m_key,&key );
102 m_filenameCtrl.GetWindowText(sFilename);
103 strncpy(key.pszFilename, sFilename, sizeof(key.pszFilename));
104 key.pszFilename[sizeof(key.pszFilename)-1]=0;
105 key.nVolume=m_Volume.GetValue();
106 key.nPan=m_Pan.GetValue()+127;
107 key.inRadius = m_InRadius.GetValue();
108 key.outRadius = m_OutRadius.GetValue();
109 key.b3DSound = (m_soundType==1)?true:false;
110 key.bStream = m_streamBtn.GetCheck() != 0;
111 key.bLoop = m_loopBtn.GetCheck() != 0;
112 _smart_ptr<ISound> pSound = GetIEditor()->GetSystem()->GetISoundSystem()->LoadSound(key.pszFilename, FLAG_SOUND_2D|FLAG_SOUND_LOAD_SYNCHRONOUSLY);
113 if (pSound)
114 {
115 key.fDuration=(float)pSound->GetLengthMs()/1000.0f;
116 }else
117 key.fDuration=0.0f;
118 m_track->SetKey(m_key, &key);
119 GetIEditor()->GetAnimation()->ForceAnimation();
120 RefreshTrackView();
121
122 GetIEditor()->SetModifiedFlag();
123}
124
125//////////////////////////////////////////////////////////////////////////
126void CTVSoundKeyDialog::OnBnClickedStereo()

Callers

nothing calls this directly

Calls 13

GetIEditorFunction · 0.85
GetCheckMethod · 0.80
GetISoundSystemMethod · 0.80
ForceAnimationMethod · 0.80
GetAnimationMethod · 0.80
SetModifiedFlagMethod · 0.80
GetKeyMethod · 0.45
GetWindowTextMethod · 0.45
GetValueMethod · 0.45
LoadSoundMethod · 0.45
GetSystemMethod · 0.45
GetLengthMsMethod · 0.45

Tested by

no test coverage detected