本文整理汇总了C++中SoundInstance::UpdateParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundInstance::UpdateParameter方法的具体用法?C++ SoundInstance::UpdateParameter怎么用?C++ SoundInstance::UpdateParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundInstance
的用法示例。
在下文中一共展示了SoundInstance::UpdateParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderOutput
void SoundParameterGraph::RenderOutput( int realX, int realY )
{
if( m_parameter->m_type == SoundParameter::TypeRangedRandom )
{
SoundEditorWindow *sew = (SoundEditorWindow *)EclGetWindow(SOUND_EDITOR_WINDOW_NAME);
if( !sew ) return;
SoundInstance *instance = g_app->m_soundSystem->GetSoundInstance( g_app->m_soundSystem->m_editorInstanceId );
if( instance )
{
instance->UpdateParameter( *m_parameter );
}
float output = m_parameter->m_output;
float x, minY, maxY;
GetPosition( output, m_minInput, &x, &minY );
GetPosition( output, m_maxInput, &x, &maxY );
glColor4f( 0.5, 1.0, 0.5, 0.75 );
glBegin( GL_LINES );
glVertex2f( realX + x, realY + minY );
glVertex2f( realX + x, realY + maxY);
glEnd();
float desiredOutput = m_parameter->m_desiredOutput;
GetPosition( desiredOutput, m_minInput, &x, &minY );
GetPosition( desiredOutput, m_maxInput, &x, &maxY );
glColor4f( 0.5, 1.0, 0.5, 0.35 );
glBegin( GL_LINES );
glVertex2f( realX + x, realY + minY );
glVertex2f( realX + x, realY + maxY);
glEnd();
}
else if( m_parameter->m_type == SoundParameter::TypeLinked )
{
SoundEditorWindow *sew = (SoundEditorWindow *)EclGetWindow(SOUND_EDITOR_WINDOW_NAME);
if( !sew ) return;
SoundInstance *instance = g_app->m_soundSystem->GetSoundInstance( g_app->m_soundSystem->m_editorInstanceId );
if( instance )
{
instance->UpdateParameter( *m_parameter );
}
float input = m_parameter->m_input;
float output = m_parameter->m_output;
float minX, minY, maxX, maxY;
GetPosition( m_minOutput, input, &minX, &minY );
GetPosition( output, m_minInput, &maxX, &maxY );
glColor4f( 0.5, 1.0, 0.5, 0.75 );
glBegin( GL_LINES );
glVertex2f( realX + minX, realY + minY );
glVertex2f( realX + maxX, realY + minY );
glVertex2f( realX + maxX, realY + minY );
glVertex2f( realX + maxX, realY + maxY );
glEnd();
glBegin( GL_LINE_LOOP );
glVertex2f( realX + 2, realY + minY - 9 );
glVertex2f( realX + 48, realY + minY - 9 );
glVertex2f( realX + 48, realY + minY + 5 );
glVertex2f( realX + 2, realY + minY + 5 );
glEnd();
g_editorFont.DrawText2DRight( realX + minX, realY + minY, 10, "%2.2", input );
g_editorFont.DrawText2DCentre( realX + maxX, realY + maxY + 10, 10, "%2.2", output );
float desiredOutput = m_parameter->m_desiredOutput;
GetPosition( m_minOutput, input, &minX, &minY );
GetPosition( desiredOutput, m_minInput, &maxX, &maxY );
glColor4f( 0.5, 1.0, 0.5, 0.35 );
glBegin( GL_LINES );
glVertex2f( realX + minX, realY + minY );
glVertex2f( realX + maxX, realY + minY );
glVertex2f( realX + maxX, realY + minY );
glVertex2f( realX + maxX, realY + maxY );
glEnd();
}
}