/// <summary>
        ///
        /// </summary>
        private void ReadCombiData(int bankStart, int numberOfBanks)
        {
            for (int bankIndex = bankStart; bankIndex < numberOfBanks; bankIndex++)
            {
                Common.Synth.Meta.IBank bank = CurrentPcgMemory.CombiBanks[bankIndex];
                bank.ByteOffset = Index;
                bank.ByteLength = 208;
                bank.IsWritable = true;
                bank.IsLoaded   = true;

                for (int index = 0; index < bank.Patches.Count; index++)
                {
                    // Place in PcgMemory.
                    ICombi combi = (ICombi)bank[index];
                    combi.ByteOffset = Index;
                    combi.ByteLength = bank.ByteLength;
                    combi.IsLoaded   = true;

                    combi.Timbres.ByteOffset = combi.ByteOffset + TimbresByteOffset;

                    foreach (ITimbre timbre in combi.Timbres.TimbresCollection)
                    {
                        timbre.ByteOffset = combi.Timbres.ByteOffset + timbre.Index * timbre.ByteLength;
                    }

                    // Skip to next.
                    Index += bank.ByteLength;
                }
            }

            // When virtual banks are used, here needs to be checked to stop reading combi banks.
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="offset"></param>
        private void ReadSingleCombi(int offset)
        {
            Common.Synth.Meta.IBank bank = CurrentPcgMemory.CombiBanks[0];
            bank.ByteOffset = 0;
            bank.ByteLength = 128;
            bank.IsWritable = true;
            bank.IsLoaded   = true;

            Common.Synth.Meta.IPatch combi = bank[0];
            combi.ByteOffset = offset;
            combi.ByteLength = bank.ByteLength;
            combi.IsLoaded   = true;
        }