本文整理汇总了C#中Microsoft.Xna.Framework.Audio.AudioEngine.INTERNAL_getVariableName方法的典型用法代码示例。如果您正苦于以下问题:C# AudioEngine.INTERNAL_getVariableName方法的具体用法?C# AudioEngine.INTERNAL_getVariableName怎么用?C# AudioEngine.INTERNAL_getVariableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Audio.AudioEngine
的用法示例。
在下文中一共展示了AudioEngine.INTERNAL_getVariableName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SoundBank
//.........这里部分代码省略.........
else if (varTableType == 1)
{
// Complex with byte min/max
uint varOffset = reader.ReadUInt32();
byte wMin = reader.ReadByte();
byte wMax = reader.ReadByte();
// Store for sound read
long varPos = reader.BaseStream.Position;
// Seek to the sound in the Bank
reader.BaseStream.Seek(varOffset, SeekOrigin.Begin);
// Read the sound
cueSounds[j] = new XACTSound(reader);
// Back to where we were...
reader.BaseStream.Seek(varPos, SeekOrigin.Begin);
// Calculate probability based on weight
cueProbs[j, 0] = wMax / 255.0f;
cueProbs[j, 1] = wMin / 255.0f;
}
else if (varTableType == 3)
{
// Complex with float min/max
uint varOffset = reader.ReadUInt32();
float wMin = reader.ReadSingle();
float wMax = reader.ReadSingle();
// Unknown value
reader.ReadUInt32();
// Store for sound read
long varPos = reader.BaseStream.Position;
// Seek to the sound in the Bank
reader.BaseStream.Seek(varOffset, SeekOrigin.Begin);
// Read the sound
cueSounds[j] = new XACTSound(reader);
// Back to where we were...
reader.BaseStream.Seek(varPos, SeekOrigin.Begin);
// Calculate probability based on weight
cueProbs[j, 0] = wMax;
cueProbs[j, 1] = wMin;
}
else if (varTableType == 4)
{
// Compact Wave
ushort track = reader.ReadUInt16();
byte waveBank = reader.ReadByte();
// Create the Sound
cueSounds[j] = new XACTSound(track, waveBank);
// FIXME: Assume Sound weight is 100%
cueProbs[j, 0] = 1.0f;
cueProbs[j, 1] = 0.0f;
}
else
{
throw new NotSupportedException();
}
}
// Back to where we were...
reader.BaseStream.Seek(curPos, SeekOrigin.Begin);
// Add Built CueData to Dictionary
INTERNAL_cueData.Add(
cueNames[numCueSimple + i],
new CueData(
cueSounds,
cueProbs,
(varTableType == 3) ? INTERNAL_baseEngine.INTERNAL_getVariableName(variable) : String.Empty
)
);
}
// Cue instance limit
byte instanceLimit = reader.ReadByte();
// Fade In/Out, unused
reader.ReadUInt16();
reader.ReadUInt16();
// Cue max instance behavior
byte behavior = reader.ReadByte();
INTERNAL_cueData[cueNames[numCueSimple + i]].SetLimit(
instanceLimit,
behavior
);
}
}
IsDisposed = false;
}