From 0888e0bb2ff7dbcdf8370e63120e3fa4e19e232e Mon Sep 17 00:00:00 2001 From: rjkiv <76180273+rjkiv@users.noreply.github.com> Date: Tue, 9 May 2023 15:06:50 -0400 Subject: [PATCH] CON file native integration (#286) * i hate you riley * lazy midi file stream implementation * i think CONs work now? * only validate CON songs if any were found * account for potentially different path name schemes * removed unused file * rebase with current YARG dev branch --- .../BassNative/Linux/x86_64/libbass.so.meta | 63 --------- .../Linux/x86_64/libbass_fx.so.meta | 63 --------- .../Linux/x86_64/libbassmix.so.meta | 63 --------- .../Linux/x86_64/libbassopus.so.meta | 63 --------- .../Plugins/BassNative/Mac/libbass.dylib.meta | 63 --------- .../BassNative/Mac/libbass_fx.dylib.meta | 63 --------- .../BassNative/Mac/libbassmix.dylib.meta | 63 --------- .../BassNative/Mac/libbassopus.dylib.meta | 63 --------- .../BassNative/Windows/x86/bass.dll.meta | 63 --------- .../BassNative/Windows/x86/bass_fx.dll.meta | 63 --------- .../BassNative/Windows/x86/bassmix.dll.meta | 63 --------- .../BassNative/Windows/x86/bassopus.dll.meta | 63 --------- .../BassNative/Windows/x86_64/bass.dll.meta | 63 --------- .../Windows/x86_64/bass_fx.dll.meta | 63 --------- .../Windows/x86_64/bassmix.dll.meta | 63 --------- .../Windows/x86_64/bassopus.dll.meta | 63 --------- Assets/Script/Audio/Bass/BassAudioManager.cs | 1 - Assets/Script/PlayMode/Play.cs | 2 - .../Script/Serialization/Parser/MidiParser.cs | 11 +- .../Serialization/Xbox/XboxCONFileBrowser.cs | 3 +- Assets/Script/Serialization/Xbox/XboxRedo.cs | 125 ------------------ .../Serialization/Xbox/XboxRedo.cs.meta | 11 -- Assets/Script/Song/CacheHelpers.cs | 58 ++++++++ Assets/Script/Song/Scanning/SongScanThread.cs | 43 ++++-- Assets/Script/Song/SongCache.cs | 52 +++++--- Assets/Script/UI/MusicLibrary/Sidebar.cs | 40 ++++-- 26 files changed, 165 insertions(+), 1189 deletions(-) delete mode 100644 Assets/Plugins/BassNative/Linux/x86_64/libbass.so.meta delete mode 100644 Assets/Plugins/BassNative/Linux/x86_64/libbass_fx.so.meta delete mode 100644 Assets/Plugins/BassNative/Linux/x86_64/libbassmix.so.meta delete mode 100644 Assets/Plugins/BassNative/Linux/x86_64/libbassopus.so.meta delete mode 100644 Assets/Plugins/BassNative/Mac/libbass.dylib.meta delete mode 100644 Assets/Plugins/BassNative/Mac/libbass_fx.dylib.meta delete mode 100644 Assets/Plugins/BassNative/Mac/libbassmix.dylib.meta delete mode 100644 Assets/Plugins/BassNative/Mac/libbassopus.dylib.meta delete mode 100644 Assets/Plugins/BassNative/Windows/x86/bass.dll.meta delete mode 100644 Assets/Plugins/BassNative/Windows/x86/bass_fx.dll.meta delete mode 100644 Assets/Plugins/BassNative/Windows/x86/bassmix.dll.meta delete mode 100644 Assets/Plugins/BassNative/Windows/x86/bassopus.dll.meta delete mode 100644 Assets/Plugins/BassNative/Windows/x86_64/bass.dll.meta delete mode 100644 Assets/Plugins/BassNative/Windows/x86_64/bass_fx.dll.meta delete mode 100644 Assets/Plugins/BassNative/Windows/x86_64/bassmix.dll.meta delete mode 100644 Assets/Plugins/BassNative/Windows/x86_64/bassopus.dll.meta delete mode 100644 Assets/Script/Serialization/Xbox/XboxRedo.cs delete mode 100644 Assets/Script/Serialization/Xbox/XboxRedo.cs.meta diff --git a/Assets/Plugins/BassNative/Linux/x86_64/libbass.so.meta b/Assets/Plugins/BassNative/Linux/x86_64/libbass.so.meta deleted file mode 100644 index 198536947..000000000 --- a/Assets/Plugins/BassNative/Linux/x86_64/libbass.so.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 233b5cda3060a714483e65f4790ccd3e -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 0 - Exclude OSXUniversal: 1 - Exclude Win: 0 - Exclude Win64: 0 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Linux - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: x86_64 - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 1 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Linux/x86_64/libbass_fx.so.meta b/Assets/Plugins/BassNative/Linux/x86_64/libbass_fx.so.meta deleted file mode 100644 index 3a225364b..000000000 --- a/Assets/Plugins/BassNative/Linux/x86_64/libbass_fx.so.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 9f025baf98aab4b4789dee03896978f3 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 0 - Exclude OSXUniversal: 1 - Exclude Win: 0 - Exclude Win64: 0 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Linux - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: x86_64 - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 1 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Linux/x86_64/libbassmix.so.meta b/Assets/Plugins/BassNative/Linux/x86_64/libbassmix.so.meta deleted file mode 100644 index 92d0e73ce..000000000 --- a/Assets/Plugins/BassNative/Linux/x86_64/libbassmix.so.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: b4872f45c2e3ec746aaa89589b00755e -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 0 - Exclude OSXUniversal: 1 - Exclude Win: 0 - Exclude Win64: 0 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Linux - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 1 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Linux/x86_64/libbassopus.so.meta b/Assets/Plugins/BassNative/Linux/x86_64/libbassopus.so.meta deleted file mode 100644 index e6fe5e246..000000000 --- a/Assets/Plugins/BassNative/Linux/x86_64/libbassopus.so.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: f93ddd7269b32d1469ca45b4ca06c913 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 0 - Exclude OSXUniversal: 1 - Exclude Win: 0 - Exclude Win64: 0 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Linux - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 1 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Mac/libbass.dylib.meta b/Assets/Plugins/BassNative/Mac/libbass.dylib.meta deleted file mode 100644 index 454b0eb28..000000000 --- a/Assets/Plugins/BassNative/Mac/libbass.dylib.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: b3977a279868ffe42afd337321871825 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 1 - Exclude OSXUniversal: 0 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: OSX - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Mac/libbass_fx.dylib.meta b/Assets/Plugins/BassNative/Mac/libbass_fx.dylib.meta deleted file mode 100644 index cac427132..000000000 --- a/Assets/Plugins/BassNative/Mac/libbass_fx.dylib.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 83709cbbceceebe4da2dcd586212d22c -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 1 - Exclude OSXUniversal: 0 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: OSX - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Mac/libbassmix.dylib.meta b/Assets/Plugins/BassNative/Mac/libbassmix.dylib.meta deleted file mode 100644 index c512925fe..000000000 --- a/Assets/Plugins/BassNative/Mac/libbassmix.dylib.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: ad7cbde76cb0cdc41bc670991971e89a -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 1 - Exclude OSXUniversal: 0 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: OSX - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Mac/libbassopus.dylib.meta b/Assets/Plugins/BassNative/Mac/libbassopus.dylib.meta deleted file mode 100644 index 67cbff0e1..000000000 --- a/Assets/Plugins/BassNative/Mac/libbassopus.dylib.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 351b7647659c4384f95cb90c26036e14 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 1 - Exclude OSXUniversal: 0 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: OSX - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Windows/x86/bass.dll.meta b/Assets/Plugins/BassNative/Windows/x86/bass.dll.meta deleted file mode 100644 index a53713183..000000000 --- a/Assets/Plugins/BassNative/Windows/x86/bass.dll.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 9d4b0bba625f89347a7f7edec258a3f8 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux64: 0 - Exclude OSXUniversal: 0 - Exclude Win: 0 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: Windows - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Windows/x86/bass_fx.dll.meta b/Assets/Plugins/BassNative/Windows/x86/bass_fx.dll.meta deleted file mode 100644 index 60748a995..000000000 --- a/Assets/Plugins/BassNative/Windows/x86/bass_fx.dll.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 3b82501a1ad569944a3404f0b1688d93 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux64: 0 - Exclude OSXUniversal: 0 - Exclude Win: 0 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: Windows - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Windows/x86/bassmix.dll.meta b/Assets/Plugins/BassNative/Windows/x86/bassmix.dll.meta deleted file mode 100644 index c23ad4aef..000000000 --- a/Assets/Plugins/BassNative/Windows/x86/bassmix.dll.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 971fe7484b7d36a48b0c7f2a3b22cb80 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux64: 0 - Exclude OSXUniversal: 0 - Exclude Win: 0 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: Windows - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Windows/x86/bassopus.dll.meta b/Assets/Plugins/BassNative/Windows/x86/bassopus.dll.meta deleted file mode 100644 index a35c587ce..000000000 --- a/Assets/Plugins/BassNative/Windows/x86/bassopus.dll.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: cd00b8d82dae1e643b01c1e547518e8e -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux64: 0 - Exclude OSXUniversal: 0 - Exclude Win: 0 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: AnyOS - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: x86 - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Windows/x86_64/bass.dll.meta b/Assets/Plugins/BassNative/Windows/x86_64/bass.dll.meta deleted file mode 100644 index 28b3ee3a0..000000000 --- a/Assets/Plugins/BassNative/Windows/x86_64/bass.dll.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 42390fb755ba65f4ba26f71ff37d23e0 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 0 - Exclude OSXUniversal: 0 - Exclude Win: 1 - Exclude Win64: 0 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Windows - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 1 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Windows/x86_64/bass_fx.dll.meta b/Assets/Plugins/BassNative/Windows/x86_64/bass_fx.dll.meta deleted file mode 100644 index ee321e3cb..000000000 --- a/Assets/Plugins/BassNative/Windows/x86_64/bass_fx.dll.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: ef9dbcfefb42c4c4289219f03d320969 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 0 - Exclude OSXUniversal: 0 - Exclude Win: 1 - Exclude Win64: 0 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Windows - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 1 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Windows/x86_64/bassmix.dll.meta b/Assets/Plugins/BassNative/Windows/x86_64/bassmix.dll.meta deleted file mode 100644 index be615fddc..000000000 --- a/Assets/Plugins/BassNative/Windows/x86_64/bassmix.dll.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: e2e56ac72e66f8f4295e024b7357db18 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 0 - Exclude OSXUniversal: 0 - Exclude Win: 1 - Exclude Win64: 0 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Windows - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 1 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/BassNative/Windows/x86_64/bassopus.dll.meta b/Assets/Plugins/BassNative/Windows/x86_64/bassopus.dll.meta deleted file mode 100644 index 20afb0e71..000000000 --- a/Assets/Plugins/BassNative/Windows/x86_64/bassopus.dll.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 7a61b8dd91b65024698f93b0701ba869 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux64: 0 - Exclude OSXUniversal: 0 - Exclude Win: 1 - Exclude Win64: 0 - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Windows - - first: - Standalone: Linux64 - second: - enabled: 1 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 1 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 1 - settings: - CPU: x86_64 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Script/Audio/Bass/BassAudioManager.cs b/Assets/Script/Audio/Bass/BassAudioManager.cs index 4fcf36f2d..727520f37 100644 --- a/Assets/Script/Audio/Bass/BassAudioManager.cs +++ b/Assets/Script/Audio/Bass/BassAudioManager.cs @@ -209,7 +209,6 @@ public void LoadMogg(ExtractedConSongEntry exConSong, bool isSpeedUp) { UnloadSong(); byte[] moggArray; - if (exConSong is ConSongEntry conSong) { moggArray = XboxCONInnerFileRetriever.RetrieveFile(conSong.Location, conSong.MoggPath, conSong.MoggFileSize, conSong.MoggFileMemBlockOffsets)[conSong.MoggAddressAudioOffset..]; diff --git a/Assets/Script/PlayMode/Play.cs b/Assets/Script/PlayMode/Play.cs index 5b31a3eb4..8836d7bd4 100644 --- a/Assets/Script/PlayMode/Play.cs +++ b/Assets/Script/PlayMode/Play.cs @@ -116,8 +116,6 @@ private void StartSong() { // Load MOGG if CON, otherwise load stems if (song is ExtractedConSongEntry rawConSongEntry) { - Debug.Log(rawConSongEntry.MatrixRatios.GetLength(0)); - GameManager.AudioManager.LoadMogg(rawConSongEntry, isSpeedUp); } else { diff --git a/Assets/Script/Serialization/Parser/MidiParser.cs b/Assets/Script/Serialization/Parser/MidiParser.cs index 78db0a8c9..f2b9600e8 100644 --- a/Assets/Script/Serialization/Parser/MidiParser.cs +++ b/Assets/Script/Serialization/Parser/MidiParser.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using Melanchall.DryWetMidi.Core; using Melanchall.DryWetMidi.Interaction; @@ -23,8 +24,16 @@ private struct EventIR { public MidiFile midi; public MidiParser(SongEntry songEntry, string[] files) : base(songEntry, files) { - midi = MidiFile.Read(files[0], new ReadingSettings() { TextEncoding = System.Text.Encoding.UTF8 }); + if(songEntry.SongType == SongType.RbCon){ + var conSong = (ConSongEntry)songEntry; + using var stream = new MemoryStream(XboxCONInnerFileRetriever.RetrieveFile( + conSong.Location, conSong.NotesFile, conSong.MidiFileSize, conSong.MidiFileMemBlockOffsets + )); + midi = MidiFile.Read(stream, new ReadingSettings() { TextEncoding = System.Text.Encoding.UTF8 }); + } + else midi = MidiFile.Read(files[0], new ReadingSettings() { TextEncoding = System.Text.Encoding.UTF8 }); + // TODO: fix this to account for upgrade CONs/ExCONs // Merge midi files for (int i = 1; i < files.Length; i++) { var upgrade = MidiFile.Read(files[i], new ReadingSettings() { TextEncoding = System.Text.Encoding.UTF8 }); diff --git a/Assets/Script/Serialization/Xbox/XboxCONFileBrowser.cs b/Assets/Script/Serialization/Xbox/XboxCONFileBrowser.cs index e54a55fca..5979a1c79 100644 --- a/Assets/Script/Serialization/Xbox/XboxCONFileBrowser.cs +++ b/Assets/Script/Serialization/Xbox/XboxCONFileBrowser.cs @@ -11,14 +11,13 @@ namespace YARG.Serialization { public static class XboxCONFileBrowser { public static List BrowseCON(string conName){ - Debug.Log($"con name = {conName}"); var songList = new List(); var dtaTree = new DataArray(); // Attempt to read songs.dta STFS theCON = new STFS(conName); try { - dtaTree = DTX.FromPlainTextBytes(theCON.GetFile("songs/songs.dta")); + dtaTree = DTX.FromPlainTextBytes(theCON.GetFile(Path.Combine("songs", "songs.dta"))); } catch (Exception e) { Debug.LogError($"Failed to parse songs.dta for `{conName}`."); Debug.LogException(e); diff --git a/Assets/Script/Serialization/Xbox/XboxRedo.cs b/Assets/Script/Serialization/Xbox/XboxRedo.cs deleted file mode 100644 index 12838e8ca..000000000 --- a/Assets/Script/Serialization/Xbox/XboxRedo.cs +++ /dev/null @@ -1,125 +0,0 @@ -// using System; -// using System.Collections.Generic; -// using System.IO; -// using System.Text; -// using System.Threading.Tasks; -// using DtxCS.DataTypes; -// using UnityEngine; -// using XboxSTFS; -// using YARG.Data; - -// namespace YARG.Serialization { -// public abstract class XboxSongAbs { -// public abstract byte[] GetMidiFile(); -// } - -// // TODO: fill this class out to be similar to XboxCONSong -// // and replace the existing XboxSong class with this one -// public class XboxRawSong : XboxSongAbs { - -// public string shortname { get; private set; } -// public string rootPath { get; private set; } - -// public XboxRawSong(string path, DataArray dta){ -// rootPath = path; -// } -// public override byte[] GetMidiFile(){ -// return File.ReadAllBytes($"{rootPath}/{shortname}/{shortname}.mid"); -// } - -// } - -// public class XboxCONSong : XboxSongAbs { - -// public string shortname { get; private set; } -// public string CONRootPath { get; private set; } - -// private DataArray dta; - -// private uint MidiSize; -// private uint[] MidiOffsets; - -// private uint MoggSize; -// private uint[] MoggOffsets; - -// private uint ImgSize; -// private uint[] ImgOffsets; - -// XboxSongData songDta; -// XboxMoggData moggDta; -// XboxImage img; - -// public XboxCONSong(string path, DataArray currentDTA, STFS theCON){ -// // set CON file path, dta and song shortname -// CONRootPath = path; -// dta = currentDTA; -// shortname = dta.Name; - -// // get file sizes and offsets in the CON's memory -// MidiSize = theCON.GetFileSize($"songs/{shortname}/{shortname}.mid"); -// MidiOffsets = theCON.GetMemOffsets($"songs/{shortname}/{shortname}.mid"); -// MoggSize = theCON.GetFileSize($"songs/{shortname}/{shortname}.mogg"); -// MoggOffsets = theCON.GetMemOffsets($"songs/{shortname}/{shortname}.mogg"); -// ImgSize = theCON.GetFileSize($"songs/{shortname}/gen/{shortname}_keep.png_xbox"); -// ImgOffsets = theCON.GetMemOffsets($"songs/{shortname}/gen/{shortname}_keep.png_xbox"); -// } - -// public void ParseSong(){ -// // first, parse songs.dta -// songDta = new XboxSongData(); -// songDta.ParseFromDta(dta); - -// // now, parse the mogg -// moggDta = new XboxMoggData(CONRootPath, MoggSize, MoggOffsets); -// moggDta.ParseMoggHeader(); -// moggDta.ParseFromDta(dta.Array("song")); -// moggDta.CalculateMoggBassInfo(); - -// // finally, parse the image -// if(songDta.albumArt && ImgSize > 0 && ImgOffsets != null){ -// img = new XboxImage(CONRootPath, ImgSize, ImgOffsets); -// } - -// } - -// public bool IsValidSong() { -// // Skip if the song doesn't have notes -// if(MidiSize == 0 && MidiOffsets == null) return false; -// // Skip if this is a "fake song" (tutorials, etc.) -// if (songDta.fake) return false; -// // Skip if the mogg is encrypted -// if (moggDta.Header != 0xA) return false; - -// return true; -// } - -// public override string ToString() { -// return string.Join(Environment.NewLine, -// $"XBOX CON SONG {shortname}", -// $"CON file: {CONRootPath}", -// "", -// songDta.ToString(), -// "", -// moggDta.ToString() -// ); -// } - -// public override byte[] GetMidiFile(){ -// byte[] f = new byte[MidiSize]; -// uint lastSize = MidiSize % 0x1000; - -// Parallel.For(0, MidiOffsets.Length, i => { -// uint readLen = (i == MidiOffsets.Length - 1) ? lastSize : 0x1000; -// using var fs = new FileStream(CONRootPath, FileMode.Open, FileAccess.Read); -// using var br = new BinaryReader(fs, new ASCIIEncoding()); -// fs.Seek(MidiOffsets[i], SeekOrigin.Begin); -// Array.Copy(br.ReadBytes((int)readLen), 0, f, i*0x1000, (int)readLen); -// }); - -// return f; -// } - -// //TODO: convert each XboxCONSong to its own SongInfo for YARG to use in-game - -// } -// } \ No newline at end of file diff --git a/Assets/Script/Serialization/Xbox/XboxRedo.cs.meta b/Assets/Script/Serialization/Xbox/XboxRedo.cs.meta deleted file mode 100644 index aa332a57f..000000000 --- a/Assets/Script/Serialization/Xbox/XboxRedo.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 35c6e7407fff646a5a8839d7b1aeb77d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Script/Song/CacheHelpers.cs b/Assets/Script/Song/CacheHelpers.cs index d9b5e2945..79247ae71 100644 --- a/Assets/Script/Song/CacheHelpers.cs +++ b/Assets/Script/Song/CacheHelpers.cs @@ -46,6 +46,34 @@ Image data writer.Write(ExCONSong.ImagePath); } + public static void WriteConData(BinaryWriter writer, ConSongEntry CONSong) { + + // midi file size and memory offsets + writer.Write(CONSong.MidiFileSize); + writer.Write(CONSong.MidiFileMemBlockOffsets.Length); + for(int i = 0; i < CONSong.MidiFileMemBlockOffsets.Length; i++){ + writer.Write(CONSong.MidiFileMemBlockOffsets[i]); + } + + // mogg file size and memory offsets + writer.Write(CONSong.MoggFileSize); + writer.Write(CONSong.MoggFileMemBlockOffsets.Length); + for(int i = 0; i < CONSong.MoggFileMemBlockOffsets.Length; i++){ + writer.Write(CONSong.MoggFileMemBlockOffsets[i]); + } + + // image file size and memory offsets, if they exist + writer.Write(CONSong.ImageFileSize); + if(CONSong.ImageFileMemBlockOffsets == null) writer.Write(0); + else{ + writer.Write(CONSong.ImageFileMemBlockOffsets.Length); + for(int i = 0; i < CONSong.ImageFileMemBlockOffsets.Length; i++){ + writer.Write(CONSong.ImageFileMemBlockOffsets[i]); + } + } + + } + public static void ReadExtractedConData(BinaryReader reader, ExtractedConSongEntry ExCONSong) { ExCONSong.MoggPath = reader.ReadString(); ExCONSong.MoggHeader = reader.ReadInt32(); @@ -89,5 +117,35 @@ Image data ExCONSong.ImagePath = reader.ReadString(); } + public static void ReadConData(BinaryReader reader, ConSongEntry CONSong) { + + // midi file size and memory offsets + CONSong.MidiFileSize = reader.ReadUInt32(); + uint midiOffsetsLength = reader.ReadUInt32(); + CONSong.MidiFileMemBlockOffsets = new uint[midiOffsetsLength]; + for(int i = 0; i < midiOffsetsLength; i++){ + CONSong.MidiFileMemBlockOffsets[i] = reader.ReadUInt32(); + } + + // mogg file size and memory offsets + CONSong.MoggFileSize = reader.ReadUInt32(); + uint moggOffsetsLength = reader.ReadUInt32(); + CONSong.MoggFileMemBlockOffsets = new uint[moggOffsetsLength]; + for(int i = 0; i < moggOffsetsLength; i++){ + CONSong.MoggFileMemBlockOffsets[i] = reader.ReadUInt32(); + } + + // image file size and memory offsets, if they exist + CONSong.ImageFileSize = reader.ReadUInt32(); + uint imgOffsetsLength = reader.ReadUInt32(); + if(imgOffsetsLength > 0){ + CONSong.ImageFileMemBlockOffsets = new uint[imgOffsetsLength]; + for(int i = 0; i < imgOffsetsLength; i++){ + CONSong.ImageFileMemBlockOffsets[i] = reader.ReadUInt32(); + } + } + + } + } } \ No newline at end of file diff --git a/Assets/Script/Song/Scanning/SongScanThread.cs b/Assets/Script/Song/Scanning/SongScanThread.cs index 5bb4a66ef..1db160115 100644 --- a/Assets/Script/Song/Scanning/SongScanThread.cs +++ b/Assets/Script/Song/Scanning/SongScanThread.cs @@ -7,6 +7,7 @@ using System.Threading; using UnityEngine; using YARG.Serialization; +using YARG.Song; using YARG.Song.Preparsers; namespace YARG.Song { @@ -135,23 +136,23 @@ private void ScanSubDirectory(string cacheFolder, string subDir, ICollection files = ExCONBrowser.BrowseFolder(songsPath); - foreach(var file in files){ + foreach(ExtractedConSongEntry file in files){ // validate that the song is good to add in-game - var CONResult = ScanExConSong(cacheFolder, file); - switch(CONResult){ + var ExCONResult = ScanExConSong(cacheFolder, file); + switch(ExCONResult){ case ScanResult.Ok: _songsScanned++; songsScanned = _songsScanned; - songs.Add(file); + songs.Add((ExtractedConSongEntry)file); break; case ScanResult.NotASong: break; default: _errorsEncountered++; errorsEncountered = _errorsEncountered; - _songErrors[cacheFolder].Add(new SongError(subDir, CONResult)); + _songErrors[cacheFolder].Add(new SongError(subDir, ExCONResult)); Debug.LogWarning($"Error encountered with {subDir}"); break; } @@ -167,13 +168,29 @@ private void ScanSubDirectory(string cacheFolder, string subDir, ICollection SongsInsideCON = XboxCONFileBrowser.BrowseCON(file); + // for each CON song that was found (assuming some WERE found) + if(SongsInsideCON != null){ + foreach(ConSongEntry SongInsideCON in SongsInsideCON){ + // validate that the song is good to add in-game + var CONResult = ScanConSong(cacheFolder, SongInsideCON); + switch(CONResult){ + case ScanResult.Ok: + _songsScanned++; + songsScanned = _songsScanned; + songs.Add((ConSongEntry)SongInsideCON); + break; + case ScanResult.NotASong: + break; + default: + _errorsEncountered++; + errorsEncountered = _errorsEncountered; + _songErrors[cacheFolder].Add(new SongError(subDir, CONResult)); + Debug.LogWarning($"Error encountered with {subDir}"); + break; + } + } + } } } diff --git a/Assets/Script/Song/SongCache.cs b/Assets/Script/Song/SongCache.cs index 9c68be2bd..bb126e246 100644 --- a/Assets/Script/Song/SongCache.cs +++ b/Assets/Script/Song/SongCache.cs @@ -12,7 +12,7 @@ public class SongCache { /// /// The date in which the cache version is based on (and cache revision) /// - private const int CACHE_VERSION = 23_05_06_04; + private const int CACHE_VERSION = 23_05_08_01; private readonly string _folder; private readonly string _cacheFile; @@ -77,12 +77,23 @@ public List ReadCache() { } private static void WriteSongEntry(BinaryWriter writer, SongEntry song) { - //Debug.Log($"Writing {song.Name} to cache"); + // Debug.Log($"Writing {song.Name} to cache"); + + bool isCON = false; if (song is IniSongEntry) { writer.Write((int) SongType.SongIni); - } else if (song is ExtractedConSongEntry) { - writer.Write((int) SongType.ExtractedRbCon); + } + else { + if (song is ConSongEntry conEntry){ + if(conEntry.MidiFileMemBlockOffsets == null){ // use the midi file offsets array to determine if CON or ExCON + writer.Write((int) SongType.ExtractedRbCon); + } + else { + writer.Write((int) SongType.RbCon); + isCON = true; + } + } } writer.Write((int) song.DrumType); @@ -114,18 +125,24 @@ private static void WriteSongEntry(BinaryWriter writer, SongEntry song) { writer.Write(song.AvailableParts); - switch (song) { - case ExtractedConSongEntry conSong: + if (song is IniSongEntry iniSong) { + // These are CH specific ini properties + writer.Write(iniSong.Playlist); + writer.Write(iniSong.SubPlaylist); + writer.Write(iniSong.IsModChart); + writer.Write(iniSong.HasLyrics); + } + else { + if(!isCON){ //ExCON + // Write ex-con stuff + CacheHelpers.WriteExtractedConData(writer, (ExtractedConSongEntry)song); + } + else{ // Write con stuff - CacheHelpers.WriteExtractedConData(writer, conSong); - break; - case IniSongEntry iniSong: - // These are CH specific ini properties - writer.Write(iniSong.Playlist); - writer.Write(iniSong.SubPlaylist); - writer.Write(iniSong.IsModChart); - writer.Write(iniSong.HasLyrics); - break; + CacheHelpers.WriteExtractedConData(writer, (ConSongEntry)song); + // Write con-exclusive stuff + CacheHelpers.WriteConData(writer, (ConSongEntry)song); + } } writer.Write(song.Checksum); @@ -139,6 +156,7 @@ private static SongEntry ReadSongEntry(BinaryReader reader) { var type = (SongType)reader.ReadInt32(); result = type switch { + SongType.RbCon => new ConSongEntry(), SongType.ExtractedRbCon => new ExtractedConSongEntry(), SongType.SongIni => new IniSongEntry(), _ => result @@ -180,6 +198,10 @@ private static SongEntry ReadSongEntry(BinaryReader reader) { case SongType.ExtractedRbCon: CacheHelpers.ReadExtractedConData(reader, (ExtractedConSongEntry) result); break; + case SongType.RbCon: + CacheHelpers.ReadExtractedConData(reader, (ConSongEntry)result); + CacheHelpers.ReadConData(reader, (ConSongEntry)result); + break; case SongType.SongIni: { // Ini specific properties var iniSong = (IniSongEntry)result; diff --git a/Assets/Script/UI/MusicLibrary/Sidebar.cs b/Assets/Script/UI/MusicLibrary/Sidebar.cs index d591df8d3..9f6dcc64d 100644 --- a/Assets/Script/UI/MusicLibrary/Sidebar.cs +++ b/Assets/Script/UI/MusicLibrary/Sidebar.cs @@ -153,18 +153,36 @@ public async UniTask LoadAlbumCover() { break; } } - } else { - // Check if an ExCon/Con or if there is no album image for this song - if (songEntry is not ExtractedConSongEntry conEntry || conEntry.ImagePath == string.Empty) { - return; + } + else if(songEntry.SongType == SongType.RbCon){ + var c = (ConSongEntry) songEntry; + if(c.ImagePath != string.Empty){ + _albumCover.texture = XboxImageTextureGenerator.GetTexture( + XboxCONInnerFileRetriever.RetrieveFile( + c.Location, c.ImagePath, + c.ImageFileSize, c.ImageFileMemBlockOffsets + )); + _albumCover.color = Color.white; + _albumCover.uvRect = new Rect(0f, 0f, 1f, -1f); + } + else { + _albumCover.texture = null; + _albumCover.color = Color.white; // TODO: make this transparent so that you view the YARG default album art + _albumCover.uvRect = new Rect(0f, 0f, 1f, -1f); + } + } + else if(songEntry.SongType == SongType.ExtractedRbCon){ + var x = (ExtractedConSongEntry) songEntry; + if(x.ImagePath != string.Empty){ + _albumCover.texture = XboxImageTextureGenerator.GetTexture(File.ReadAllBytes(x.ImagePath)); + _albumCover.color = Color.white; + _albumCover.uvRect = new Rect(0f, 0f, 1f, -1f); + } + else { + _albumCover.texture = null; + _albumCover.color = Color.white; // TODO: make this transparent so that you view the YARG default album art + _albumCover.uvRect = new Rect(0f, 0f, 1f, -1f); } - - // TODO: Use task for below w/ cancel token - - // Set album cover - _albumCover.texture = XboxImageTextureGenerator.GetTexture(File.ReadAllBytes(conEntry.ImagePath)); - _albumCover.color = Color.white; - _albumCover.uvRect = new Rect(0f, 0f, 1f, -1f); } }