当前位置: 首页>>代码示例>>C++>>正文


C++ BigInteger::getBitRangeAsInt方法代码示例

本文整理汇总了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);
	}
}
开发者ID:gareth8118,项目名称:ctrlr,代码行数:25,代码来源:CtrlrMIDILibrary.cpp

示例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;
	}
}
开发者ID:Srikrishna31,项目名称:ctrlr,代码行数:71,代码来源:CtrlrSysexProcessor.cpp


注:本文中的BigInteger::getBitRangeAsInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。