1.17.2008

WAVEDEV - Volume

HandleWaveMessage():
SetGain(newgain) [ By pStreamContext or DeviceContext ]

StreamContext (SetGain )
GainChange( )
{
m_fxGain = MapGain(newgain);
}

MapGain( )
translate and tablet from GainMap[ ]
可以知道最後update到m_fxGain 這個variable中。

這個variable 給很多 ouput.cpp 的 Render( ) 使用。
有趣的地方:

CMidiNote::Render( ) 中,會由 SineTable[] 取出 amplititude,然後 * m_fxGain。

加上log message:
StreamContext:SetGain 19991999
StreamContext:GainChange
StreamContext:MapGain 1999
SecondaryGain fff, Total Gain 1998e667
Index 39, Result 9EF
result 就是經過GainMap[] 後的值。

沒有留言: