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


C++ Music::getEffect1方法代码示例

本文整理汇总了C++中Music::getEffect1方法的典型用法代码示例。如果您正苦于以下问题:C++ Music::getEffect1方法的具体用法?C++ Music::getEffect1怎么用?C++ Music::getEffect1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Music的用法示例。


在下文中一共展示了Music::getEffect1方法的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;
}
开发者ID:martinpiper,项目名称:C64Public,代码行数:101,代码来源:MusicStudioDocMWMusic.cpp


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