| 21 | #include "Engine/Platform/MessageBox.h" |
| 22 | |
| 23 | bool ImportAudio::TryGetImportOptions(const StringView& path, Options& options) |
| 24 | { |
| 25 | #if IMPORT_AUDIO_CACHE_OPTIONS |
| 26 | if (FileSystem::FileExists(path)) |
| 27 | { |
| 28 | auto tmpFile = ContentStorageManager::GetStorage(path); |
| 29 | AssetInitData data; |
| 30 | if (tmpFile |
| 31 | && tmpFile->GetEntriesCount() == 1 |
| 32 | && tmpFile->GetEntry(0).TypeName == AudioClip::TypeName |
| 33 | && !tmpFile->LoadAssetHeader(0, data) |
| 34 | && data.SerializedVersion >= 1) |
| 35 | { |
| 36 | // Check import meta |
| 37 | rapidjson_flax::Document metadata; |
| 38 | metadata.Parse(data.Metadata.Get<const char>(), data.Metadata.Length()); |
| 39 | if (!metadata.HasParseError()) |
| 40 | { |
| 41 | options.Deserialize(metadata, nullptr); |
| 42 | return true; |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | #endif |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | CreateAssetResult ImportAudio::Import(CreateAssetContext& context, AudioDecoder& decoder) |
| 51 | { |
nothing calls this directly
no test coverage detected