本文整理汇总了C++中BigInteger::getBitRangeAsInt方法的典型用法代码示例。如果您正苦于以下问题:C++ BigInteger::getBitRangeAsInt方法的具体用法?C++ BigInteger::getBitRangeAsInt怎么用?C++ BigInteger::getBitRangeAsInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BigInteger
的用法示例。
在下文中一共展示了BigInteger::getBitRangeAsInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: valueTreePropertyChanged
void CtrlrMIDILibrary::valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property)
{
if (!treeWhosePropertyHasChanged.hasType(Ids::midiLibrary))
return;
if (property == Ids::midiLibraryBank)
{
setCurrentBank(Uuid(getProperty(property)));
}
else if (property == Ids::midiLibraryProgram)
{
setCurrentProgram (Uuid(getProperty(property)), InheritFromLibrary);
}
else if (property == Ids::midiLibrarySnapshot)
{
setCurrentSnapshot (Uuid(getProperty(property)), InheritFromLibrary);
}
else if ((property == Ids::lsb || property == Ids::msb) && treeWhosePropertyHasChanged.hasType (Ids::midiLibraryBank))
{
BigInteger bi;
bi.setBitRangeAsInt (0, 7, (int)treeWhosePropertyHasChanged.getProperty(Ids::lsb));
bi.setBitRangeAsInt (7, 7, (int)treeWhosePropertyHasChanged.getProperty(Ids::msb));
treeWhosePropertyHasChanged.setProperty (Ids::value, (int)bi.getBitRangeAsInt (0, 14), nullptr);
}
}
示例2: sysExProcessToken
void CtrlrSysexProcessor::sysExProcessToken (const CtrlrSysexToken token, uint8 *byte, const int value, const int channel)
{
if (byte == NULL)
return;
BigInteger bi;
switch (token.getType())
{
case ByteValue:
*byte = (uint8)value;
break;
case ByteChannel:
*byte = (uint8)jlimit (0,15, channel-1);
break;
case LSB7bitValue:
*byte = (uint8)(value & 127);
break;
case MSB7bitValue:
*byte = (uint8)(value >> 7);
break;
case ByteChannel4Bit:
bi = BigInteger ((uint8)jlimit (0,15, channel-1));
bi.setBitRangeAsInt (4, 3, token.getAdditionalData());
*byte = (uint8)bi.getBitRangeAsInt(0,7);
break;
case GlobalVariable:
if (getGlobalVariables() [token.getAdditionalData()] >= 0)
*byte = (uint8)getGlobalVariables() [token.getAdditionalData()];
break;
case LSB4bitValue:
*byte = (uint8)(value & 0xf);
break;
case MSB4bitValue:
*byte = (uint8)((value >> 4) & 0xf);
break;
case RolandSplitByte1:
*byte = getRolandSplit (value, 1);
break;
case RolandSplitByte2:
*byte = getRolandSplit (value, 2);
break;
case RolandSplitByte3:
*byte = getRolandSplit (value, 3);
break;
case RolandSplitByte4:
*byte = getRolandSplit (value, 4);
break;
case CurrentProgram:
case CurrentBank:
case Ignore:
case ChecksumRolandJP8080:
case ChecksumWaldorfRackAttack:
case FormulaToken:
case LUAToken:
case NoToken:
break;
}
}