Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
RawSoundAssetImporter.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.Collections.Generic;
5 
6 using SiliconStudio.Assets;
7 using SiliconStudio.Core.IO;
8 
9 namespace SiliconStudio.Paradox.Assets.Audio
10 {
12  {
13  // Supported file extensions for this importer
14  public const string FileExtensions = ".wav";
15 
16  private static readonly Guid uid = new Guid("634842fa-d1db-45c2-b13d-bc11486dae4d");
17  public override Guid Id
18  {
19  get
20  {
21  return uid;
22  }
23  }
24 
25  public override string Description
26  {
27  get
28  {
29  return "Raw sound importer for creating SoundEffect assets";
30  }
31  }
32 
33  public override string SupportedFileExtensions
34  {
35  get
36  {
37  return FileExtensions;
38  }
39  }
40 
41  public override AssetImporterParameters GetDefaultParameters(bool isForReImport)
42  {
43  return new AssetImporterParameters(supportedTypes);
44  }
45  private static readonly Type[] supportedTypes = { typeof(SoundEffectAsset) };
46 
47  public override IEnumerable<AssetItem> Import(UFile rawAssetPath, AssetImporterParameters importParameters)
48  {
49  var asset = new SoundEffectAsset { Source = rawAssetPath };
50 
51  // Creates the url to the texture
52  var textureUrl = new UFile(rawAssetPath.GetFileName(), null);
53 
54  yield return new AssetItem(textureUrl, asset);
55  }
56  }
57 }
Parameters used by IAssetImporter.Import
An asset item part of a Package accessible through SiliconStudio.Assets.Package.Assets.
Definition: AssetItem.cs:17
string GetFileName()
Gets the name of the file without its extension. Can be null.
Definition: UFile.cs:75
override IEnumerable< AssetItem > Import(UFile rawAssetPath, AssetImporterParameters importParameters)
Imports a raw assets from the specified path into the specified package.
override AssetImporterParameters GetDefaultParameters(bool isForReImport)
Gets the default parameters for this importer.
Defines a normalized file path. See UPath for details. This class cannot be inherited.
Definition: UFile.cs:13