本文整理汇总了C++中Music::getEffect2方法的典型用法代码示例。如果您正苦于以下问题:C++ Music::getEffect2方法的具体用法?C++ Music::getEffect2怎么用?C++ Music::getEffect2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Music
的用法示例。
在下文中一共展示了Music::getEffect2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadMWMusicFile
//.........这里部分代码省略.........
{
break;
}
unsigned char env = sequenceBlock[i];
i++;
if (env & 0x80)
{
// TODO: Bend instead of voice change?
}
else
{
if (env != lastEnv)
{
lastEnv = env;
blockText += L"ENV:" + GetNum(lastEnv) + L"\r\n";
}
}
}
lengthByte = lengthByte & 0x3f;
if (lengthByte != lastDur)
{
lastDur = lengthByte;
blockText += L"DUR:" + GetNum(lastDur) + L"\r\n";
}
if (i >= sequenceBlock.size())
{
break;
}
unsigned char noteByte = sequenceBlock[i];
noteByte &= 0x7f;
blockText += CString(MusicStudio1::BlockEntry::GetNoteFromNumber(noteByte).c_str()) + L"\r\n";
}
mBlocks[sequence] = blockText;
}
const std::vector<Block> &effect1 = music.getEffect1();
const std::vector<Block> &effect2 = music.getEffect2();
for (size_t effect = 0 ; effect < effect1.size() ; effect++)
{
if (effect >= MusicStudio1::MusicFile::kMaxEnvelopes)
{
break;
}
mEnvelopeNames[effect] = _T("A note");
mEnvelopes[effect].mAttackDecay = effect1[effect][0];
mEnvelopes[effect].mSustainRelease = effect1[effect][1];
mEnvelopes[effect].mAllowVoiceEffects = true;
int nextTableWave = getNextFreeTableControl(MusicStudio1::kTableIndex_Wave);
int nextTableNote = getNextFreeTableControl(MusicStudio1::kTableIndex_Note);
int nextTablePulse = getNextFreeTableControl(MusicStudio1::kTableIndex_Pulse);
if (nextTableWave > 0)
{
mEnvelopes[effect].mActiveTableWave = true;
mEnvelopes[effect].mTableWave = nextTableWave;
mTablesControls[MusicStudio1::kTableIndex_Wave][nextTableWave] = effect1[effect][2];
mTablesControls[MusicStudio1::kTableIndex_Wave][nextTableWave+1] = 0xff;
if ( (effect1[effect][2] & MusicStudio1::kSIDVoiceControl_Mask_Pulse) && nextTablePulse > 0)
{
mEnvelopes[effect].mActiveTablePulse = true;
mEnvelopes[effect].mTablePulse = nextTablePulse;
mTablesControls[MusicStudio1::kTableIndex_Pulse][nextTablePulse] = effect1[effect][4] & 0x0f;
mTablesValues[MusicStudio1::kTableIndex_Pulse][nextTablePulse] = effect1[effect][4];
mTablesControls[MusicStudio1::kTableIndex_Pulse][nextTablePulse+1] = 0xff;
// TODO: effect1[effect][5] is used for "PULSE WIDTH MODULATION CODE"
}
// Handle: ATK NOTE SPECIAL
if ( (effect1[effect][3] & 0x20) && nextTableNote > 0 )
{
mEnvelopes[effect].mActiveTableNote = true;
mEnvelopes[effect].mTableNote = nextTableNote;
if (effect2[effect][1] == 0)
{
mTablesControls[MusicStudio1::kTableIndex_Note][nextTableNote] = 0xb0 | (effect1[effect][7] & 0x0f);
mTablesValues[MusicStudio1::kTableIndex_Note][nextTableNote] = 0;
mTablesControls[MusicStudio1::kTableIndex_Note][nextTableNote+1] = 0xff;
}
else
{
mTablesControls[MusicStudio1::kTableIndex_Note][nextTableNote] = 0x10 | (effect1[effect][7] & 0x0f);
mTablesValues[MusicStudio1::kTableIndex_Note][nextTableNote] = effect2[effect][1];
mTablesControls[MusicStudio1::kTableIndex_Note][nextTableNote+1] = 0x20;
mTablesControls[MusicStudio1::kTableIndex_Note][nextTableNote+2] = 0xff;
}
}
}
// OptimiseTables(true);
}
return true;
}