mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
added OggAudio.Instance public property.
This commit is contained in:
parent
0a73f4f96e
commit
be6825bf07
@ -63,8 +63,8 @@ namespace GameRes.Formats
|
||||
{
|
||||
if (0 == signature) return null;
|
||||
// resolve some special cases first
|
||||
if (s_OggFormat.Value.Signature == signature)
|
||||
return s_OggFormat.Value;
|
||||
if (OggAudio.Instance.Signature == signature)
|
||||
return OggAudio.Instance;
|
||||
if (AudioFormat.Wav.Signature == signature)
|
||||
return AudioFormat.Wav;
|
||||
if (0x4D42 == (signature & 0xFFFF)) // 'BM'
|
||||
|
@ -26,6 +26,7 @@
|
||||
using System;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NVorbis;
|
||||
|
||||
namespace GameRes.Formats
|
||||
@ -133,5 +134,9 @@ namespace GameRes.Formats
|
||||
{
|
||||
return new OggInput (file);
|
||||
}
|
||||
|
||||
public static AudioFormat Instance { get { return s_OggFormat.Value; } }
|
||||
|
||||
static readonly Lazy<AudioFormat> s_OggFormat = new Lazy<AudioFormat> (() => FormatCatalog.Instance.AudioFormats.FirstOrDefault (x => x.Tag == "OGG"));
|
||||
}
|
||||
}
|
||||
|
@ -44,8 +44,6 @@ namespace GameRes.Formats.BlackCyc
|
||||
Extensions = new string[] { "vaw", "wgq" };
|
||||
}
|
||||
|
||||
static readonly Lazy<AudioFormat> OggFormat = new Lazy<AudioFormat> (() => FormatCatalog.Instance.AudioFormats.FirstOrDefault (x => x.Tag == "OGG"));
|
||||
|
||||
public override SoundInput TryOpen (Stream file)
|
||||
{
|
||||
var header = ResourceHeader.Read (file);
|
||||
@ -64,12 +62,12 @@ namespace GameRes.Formats.BlackCyc
|
||||
}
|
||||
else if (2 == header.PackType)
|
||||
{
|
||||
format = OggFormat.Value;
|
||||
format = OggAudio.Instance;
|
||||
offset = 0x6C;
|
||||
}
|
||||
else if (6 == header.PackType && Binary.AsciiEqual (header.Bytes, 0x10, "OGG "))
|
||||
{
|
||||
format = OggFormat.Value;
|
||||
format = OggAudio.Instance;
|
||||
offset = 0x40;
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user