本文整理汇总了C++中CFamiTrackerDoc::GetInstrument方法的典型用法代码示例。如果您正苦于以下问题:C++ CFamiTrackerDoc::GetInstrument方法的具体用法?C++ CFamiTrackerDoc::GetInstrument怎么用?C++ CFamiTrackerDoc::GetInstrument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFamiTrackerDoc
的用法示例。
在下文中一共展示了CFamiTrackerDoc::GetInstrument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetCurrentInstrument
void CInstrumentEditDlg::SetCurrentInstrument(int Index)
{
CFamiTrackerDoc *pDoc = CFamiTrackerDoc::GetDoc();
std::shared_ptr<CInstrument> pInstrument = pDoc->GetInstrument(Index);
int InstType = pInstrument->GetType();
// Dialog title
char Name[256];
pDoc->GetInstrumentName(Index, Name);
CString Suffix;
Suffix.Format(_T("%02X. %s (%s)"), Index, Name, CHIP_NAMES[InstType]);
CString Title;
AfxFormatString1(Title, IDS_INSTRUMENT_EDITOR_TITLE, Suffix);
SetWindowText(Title);
if (InstType != m_iSelectedInstType) {
ShowWindow(SW_HIDE);
ClearPanels();
switch (InstType) {
case INST_2A03: {
int Channel = CFamiTrackerView::GetView()->GetSelectedChannel();
int Type = pDoc->GetChannelType(Channel);
bool bShowDPCM = (Type == CHANID_DPCM) || (std::static_pointer_cast<CInstrument2A03>(pInstrument)->AssignedSamples());
InsertPane(new CInstrumentEditorSeq(NULL, _T("2A03 settings"), CInstrument2A03::SEQUENCE_NAME, 15, 3, INST_2A03), !bShowDPCM); // // //
InsertPane(new CInstrumentEditorDPCM(), bShowDPCM);
}
break;
case INST_VRC6:
InsertPane(new CInstrumentEditorSeq(NULL, _T("Konami VRC6"), CInstrumentVRC6::SEQUENCE_NAME, 15, 7, INST_VRC6), true);
break;
case INST_VRC7:
InsertPane(new CInstrumentEditorVRC7(), true);
break;
case INST_FDS:
InsertPane(new CInstrumentEditorFDS(), true);
InsertPane(new CInstrumentEditorFDSEnvelope(), false);
break;
case INST_N163:
InsertPane(new CInstrumentEditorSeq(
NULL, _T("Envelopes"), CInstrumentN163::SEQUENCE_NAME, 15, CInstrumentN163::MAX_WAVE_COUNT - 1, INST_N163
), true);
InsertPane(new CInstrumentEditorN163Wave(), false);
break;
case INST_S5B:
InsertPane(new CInstrumentEditorSeq(NULL, _T("Sunsoft 5B"), CInstrumentS5B::SEQUENCE_NAME, 15, 255, INST_S5B), true);
break;
}
m_iSelectedInstType = InstType;
}
for (int i = 0; i < PANEL_COUNT; ++i) {
if (m_pPanels[i] != NULL) {
m_pPanels[i]->SelectInstrument(pInstrument);
}
}
ShowWindow(SW_SHOW);
UpdateWindow();
m_iSelectedInstType = InstType;
}