Пример #1
0
 /// <summary>
 /// Import the specified Zip file into the SoundManager sound scheme
 /// </summary>
 /// <param name="zipfile">Input Zip file</param>
 public static void Import(string zipfile)
 {
     using (ZipFile zip = ZipFile.Read(zipfile))
     {
         foreach (SoundEvent soundEvent in SoundEvent.GetAll())
         {
             if (TryExtract(zip, soundEvent.FileName, SoundEvent.DataDirectory) ||
                 TryExtract(zip, soundEvent.LegacyFileName, SoundEvent.DataDirectory, soundEvent.FileName))
             {
                 SoundScheme.Update(soundEvent, soundEvent.FilePath);
             }
             else
             {
                 SoundScheme.Remove(soundEvent);
             }
         }
         SchemeMeta.ResetAll();
         if (!TryExtract(zip, Path.GetFileName(SchemeMeta.SchemeImageFilePath), SoundEvent.DataDirectory))
         {
             TryExtract(zip, "visuel.bmp", SoundEvent.DataDirectory, Path.GetFileName(SchemeMeta.SchemeImageFilePath));
         }
         if (!TryExtract(zip, Path.GetFileName(SchemeMeta.SchemeInfoFilePath), SoundEvent.DataDirectory))
         {
             TryExtract(zip, "infos.ini", SoundEvent.DataDirectory, Path.GetFileName(SchemeMeta.SchemeInfoFilePath));
         }
         SchemeMeta.ReloadFromDisk();
         SoundScheme.Apply(SoundScheme.GetSchemeSoundManager(), Settings.MissingSoundUseDefault);
     }
 }
Пример #2
0
        /// <summary>
        /// Reload scheme image and info
        /// </summary>
        private void RefreshSchemeMetadata()
        {
            SchemeMeta.ReloadFromDisk();
            soundImage.Image       = SchemeMeta.Thumbnail;
            soundImageText.Visible = (soundImage.Image == null);

            soundInfoNameBox.Text   = SchemeMeta.Name;
            soundInfoAuthorBox.Text = SchemeMeta.Author;
            soundInfoAboutBox.Text  = SchemeMeta.About;
        }