コード例 #1
0
        public void ChangeCombi()
        {
            var pcg          = CreatePcg();
            var programIa000 = (IProgram)pcg.ProgramBanks[0][0];
            var combiIa000   = (ICombi)(pcg.CombiBanks[0])[0];

            combiIa000.Name = "NonEmpty";

            combiIa000.Timbres.TimbresCollection[0].UsedProgram = programIa000;

            // Set most virtual banks loaded to save time.
            foreach (var bank in pcg.CombiBanks.BankCollection.Where(
                         bank => (bank.Type == BankType.EType.Virtual) && (bank.Id != "V-0A")))
            {
                bank.IsLoaded = false;
            }

            // Run actual test.
            var referenceChanger = new ReferenceChanger(pcg);
            var ruleParser       = new RuleParser(pcg);

            referenceChanger.ParseRules(ruleParser, "I-A000->I-B000");
            referenceChanger.ChangeReferences();

            Debug.Assert(combiIa000.Timbres.TimbresCollection[0].UsedProgram == pcg.ProgramBanks[1][0]);
        }
コード例 #2
0
        public void ChangeSetListSlotNotTooMany()
        {
            var pcg = CreatePcg();

            var programIa000      = (IProgram)pcg.ProgramBanks[0][0];
            var setListSlot000000 = (ISetListSlot)(pcg.SetLists[0])[0];

            setListSlot000000.SelectedPatchType = SetListSlot.PatchType.Program;
            setListSlot000000.UsedPatch         = programIa000;

            var programIa001      = (IProgram)pcg.ProgramBanks[0][1];
            var setListSlot000001 = (ISetListSlot)(pcg.SetLists[0])[1];

            setListSlot000001.SelectedPatchType = SetListSlot.PatchType.Program;
            setListSlot000001.UsedPatch         = programIa001;

            var referenceChanger = new ReferenceChanger(pcg);
            var ruleParser       = new RuleParser(pcg);

            referenceChanger.ParseRules(ruleParser, "I-A000->I-B000");
            referenceChanger.ChangeReferences();

            Debug.Assert(setListSlot000000.UsedPatch == pcg.ProgramBanks[1][0]); // Changed
            Debug.Assert(setListSlot000001.UsedPatch == programIa001);           // Not changed
        }
コード例 #3
0
        public void ChangeSetListSlot()
        {
            IPcgMemory   pcg               = CreatePcg();
            IProgram     programIa000      = (IProgram)pcg.ProgramBanks[0][0];
            ISetListSlot setListSlot000000 = (ISetListSlot)(pcg.SetLists[0])[0];

            setListSlot000000.SelectedPatchType = SetListSlot.PatchType.Program;
            setListSlot000000.UsedPatch         = programIa000;

            ReferenceChanger referenceChanger = new ReferenceChanger(pcg);
            RuleParser       ruleParser       = new RuleParser(pcg);

            referenceChanger.ParseRules(ruleParser, "I-A000->I-B000");
            referenceChanger.ChangeReferences();

            Debug.Assert(setListSlot000000.UsedPatch == pcg.ProgramBanks[1][0]);
        }