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


C++ CFamiTrackerDoc::GetChannelType方法代码示例

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


在下文中一共展示了CFamiTrackerDoc::GetChannelType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:fourks,项目名称:0CC-FamiTracker,代码行数:63,代码来源:InstrumentEditDlg.cpp

示例2: SetCurrentInstrument

void CInstrumentEditDlg::SetCurrentInstrument(int Index)
{
    CFamiTrackerDoc *pDoc = CFamiTrackerDoc::GetDoc();
    CInstrumentContainer<CInstrument> instContainer(pDoc, Index);
    CInstrument *pInstrument = instContainer();
    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) || (static_cast<CInstrument2A03*>(pInstrument)->AssignedSamples());
            InsertPane(new CInstrumentEditor2A03(), !bShowDPCM);
            InsertPane(new CInstrumentEditorDPCM(), bShowDPCM);
        }
        break;
        case INST_VRC6:
            InsertPane(new CInstrumentEditorVRC6(), 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 CInstrumentEditorN163(), true);
            InsertPane(new CInstrumentEditorN163Wave(), false);
            break;
        case INST_S5B:
            InsertPane(new CInstrumentEditorS5B(), true);
            break;
        }

        m_iSelectedInstType = InstType;
    }

    for (int i = 0; i < PANEL_COUNT; ++i) {
        if (m_pPanels[i] != NULL) {
            m_pPanels[i]->SelectInstrument(Index);
        }
    }

    ShowWindow(SW_SHOW);
    UpdateWindow();

    m_iSelectedInstType = InstType;
}
开发者ID:WhoIsLudwig,项目名称:nesicide,代码行数:62,代码来源:InstrumentEditDlg.cpp


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