本文整理匯總了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;
}