public void LoadRom(Stream stream, string filename, string name)
        {
            dx7_bank bank = new dx7_bank();

            bank.dx7_patchbank_load(stream, filename, name.ToUpper());
            _banks.Add(bank);
            Cache();
        }
        private void LoadFactoryRom(string romName)
        {
            Assembly assembly     = Assembly.GetExecutingAssembly();
            string   resourceName = string.Format("Sixport.Roms.{0}.syx", romName);
            Stream   stream       = assembly.GetManifestResourceStream(resourceName);
            dx7_bank bank         = new dx7_bank();

            bank.dx7_patchbank_load(stream, romName + ".syx", romName.ToUpper());
            stream.Close();
            stream.Dispose();
            _banks.Add(bank);
        }
        private void Cache()
        {
            List <string> list = new List <string>();

            for (int i = 0; i < _banks.Count; i++)
            {
                dx7_bank bank     = _banks[i];
                string   bankName = bank.Name;
                for (int j = 0; j < bank.Patches.Count; j++)
                {
                    list.Add(bankName + " / " + bank.Patches[j].Name);
                }
            }
            _cache = list;
        }
 public dx7_patch this[int index]
 {
     get
     {
         int rem = index;
         for (int i = 0; i < _banks.Count; i++)
         {
             dx7_bank bank       = _banks[i];
             int      bankLength = bank.Patches.Count;
             if (rem >= bankLength)
             {
                 rem -= bankLength;
                 continue;
             }
             return(bank.Patches[rem]);
         }
         return(null);
     }
 }