bool CInstrumentFDS::Load(CDocumentFile *pDocFile) { for (int i = 0; i < WAVE_SIZE; ++i) { SetSample(i, pDocFile->GetBlockChar()); } for (int i = 0; i < MOD_SIZE; ++i) { SetModulation(i, pDocFile->GetBlockChar()); } SetModulationSpeed(pDocFile->GetBlockInt()); SetModulationDepth(pDocFile->GetBlockInt()); SetModulationDelay(pDocFile->GetBlockInt()); // hack to fix earlier saved files (remove this eventually) /* if (pDocFile->GetBlockVersion() > 2) { LoadSequence(pDocFile, m_pVolume); LoadSequence(pDocFile, m_pArpeggio); if (pDocFile->GetBlockVersion() > 2) LoadSequence(pDocFile, m_pPitch); } else { */ unsigned int a = pDocFile->GetBlockInt(); unsigned int b = pDocFile->GetBlockInt(); pDocFile->RollbackPointer(8); if (a < 256 && (b & 0xFF) != 0x00) { } else { LoadSequence(pDocFile, m_pVolume); LoadSequence(pDocFile, m_pArpeggio); // // Note: Remove this line when files are unable to load // (if a file contains FDS instruments but FDS is disabled) // this was a problem in an earlier version. // if (pDocFile->GetBlockVersion() > 2) LoadSequence(pDocFile, m_pPitch); } // } // Older files was 0-15, new is 0-31 if (pDocFile->GetBlockVersion() <= 3) { for (unsigned int i = 0; i < m_pVolume->GetItemCount(); ++i) m_pVolume->SetItem(i, m_pVolume->GetItem(i) * 2); } return true; }
void CInstrumentEditorFDSEnvelope::SelectInstrument(std::shared_ptr<CInstrument> pInst) { m_pInstrument = std::dynamic_pointer_cast<CInstrumentFDS>(pInst); ASSERT(m_pInstrument); LoadSequence(); SetFocus(); }
//загрузка из XML файла void CDialogScriptHelper::Load (CUIXml* uiXml, XML_NODE* phrase_node) { LoadSequence(uiXml,phrase_node, "precondition", m_Preconditions); LoadSequence(uiXml,phrase_node, "action", m_ScriptActions); LoadSequence(uiXml,phrase_node, "has_info", m_HasInfo); LoadSequence(uiXml,phrase_node, "dont_has_info", m_DontHasInfo); LoadSequence(uiXml,phrase_node, "give_info", m_GiveInfo); LoadSequence(uiXml,phrase_node, "disable_info", m_DisableInfo); }
//загрузка из XML файла void CPhraseScript::Load (CUIXml* uiXml, XML_NODE* phrase_node) { // m_sScriptTextFunc = uiXml.Read(phrase_node, "script_text", 0, NULL); LoadSequence(uiXml,phrase_node, "precondition", m_Preconditions); LoadSequence(uiXml,phrase_node, "action", m_ScriptActions); LoadSequence(uiXml,phrase_node, "has_info", m_HasInfo); LoadSequence(uiXml,phrase_node, "dont_has_info", m_DontHasInfo); LoadSequence(uiXml,phrase_node, "give_info", m_GiveInfo); LoadSequence(uiXml,phrase_node, "disable_info", m_DisableInfo); }
void LoadDB(char *fn, int n, int mx, int d, Input **pxlst){ int i; FILE *fp = fopen(fn, "r"); char buf[BUFSIZE]; if (fp == NULL) error("cannot open list", fn); fprintf(stderr, "load dataset... \n"); //fprintf(stderr, "fB=%d... \n", FB); Input *xlst = (Input*)malloc(sizeof(Input)*n); for(i=0;i<n;i++){ if(fscanf(fp, "%s", buf)==EOF) error("error (filesize < n)", fn); xlst[i].m = LoadSequence(buf, mx, d, &xlst[i].O); strcpy(xlst[i].tag,buf); xlst[i].id=i; }//i fclose(fp); *pxlst = xlst; }
void CInstrumentEditorFDSEnvelope::OnCbnSelchangeType() { CComboBox *pTypeBox = static_cast<CComboBox*>(GetDlgItem(IDC_TYPE)); m_iSelectedSetting = pTypeBox->GetCurSel(); LoadSequence(); }
void CInstrumentEditorFDSEnvelope::OnCbnSelchangeType() { CComboBox *pTypeBox = (CComboBox*)GetDlgItem(IDC_TYPE); m_iSelectedType = pTypeBox->GetCurSel(); LoadSequence(); }
void CInstrumentEditorFDSEnvelope::SelectInstrument(int Instrument) { CInstrumentFDS *pInst = (CInstrumentFDS*)GetDocument()->GetInstrument(Instrument); m_pInstrument = pInst; LoadSequence(); }