Esempio n. 1
0
static VariableNestingLevel *
getBaseDataVariables (void) {
  if (baseDataVariables) {
    releaseVariableNestingLevel(currentDataVariables);
    deleteVariables(baseDataVariables);
  } else {
    VariableNestingLevel *globalVariables = getGlobalVariables(1);
    if (!globalVariables) return NULL;

    VariableNestingLevel *baseVariables = newVariableNestingLevel(globalVariables, "base");
    if (!baseVariables) return NULL;

    baseDataVariables = claimVariableNestingLevel(baseVariables);
  }

  currentDataVariables = claimVariableNestingLevel(baseDataVariables);
  return baseDataVariables;
}
Esempio n. 2
0
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;
	}
}