コード例 #1
0
 public SXXEditor(StandardUI host, SNDFile datafile, SoundCache cache, string FileName)
 {
     InitializeComponent();
     this.datafile = datafile;
     this.host     = host;
     this.cache    = cache;
     this.fileName = FileName;
     Text          = string.Format("{0} - Sound Editor", FileName);
 }
コード例 #2
0
        /// <summary>
        /// Helper function to create a sound cache from a given data file.
        /// </summary>
        /// <param name="datafile">The datafile to load from. Must have a valid stream.</param>
        /// <returns>The sound cache with the sound data.</returns>
        public static SoundCache CreateCacheFromFile(SNDFile datafile)
        {
            SoundCache cache = new SoundCache();

            for (int i = 0; i < datafile.Sounds.Count; i++)
            {
                cache.CacheSound(datafile.LoadSound(i));
            }

            return(cache);
        }