From 1b1bd0f16fd0a9848c430769a5cf76d5f454cc6d Mon Sep 17 00:00:00 2001 From: EliteAsian Date: Thu, 20 Apr 2023 18:32:03 -0400 Subject: [PATCH] Moved libraries to plugins --- Assets/Libraries/Concentus.Oggfile.meta | 8 - .../Concentus.Oggfile/BufferedReadStream.cs | 234 ------- .../BufferedReadStream.cs.meta | 11 - .../Libraries/Concentus.Oggfile/DataPacket.cs | 504 ---------------- .../Concentus.Oggfile/DataPacket.cs.meta | 11 - .../Concentus.Oggfile/IContainerReader.cs | 62 -- .../IContainerReader.cs.meta | 11 - .../Concentus.Oggfile/IPacketProvider.cs | 91 --- .../Concentus.Oggfile/IPacketProvider.cs.meta | 11 - .../Concentus.Oggfile/NewStreamEventArgs.cs | 38 -- .../NewStreamEventArgs.cs.meta | 11 - .../Concentus.Oggfile/OggContainerReader.cs | 532 ---------------- .../OggContainerReader.cs.meta | 11 - Assets/Libraries/Concentus.Oggfile/OggCrc.cs | 63 -- .../Concentus.Oggfile/OggCrc.cs.meta | 11 - .../Libraries/Concentus.Oggfile/OggPacket.cs | 119 ---- .../Concentus.Oggfile/OggPacket.cs.meta | 11 - .../Concentus.Oggfile/OggPacketReader.cs | 476 --------------- .../Concentus.Oggfile/OggPacketReader.cs.meta | 11 - .../Concentus.Oggfile/OggPageFlags.cs | 20 - .../Concentus.Oggfile/OggPageFlags.cs.meta | 11 - .../Libraries/Concentus.Oggfile/OpusHeader.cs | 20 - .../Concentus.Oggfile/OpusHeader.cs.meta | 11 - .../Concentus.Oggfile/OpusOggReadStream.cs | 297 --------- .../OpusOggReadStream.cs.meta | 11 - .../Concentus.Oggfile/OpusOggWriteStream.cs | 436 -------------- .../OpusOggWriteStream.cs.meta | 11 - .../Concentus.Oggfile/OpusTagName.cs | 18 - .../Concentus.Oggfile/OpusTagName.cs.meta | 11 - .../Libraries/Concentus.Oggfile/OpusTags.cs | 82 --- .../Concentus.Oggfile/OpusTags.cs.meta | 11 - .../ParameterChangeEventArgs.cs | 34 -- .../ParameterChangeEventArgs.cs.meta | 11 - .../Concentus.Oggfile/StreamReadBuffer.cs | 569 ------------------ .../StreamReadBuffer.cs.meta | 11 - Assets/{Libraries.meta => Plugins.meta} | 2 +- Assets/{Libraries => Plugins}/BassNative.meta | 0 .../BassNative/.gitignore | 0 .../BassNative/Linux.meta | 0 .../BassNative/Linux/x86_64.meta | 0 .../BassNative/Linux/x86_64/libbass.so.meta | 0 .../Linux/x86_64/libbass_fx.so.meta | 0 .../Linux/x86_64/libbassmix.so.meta | 0 .../Linux/x86_64/libbassopus.so.meta | 0 .../BassNative/Mac.meta | 0 .../BassNative/Mac/libbass.dylib.meta | 0 .../BassNative/Mac/libbass_fx.dylib.meta | 0 .../BassNative/Mac/libbassmix.dylib.meta | 0 .../BassNative/Mac/libbassopus.dylib.meta | 0 .../BassNative/Windows.meta | 0 .../BassNative/Windows/x86.meta | 0 .../BassNative/Windows/x86/bass.dll.meta | 0 .../BassNative/Windows/x86/bass_fx.dll.meta | 0 .../BassNative/Windows/x86/bassmix.dll.meta | 0 .../BassNative/Windows/x86/bassopus.dll.meta | 0 .../BassNative/Windows/x86_64.meta | 0 .../BassNative/Windows/x86_64/bass.dll.meta | 0 .../Windows/x86_64/bass_fx.dll.meta | 0 .../Windows/x86_64/bassmix.dll.meta | 0 .../Windows/x86_64/bassopus.dll.meta | 0 .../DiscordGameSDK.meta | 0 .../DiscordGameSDK/ActivityManager.cs | 0 .../DiscordGameSDK/ActivityManager.cs.meta | 0 .../DiscordGameSDK/Constants.cs | 0 .../DiscordGameSDK/Constants.cs.meta | 0 .../DiscordGameSDK/Core.cs | 0 .../DiscordGameSDK/Core.cs.meta | 0 .../DiscordGameSDK/Plugins.meta | 0 .../DiscordGameSDK/Plugins/aarch64.meta | 0 .../Plugins/aarch64/discord_game_sdk.bundle | Bin .../aarch64/discord_game_sdk.bundle.meta | 0 .../Plugins/aarch64/discord_game_sdk.dylib | Bin .../aarch64/discord_game_sdk.dylib.meta | 0 .../DiscordGameSDK/Plugins/x86.meta | 0 .../Plugins/x86/discord_game_sdk.dll | Bin .../Plugins/x86/discord_game_sdk.dll.lib | Bin .../Plugins/x86/discord_game_sdk.dll.lib.meta | 0 .../Plugins/x86/discord_game_sdk.dll.meta | 0 .../DiscordGameSDK/Plugins/x86_64.meta | 0 .../Plugins/x86_64/discord_game_sdk.bundle | Bin .../x86_64/discord_game_sdk.bundle.meta | 0 .../Plugins/x86_64/discord_game_sdk.dll | Bin .../Plugins/x86_64/discord_game_sdk.dll.lib | Bin .../x86_64/discord_game_sdk.dll.lib.meta | 0 .../Plugins/x86_64/discord_game_sdk.dll.meta | 0 .../Plugins/x86_64/discord_game_sdk.dylib | Bin .../x86_64/discord_game_sdk.dylib.meta | 0 .../Plugins/x86_64/discord_game_sdk.so | Bin .../Plugins/x86_64/discord_game_sdk.so.meta | 0 .../{Libraries => Plugins}/OccurrenceList.cs | 0 .../OccurrenceList.cs.meta | 0 .../StandaloneFileBrowser.meta | 0 .../IStandaloneFileBrowser.cs | 0 .../IStandaloneFileBrowser.cs.meta | 0 .../StandaloneFileBrowser/Plugins.meta | 0 .../StandaloneFileBrowser/Plugins/Linux.meta | 0 .../Plugins/Linux/x86_64.meta | 0 .../Linux/x86_64/libStandaloneFileBrowser.so | Bin .../x86_64/libStandaloneFileBrowser.so.meta | 0 .../Plugins/Ookii.Dialogs.dll | Bin .../Plugins/Ookii.Dialogs.dll.meta | 0 .../Plugins/StandaloneFileBrowser.bundle.meta | 0 .../Contents.meta | 0 .../Contents/Info.plist | 0 .../Contents/Info.plist.meta | 0 .../Contents/MacOS.meta | 0 .../Contents/MacOS/StandaloneFileBrowser | Bin .../Contents/MacOS/StandaloneFileBrowser.meta | 0 .../Plugins/StandaloneFileBrowser.jslib | 0 .../Plugins/StandaloneFileBrowser.jslib.meta | 0 .../Plugins/System.Windows.Forms.dll | Bin .../Plugins/System.Windows.Forms.dll.meta | 0 .../StandaloneFileBrowser.cs | 0 .../StandaloneFileBrowser.cs.meta | 0 .../StandaloneFileBrowserEditor.cs | 0 .../StandaloneFileBrowserEditor.cs.meta | 0 .../StandaloneFileBrowserLinux.cs | 0 .../StandaloneFileBrowserLinux.cs.meta | 0 .../StandaloneFileBrowserMac.cs | 0 .../StandaloneFileBrowserMac.cs.meta | 0 .../StandaloneFileBrowserWindows.cs | 0 .../StandaloneFileBrowserWindows.cs.meta | 0 .../VectorExtensions.cs | 0 .../VectorExtensions.cs.meta | 0 Assets/packages.config | 1 - 125 files changed, 1 insertion(+), 3792 deletions(-) delete mode 100644 Assets/Libraries/Concentus.Oggfile.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/BufferedReadStream.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/BufferedReadStream.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/DataPacket.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/DataPacket.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/IContainerReader.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/IContainerReader.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/IPacketProvider.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/IPacketProvider.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/NewStreamEventArgs.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/NewStreamEventArgs.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggContainerReader.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggContainerReader.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggCrc.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggCrc.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggPacket.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggPacket.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggPacketReader.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggPacketReader.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggPageFlags.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OggPageFlags.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusHeader.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusHeader.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusOggReadStream.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusOggReadStream.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusOggWriteStream.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusOggWriteStream.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusTagName.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusTagName.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusTags.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/OpusTags.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/ParameterChangeEventArgs.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/ParameterChangeEventArgs.cs.meta delete mode 100644 Assets/Libraries/Concentus.Oggfile/StreamReadBuffer.cs delete mode 100644 Assets/Libraries/Concentus.Oggfile/StreamReadBuffer.cs.meta rename Assets/{Libraries.meta => Plugins.meta} (77%) rename Assets/{Libraries => Plugins}/BassNative.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/.gitignore (100%) rename Assets/{Libraries => Plugins}/BassNative/Linux.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Linux/x86_64.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Linux/x86_64/libbass.so.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Linux/x86_64/libbass_fx.so.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Linux/x86_64/libbassmix.so.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Linux/x86_64/libbassopus.so.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Mac.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Mac/libbass.dylib.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Mac/libbass_fx.dylib.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Mac/libbassmix.dylib.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Mac/libbassopus.dylib.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86/bass.dll.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86/bass_fx.dll.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86/bassmix.dll.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86/bassopus.dll.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86_64.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86_64/bass.dll.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86_64/bass_fx.dll.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86_64/bassmix.dll.meta (100%) rename Assets/{Libraries => Plugins}/BassNative/Windows/x86_64/bassopus.dll.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/ActivityManager.cs (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/ActivityManager.cs.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Constants.cs (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Constants.cs.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Core.cs (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Core.cs.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/aarch64.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib.meta (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so (100%) rename Assets/{Libraries => Plugins}/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so.meta (100%) rename Assets/{Libraries => Plugins}/OccurrenceList.cs (100%) rename Assets/{Libraries => Plugins}/OccurrenceList.cs.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/IStandaloneFileBrowser.cs (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/IStandaloneFileBrowser.cs.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/Linux.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/Linux/x86_64.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowser.cs (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowser.cs.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowserMac.cs (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowserMac.cs.meta (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs (100%) rename Assets/{Libraries => Plugins}/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs.meta (100%) rename Assets/{Libraries => Plugins}/VectorExtensions.cs (100%) rename Assets/{Libraries => Plugins}/VectorExtensions.cs.meta (100%) diff --git a/Assets/Libraries/Concentus.Oggfile.meta b/Assets/Libraries/Concentus.Oggfile.meta deleted file mode 100644 index 65b378269..000000000 --- a/Assets/Libraries/Concentus.Oggfile.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c6501cc14da54764f91f0b6805f93e0a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/BufferedReadStream.cs b/Assets/Libraries/Concentus.Oggfile/BufferedReadStream.cs deleted file mode 100644 index a38e5f854..000000000 --- a/Assets/Libraries/Concentus.Oggfile/BufferedReadStream.cs +++ /dev/null @@ -1,234 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Concentus.Oggfile -{ - /// - /// A thread-safe, read-only, buffering stream wrapper. - /// - internal partial class BufferedReadStream : Stream - { - const int DEFAULT_INITIAL_SIZE = 32768; // 32KB (1/2 full page) - const int DEFAULT_MAX_SIZE = 262144; // 256KB (4 full pages) - - Stream _baseStream; - StreamReadBuffer _buffer; - long _readPosition; - //object _localLock = new object(); - //System.Threading.Thread _owningThread; - //int _lockCount; - - public BufferedReadStream(Stream baseStream) - : this(baseStream, DEFAULT_INITIAL_SIZE, DEFAULT_MAX_SIZE, false) - { - } - - public BufferedReadStream(Stream baseStream, bool minimalRead) - : this(baseStream, DEFAULT_INITIAL_SIZE, DEFAULT_MAX_SIZE, minimalRead) - { - } - - public BufferedReadStream(Stream baseStream, int initialSize, int maxSize) - : this(baseStream, initialSize, maxSize, false) - { - } - - public BufferedReadStream(Stream baseStream, int initialSize, int maxBufferSize, bool minimalRead) - { - if (baseStream == null) throw new ArgumentNullException("baseStream"); - if (!baseStream.CanRead) throw new ArgumentException("baseStream"); - - if (maxBufferSize < 1) maxBufferSize = 1; - if (initialSize < 1) initialSize = 1; - if (initialSize > maxBufferSize) initialSize = maxBufferSize; - - _baseStream = baseStream; - _buffer = new StreamReadBuffer(baseStream, initialSize, maxBufferSize, minimalRead); - _buffer.MaxSize = maxBufferSize; - _buffer.MinimalRead = minimalRead; - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - if (disposing) - { - if (_buffer != null) - { - _buffer.Dispose(); - _buffer = null; - } - - if (CloseBaseStream) - { - //_baseStream.Close(); - } - } - } - - // route all the container locking through here so we can track whether the caller actually took the lock... - public void TakeLock() - { - //System.Threading.Monitor.Enter(_localLock); - //if (++_lockCount == 1) - //{ - // _owningThread = System.Threading.Thread.CurrentThread; - //} - } - - void CheckLock() - { - //if (_owningThread != System.Threading.Thread.CurrentThread) - //{ - // throw new System.Threading.SynchronizationLockException(); - //} - } - - public void ReleaseLock() - { - //CheckLock(); - //if (--_lockCount == 0) - //{ - // _owningThread = null; - //} - //System.Threading.Monitor.Exit(_localLock); - } - - public bool CloseBaseStream - { - get; - set; - } - - public bool MinimalRead - { - get { return _buffer.MinimalRead; } - set { _buffer.MinimalRead = value; } - } - - public int MaxBufferSize - { - get { return _buffer.MaxSize; } - set - { - CheckLock(); - _buffer.MaxSize = value; - } - } - - public long BufferBaseOffset - { - get { return _buffer.BaseOffset; } - } - - public int BufferBytesFilled - { - get { return _buffer.BytesFilled; } - } - - public void Discard(int bytes) - { - CheckLock(); - _buffer.DiscardThrough(_buffer.BaseOffset + bytes); - } - - public void DiscardThrough(long offset) - { - CheckLock(); - _buffer.DiscardThrough(offset); - } - - public override bool CanRead - { - get { return true; } - } - - public override bool CanSeek - { - get { return true; } - } - - public override bool CanWrite - { - get { return false; } - } - - public override void Flush() - { - // no-op - } - - public override long Length - { - get { return _baseStream.Length; } - } - - public override long Position - { - get { return _readPosition; } - set { Seek(value, SeekOrigin.Begin); } - } - - public override int ReadByte() - { - CheckLock(); - var val = _buffer.ReadByte(Position); - if (val > -1) - { - Seek(1, SeekOrigin.Current); - } - return val; - } - - public override int Read(byte[] buffer, int offset, int count) - { - CheckLock(); - var cnt = _buffer.Read(Position, buffer, offset, count); - Seek(cnt, SeekOrigin.Current); - return cnt; - } - - public override long Seek(long offset, SeekOrigin origin) - { - CheckLock(); - switch (origin) - { - case SeekOrigin.Begin: - // no-op - break; - case SeekOrigin.Current: - offset += Position; - break; - case SeekOrigin.End: - offset += _baseStream.Length; - break; - } - - if (!_baseStream.CanSeek) - { - if (offset < _buffer.BaseOffset) throw new InvalidOperationException("Cannot seek to before the start of the buffer!"); - if (offset >= _buffer.BufferEndOffset) throw new InvalidOperationException("Cannot seek to beyond the end of the buffer! Discard some bytes."); - } - - return (_readPosition = offset); - } - - public override void SetLength(long value) - { - throw new NotSupportedException(); - } - - public override void Write(byte[] buffer, int offset, int count) - { - throw new NotSupportedException(); - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/BufferedReadStream.cs.meta b/Assets/Libraries/Concentus.Oggfile/BufferedReadStream.cs.meta deleted file mode 100644 index e82f89583..000000000 --- a/Assets/Libraries/Concentus.Oggfile/BufferedReadStream.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3628c94f568b4124b8adf270e2521005 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/DataPacket.cs b/Assets/Libraries/Concentus.Oggfile/DataPacket.cs deleted file mode 100644 index 32d1ee2a7..000000000 --- a/Assets/Libraries/Concentus.Oggfile/DataPacket.cs +++ /dev/null @@ -1,504 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Concentus.Oggfile -{ - /// - /// A single data packet from a logical Vorbis stream. - /// - internal abstract class DataPacket - { - ulong _bitBucket; // 8 - int _bitCount; // 4 - int _readBits; // 4 - byte _overflowBits; // 1 - PacketFlags _packetFlags; // 1 - long _granulePosition; // 8 - long _pageGranulePosition; // 8 - int _length; // 4 - int _granuleCount; // 4 - int _pageSequenceNumber; // 4 - - /// - /// Defines flags to apply to the current packet - /// - [Flags] - // for now, let's use a byte... if we find we need more space, we can always expand it... - protected enum PacketFlags : byte - { - /// - /// Packet is first since reader had to resync with stream. - /// - IsResync = 0x01, - /// - /// Packet is the last in the logical stream. - /// - IsEndOfStream = 0x02, - /// - /// Packet does not have all its data available. - /// - IsShort = 0x04, - /// - /// Packet has a granule count defined. - /// - HasGranuleCount = 0x08, - - /// - /// Flag for use by inheritors. - /// - User1 = 0x10, - /// - /// Flag for use by inheritors. - /// - User2 = 0x20, - /// - /// Flag for use by inheritors. - /// - User3 = 0x40, - /// - /// Flag for use by inheritors. - /// - User4 = 0x80, - } - - /// - /// Gets the value of the specified flag. - /// - protected bool GetFlag(PacketFlags flag) - { - return (_packetFlags & flag) == flag; - } - - /// - /// Sets the value of the specified flag. - /// - protected void SetFlag(PacketFlags flag, bool value) - { - if (value) - { - _packetFlags |= flag; - } - else - { - _packetFlags &= ~flag; - } - } - - /// - /// Creates a new instance with the specified length. - /// - /// The length of the packet. - protected DataPacket(int length) - { - Length = length; - } - - /// - /// Reads the next byte of the packet. - /// - /// The next byte if available, otherwise -1. - abstract protected int ReadNextByte(); - - /// - /// Indicates that the packet has been read and its data is no longer needed. - /// - virtual public void Done() - { - } - - /// - /// Attempts to read the specified number of bits from the packet, but may return fewer. Does not advance the position counter. - /// - /// The number of bits to attempt to read. - /// The number of bits actually read. - /// The value of the bits read. - /// is not between 0 and 64. - public ulong TryPeekBits(int count, out int bitsRead) - { - ulong value = 0; - - if (count < 0 || count > 64) throw new ArgumentOutOfRangeException("count"); - if (count == 0) - { - bitsRead = 0; - return 0UL; - } - - while (_bitCount < count) - { - var val = ReadNextByte(); - if (val == -1) - { - bitsRead = _bitCount; - value = _bitBucket; - _bitBucket = 0; - _bitCount = 0; - - IsShort = true; - - return value; - } - _bitBucket = (ulong)(val & 0xFF) << _bitCount | _bitBucket; - _bitCount += 8; - - if (_bitCount > 64) - { - _overflowBits = (byte)(val >> (72 - _bitCount)); - } - } - - value = _bitBucket; - - if (count < 64) - { - value &= (1UL << count) - 1; - } - - bitsRead = count; - return value; - } - - /// - /// Advances the position counter by the specified number of bits. - /// - /// The number of bits to advance. - public void SkipBits(int count) - { - if (count == 0) - { - // no-op - } - else if (_bitCount > count) - { - // we still have bits left over... - if (count > 63) - { - _bitBucket = 0; - } - else - { - _bitBucket >>= count; - } - if (_bitCount > 64) - { - var overflowCount = _bitCount - 64; - _bitBucket |= (ulong)_overflowBits << (_bitCount - count - overflowCount); - - if (overflowCount > count) - { - // ugh, we have to keep bits in overflow - _overflowBits >>= count; - } - } - - _bitCount -= count; - _readBits += count; - } - else if (_bitCount == count) - { - _bitBucket = 0UL; - _bitCount = 0; - _readBits += count; - } - else // _bitCount < count - { - // we have to move more bits than we have available... - count -= _bitCount; - _readBits += _bitCount; - _bitCount = 0; - _bitBucket = 0; - - while (count > 8) - { - if (ReadNextByte() == -1) - { - count = 0; - IsShort = true; - break; - } - count -= 8; - _readBits += 8; - } - - if (count > 0) - { - var temp = ReadNextByte(); - if (temp == -1) - { - IsShort = true; - } - else - { - _bitBucket = (ulong)(temp >> count); - _bitCount = 8 - count; - _readBits += count; - } - } - } - } - - /// - /// Resets the bit reader. - /// - protected void ResetBitReader() - { - _bitBucket = 0; - _bitCount = 0; - _readBits = 0; - - IsShort = false; - } - - /// - /// Gets whether the packet was found after a stream resync. - /// - public bool IsResync - { - get { return GetFlag(PacketFlags.IsResync); } - internal set { SetFlag(PacketFlags.IsResync, value); } - } - - /// - /// Gets the position of the last granule in the packet. - /// - public long GranulePosition - { - get { return _granulePosition; } - set { _granulePosition = value; } - } - - /// - /// Gets the position of the last granule in the page the packet is in. - /// - public long PageGranulePosition - { - get { return _pageGranulePosition; } - internal set { _pageGranulePosition = value; } - } - - /// - /// Gets the length of the packet. - /// - public int Length - { - get { return _length; } - protected set { _length = value; } - } - - /// - /// Gets whether the packet is the last one in the logical stream. - /// - public bool IsEndOfStream - { - get { return GetFlag(PacketFlags.IsEndOfStream); } - internal set { SetFlag(PacketFlags.IsEndOfStream, value); } - } - - /// - /// Gets the number of bits read from the packet. - /// - public long BitsRead - { - get { return _readBits; } - } - - /// - /// Gets the number of granules in the packet. If null, the packet has not been decoded yet. - /// - public int? GranuleCount - { - get - { - if (GetFlag(PacketFlags.HasGranuleCount)) - { - return _granuleCount; - } - return null; - } - set - { - if (value.HasValue) - { - _granuleCount = value.Value; - SetFlag(PacketFlags.HasGranuleCount, true); - } - else - { - SetFlag(PacketFlags.HasGranuleCount, false); - } - } - } - - internal int PageSequenceNumber - { - get { return _pageSequenceNumber; } - set { _pageSequenceNumber = value; } - } - - internal bool IsShort - { - get { return GetFlag(PacketFlags.IsShort); } - private set { SetFlag(PacketFlags.IsShort, value); } - } - - /// - /// Reads the specified number of bits from the packet and advances the position counter. - /// - /// The number of bits to read. - /// The value of the bits read. - /// The number of bits specified is not between 0 and 64. - public ulong ReadBits(int count) - { - // short-circuit 0 - if (count == 0) return 0UL; - - int temp; - var value = TryPeekBits(count, out temp); - - SkipBits(count); - - return value; - } - - /// - /// Reads the next byte from the packet. Does not advance the position counter. - /// - /// The byte read from the packet. - public byte PeekByte() - { - int temp; - return (byte)TryPeekBits(8, out temp); - } - - /// - /// Reads the next byte from the packet and advances the position counter. - /// - /// The byte read from the packet. - public byte ReadByte() - { - return (byte)ReadBits(8); - } - - /// - /// Reads the specified number of bytes from the packet and advances the position counter. - /// - /// The number of bytes to read. - /// A byte array holding the data read. - public byte[] ReadBytes(int count) - { - var buf = new List(count); - - while (buf.Count < count) - { - buf.Add(ReadByte()); - } - - return buf.ToArray(); - } - - /// - /// Reads the specified number of bytes from the packet into the buffer specified and advances the position counter. - /// - /// The buffer to read into. - /// The index into the buffer to start placing the read data. - /// The number of bytes to read. - /// The number of bytes read. - /// is less than 0 or + is past the end of . - public int Read(byte[] buffer, int index, int count) - { - if (index < 0 || index + count > buffer.Length) throw new ArgumentOutOfRangeException("index"); - for (int i = 0; i < count; i++) - { - int cnt; - byte val = (byte)TryPeekBits(8, out cnt); - if (cnt == 0) - { - return i; - } - buffer[index++] = val; - SkipBits(8); - } - return count; - } - - /// - /// Reads the next bit from the packet and advances the position counter. - /// - /// The value of the bit read. - public bool ReadBit() - { - return ReadBits(1) == 1; - } - - /// - /// Retrieves the next 16 bits from the packet as a and advances the position counter. - /// - /// The value of the next 16 bits. - public short ReadInt16() - { - return (short)ReadBits(16); - } - - /// - /// Retrieves the next 32 bits from the packet as a and advances the position counter. - /// - /// The value of the next 32 bits. - public int ReadInt32() - { - return (int)ReadBits(32); - } - - /// - /// Retrieves the next 64 bits from the packet as a and advances the position counter. - /// - /// The value of the next 64 bits. - public long ReadInt64() - { - return (long)ReadBits(64); - } - - /// - /// Retrieves the next 16 bits from the packet as a and advances the position counter. - /// - /// The value of the next 16 bits. - public ushort ReadUInt16() - { - return (ushort)ReadBits(16); - } - - /// - /// Retrieves the next 32 bits from the packet as a and advances the position counter. - /// - /// The value of the next 32 bits. - public uint ReadUInt32() - { - return (uint)ReadBits(32); - } - - /// - /// Retrieves the next 64 bits from the packet as a and advances the position counter. - /// - /// The value of the next 64 bits. - public ulong ReadUInt64() - { - return (ulong)ReadBits(64); - } - - /// - /// Advances the position counter by the specified number of bytes. - /// - /// The number of bytes to advance. - public void SkipBytes(int count) - { - SkipBits(count * 8); - } - } -} \ No newline at end of file diff --git a/Assets/Libraries/Concentus.Oggfile/DataPacket.cs.meta b/Assets/Libraries/Concentus.Oggfile/DataPacket.cs.meta deleted file mode 100644 index 4592f92a7..000000000 --- a/Assets/Libraries/Concentus.Oggfile/DataPacket.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3e3d5713a93669748be75d7697b73aaf -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/IContainerReader.cs b/Assets/Libraries/Concentus.Oggfile/IContainerReader.cs deleted file mode 100644 index fa91de9f1..000000000 --- a/Assets/Libraries/Concentus.Oggfile/IContainerReader.cs +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; - -namespace Concentus.Oggfile -{ - /// - /// Provides a interface for a Vorbis logical stream container. - /// - internal interface IContainerReader : IDisposable - { - /// - /// Gets the list of stream serials found in the container so far. - /// - int[] StreamSerials { get; } - - /// - /// Gets whether the container supports seeking. - /// - bool CanSeek { get; } - - /// - /// Gets the number of bits in the container that are not associated with a logical stream. - /// - long WasteBits { get; } - - /// - /// Gets the number of pages that have been read in the container. - /// - int PagesRead { get; } - - /// - /// Event raised when a new logical stream is found in the container. - /// - event EventHandler NewStream; - - /// - /// Initializes the container and finds the first stream. - /// - /// True if a valid logical stream is found, otherwise False. - bool Init(); - - /// - /// Finds the next new stream in the container. - /// - /// True if a new stream was found, otherwise False. - /// is False. - bool FindNextStream(); - - /// - /// Retrieves the total number of pages in the container. - /// - /// The total number of pages. - /// is False. - int GetTotalPageCount(); - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/IContainerReader.cs.meta b/Assets/Libraries/Concentus.Oggfile/IContainerReader.cs.meta deleted file mode 100644 index ed68243a6..000000000 --- a/Assets/Libraries/Concentus.Oggfile/IContainerReader.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 60f1a21603d922d4e96d1293c451baef -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/IPacketProvider.cs b/Assets/Libraries/Concentus.Oggfile/IPacketProvider.cs deleted file mode 100644 index 2911a4f56..000000000 --- a/Assets/Libraries/Concentus.Oggfile/IPacketProvider.cs +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Concentus.Oggfile -{ - /// - /// Provides packets on-demand for the Vorbis stream decoder. - /// - internal interface IPacketProvider : IDisposable - { - /// - /// Gets the serial number associated with this stream. - /// - int StreamSerial { get; } - - /// - /// Gets whether seeking is supported on this stream. - /// - bool CanSeek { get; } - - /// - /// Gets the number of bits of overhead in this stream's container. - /// - long ContainerBits { get; } - - /// - /// Retrieves the total number of pages (or frames) this stream uses. - /// - /// The page count. - /// is False. - int GetTotalPageCount(); - - /// - /// Retrieves the next packet in the stream. - /// - /// The next packet in the stream or null if no more packets. - DataPacket GetNextPacket(); - - /// - /// Retrieves the next packet in the stream but does not advance to the following packet. - /// - /// The next packet in the stream or null if no more packets. - DataPacket PeekNextPacket(); - - /// - /// Retrieves the packet specified from the stream. - /// - /// The index of the packet to retrieve. - /// The specified packet. - /// is less than 0 or past the end of the stream. - /// is False. - DataPacket GetPacket(int packetIndex); - - /// - /// Retrieves the total number of granules in this Vorbis stream. - /// - /// The number of samples - /// is False. - long GetGranuleCount(); - - /// - /// Finds the packet index to the granule position specified in the current stream. - /// - /// The granule position to seek to. - /// A callback method that takes the current and previous packets and returns the number of granules in the current packet. - /// The index of the packet that includes the specified granule position or -1 if none found. - /// is less than 0 or is after the last granule. - DataPacket FindPacket(long granulePos, Func packetGranuleCountCallback); - - /// - /// Sets the next packet to be returned, applying a pre-roll as necessary. - /// - /// The packet to key from. - /// The number of packets to return before the indicated packet. - void SeekToPacket(DataPacket packet, int preRoll); - - /// - /// Occurs when the stream is about to change parameters. - /// - event EventHandler ParameterChange; - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/IPacketProvider.cs.meta b/Assets/Libraries/Concentus.Oggfile/IPacketProvider.cs.meta deleted file mode 100644 index 5a7cc7753..000000000 --- a/Assets/Libraries/Concentus.Oggfile/IPacketProvider.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 621f3b2115b990741aff6763f43d389d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/NewStreamEventArgs.cs b/Assets/Libraries/Concentus.Oggfile/NewStreamEventArgs.cs deleted file mode 100644 index 825da6269..000000000 --- a/Assets/Libraries/Concentus.Oggfile/NewStreamEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; - -namespace Concentus.Oggfile -{ - /// - /// Event data for when a new logical stream is found in a container. - /// - internal class NewStreamEventArgs : EventArgs - { - /// - /// Creates a new instance of with the specified . - /// - /// An instance. - public NewStreamEventArgs(IPacketProvider packetProvider) - { - if (packetProvider == null) throw new ArgumentNullException("packetProvider"); - - PacketProvider = packetProvider; - } - - /// - /// Gets new the instance. - /// - public IPacketProvider PacketProvider { get; private set; } - - /// - /// Gets or sets whether to ignore the logical stream associated with the packet provider. - /// - public bool IgnoreStream { get; set; } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/NewStreamEventArgs.cs.meta b/Assets/Libraries/Concentus.Oggfile/NewStreamEventArgs.cs.meta deleted file mode 100644 index af0e91b41..000000000 --- a/Assets/Libraries/Concentus.Oggfile/NewStreamEventArgs.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7eaef68434781534494b121a402cfd0d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OggContainerReader.cs b/Assets/Libraries/Concentus.Oggfile/OggContainerReader.cs deleted file mode 100644 index a4c70eb05..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggContainerReader.cs +++ /dev/null @@ -1,532 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; - -namespace Concentus.Oggfile -{ - /// - /// Provides an implementation for basic Ogg files. - /// - internal class OggContainerReader : IContainerReader - { - Crc _crc = new Crc(); - BufferedReadStream _stream; - Dictionary _packetReaders; - List _disposedStreamSerials; - long _nextPageOffset; - int _pageCount; - - byte[] _readBuffer = new byte[65025]; // up to a full page of data (but no more!) - - long _containerBits, _wasteBits; - - /// - /// Gets the list of stream serials found in the container so far. - /// - public int[] StreamSerials - { - get { return System.Linq.Enumerable.ToArray(_packetReaders.Keys); } - } - - /// - /// Event raised when a new logical stream is found in the container. - /// - public event EventHandler NewStream; - - /// - /// Creates a new instance with the specified stream. Optionally sets to close the stream when disposed. - /// - /// The stream to read. - /// True to close the stream when is called, otherwise False. - public OggContainerReader(Stream stream, bool closeOnDispose) - { - _packetReaders = new Dictionary(); - _disposedStreamSerials = new List(); - - _stream = (stream as BufferedReadStream) ?? new BufferedReadStream(stream) { CloseBaseStream = closeOnDispose }; - } - - /// - /// Initializes the container and finds the first stream. - /// - /// True if a valid logical stream is found, otherwise False. - public bool Init() - { - _stream.TakeLock(); - try - { - return GatherNextPage() != -1; - } - finally - { - _stream.ReleaseLock(); - } - } - - /// - /// Disposes this instance. - /// - public void Dispose() - { - // don't use _packetReaders directly since that'll change the enumeration... - foreach (var streamSerial in StreamSerials) - { - _packetReaders[streamSerial].Dispose(); - } - - _nextPageOffset = 0L; - _containerBits = 0L; - _wasteBits = 0L; - - _stream.Dispose(); - } - - /// - /// Gets the instance for the specified stream serial. - /// - /// The stream serial to look for. - /// An instance. - /// The specified stream serial was not found. - public IPacketProvider GetStream(int streamSerial) - { - PacketReader provider; - if (!_packetReaders.TryGetValue(streamSerial, out provider)) - { - throw new ArgumentOutOfRangeException("streamSerial"); - } - return provider; - } - - /// - /// Finds the next new stream in the container. - /// - /// True if a new stream was found, otherwise False. - /// is False. - public bool FindNextStream() - { - if (!CanSeek) throw new InvalidOperationException(); - - // goes through all the pages until the serial count increases - var cnt = this._packetReaders.Count; - while (this._packetReaders.Count == cnt) - { - _stream.TakeLock(); - try - { - // acquire & release the lock every pass so we don't block any longer than necessary - if (GatherNextPage() == -1) - { - break; - } - } - finally - { - _stream.ReleaseLock(); - } - } - return cnt > this._packetReaders.Count; - } - - /// - /// Gets the number of pages that have been read in the container. - /// - public int PagesRead - { - get { return _pageCount; } - } - - /// - /// Retrieves the total number of pages in the container. - /// - /// The total number of pages. - /// is False. - public int GetTotalPageCount() - { - if (!CanSeek) throw new InvalidOperationException(); - - // just read pages until we can't any more... - while (true) - { - _stream.TakeLock(); - try - { - // acquire & release the lock every pass so we don't block any longer than necessary - if (GatherNextPage() == -1) - { - break; - } - } - finally - { - _stream.ReleaseLock(); - } - } - - return _pageCount; - } - - /// - /// Gets whether the container supports seeking. - /// - public bool CanSeek - { - get { return _stream.CanSeek; } - } - - /// - /// Gets the number of bits in the container that are not associated with a logical stream. - /// - public long WasteBits - { - get { return _wasteBits; } - } - - - // private implmentation bits - class PageHeader - { - public int StreamSerial { get; set; } - public PageFlags Flags { get; set; } - public long GranulePosition { get; set; } - public int SequenceNumber { get; set; } - public long DataOffset { get; set; } - public int[] PacketSizes { get; set; } - public bool LastPacketContinues { get; set; } - public bool IsResync { get; set; } - } - - PageHeader ReadPageHeader(long position) - { - // set the stream's position - _stream.Seek(position, SeekOrigin.Begin); - - // header - // NB: if the stream didn't have an EOS flag, this is the most likely spot for the EOF to be found... - if (_stream.Read(_readBuffer, 0, 27) != 27) return null; - - // capture signature ("OggS") - if (_readBuffer[0] != 0x4f || _readBuffer[1] != 0x67 || _readBuffer[2] != 0x67 || _readBuffer[3] != 0x53) - { - Debug.WriteLine("No OggS signature found in header"); - return null; - } - - // check the stream version - if (_readBuffer[4] != 0) - { - Debug.WriteLine("Ogg stream version does not match expected value 0"); - return null; - } - - // start populating the header - var hdr = new PageHeader(); - - // bit flags - hdr.Flags = (PageFlags)_readBuffer[5]; - - // granulePosition - hdr.GranulePosition = BitConverter.ToInt64(_readBuffer, 6); - - // stream serial - hdr.StreamSerial = BitConverter.ToInt32(_readBuffer, 14); - - // sequence number - hdr.SequenceNumber = BitConverter.ToInt32(_readBuffer, 18); - - // save off the CRC - var crc = BitConverter.ToUInt32(_readBuffer, 22); - - // start calculating the CRC value for this page - _crc.Reset(); - for (int i = 0; i < 22; i++) - { - _crc.Update(_readBuffer[i]); - } - _crc.Update(0); - _crc.Update(0); - _crc.Update(0); - _crc.Update(0); - _crc.Update(_readBuffer[26]); - - // figure out the length of the page - var segCnt = (int)_readBuffer[26]; - if (_stream.Read(_readBuffer, 0, segCnt) != segCnt) - { - Debug.WriteLine("Page header reports that there are " + segCnt + " lacing segments, but not that many bytes were found in the buffer!"); - return null; - } - - var packetSizes = new List(segCnt); - - int size = 0, idx = 0; - for (int i = 0; i < segCnt; i++) - { - var temp = _readBuffer[i]; - _crc.Update(temp); - - if (idx == packetSizes.Count) packetSizes.Add(0); - packetSizes[idx] += temp; - if (temp < 255) - { - ++idx; - hdr.LastPacketContinues = false; - } - else - { - hdr.LastPacketContinues = true; - } - - size += temp; - } - hdr.PacketSizes = packetSizes.ToArray(); - hdr.DataOffset = position + 27 + segCnt; - - // now we have to go through every byte in the page - if (_stream.Read(_readBuffer, 0, size) != size) - { - Debug.WriteLine("Could not read lacing segment from payload: Insufficient bytes"); - return null; - } - - for (int i = 0; i < size; i++) - { - _crc.Update(_readBuffer[i]); - } - - //Debug.WriteLine("Calculated CRC for page is " + _crc.Value + " (expecting " + crc + ")"); - if (_crc.Test(crc)) - { - _containerBits += 8 * (27 + segCnt); - ++_pageCount; - return hdr; - } - - Debug.WriteLine("CRC validation failed for page; assuming it is corrupted"); - return null; - } - - PageHeader FindNextPageHeader() - { - var startPos = _nextPageOffset; - - var isResync = false; - PageHeader hdr; - while ((hdr = ReadPageHeader(startPos)) == null) - { - isResync = true; - _wasteBits += 8; - _stream.Position = ++startPos; - - var cnt = 0; - do - { - var b = _stream.ReadByte(); - if (b == 0x4f) - { - if (_stream.ReadByte() == 0x67 && _stream.ReadByte() == 0x67 && _stream.ReadByte() == 0x53) - { - // found it! - startPos += cnt; - break; - } - else - { - _stream.Seek(-3, SeekOrigin.Current); - } - } - else if (b == -1) - { - Debug.WriteLine("End of stream reached while looking for next page"); - return null; - } - _wasteBits += 8; - } while (++cnt < 65536); // we will only search through 64KB of data to find the next sync marker. if it can't be found, we have a badly corrupted stream. - if (cnt == 65536) - { - Debug.WriteLine("Could not find the next page after searching through 64Kb of data. Assuming the stream is badly corrupted"); - return null; - } - } - hdr.IsResync = isResync; - - _nextPageOffset = hdr.DataOffset; - for (int i = 0; i < hdr.PacketSizes.Length; i++) - { - _nextPageOffset += hdr.PacketSizes[i]; - } - - return hdr; - } - - bool AddPage(PageHeader hdr) - { - // get our packet reader (create one if we have to) - PacketReader packetReader; - if (!_packetReaders.TryGetValue(hdr.StreamSerial, out packetReader)) - { - packetReader = new PacketReader(this, hdr.StreamSerial); - } - - // save off the container bits - packetReader.ContainerBits += _containerBits; - _containerBits = 0; - - // get our flags prepped - var isContinued = hdr.PacketSizes.Length == 1 && hdr.LastPacketContinues; - var isContinuation = (hdr.Flags & PageFlags.ContinuesPacket) == PageFlags.ContinuesPacket; - var isEOS = false; - var isResync = hdr.IsResync; - - // add all the packets, making sure to update flags as needed - var dataOffset = hdr.DataOffset; - var cnt = hdr.PacketSizes.Length; - foreach (var size in hdr.PacketSizes) - { - var packet = new Packet(this, dataOffset, size) - { - PageGranulePosition = hdr.GranulePosition, - IsEndOfStream = isEOS, - PageSequenceNumber = hdr.SequenceNumber, - IsContinued = isContinued, - IsContinuation = isContinuation, - IsResync = isResync, - }; - packetReader.AddPacket(packet); - - // update the offset into the stream for each packet - dataOffset += size; - - // only the first packet in a page can be a continuation or resync - isContinuation = false; - isResync = false; - - // only the last packet in a page can be continued or flagged end of stream - if (--cnt == 1) - { - isContinued = hdr.LastPacketContinues; - isEOS = (hdr.Flags & PageFlags.EndOfStream) == PageFlags.EndOfStream; - } - } - - // if the packet reader list doesn't include the serial in question, add it to the list and indicate a new stream to the caller - if (!_packetReaders.ContainsKey(hdr.StreamSerial)) - { - _packetReaders.Add(hdr.StreamSerial, packetReader); - return true; - } - else - { - // otherwise, indicate an existing stream to the caller - return false; - } - } - - int GatherNextPage() - { - while (true) - { - // get our next header - var hdr = FindNextPageHeader(); - if (hdr == null) - { - return -1; - } - - // if it's in a disposed stream, grab the next page instead - if (_disposedStreamSerials.Contains(hdr.StreamSerial)) continue; - - // otherwise, add it - if (AddPage(hdr)) - { - var callback = NewStream; - if (callback != null) - { - var ea = new NewStreamEventArgs(_packetReaders[hdr.StreamSerial]); - callback(this, ea); - if (ea.IgnoreStream) - { - _packetReaders[hdr.StreamSerial].Dispose(); - continue; - } - } - } - - return hdr.StreamSerial; - } - } - - // packet reader bits... - internal void DisposePacketReader(PacketReader packetReader) - { - _disposedStreamSerials.Add(packetReader.StreamSerial); - _packetReaders.Remove(packetReader.StreamSerial); - } - - internal int PacketReadByte(long offset) - { - _stream.TakeLock(); - try - { - _stream.Position = offset; - return _stream.ReadByte(); - } - finally - { - _stream.ReleaseLock(); - } - } - - internal void PacketDiscardThrough(long offset) - { - _stream.TakeLock(); - try - { - _stream.DiscardThrough(offset); - } - finally - { - _stream.ReleaseLock(); - } - } - - internal void GatherNextPage(int streamSerial) - { - if (!_packetReaders.ContainsKey(streamSerial)) throw new ArgumentOutOfRangeException("streamSerial"); - - int nextSerial; - do - { - _stream.TakeLock(); - try - { - if (_packetReaders[streamSerial].HasEndOfStream) break; - - nextSerial = GatherNextPage(); - if (nextSerial == -1) - { - foreach (var reader in _packetReaders) - { - if (!reader.Value.HasEndOfStream) - { - reader.Value.SetEndOfStream(); - } - } - break; - } - } - finally - { - _stream.ReleaseLock(); - } - } while (nextSerial != streamSerial); - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OggContainerReader.cs.meta b/Assets/Libraries/Concentus.Oggfile/OggContainerReader.cs.meta deleted file mode 100644 index b0d3f3e2c..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggContainerReader.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b622b641c8138a84987711086ca96a0c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OggCrc.cs b/Assets/Libraries/Concentus.Oggfile/OggCrc.cs deleted file mode 100644 index 361a7906d..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggCrc.cs +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Concentus.Oggfile -{ - internal class Crc - { - const uint CRC32_POLY = 0x04c11db7; - static uint[] crcTable = new uint[256]; - - static Crc() - { - for (uint i = 0; i < 256; i++) - { - uint s = i << 24; - for (int j = 0; j < 8; ++j) - { - s = (s << 1) ^ (s >= (1U << 31) ? CRC32_POLY : 0); - } - crcTable[i] = s; - } - } - - uint _crc; - - public Crc() - { - Reset(); - } - - public void Reset() - { - _crc = 0U; - } - - public void Update(int nextVal) - { - _crc = (_crc << 8) ^ crcTable[nextVal ^ (_crc >> 24)]; - } - - public bool Test(uint checkCrc) - { - return _crc == checkCrc; - } - - public uint Value - { - get - { - return _crc; - } - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OggCrc.cs.meta b/Assets/Libraries/Concentus.Oggfile/OggCrc.cs.meta deleted file mode 100644 index aa2b25259..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggCrc.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d5d043daf5930c04c8427d8cbcf6377c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OggPacket.cs b/Assets/Libraries/Concentus.Oggfile/OggPacket.cs deleted file mode 100644 index eef348ece..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggPacket.cs +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; - -namespace Concentus.Oggfile -{ - internal class Packet : DataPacket - { - long _offset; // 8 - int _length; // 4 - int _curOfs; // 4 - Packet _mergedPacket; // IntPtr.Size - Packet _next; // IntPtr.Size - Packet _prev; // IntPtr.Size - OggContainerReader _containerReader; // IntPtr.Size - - internal Packet Next - { - get { return _next; } - set { _next = value; } - } - internal Packet Prev - { - get { return _prev; } - set { _prev = value; } - } - internal bool IsContinued - { - get { return GetFlag(PacketFlags.User1); } - set { SetFlag(PacketFlags.User1, value); } - } - internal bool IsContinuation - { - get { return GetFlag(PacketFlags.User2); } - set { SetFlag(PacketFlags.User2, value); } - } - - internal Packet(OggContainerReader containerReader, long streamOffset, int length) - : base(length) - { - _containerReader = containerReader; - - _offset = streamOffset; - _length = length; - _curOfs = 0; - } - - internal void MergeWith(DataPacket continuation) - { - var op = continuation as Packet; - - if (op == null) throw new ArgumentException("Incorrect packet type!"); - - Length += continuation.Length; - - if (_mergedPacket == null) - { - _mergedPacket = op; - } - else - { - _mergedPacket.MergeWith(continuation); - } - - // per the spec, a partial packet goes with the next page's granulepos. we'll go ahead and assign it to the next page as well - PageGranulePosition = continuation.PageGranulePosition; - PageSequenceNumber = continuation.PageSequenceNumber; - } - - internal void Reset() - { - _curOfs = 0; - ResetBitReader(); - - if (_mergedPacket != null) - { - _mergedPacket.Reset(); - } - } - - protected override int ReadNextByte() - { - if (_curOfs == _length) - { - if (_mergedPacket == null) return -1; - - return _mergedPacket.ReadNextByte(); - } - - var b = _containerReader.PacketReadByte(_offset + _curOfs); - if (b != -1) - { - ++_curOfs; - } - return b; - } - - public override void Done() - { - if (_mergedPacket != null) - { - _mergedPacket.Done(); - } - else - { - _containerReader.PacketDiscardThrough(_offset + _length); - } - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OggPacket.cs.meta b/Assets/Libraries/Concentus.Oggfile/OggPacket.cs.meta deleted file mode 100644 index f98636a4d..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggPacket.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fb823319ed0ad3943b26c9bcbfc00103 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OggPacketReader.cs b/Assets/Libraries/Concentus.Oggfile/OggPacketReader.cs deleted file mode 100644 index 7dcd2fc45..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggPacketReader.cs +++ /dev/null @@ -1,476 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.IO; - -namespace Concentus.Oggfile -{ - [System.Diagnostics.DebuggerTypeProxy(typeof(PacketReader.DebugView))] - internal class PacketReader : IPacketProvider - { - internal class DebugView - { - PacketReader _reader; - - public DebugView(PacketReader reader) - { - if (reader == null) throw new ArgumentNullException("reader"); - _reader = reader; - } - - public OggContainerReader Container { get { return _reader._container; } } - public int StreamSerial { get { return _reader._streamSerial; } } - public bool EndOfStreamFound { get { return _reader._eosFound; } } - - public int CurrentPacketIndex - { - get - { - if (_reader._current == null) return -1; - return Array.IndexOf(Packets, _reader._current); - } - } - - Packet _last, _first; - Packet[] _packetList = new Packet[0]; - public Packet[] Packets - { - get - { - if (_reader._last == _last && _reader._first == _first) - { - return _packetList; - } - - _last = _reader._last; - _first = _reader._first; - - var packets = new List(); - var node = _first; - while (node != null) - { - packets.Add(node); - node = node.Next; - } - _packetList = packets.ToArray(); - return _packetList; - } - } - } - - // IPacketProvider requires this, but we aren't using it -#pragma warning disable 67 // disable the "unused" warning - public event EventHandler ParameterChange; -#pragma warning restore 67 - - OggContainerReader _container; - int _streamSerial; - bool _eosFound; - - Packet _first, _current, _last; - - object _packetLock = new object(); - - internal PacketReader(OggContainerReader container, int streamSerial) - { - _container = container; - _streamSerial = streamSerial; - } - - public void Dispose() - { - _eosFound = true; - - _container.DisposePacketReader(this); - _container = null; - - _current = null; - - if (_first != null) - { - var node = _first; - _first = null; - while (node.Next != null) - { - var temp = node.Next; - node.Next = null; - node = temp; - node.Prev = null; - } - node = null; - } - - _last = null; - } - - internal void AddPacket(Packet packet) - { - lock (_packetLock) - { - // if we've already found the end of the stream, don't accept any more packets - if (_eosFound) return; - - // if the packet is a resync, it cannot be a continuation... - if (packet.IsResync) - { - packet.IsContinuation = false; - if (_last != null) _last.IsContinued = false; - } - - if (packet.IsContinuation) - { - // if we get here, the stream is invalid if there isn't a previous packet - if (_last == null) throw new InvalidDataException(); - - // if the last packet isn't continued, something is wrong - if (!_last.IsContinued) throw new InvalidDataException(); - - _last.MergeWith(packet); - _last.IsContinued = packet.IsContinued; - } - else - { - var p = packet as Packet; - if (p == null) throw new ArgumentException("Wrong packet datatype", "packet"); - - if (_first == null) - { - // this is the first packet to add, so just set first & last to point at it - _first = p; - _last = p; - } - else - { - // swap the new packet in to the last position (remember, we're doubly-linked) - _last = ((p.Prev = _last).Next = p); - } - } - - if (packet.IsEndOfStream) - { - SetEndOfStream(); - } - } - } - - internal bool HasEndOfStream - { - get { return _eosFound; } - } - - internal void SetEndOfStream() - { - lock (_packetLock) - { - // set the flag... - _eosFound = true; - - // make sure we're handling the last packet correctly - if (_last.IsContinued) - { - // last packet was a partial... spec says dump it - _last = _last.Prev; - _last.Next.Prev = null; - _last.Next = null; - } - } - } - - public int StreamSerial - { - get { return _streamSerial; } - } - - public long ContainerBits - { - get; - set; - } - - public bool CanSeek - { - get { return _container.CanSeek; } - } - - // This is fast path... don't make the caller wait if we can help it... - public DataPacket GetNextPacket() - { - return (_current = PeekNextPacketInternal()); - } - - public DataPacket PeekNextPacket() - { - return PeekNextPacketInternal(); - } - - Packet PeekNextPacketInternal() - { - // try to get the next packet in the sequence - Packet curPacket; - if (_current == null) - { - curPacket = _first; - } - else - { - while (true) - { - lock (_packetLock) - { - curPacket = _current.Next; - - // if we have a valid packet or we can't get any more, bail out of the loop - if ((curPacket != null && !curPacket.IsContinued) || _eosFound) break; - } - - // we need another packet and we've not found the end of the stream... - _container.GatherNextPage(_streamSerial); - } - } - - // if we're returning a packet, prep is for use - if (curPacket != null) - { - if (curPacket.IsContinued) throw new InvalidDataException("Packet is incomplete!"); - curPacket.Reset(); - } - - return curPacket; - } - - internal void ReadAllPages() - { - if (!CanSeek) throw new InvalidOperationException(); - - // don't hold the lock any longer than we have to - while (!_eosFound) - { - _container.GatherNextPage(_streamSerial); - } - } - - internal DataPacket GetLastPacket() - { - ReadAllPages(); - - return _last; - } - - public int GetTotalPageCount() - { - ReadAllPages(); - - // here we just count the number of times the page sequence number changes - var cnt = 0; - var lastPageSeqNo = 0; - var packet = _first; - while (packet != null) - { - if (packet.PageSequenceNumber != lastPageSeqNo) - { - ++cnt; - lastPageSeqNo = packet.PageSequenceNumber; - } - packet = packet.Next; - } - return cnt; - } - - public DataPacket GetPacket(int packetIndex) - { - if (!CanSeek) throw new InvalidOperationException(); - if (packetIndex < 0) throw new ArgumentOutOfRangeException("index"); - - // if _first is null, something is borked - if (_first == null) throw new InvalidOperationException("Packet reader has no packets!"); - - // starting from the beginning, count packets until we have the one we want... - var packet = _first; - while (--packetIndex >= 0) - { - while (packet.Next == null) - { - if (_eosFound) - { - throw new ArgumentOutOfRangeException("index"); - } - _container.GatherNextPage(_streamSerial); - } - - packet = packet.Next; - } - - packet.Reset(); - return packet; - } - - Packet GetLastPacketInPage(Packet packet) - { - if (packet != null) - { - var pageSeqNumber = packet.PageSequenceNumber; - while (packet.Next != null && packet.Next.PageSequenceNumber == pageSeqNumber) - { - packet = packet.Next; - } - - if (packet != null && packet.IsContinued) - { - // move to the *actual* last packet of the page... If .Prev is null, something is wrong and we can't seek anyway - packet = packet.Prev; - } - } - return packet; - } - - Packet FindPacketInPage(Packet pagePacket, long targetGranulePos, Func packetGranuleCountCallback) - { - var lastPacketInPage = GetLastPacketInPage(pagePacket); - if (lastPacketInPage == null) - { - return null; - } - - // return the packet the granule position is in - var packet = lastPacketInPage; - do - { - if (!packet.GranuleCount.HasValue) - { - // we don't know its length or position... - - // if it's the last packet in the page, it gets the page's granule position. Otherwise, calc it. - if (packet == lastPacketInPage) - { - packet.GranulePosition = packet.PageGranulePosition; - } - else - { - packet.GranulePosition = packet.Next.GranulePosition - packet.Next.GranuleCount.Value; - } - - // if it's the last packet in the stream, it might be a partial. The spec says the last packet has to be on its own page, so if it is not assume the stream was truncated. - if (packet == _last && _eosFound && packet.Prev.PageSequenceNumber < packet.PageSequenceNumber) - { - packet.GranuleCount = (int)(packet.GranulePosition - packet.Prev.PageGranulePosition); - } - else if (packet.Prev != null) - { - packet.Prev.Reset(); - packet.Reset(); - - packet.GranuleCount = packetGranuleCountCallback(packet, packet.Prev); - } - else - { - // probably the first data packet... - if (packet.GranulePosition > packet.Next.GranulePosition - packet.Next.GranuleCount) - { - throw new InvalidOperationException("First data packet size mismatch"); - } - packet.GranuleCount = (int)packet.GranulePosition; - } - } - - // we now know the granule position and count of the packet... is the target within that range? - if (targetGranulePos <= packet.GranulePosition && targetGranulePos > packet.GranulePosition - packet.GranuleCount) - { - // make sure the previous packet has a position too - if (packet.Prev != null && !packet.Prev.GranuleCount.HasValue) - { - packet.Prev.GranulePosition = packet.GranulePosition - packet.GranuleCount.Value; - } - return packet; - } - - packet = packet.Prev; - } while (packet != null && packet.PageSequenceNumber == lastPacketInPage.PageSequenceNumber); - - // couldn't find it, but maybe that's because something glitched in the file... - // we're doing this in case there's a dicontinuity in the file... It's not perfect, but it'll work - if (packet != null && packet.PageGranulePosition < targetGranulePos) - { - packet.GranulePosition = packet.PageGranulePosition; - return packet.Next; - } - return null; - } - - public DataPacket FindPacket(long granulePos, Func packetGranuleCountCallback) - { - // This will find which packet contains the granule position being requested. It is basically a linear search. - // Please note, the spec actually calls for a bisection search, but the result here should be the same. - - // don't look for any position before 0! - if (granulePos < 0) throw new ArgumentOutOfRangeException("granulePos"); - - Packet foundPacket = null; - - // determine which direction to search from... - var packet = _current ?? _first; - if (granulePos > packet.PageGranulePosition) - { - // forward search - - // find the first packet in the page the requested granule is on - while (granulePos > packet.PageGranulePosition) - { - if ((packet.Next == null || packet.IsContinued) && !_eosFound) - { - _container.GatherNextPage(_streamSerial); - if (_eosFound) - { - packet = null; - break; - } - } - packet = packet.Next; - } - - foundPacket = FindPacketInPage(packet, granulePos, packetGranuleCountCallback); - } - else - { - // reverse search (or we're looking at the same page) - while (packet.Prev != null && (granulePos <= packet.Prev.PageGranulePosition || packet.Prev.PageGranulePosition == -1)) - { - packet = packet.Prev; - } - - foundPacket = FindPacketInPage(packet, granulePos, packetGranuleCountCallback); - } - - return foundPacket; - } - - public void SeekToPacket(DataPacket packet, int preRoll) - { - if (preRoll < 0) throw new ArgumentOutOfRangeException("preRoll"); - if (packet == null) throw new ArgumentNullException("granulePos"); - - var op = packet as Packet; - if (op == null) throw new ArgumentException("Incorrect packet type!", "packet"); - - while (--preRoll >= 0) - { - op = op.Prev; - if (op == null) throw new ArgumentOutOfRangeException("preRoll"); - } - - // _current always points to the last packet returned by PeekNextPacketInternal - _current = op.Prev; - } - - public long GetGranuleCount() - { - return GetLastPacket().PageGranulePosition; - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OggPacketReader.cs.meta b/Assets/Libraries/Concentus.Oggfile/OggPacketReader.cs.meta deleted file mode 100644 index f99dddc08..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggPacketReader.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7667d0eb8b547d441b8f4c73589b64bd -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OggPageFlags.cs b/Assets/Libraries/Concentus.Oggfile/OggPageFlags.cs deleted file mode 100644 index 25d753293..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggPageFlags.cs +++ /dev/null @@ -1,20 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; - -namespace Concentus.Oggfile -{ - [Flags] - internal enum PageFlags - { - None = 0, - ContinuesPacket = 1, - BeginningOfStream = 2, - EndOfStream = 4, - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OggPageFlags.cs.meta b/Assets/Libraries/Concentus.Oggfile/OggPageFlags.cs.meta deleted file mode 100644 index 6a1d40756..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OggPageFlags.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6087494091f3e824bb701072eb430de6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OpusHeader.cs b/Assets/Libraries/Concentus.Oggfile/OpusHeader.cs deleted file mode 100644 index 45380e99c..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusHeader.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Concentus.Oggfile -{ - internal class OpusHeader - { - byte version; - byte channel_count; - ushort pre_skip; - uint input_sample_rate; - short output_gain; - byte mapping_family; - byte stream_count; - byte coupled_count; - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OpusHeader.cs.meta b/Assets/Libraries/Concentus.Oggfile/OpusHeader.cs.meta deleted file mode 100644 index a83821149..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusHeader.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c2f353c1f9f0f304c859538c53d3c05e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OpusOggReadStream.cs b/Assets/Libraries/Concentus.Oggfile/OpusOggReadStream.cs deleted file mode 100644 index 3df13ac77..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusOggReadStream.cs +++ /dev/null @@ -1,297 +0,0 @@ -using Concentus.Structs; -using System; -using System.IO; -using System.Text; - -namespace Concentus.Oggfile -{ - /// - /// Provides functionality to decode a basic .opus Ogg file, decoding the audio packets individually and returning them. Tags are also parsed if present. - /// Note that this currently assumes the input file only has 1 elementary stream; anything more advanced than that will probably not work. - /// - public class OpusOggReadStream - { - private const double GranuleSampleRate = 48000.0; // Granule position is always expressed in units of 48000hz - private readonly Stream _stream; - private readonly OpusDecoder _decoder; - - private byte[] _nextDataPacket; - private IPacketProvider _packetProvider; - private bool _endOfStream; - - /// - /// Builds an Ogg file reader that decodes Opus packets from the given input stream, using a - /// specified output sample rate and channel count. The given decoder will be used as-is - /// and return the decoded PCM buffers directly. - /// - /// An Opus decoder. If you are reusing an existing decoder, remember to call Reset() on it before - /// processing a new stream. The decoder is optional for cases where you may only be interested in the file tags - /// The input stream for an Ogg formatted .opus file. The stream will be read from immediately - public OpusOggReadStream(OpusDecoder decoder, Stream stream) - { - if (decoder == null) - { - throw new ArgumentNullException(nameof(decoder)); - - } - if (stream == null) - { - throw new ArgumentNullException(nameof(stream)); - } - - _stream = stream; - _decoder = decoder; - _endOfStream = !Initialize(); - } - - /// - /// Gets a value indicating whether the current stream supports seeking. - /// - public bool CanSeek => _stream.CanSeek; - - /// - /// Gets the tags that were parsed from the OpusTags Ogg packet, or NULL if no such packet was found. - /// - public OpusTags Tags { get; private set; } - - /// - /// Returns true if there is still another data packet to be decoded from the current Ogg stream. - /// Note that this decoder currently only assumes that the input has 1 elementary stream with no splices - /// or other fancy things. - /// - public bool HasNextPacket => !_endOfStream; - - /// - /// If an error happened either in stream initialization, reading, or decoding, the message will appear here. - /// - public string LastError { get; private set; } - - /// - /// Gets the position of the last granule in the page the packet is in. - /// - public long PageGranulePosition { get; private set; } - - /// - /// Gets the current time in the stream. - /// - public TimeSpan CurrentTime => TimeSpan.FromSeconds(PageGranulePosition / GranuleSampleRate); - - /// - /// Gets the total number of granules in this stream. - /// - public long GranuleCount { get; private set; } - - /// - /// Gets the total time from the stream. Only available if the stream is seekable. - /// - public TimeSpan TotalTime => TimeSpan.FromSeconds(GranuleCount / GranuleSampleRate); - - /// - /// Gets the current pages (or frame) position in this stream. - /// - public long PagePosition { get; private set; } - - /// - /// Gets the total number of pages (or frames) this stream uses. Only available if the stream is seekable. - /// - public long PageCount { get; private set; } - - /// - /// Reads the next packet from the Ogg stream and decodes it, returning the decoded PCM buffer. - /// If there are no more packets to decode, this returns NULL. If an error occurs, this also returns - /// NULL and puts the error message into the LastError field - /// - /// The decoded audio for the next packet in the stream, or NULL - public short[] DecodeNextPacket() - { - if (_decoder == null) - { - throw new InvalidOperationException("Cannot decode opus packets as a decoder was never provided"); - } - - if (_nextDataPacket == null || _nextDataPacket.Length == 0) - { - _endOfStream = true; - return null; - } - - try - { - int numSamples = OpusPacketInfo.GetNumSamples(_nextDataPacket, 0, _nextDataPacket.Length, _decoder.SampleRate); - short[] output = new short[numSamples * _decoder.NumChannels]; - _decoder.Decode(_nextDataPacket, 0, _nextDataPacket.Length, output, 0, numSamples, false); - - QueueNextPacket(); - - return output; - } - catch (OpusException e) - { - LastError = "Opus decoder threw exception: " + e.Message; - return null; - } - } - - /// - /// Creates an opus decoder and reads from the ogg stream until a data packet is encountered, - /// queuing it up for future decoding. Tags are also parsed if they are encountered. - /// - /// True if the stream is valid and ready to be decoded - private bool Initialize() - { - try - { - var oggContainerReader = new OggContainerReader(_stream, true); - if (!oggContainerReader.Init()) - { - LastError = "Could not initialize stream"; - return false; - } - - if (oggContainerReader.StreamSerials.Length == 0) - { - LastError = "Initialization failed: No elementary streams found in input file"; - return false; - } - - int firstStreamSerial = oggContainerReader.StreamSerials[0]; - _packetProvider = oggContainerReader.GetStream(firstStreamSerial); - - if (CanSeek) - { - GranuleCount = _packetProvider.GetGranuleCount(); - PageCount = _packetProvider.GetTotalPageCount(); - } - - QueueNextPacket(); - - return true; - } - catch (Exception e) - { - LastError = "Unknown initialization error: " + e.Message; - return false; - } - } - - /// - /// Seeks the stream for a valid packet at the specified playbackTime. Note that this is the best approximated position. - /// - /// The playback time. - public void SeekTo(TimeSpan playbackTime) - { - if (!CanSeek) - { - throw new InvalidOperationException("Stream is not seekable."); - } - - if (playbackTime < TimeSpan.Zero || playbackTime > TotalTime) - { - throw new ArgumentOutOfRangeException(nameof(playbackTime)); - } - - long granulePosition = Convert.ToInt64(playbackTime.TotalSeconds * GranuleSampleRate); - SeekToGranulePosition(granulePosition); - } - - /// - /// Seeks the stream for a valid packet at the specified granule position. - /// - /// The granule position. - private void SeekToGranulePosition(long granulePosition) - { - if (!CanSeek) - { - throw new InvalidOperationException("Stream is not seekable."); - } - - if (granulePosition < 0 || granulePosition > GranuleCount) - { - throw new ArgumentOutOfRangeException(nameof(granulePosition)); - } - - // Find a packet based on offset and return 1 in the callback if the packet is valid - var foundPacket = _packetProvider.FindPacket(granulePosition, GetPacketLength); - - // Check of the found packet is valid - if (foundPacket == null || foundPacket.IsEndOfStream) - { - _endOfStream = true; - _nextDataPacket = null; - return; - } - - // Just seek to this found packet and get the previous packet (preRoll = 1) - _packetProvider.SeekToPacket(foundPacket, 1); - - // Update the PageGranulePosition to the position from this next packet which will be retrieved by the next QueueNextPacket call - PageGranulePosition = _packetProvider.PeekNextPacket().PageGranulePosition; - - // Reset the state from the decoder to start processing a fresh stream - _decoder.ResetState(); - } - - private int GetPacketLength(DataPacket curPacket, DataPacket lastPacket) - { - // if we don't have a previous packet, or we're re-syncing, this packet has no audio data to return - if (lastPacket == null || curPacket.IsResync) - { - return 0; - } - - // make sure they are audio packets - if (curPacket.ReadBit()) - { - return 0; - } - if (lastPacket.ReadBit()) - { - return 0; - } - - // Just return a value > 0 - return 1; - } - - /// - /// Looks for the next opus data packet in the Ogg stream and queues it up. - /// If the end of stream has been reached, this does nothing. - /// - private void QueueNextPacket() - { - if (_endOfStream) - { - return; - } - - DataPacket packet = _packetProvider.GetNextPacket(); - if (packet == null || packet.IsEndOfStream) - { - _endOfStream = true; - _nextDataPacket = null; - return; - } - - PageGranulePosition = packet.PageGranulePosition; - PagePosition = packet.PageSequenceNumber; - - byte[] buf = new byte[packet.Length]; - packet.Read(buf, 0, packet.Length); - packet.Done(); - - if (buf.Length > 8 && "OpusHead".Equals(Encoding.UTF8.GetString(buf, 0, 8))) - { - QueueNextPacket(); - } - else if (buf.Length > 8 && "OpusTags".Equals(Encoding.UTF8.GetString(buf, 0, 8))) - { - Tags = OpusTags.ParsePacket(buf, buf.Length); - QueueNextPacket(); - } - else - { - _nextDataPacket = buf; - } - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OpusOggReadStream.cs.meta b/Assets/Libraries/Concentus.Oggfile/OpusOggReadStream.cs.meta deleted file mode 100644 index 353514cba..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusOggReadStream.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bd54799de669ef342932f9eb9ea205e5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OpusOggWriteStream.cs b/Assets/Libraries/Concentus.Oggfile/OpusOggWriteStream.cs deleted file mode 100644 index 50de3ad51..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusOggWriteStream.cs +++ /dev/null @@ -1,436 +0,0 @@ -using Concentus.Common; -using Concentus.Structs; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Concentus.Oggfile -{ - /// - /// A class for writing audio data as an .opus Ogg stream, using an Opus encoder provided in the constructor. - /// This will handle all of the buffering, packetization and Ogg container work in order to output standard-compliant - /// .opus files that can be played universally. Note that this makes very basic assumptions about output files: - /// - Only 1 elementary stream - /// - Segments may not span pages - /// - public class OpusOggWriteStream - { - private const int FRAME_SIZE_MS = 20; - - private OpusEncoder _encoder; - private Stream _outputStream; - private Crc _crc; - private int _inputChannels; - - // Resampler parameters - private SpeexResampler _resampler; - private int _inputSampleRate; - private int _encoderSampleRate; - - // Ogg page parameters - private short[] _opusFrame; - private int _opusFrameSamples; - private int _opusFrameIndex; - private byte[] _currentHeader = new byte[400]; - private byte[] _currentPayload = new byte[65536]; - private int _headerIndex = 0; - private int _payloadIndex = 0; - private int _pageCounter = 0; - private int _logicalStreamId = 0; - private long _granulePosition = 0; - private byte _lacingTableCount = 0; - private const int PAGE_FLAGS_POS = 5; - private const int GRANULE_COUNT_POS = 6; - private const int CHECKSUM_HEADER_POS = 22; - private const int SEGMENT_COUNT_POS = 26; - private bool _finalized = false; - - /// - /// Constructs a stream that will accept PCM audio input, and automatically encode it to Opus and packetize it using Ogg, - /// writing the output pages to an underlying stream (usually a file stream). - /// You are allowed to change the encoding parameters mid-stream using the properties of the OpusEncoder; the only thing you - /// cannot change is the sample rate and num# of channels. - /// - /// An opus encoder to use for output - /// A base stream to accept the encoded ogg file output - /// (optional) A set of tags to include in the encoded file - /// The actual real sample rate of your input data (NOT the encoder's sample rate). - /// The opus encoder usually requires 48Khz input, but most MP3s and such will give you 44.1Khz. To get the - /// sample rates to line up properly in this case, set the encoder to 48000 and pass inputSampleRate = 44100, - /// and the write stream will perform resampling for you automatically (Note that resampling will slow down - /// the encoding). - public OpusOggWriteStream(OpusEncoder encoder, Stream outputStream, OpusTags fileTags = null, int inputSampleRate = 0) - { - _encoder = encoder; - - if (_encoder.UseDTX) - { - throw new ArgumentException("DTX is not currently supported in Ogg streams"); - } - - _inputSampleRate = inputSampleRate; - if (_inputSampleRate == 0) - { - _inputSampleRate = _encoder.SampleRate; - } - - _logicalStreamId = new Random().Next(); - _encoderSampleRate = encoder.SampleRate; - _inputChannels = encoder.NumChannels; - _outputStream = outputStream; - _opusFrameIndex = 0; - _granulePosition = 0; - _opusFrameSamples = (int)((long)_encoderSampleRate * FRAME_SIZE_MS / 1000); - _opusFrame = new short[_opusFrameSamples * _inputChannels]; - _crc = new Crc(); - _resampler = SpeexResampler.Create(_inputChannels, _inputSampleRate, _encoderSampleRate, 5); - - BeginNewPage(); - WriteOpusHeadPage(); - WriteOpusTagsPage(fileTags); - } - - /// - /// Writes a buffer of PCM audio samples to the encoder and packetizer. Runs Opus encoding and potentially outputs one or more pages to the underlying Ogg stream. - /// You can write any non-zero number of samples that you want here; there are no restrictions on length or packet boundaries - /// - /// The audio samples to write. If stereo, this will be interleaved - /// The offset to use when reading data - /// The amount of PCM data to write - public void WriteSamples(short[] data, int offset, int count) - { - if (_finalized) - { - throw new InvalidOperationException("Cannot write new samples to Ogg file, the output stream is already closed!"); - } - - if ((data.Length - offset) < count) - { - // Check that caller isn't lying about its buffer sizes - throw new ArgumentOutOfRangeException("The given audio buffer claims to have " + count + " samples, but it actually only has " + (data.Length - offset)); - } - - // Try and fill the opus frame - // input cursor in RAW SAMPLES - int inputCursor = 0; - // output cursor in RAW SAMPLES - int amountToWrite = Math.Min(_opusFrame.Length - _opusFrameIndex, count - inputCursor); - while (amountToWrite > 0) - { - // Do we need to resample? - if (_inputSampleRate != _encoderSampleRate) - { - // Resample the input - // divide by channel count because these numbers are in samples-per-channel - int in_len = (count - inputCursor) / _inputChannels; - int out_len = amountToWrite / _inputChannels; - _resampler.ProcessInterleaved(data, offset + inputCursor, ref in_len, _opusFrame, _opusFrameIndex, ref out_len); - inputCursor += in_len * _inputChannels; - _opusFrameIndex += out_len * _inputChannels; - } - else - { - // If no resampling, we can do a straight memcpy instead - Array.Copy(data, offset + inputCursor, _opusFrame, _opusFrameIndex, amountToWrite); - _opusFrameIndex += amountToWrite; - inputCursor += amountToWrite; - } - - if (_opusFrameIndex == _opusFrame.Length) - { - // Frame is finished. Encode it - int packetSize = _encoder.Encode(_opusFrame, 0, _opusFrameSamples, _currentPayload, _payloadIndex, _currentPayload.Length - _payloadIndex); - _payloadIndex += packetSize; - - // Opus granules are measured in 48Khz samples. - // Since the framesize is fixed (20ms) and the sample rate doesn't change, this is basically a constant value - _granulePosition += FRAME_SIZE_MS * 48; - - // And update the lacing values in the header - int segmentLength = packetSize; - while (segmentLength >= 255) - { - segmentLength -= 255; - _currentHeader[_headerIndex++] = 0xFF; - _lacingTableCount++; - } - _currentHeader[_headerIndex++] = (byte)segmentLength; - _lacingTableCount++; - - // And finalize the page if we need - // 284 is a magic number meaning "our page is almost full so just finalize it" - // A more proper implementation would have the packets span to the next page, but meh - if (_lacingTableCount > 248) - { - FinalizePage(); - } - - _opusFrameIndex = 0; - } - - amountToWrite = Math.Min(_opusFrame.Length - _opusFrameIndex, count - inputCursor); - } - } - - /// - /// Writes a buffer of PCM audio samples to the encoder and packetizer. Runs Opus encoding and potentially outputs one or more pages to the underlying Ogg stream. - /// You can write any non-zero number of samples that you want here; there are no restrictions on length or packet boundaries. - /// This function is slightly more wasteful than the short[] version because it has to convert the samples from float to fixed-point. - /// - /// The audio samples to write. If stereo, this will be interleaved - /// The offset to use when reading data - /// The amount of PCM data to write - public void WriteSamples(float[] data, int offset, int count) - { - if (_finalized) - { - throw new InvalidOperationException("Cannot write new samples to Ogg file, the output stream is already closed!"); - } - - // Convert float samples to PCM16 - short[] convertedData = new short[count]; - for (int c = 0; c < count; c++) - { - convertedData[c] = (short)(data[c + offset] * 32767); - } - - WriteSamples(convertedData, 0, count); - } - - /// - /// Call when you are finished encoding your file. This operation will close the underlying stream as well. - /// - public void Finish() - { - // Just see how many samples we need to fill in the opus buffer, and write silence. - int samplesToWrite = _opusFrame.Length - _opusFrameIndex; - short[] paddingSamples = new short[samplesToWrite]; - WriteSamples(paddingSamples, 0, samplesToWrite); - // Finalize the page if it was not just finalized right then - FinalizePage(); - - // Write a new page that just contains the EndOfStream flag - WriteStreamFinishedPage(); - - // Now close our output - _outputStream.Flush(); - _outputStream.Dispose(); - _finalized = true; - } - - /// - /// Writes an empty page containing only the EndOfStream flag - /// - private void WriteStreamFinishedPage() - { - // Write one lacing value of 0 length - _currentHeader[_headerIndex++] = 0x00; - // Increase the segment count - _lacingTableCount++; - // Set page flag to start of logical stream - _currentHeader[PAGE_FLAGS_POS] = (byte)PageFlags.EndOfStream; - FinalizePage(); - } - - /// - /// Writes the Ogg page for OpusHead, containing encoder information - /// - private void WriteOpusHeadPage() - { - if (_payloadIndex != 0) - { - throw new InvalidOperationException("Must begin writing OpusHead on a new page!"); - } - - _payloadIndex += WriteValueToByteBuffer("OpusHead", _currentPayload, _payloadIndex); - _currentPayload[_payloadIndex++] = 0x01; // Version number - _currentPayload[_payloadIndex++] = (byte)_inputChannels; // Channel count - short preskip = 0; - _payloadIndex += WriteValueToByteBuffer(preskip, _currentPayload, _payloadIndex); // Pre-skip. - _payloadIndex += WriteValueToByteBuffer(_encoderSampleRate, _currentPayload, _payloadIndex); //Input sample rate - short outputGain = 0; - _payloadIndex += WriteValueToByteBuffer(outputGain, _currentPayload, _payloadIndex); // Output gain in Q8 - _currentPayload[_payloadIndex++] = 0x00; // Channel map (0 indicates mono/stereo config) - // Write the payload as segment data - _currentHeader[_headerIndex++] = (byte)_payloadIndex; // implicit assumption that this value will always be less than 255 - _lacingTableCount++; - // Set page flag to start of logical stream - _currentHeader[PAGE_FLAGS_POS] = (byte)PageFlags.BeginningOfStream; - FinalizePage(); - } - - /// - /// Writes an Ogg page for the OpusTags, given an input tag set - /// - /// - private void WriteOpusTagsPage(OpusTags tags = null) - { - if (tags == null) - { - tags = new OpusTags(); - } - - if (string.IsNullOrEmpty(tags.Comment)) - { - tags.Comment = CodecHelpers.GetVersionString(); - } - - if (_payloadIndex != 0) - { - throw new InvalidOperationException("Must begin writing OpusTags on a new page!"); - } - - // BUGBUG: Very long tags can overflow the page and corrupt the stream - _payloadIndex += WriteValueToByteBuffer("OpusTags", _currentPayload, _payloadIndex); - - // write comment - int stringLength = WriteValueToByteBuffer(tags.Comment, _currentPayload, _payloadIndex + 4); - _payloadIndex += WriteValueToByteBuffer(stringLength, _currentPayload, _payloadIndex); - _payloadIndex += stringLength; - - // capture the location of the tag count field to fill in later - int numTagsIndex = _payloadIndex; - _payloadIndex += 4; - - // write each tag. skipping empty or invalid ones - int tagsWritten = 0; - foreach (var kvp in tags.Fields) - { - if (string.IsNullOrEmpty(kvp.Key) || string.IsNullOrEmpty(kvp.Value)) - continue; - - string tag = kvp.Key + "=" + kvp.Value; - stringLength = WriteValueToByteBuffer(tag, _currentPayload, _payloadIndex + 4); - _payloadIndex += WriteValueToByteBuffer(stringLength, _currentPayload, _payloadIndex); - _payloadIndex += stringLength; - tagsWritten++; - } - - // Write actual tag count - WriteValueToByteBuffer(tagsWritten, _currentPayload, numTagsIndex); - - // Write segment data, ensuring we can handle tags longer than 255 bytes - int tagsSegmentSize = _payloadIndex; - while (tagsSegmentSize >= 255) - { - _currentHeader[_headerIndex++] = 255; - _lacingTableCount++; - tagsSegmentSize -= 255; - } - _currentHeader[_headerIndex++] = (byte)tagsSegmentSize; - _lacingTableCount++; - - FinalizePage(); - } - - /// - /// Clears all buffers and prepares a new page with an empty header - /// - private void BeginNewPage() - { - _headerIndex = 0; - _payloadIndex = 0; - _lacingTableCount = 0; - - // Page begin keyword - _headerIndex += WriteValueToByteBuffer("OggS", _currentHeader, _headerIndex); - // Stream version 0 - _currentHeader[_headerIndex++] = 0x0; - // Header flags - _currentHeader[_headerIndex++] = (byte)PageFlags.None; - // Granule position (for opus, it is the number of 48Khz pcm samples encoded) - _headerIndex += WriteValueToByteBuffer(_granulePosition, _currentHeader, _headerIndex); - // Logical stream serial number - _headerIndex += WriteValueToByteBuffer(_logicalStreamId, _currentHeader, _headerIndex); - // Page sequence number - _headerIndex += WriteValueToByteBuffer(_pageCounter, _currentHeader, _headerIndex); - // Checksum is initially zero - _currentHeader[_headerIndex++] = 0x0; - _currentHeader[_headerIndex++] = 0x0; - _currentHeader[_headerIndex++] = 0x0; - _currentHeader[_headerIndex++] = 0x0; - // Number of segments, initially zero - _currentHeader[_headerIndex++] = _lacingTableCount; - // Segment table goes after this point, once we have packets in this page - - _pageCounter++; - } - - /// - /// If the number of segments is nonzero, finalizes the page into a contiguous buffer, calculates CRC, and writes the page to the output stream - /// - private void FinalizePage() - { - if (_finalized) - { - throw new InvalidOperationException("Cannot finalize page, the output stream is already closed!"); - } - - if (_lacingTableCount != 0) - { - // Write the final segment count to the header - _currentHeader[SEGMENT_COUNT_POS] = _lacingTableCount; - // And the granule count for frames that finished on this page - WriteValueToByteBuffer(_granulePosition, _currentHeader, GRANULE_COUNT_POS); - // Calculate CRC and update the header - _crc.Reset(); - for (int c = 0; c < _headerIndex; c++) - { - _crc.Update(_currentHeader[c]); - } - for (int c = 0; c < _payloadIndex; c++) - { - _crc.Update(_currentPayload[c]); - } - //Debug.WriteLine("Writing CRC " + _crc.Value); - WriteValueToByteBuffer(_crc.Value, _currentHeader, CHECKSUM_HEADER_POS); - // Write the page to the stream (TODO: Make sure this operation does not overflow any target stream buffers?) - _outputStream.Write(_currentHeader, 0, _headerIndex); - _outputStream.Write(_currentPayload, 0, _payloadIndex); - // And reset the page - BeginNewPage(); - } - } - - private static int WriteValueToByteBuffer(int val, byte[] target, int targetOffset) - { - byte[] bytes = BitConverter.GetBytes(val); - Array.Copy(bytes, 0, target, targetOffset, 4); - return 4; - } - - private static int WriteValueToByteBuffer(long val, byte[] target, int targetOffset) - { - byte[] bytes = BitConverter.GetBytes(val); - Array.Copy(bytes, 0, target, targetOffset, 8); - return 8; - } - - private static int WriteValueToByteBuffer(uint val, byte[] target, int targetOffset) - { - byte[] bytes = BitConverter.GetBytes(val); - Array.Copy(bytes, 0, target, targetOffset, 4); - return 4; - } - - private static int WriteValueToByteBuffer(short val, byte[] target, int targetOffset) - { - byte[] bytes = BitConverter.GetBytes(val); - Array.Copy(bytes, 0, target, targetOffset, 2); - return 2; - } - - private static int WriteValueToByteBuffer(string val, byte[] target, int targetOffset) - { - if (string.IsNullOrEmpty(val)) - return 0; - byte[] bytes = Encoding.UTF8.GetBytes(val); - Array.Copy(bytes, 0, target, targetOffset, bytes.Length); - return bytes.Length; - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OpusOggWriteStream.cs.meta b/Assets/Libraries/Concentus.Oggfile/OpusOggWriteStream.cs.meta deleted file mode 100644 index 9bc1d2f7c..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusOggWriteStream.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fb3d4ceb026b32c4895e604ccc8a9404 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OpusTagName.cs b/Assets/Libraries/Concentus.Oggfile/OpusTagName.cs deleted file mode 100644 index 9c2dd0a2c..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusTagName.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Concentus.Oggfile -{ - /// - /// Specifies const string values for common tag names - /// - public class OpusTagName - { - public const string Title = "title"; - public const string Artist = "artist"; - public const string Album = "album"; - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OpusTagName.cs.meta b/Assets/Libraries/Concentus.Oggfile/OpusTagName.cs.meta deleted file mode 100644 index 35179386d..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusTagName.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 74a78f5fb8277a9499f49f41a38a8ce6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/OpusTags.cs b/Assets/Libraries/Concentus.Oggfile/OpusTags.cs deleted file mode 100644 index ed18db9a5..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusTags.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Concentus.Oggfile -{ - /// - /// A set of tags that are read from / written to an Opus ogg file - /// - public class OpusTags - { - private string _comment = string.Empty; - private IDictionary _fields = new Dictionary(); - - public OpusTags() - { - } - - public string Comment - { - get - { - return _comment; - } - set - { - _comment = value; - } - } - - public IDictionary Fields - { - get - { - return _fields; - } - } - - internal static OpusTags ParsePacket(byte[] packet, int packetLength) - { - if (packetLength < 8) - return null; - - if (!"OpusTags".Equals(Encoding.UTF8.GetString(packet, 0, 8))) - return null; - - OpusTags returnVal = new OpusTags(); - int cursor = 8; - int nextFieldLength = BitConverter.ToInt32(packet, cursor); - cursor += 4; - if (nextFieldLength > 0) - { - returnVal._comment = Encoding.UTF8.GetString(packet, cursor, nextFieldLength); - cursor += nextFieldLength; - } - - int numTags = BitConverter.ToInt32(packet, cursor); - cursor += 4; - for (int c = 0; c < numTags; c++) - { - nextFieldLength = BitConverter.ToInt32(packet, cursor); - cursor += 4; - if (nextFieldLength > 0) - { - string tag = Encoding.UTF8.GetString(packet, cursor, nextFieldLength); - cursor += nextFieldLength; - int eq = tag.IndexOf('='); - if (eq > 0) - { - string key = tag.Substring(0, eq); - string val = tag.Substring(eq + 1); - returnVal._fields[key] = val; - } - } - } - - return returnVal; - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/OpusTags.cs.meta b/Assets/Libraries/Concentus.Oggfile/OpusTags.cs.meta deleted file mode 100644 index 8fb0e1954..000000000 --- a/Assets/Libraries/Concentus.Oggfile/OpusTags.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fb56790bb1da235488b7d4a49973ba14 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/ParameterChangeEventArgs.cs b/Assets/Libraries/Concentus.Oggfile/ParameterChangeEventArgs.cs deleted file mode 100644 index 415ee2c9a..000000000 --- a/Assets/Libraries/Concentus.Oggfile/ParameterChangeEventArgs.cs +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Concentus.Oggfile -{ - /// - /// Event data for when a logical stream has a parameter change. - /// - internal class ParameterChangeEventArgs : EventArgs - { - /// - /// Creates a new instance of . - /// - /// The first packet after the parameter change. - public ParameterChangeEventArgs(DataPacket firstPacket) - { - FirstPacket = firstPacket; - } - - /// - /// Gets the first packet after the parameter change. This would typically be the parameters packet. - /// - public DataPacket FirstPacket { get; private set; } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/ParameterChangeEventArgs.cs.meta b/Assets/Libraries/Concentus.Oggfile/ParameterChangeEventArgs.cs.meta deleted file mode 100644 index e092d0376..000000000 --- a/Assets/Libraries/Concentus.Oggfile/ParameterChangeEventArgs.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a3e46e6daa2d7bb469619b39bc65ea90 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries/Concentus.Oggfile/StreamReadBuffer.cs b/Assets/Libraries/Concentus.Oggfile/StreamReadBuffer.cs deleted file mode 100644 index 5f26f3716..000000000 --- a/Assets/Libraries/Concentus.Oggfile/StreamReadBuffer.cs +++ /dev/null @@ -1,569 +0,0 @@ -/**************************************************************************** - * NVorbis * - * Copyright (C) 2014, Andrew Ward * - * * - * See COPYING for license terms (Ms-PL). * - * * - ***************************************************************************/ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Concentus.Oggfile -{ - internal partial class StreamReadBuffer : IDisposable - { - internal class StreamWrapper - { - internal Stream Source; - internal object LockObject = new object(); - internal long EofOffset = long.MaxValue; - internal int RefCount = 1; - } - - static Dictionary _lockObjects = new Dictionary(); - - internal StreamReadBuffer(Stream source, int initialSize, int maxSize, bool minimalRead) - { - StreamWrapper wrapper; - lock(_lockObjects) - { - if (!_lockObjects.TryGetValue(source, out wrapper)) - { - _lockObjects.Add(source, new StreamWrapper { Source = source }); - wrapper = _lockObjects[source]; - - if (source.CanSeek) - { - // assume that this is a quick operation - wrapper.EofOffset = source.Length; - } - } - else - { - wrapper.RefCount++; - } - } - - // make sure our initial size is a power of 2 (this makes resizing simpler to understand) - initialSize = 2 << (int)Math.Log(initialSize - 1, 2); - - // make sure our max size is a power of 2 (in this case, just so we report a "real" number) - maxSize = 1 << (int)Math.Log(maxSize, 2); - - _wrapper = wrapper; - _data = new byte[initialSize]; - _maxSize = maxSize; - _minimalRead = minimalRead; - - _savedBuffers = new List(); - } - - public void Dispose() - { - lock( _lockObjects ) - { - if (--_wrapper.RefCount == 0) - { - _lockObjects.Remove(_wrapper.Source); - } - } - } - - StreamWrapper _wrapper; - int _maxSize; - - byte[] _data; - long _baseOffset; - int _end; - int _discardCount; - - bool _minimalRead; - - // we're locked already when we enter, so we can do whatever we need to do without worrying about it... - class SavedBuffer - { - public byte[] Buffer; - public long BaseOffset; - public int End; - public int DiscardCount; - public long VersionSaved; - } - long _versionCounter; - List _savedBuffers; - - /// - /// Gets or Sets whether to limit reads to the smallest size possible. - /// - public bool MinimalRead - { - get { return _minimalRead; } - set { _minimalRead = value; } - } - - /// - /// Gets or Sets the maximum size of the buffer. This is not a hard limit. - /// - public int MaxSize - { - get { return _maxSize; } - set - { - if (value < 1) throw new ArgumentOutOfRangeException("Must be greater than zero."); - - var newMaxSize = 1 << (int)Math.Ceiling(Math.Log(value, 2)); - - if (newMaxSize < _end) - { - if (newMaxSize < _end - _discardCount) - { - // we can't discard enough bytes to satisfy the buffer request... - throw new ArgumentOutOfRangeException("Must be greater than or equal to the number of bytes currently buffered."); - } - - CommitDiscard(); - var newBuf = new byte[newMaxSize]; - Buffer.BlockCopy(_data, 0, newBuf, 0, _end); - _data = newBuf; - } - _maxSize = newMaxSize; - } - } - - /// - /// Gets the offset of the start of the buffered data. Reads to offsets before this are likely to require a seek. - /// - public long BaseOffset - { - get { return _baseOffset + _discardCount; } - } - - /// - /// Gets the number of bytes currently buffered. - /// - public int BytesFilled - { - get { return _end - _discardCount; } - } - - /// - /// Gets the number of bytes the buffer can hold. - /// - public int Length - { - get { return _data.Length; } - } - - internal long BufferEndOffset - { - get - { - if (_end - _discardCount > 0) - { - // this is the base offset + discard bytes + buffer max length (though technically we could go a little further...) - return _baseOffset + _discardCount + _maxSize; - } - // if there aren't any bytes in the buffer, we can seek wherever we want - return _wrapper.Source.Length; - } - } - - /// - /// Reads the number of bytes specified into the buffer given, starting with the offset indicated. - /// - /// The offset into the stream to start reading. - /// The buffer to read to. - /// The index into the buffer to start writing to. - /// The number of bytes to read. - /// The number of bytes read. - public int Read(long offset, byte[] buffer, int index, int count) - { - if (offset < 0L) throw new ArgumentOutOfRangeException("offset"); - if (buffer == null) throw new ArgumentNullException("buffer"); - if (index < 0 || index + count > buffer.Length) throw new ArgumentOutOfRangeException("index"); - if (count < 0) throw new ArgumentOutOfRangeException("count"); - if (offset >= _wrapper.EofOffset) return 0; - - var startIdx = EnsureAvailable(offset, ref count, false); - - Buffer.BlockCopy(_data, startIdx, buffer, index, count); - - return count; - } - - internal int ReadByte(long offset) - { - if (offset < 0L) throw new ArgumentOutOfRangeException("offset"); - if (offset >= _wrapper.EofOffset) return -1; - - int count = 1; - var startIdx = EnsureAvailable(offset, ref count, false); - if (count == 1) - { - return _data[startIdx]; - } - return -1; - } - - - int EnsureAvailable(long offset, ref int count, bool isRecursion) - { - // simple... if we're inside the buffer, just return the offset (FAST PATH) - if (offset >= _baseOffset && offset + count < _baseOffset + _end) - { - return (int)(offset - _baseOffset); - } - - // not so simple... we're outside the buffer somehow... - - // let's make sure the request makes sense - if (count > _maxSize) - { - throw new InvalidOperationException("Not enough room in the buffer! Increase the maximum size and try again."); - } - - // make sure we always bump the version counter when a change is made to the data in the "live" buffer - ++_versionCounter; - - // can we satisfy the request with a saved buffer? - if (!isRecursion) - { - for (int i = 0; i < _savedBuffers.Count; i++) - { - var tempS = _savedBuffers[i].BaseOffset - offset; - if ((tempS < 0 && _savedBuffers[i].End + tempS > 0) || (tempS > 0 && count - tempS > 0)) - { - SwapBuffers(_savedBuffers[i]); - return EnsureAvailable(offset, ref count, true); - } - } - } - - // look for buffers we need to drop due to age... - while (_savedBuffers.Count > 0 && _savedBuffers[0].VersionSaved + 25 < _versionCounter) - { - _savedBuffers[0].Buffer = null; - _savedBuffers.RemoveAt(0); - } - - // if we have to seek back, we're doomed... - if (offset < _baseOffset && !_wrapper.Source.CanSeek) - { - throw new InvalidOperationException("Cannot seek before buffer on forward-only streams!"); - } - - // figure up the new buffer parameters... - int readStart; - int readEnd; - CalcBuffer(offset, count, out readStart, out readEnd); - - // fill the buffer... - // if we did a reverse seek, there will be data still in end of the buffer... Make sure to fill everything between - count = FillBuffer(offset, count, readStart, readEnd); - - return (int)(offset - _baseOffset); - } - - void SaveBuffer() - { - _savedBuffers.Add( - new SavedBuffer - { - Buffer = _data, - BaseOffset = _baseOffset, - End = _end, - DiscardCount = _discardCount, - VersionSaved = _versionCounter - } - ); - - _data = null; - _end = 0; - _discardCount = 0; - } - - void CreateNewBuffer(long offset, int count) - { - SaveBuffer(); - - _data = new byte[Math.Min(2 << (int)Math.Log(count - 1, 2), _maxSize)]; - _baseOffset = offset; - } - - void SwapBuffers(SavedBuffer savedBuffer) - { - _savedBuffers.Remove(savedBuffer); - SaveBuffer(); - _data = savedBuffer.Buffer; - _baseOffset = savedBuffer.BaseOffset; - _end = savedBuffer.End; - _discardCount = savedBuffer.DiscardCount; - } - - void CalcBuffer(long offset, int count, out int readStart, out int readEnd) - { - readStart = 0; - readEnd = 0; - if (offset < _baseOffset) - { - // try to overlap the end... - if (offset + _maxSize <= _baseOffset) - { - // nope... - if (_baseOffset - (offset + _maxSize) > _maxSize) - { - // it's probably best to cache this buffer for a bit - CreateNewBuffer(offset, count); - } - else - { - // don't worry about caching... - EnsureBufferSize(count, false, 0); - } - _baseOffset = offset; - readEnd = count; - } - else - { - // we have at least some overlap - readEnd = (int)(offset - _baseOffset); - EnsureBufferSize(Math.Min((int)(offset + _maxSize - _baseOffset), _end) - readEnd, true, readEnd); - readEnd = (int)(offset - _baseOffset) - readEnd; - } - } - else - { - // try to overlap the beginning... - if (offset >= _baseOffset + _maxSize) - { - // nope... - if (offset - (_baseOffset + _maxSize) > _maxSize) - { - CreateNewBuffer(offset, count); - } - else - { - EnsureBufferSize(count, false, 0); - } - _baseOffset = offset; - readEnd = count; - } - else - { - // we have at least some overlap - readEnd = (int)(offset + count - _baseOffset); - var ofs = Math.Max(readEnd - _maxSize, 0); - EnsureBufferSize(readEnd - ofs, true, ofs); - readStart = _end; - // re-pull in case EnsureBufferSize had to discard... - readEnd = (int)(offset + count - _baseOffset); - } - } - } - - void EnsureBufferSize(int reqSize, bool copyContents, int copyOffset) - { - byte[] newBuf = _data; - if (reqSize > _data.Length) - { - if (reqSize > _maxSize) - { - if (_wrapper.Source.CanSeek || reqSize - _discardCount <= _maxSize) - { - // lose some of the earlier data... - var ofs = reqSize - _maxSize; - copyOffset += ofs; - reqSize = _maxSize; - } - else - { - throw new InvalidOperationException("Not enough room in the buffer! Increase the maximum size and try again."); - } - } - else - { - // find the new size - var size = _data.Length; - while (size < reqSize) - { - size *= 2; - } - reqSize = size; - } - - // if we discarded some bytes above, don't resize the buffer unless we have to... - if (reqSize > _data.Length) - { - newBuf = new byte[reqSize]; - } - } - - if (copyContents) - { - // adjust the position of the data - if ((copyOffset > 0 && copyOffset < _end) || (copyOffset == 0 && newBuf != _data)) - { - // copy forward - Buffer.BlockCopy(_data, copyOffset, newBuf, 0, _end - copyOffset); - - // adjust our discard count - if ((_discardCount -= copyOffset) < 0) _discardCount = 0; - } - else if (copyOffset < 0 && -copyOffset < _end) - { - // copy backward - // be clever... if we're moving to a new buffer or the ranges don't overlap, just use a block copy - if (newBuf != _data || _end <= -copyOffset) - { - Buffer.BlockCopy(_data, 0, newBuf, -copyOffset, Math.Max(_end, Math.Min(_end, _data.Length + copyOffset))); - } - else - { - // this shouldn't happen often, so we can get away with a full buffer refill - _end = copyOffset; - } - - // adjust our discard count - _discardCount = 0; - } - else - { - _end = copyOffset; - _discardCount = 0; - } - - // adjust our markers - _baseOffset += copyOffset; - _end -= copyOffset; - if (_end > newBuf.Length) _end = newBuf.Length; - } - else - { - _discardCount = 0; - // we can't set _baseOffset since our caller hasn't told us what it should be... - _end = 0; - } - - _data = newBuf; - } - - int FillBuffer(long offset, int count, int readStart, int readEnd) - { - var readOffset = _baseOffset + readStart; - var readCount = readEnd - readStart; - - lock (_wrapper.LockObject) - { - readCount = PrepareStreamForRead(readCount, readOffset); - - ReadStream(readStart, readCount, readOffset); - - // check for full read... - if (_end < readStart + readCount) - { - count = Math.Max(0, (int)(_baseOffset + _end - offset)); - } - else if (!_minimalRead && _end < _data.Length) - { - // try to finish filling the buffer - readCount = _data.Length - _end; - readCount = PrepareStreamForRead(readCount, _baseOffset + _end); - _end += _wrapper.Source.Read(_data, _end, readCount); - } - } - return count; - } - - int PrepareStreamForRead(int readCount, long readOffset) - { - if (readCount > 0 && _wrapper.Source.Position != readOffset) - { - if (readOffset < _wrapper.EofOffset) - { - if (_wrapper.Source.CanSeek) - { - _wrapper.Source.Position = readOffset; - } - else - { - // ugh, gotta read bytes until we've reached the desired offset - var seekCount = readOffset - _wrapper.Source.Position; - if (seekCount < 0) - { - // not so fast... we can't seek backwards. This technically shouldn't happen, but just in case... - readCount = 0; - } - else - { - while (--seekCount >= 0) - { - if (_wrapper.Source.ReadByte() == -1) - { - // crap... we just threw away a bunch of bytes for no reason - _wrapper.EofOffset = _wrapper.Source.Position; - readCount = 0; - break; - } - } - } - } - } - else - { - readCount = 0; - } - } - return readCount; - } - - void ReadStream(int readStart, int readCount, long readOffset) - { - while (readCount > 0 && readOffset < _wrapper.EofOffset) - { - var temp = _wrapper.Source.Read(_data, readStart, readCount); - if (temp == 0) - { - break; - } - readStart += temp; - readOffset += temp; - readCount -= temp; - } - - if (readStart > _end) - { - _end = readStart; - } - } - - /// - /// Tells the buffer that it no longer needs to maintain any bytes before the indicated offset. - /// - /// The offset to discard through. - public void DiscardThrough(long offset) - { - var count = (int)(offset - _baseOffset); - _discardCount = Math.Max(count, _discardCount); - - if (_discardCount >= _data.Length) CommitDiscard(); - } - - void CommitDiscard() - { - if (_discardCount >= _data.Length || _discardCount >= _end) - { - // we have been told to discard the entire buffer - _baseOffset += _discardCount; - _end = 0; - } - else - { - // just discard the first part... - Buffer.BlockCopy(_data, _discardCount, _data, 0, _end - _discardCount); - _baseOffset += _discardCount; - _end -= _discardCount; - } - _discardCount = 0; - } - } -} diff --git a/Assets/Libraries/Concentus.Oggfile/StreamReadBuffer.cs.meta b/Assets/Libraries/Concentus.Oggfile/StreamReadBuffer.cs.meta deleted file mode 100644 index 8926bf484..000000000 --- a/Assets/Libraries/Concentus.Oggfile/StreamReadBuffer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 320cfd584fb2bed4cac3a8a732b05b82 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Libraries.meta b/Assets/Plugins.meta similarity index 77% rename from Assets/Libraries.meta rename to Assets/Plugins.meta index ac1601502..eaaf8bf92 100644 --- a/Assets/Libraries.meta +++ b/Assets/Plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 93c841a6091f3084f8226ac49d739b6b +guid: fcf65e96a781b2440b69e7c7491cb441 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Libraries/BassNative.meta b/Assets/Plugins/BassNative.meta similarity index 100% rename from Assets/Libraries/BassNative.meta rename to Assets/Plugins/BassNative.meta diff --git a/Assets/Libraries/BassNative/.gitignore b/Assets/Plugins/BassNative/.gitignore similarity index 100% rename from Assets/Libraries/BassNative/.gitignore rename to Assets/Plugins/BassNative/.gitignore diff --git a/Assets/Libraries/BassNative/Linux.meta b/Assets/Plugins/BassNative/Linux.meta similarity index 100% rename from Assets/Libraries/BassNative/Linux.meta rename to Assets/Plugins/BassNative/Linux.meta diff --git a/Assets/Libraries/BassNative/Linux/x86_64.meta b/Assets/Plugins/BassNative/Linux/x86_64.meta similarity index 100% rename from Assets/Libraries/BassNative/Linux/x86_64.meta rename to Assets/Plugins/BassNative/Linux/x86_64.meta diff --git a/Assets/Libraries/BassNative/Linux/x86_64/libbass.so.meta b/Assets/Plugins/BassNative/Linux/x86_64/libbass.so.meta similarity index 100% rename from Assets/Libraries/BassNative/Linux/x86_64/libbass.so.meta rename to Assets/Plugins/BassNative/Linux/x86_64/libbass.so.meta diff --git a/Assets/Libraries/BassNative/Linux/x86_64/libbass_fx.so.meta b/Assets/Plugins/BassNative/Linux/x86_64/libbass_fx.so.meta similarity index 100% rename from Assets/Libraries/BassNative/Linux/x86_64/libbass_fx.so.meta rename to Assets/Plugins/BassNative/Linux/x86_64/libbass_fx.so.meta diff --git a/Assets/Libraries/BassNative/Linux/x86_64/libbassmix.so.meta b/Assets/Plugins/BassNative/Linux/x86_64/libbassmix.so.meta similarity index 100% rename from Assets/Libraries/BassNative/Linux/x86_64/libbassmix.so.meta rename to Assets/Plugins/BassNative/Linux/x86_64/libbassmix.so.meta diff --git a/Assets/Libraries/BassNative/Linux/x86_64/libbassopus.so.meta b/Assets/Plugins/BassNative/Linux/x86_64/libbassopus.so.meta similarity index 100% rename from Assets/Libraries/BassNative/Linux/x86_64/libbassopus.so.meta rename to Assets/Plugins/BassNative/Linux/x86_64/libbassopus.so.meta diff --git a/Assets/Libraries/BassNative/Mac.meta b/Assets/Plugins/BassNative/Mac.meta similarity index 100% rename from Assets/Libraries/BassNative/Mac.meta rename to Assets/Plugins/BassNative/Mac.meta diff --git a/Assets/Libraries/BassNative/Mac/libbass.dylib.meta b/Assets/Plugins/BassNative/Mac/libbass.dylib.meta similarity index 100% rename from Assets/Libraries/BassNative/Mac/libbass.dylib.meta rename to Assets/Plugins/BassNative/Mac/libbass.dylib.meta diff --git a/Assets/Libraries/BassNative/Mac/libbass_fx.dylib.meta b/Assets/Plugins/BassNative/Mac/libbass_fx.dylib.meta similarity index 100% rename from Assets/Libraries/BassNative/Mac/libbass_fx.dylib.meta rename to Assets/Plugins/BassNative/Mac/libbass_fx.dylib.meta diff --git a/Assets/Libraries/BassNative/Mac/libbassmix.dylib.meta b/Assets/Plugins/BassNative/Mac/libbassmix.dylib.meta similarity index 100% rename from Assets/Libraries/BassNative/Mac/libbassmix.dylib.meta rename to Assets/Plugins/BassNative/Mac/libbassmix.dylib.meta diff --git a/Assets/Libraries/BassNative/Mac/libbassopus.dylib.meta b/Assets/Plugins/BassNative/Mac/libbassopus.dylib.meta similarity index 100% rename from Assets/Libraries/BassNative/Mac/libbassopus.dylib.meta rename to Assets/Plugins/BassNative/Mac/libbassopus.dylib.meta diff --git a/Assets/Libraries/BassNative/Windows.meta b/Assets/Plugins/BassNative/Windows.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows.meta rename to Assets/Plugins/BassNative/Windows.meta diff --git a/Assets/Libraries/BassNative/Windows/x86.meta b/Assets/Plugins/BassNative/Windows/x86.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86.meta rename to Assets/Plugins/BassNative/Windows/x86.meta diff --git a/Assets/Libraries/BassNative/Windows/x86/bass.dll.meta b/Assets/Plugins/BassNative/Windows/x86/bass.dll.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86/bass.dll.meta rename to Assets/Plugins/BassNative/Windows/x86/bass.dll.meta diff --git a/Assets/Libraries/BassNative/Windows/x86/bass_fx.dll.meta b/Assets/Plugins/BassNative/Windows/x86/bass_fx.dll.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86/bass_fx.dll.meta rename to Assets/Plugins/BassNative/Windows/x86/bass_fx.dll.meta diff --git a/Assets/Libraries/BassNative/Windows/x86/bassmix.dll.meta b/Assets/Plugins/BassNative/Windows/x86/bassmix.dll.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86/bassmix.dll.meta rename to Assets/Plugins/BassNative/Windows/x86/bassmix.dll.meta diff --git a/Assets/Libraries/BassNative/Windows/x86/bassopus.dll.meta b/Assets/Plugins/BassNative/Windows/x86/bassopus.dll.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86/bassopus.dll.meta rename to Assets/Plugins/BassNative/Windows/x86/bassopus.dll.meta diff --git a/Assets/Libraries/BassNative/Windows/x86_64.meta b/Assets/Plugins/BassNative/Windows/x86_64.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86_64.meta rename to Assets/Plugins/BassNative/Windows/x86_64.meta diff --git a/Assets/Libraries/BassNative/Windows/x86_64/bass.dll.meta b/Assets/Plugins/BassNative/Windows/x86_64/bass.dll.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86_64/bass.dll.meta rename to Assets/Plugins/BassNative/Windows/x86_64/bass.dll.meta diff --git a/Assets/Libraries/BassNative/Windows/x86_64/bass_fx.dll.meta b/Assets/Plugins/BassNative/Windows/x86_64/bass_fx.dll.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86_64/bass_fx.dll.meta rename to Assets/Plugins/BassNative/Windows/x86_64/bass_fx.dll.meta diff --git a/Assets/Libraries/BassNative/Windows/x86_64/bassmix.dll.meta b/Assets/Plugins/BassNative/Windows/x86_64/bassmix.dll.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86_64/bassmix.dll.meta rename to Assets/Plugins/BassNative/Windows/x86_64/bassmix.dll.meta diff --git a/Assets/Libraries/BassNative/Windows/x86_64/bassopus.dll.meta b/Assets/Plugins/BassNative/Windows/x86_64/bassopus.dll.meta similarity index 100% rename from Assets/Libraries/BassNative/Windows/x86_64/bassopus.dll.meta rename to Assets/Plugins/BassNative/Windows/x86_64/bassopus.dll.meta diff --git a/Assets/Libraries/DiscordGameSDK.meta b/Assets/Plugins/DiscordGameSDK.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK.meta rename to Assets/Plugins/DiscordGameSDK.meta diff --git a/Assets/Libraries/DiscordGameSDK/ActivityManager.cs b/Assets/Plugins/DiscordGameSDK/ActivityManager.cs similarity index 100% rename from Assets/Libraries/DiscordGameSDK/ActivityManager.cs rename to Assets/Plugins/DiscordGameSDK/ActivityManager.cs diff --git a/Assets/Libraries/DiscordGameSDK/ActivityManager.cs.meta b/Assets/Plugins/DiscordGameSDK/ActivityManager.cs.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/ActivityManager.cs.meta rename to Assets/Plugins/DiscordGameSDK/ActivityManager.cs.meta diff --git a/Assets/Libraries/DiscordGameSDK/Constants.cs b/Assets/Plugins/DiscordGameSDK/Constants.cs similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Constants.cs rename to Assets/Plugins/DiscordGameSDK/Constants.cs diff --git a/Assets/Libraries/DiscordGameSDK/Constants.cs.meta b/Assets/Plugins/DiscordGameSDK/Constants.cs.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Constants.cs.meta rename to Assets/Plugins/DiscordGameSDK/Constants.cs.meta diff --git a/Assets/Libraries/DiscordGameSDK/Core.cs b/Assets/Plugins/DiscordGameSDK/Core.cs similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Core.cs rename to Assets/Plugins/DiscordGameSDK/Core.cs diff --git a/Assets/Libraries/DiscordGameSDK/Core.cs.meta b/Assets/Plugins/DiscordGameSDK/Core.cs.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Core.cs.meta rename to Assets/Plugins/DiscordGameSDK/Core.cs.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins.meta b/Assets/Plugins/DiscordGameSDK/Plugins.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins.meta rename to Assets/Plugins/DiscordGameSDK/Plugins.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/aarch64.meta b/Assets/Plugins/DiscordGameSDK/Plugins/aarch64.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/aarch64.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/aarch64.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle b/Assets/Plugins/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle rename to Assets/Plugins/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle.meta b/Assets/Plugins/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.bundle.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib b/Assets/Plugins/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib rename to Assets/Plugins/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib.meta b/Assets/Plugins/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/aarch64/discord_game_sdk.dylib.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll b/Assets/Plugins/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll rename to Assets/Plugins/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib b/Assets/Plugins/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib rename to Assets/Plugins/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.lib.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86/discord_game_sdk.dll.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.bundle.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.lib.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dll.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.dylib.meta diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so diff --git a/Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so.meta b/Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so.meta similarity index 100% rename from Assets/Libraries/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so.meta rename to Assets/Plugins/DiscordGameSDK/Plugins/x86_64/discord_game_sdk.so.meta diff --git a/Assets/Libraries/OccurrenceList.cs b/Assets/Plugins/OccurrenceList.cs similarity index 100% rename from Assets/Libraries/OccurrenceList.cs rename to Assets/Plugins/OccurrenceList.cs diff --git a/Assets/Libraries/OccurrenceList.cs.meta b/Assets/Plugins/OccurrenceList.cs.meta similarity index 100% rename from Assets/Libraries/OccurrenceList.cs.meta rename to Assets/Plugins/OccurrenceList.cs.meta diff --git a/Assets/Libraries/StandaloneFileBrowser.meta b/Assets/Plugins/StandaloneFileBrowser.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser.meta rename to Assets/Plugins/StandaloneFileBrowser.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/IStandaloneFileBrowser.cs b/Assets/Plugins/StandaloneFileBrowser/IStandaloneFileBrowser.cs similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/IStandaloneFileBrowser.cs rename to Assets/Plugins/StandaloneFileBrowser/IStandaloneFileBrowser.cs diff --git a/Assets/Libraries/StandaloneFileBrowser/IStandaloneFileBrowser.cs.meta b/Assets/Plugins/StandaloneFileBrowser/IStandaloneFileBrowser.cs.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/IStandaloneFileBrowser.cs.meta rename to Assets/Plugins/StandaloneFileBrowser/IStandaloneFileBrowser.cs.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/Linux.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/Linux.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/Linux.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/Linux.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/Linux/x86_64.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/Linux/x86_64.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/Linux/x86_64.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/Linux/x86_64.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so b/Assets/Plugins/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so rename to Assets/Plugins/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll b/Assets/Plugins/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll rename to Assets/Plugins/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll b/Assets/Plugins/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll rename to Assets/Plugins/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll diff --git a/Assets/Libraries/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll.meta b/Assets/Plugins/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll.meta rename to Assets/Plugins/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowser.cs b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowser.cs similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowser.cs rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowser.cs diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowser.cs.meta b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowser.cs.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowser.cs.meta rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowser.cs.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs.meta b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs.meta rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs.meta b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs.meta rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserMac.cs b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserMac.cs similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserMac.cs rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserMac.cs diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserMac.cs.meta b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserMac.cs.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserMac.cs.meta rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserMac.cs.meta diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs diff --git a/Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs.meta b/Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs.meta similarity index 100% rename from Assets/Libraries/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs.meta rename to Assets/Plugins/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs.meta diff --git a/Assets/Libraries/VectorExtensions.cs b/Assets/Plugins/VectorExtensions.cs similarity index 100% rename from Assets/Libraries/VectorExtensions.cs rename to Assets/Plugins/VectorExtensions.cs diff --git a/Assets/Libraries/VectorExtensions.cs.meta b/Assets/Plugins/VectorExtensions.cs.meta similarity index 100% rename from Assets/Libraries/VectorExtensions.cs.meta rename to Assets/Plugins/VectorExtensions.cs.meta diff --git a/Assets/packages.config b/Assets/packages.config index 068002490..bbc937628 100644 --- a/Assets/packages.config +++ b/Assets/packages.config @@ -1,6 +1,5 @@  -