From 2e89b9e13cf086a2f5bf85e4cf81186270429d75 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 19 Sep 2019 08:09:18 -0400 Subject: [PATCH] Imported more DataFormats from original ExtensibleDataStorage codebase --- .../Shortcut/Linux/LinuxShortcutDataFormat.cs | 55 ++++ .../UniversalEditor.Essential.csproj | 2 + .../DataFormats/FileSystem/HA/HADataFormat.cs | 96 +++++++ .../HyperArchiver/HyperArchiverDataFormat.cs | 210 ++++++++++++++ .../UniversalEditor.Plugins.FileSystem.csproj | 4 + .../Audio/Synthesized/EdLib/AdlibBlockType.cs | 29 ++ .../Audio/Synthesized/EdLib/AdlibSoundcard.cs | 29 ++ .../Audio/Synthesized/EdLib/D00DataFormat.cs | 155 ++++++++++ .../Audio/Waveform/CRI/ADX/ADXBlock.cs | 36 +++ .../Audio/Waveform/CRI/ADX/ADXDataFormat.cs | 266 ++++++++++++++++++ .../Audio/Waveform/CRI/ADX/ADXDocument.cs | 254 +++++++++++++++++ .../Audio/Waveform/CRI/ADX/ADXEncodingType.cs | 35 +++ .../Audio/Waveform/CRI/ADX/ADXVersion.cs | 35 +++ .../UniversalEditor.Plugins.Multimedia.csproj | 10 + 14 files changed, 1216 insertions(+) create mode 100644 CSharp/Libraries/UniversalEditor.Essential/DataFormats/Shortcut/Linux/LinuxShortcutDataFormat.cs create mode 100644 CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HA/HADataFormat.cs create mode 100644 CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HyperArchiver/HyperArchiverDataFormat.cs create mode 100644 CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Audio/Synthesized/EdLib/AdlibBlockType.cs create mode 100644 CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Audio/Synthesized/EdLib/AdlibSoundcard.cs create mode 100644 CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Audio/Synthesized/EdLib/D00DataFormat.cs create mode 100755 CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Audio/Waveform/CRI/ADX/ADXBlock.cs create mode 100755 CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Audio/Waveform/CRI/ADX/ADXDataFormat.cs create mode 100644 CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Audio/Waveform/CRI/ADX/ADXDocument.cs create mode 100755 CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Audio/Waveform/CRI/ADX/ADXEncodingType.cs create mode 100755 CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Audio/Waveform/CRI/ADX/ADXVersion.cs diff --git a/CSharp/Libraries/UniversalEditor.Essential/DataFormats/Shortcut/Linux/LinuxShortcutDataFormat.cs b/CSharp/Libraries/UniversalEditor.Essential/DataFormats/Shortcut/Linux/LinuxShortcutDataFormat.cs new file mode 100644 index 00000000..f49e3843 --- /dev/null +++ b/CSharp/Libraries/UniversalEditor.Essential/DataFormats/Shortcut/Linux/LinuxShortcutDataFormat.cs @@ -0,0 +1,55 @@ +// +// INTXLINKDataFormat.cs +// +// Author: +// Mike Becker +// +// Copyright (c) 2019 Mike Becker +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +using UniversalEditor.IO; +using UniversalEditor.ObjectModels.Shortcut; + +namespace UniversalEditor.DataFormats.Shortcut.Linux +{ + public class LinuxShortcutDataFormat : DataFormat + { + protected override void LoadInternal(ref ObjectModel objectModel) + { + ShortcutObjectModel shortcut = (objectModel as ShortcutObjectModel); + if (shortcut == null) + throw new ObjectModelNotSupportedException(); + + Reader br = base.Accessor.Reader; + string INTXLNK = br.ReadFixedLengthString(7); + if (INTXLNK != "INTXLNK") + throw new InvalidDataFormatException(); + + byte b = br.ReadByte(); + shortcut.ExecutableFileName = br.ReadStringToEnd(Encoding.UTF16LittleEndian); + } + protected override void SaveInternal(ObjectModel objectModel) + { + ShortcutObjectModel shortcut = (objectModel as ShortcutObjectModel); + if (shortcut == null) + throw new ObjectModelNotSupportedException(); + + Writer bw = base.Accessor.Writer; + bw.WriteFixedLengthString("INTXLNK"); + bw.WriteByte(1); + bw.WriteFixedLengthString(shortcut.ExecutableFileName, Encoding.UTF16LittleEndian); + } + } +} diff --git a/CSharp/Libraries/UniversalEditor.Essential/UniversalEditor.Essential.csproj b/CSharp/Libraries/UniversalEditor.Essential/UniversalEditor.Essential.csproj index 14b15627..3fb239ef 100644 --- a/CSharp/Libraries/UniversalEditor.Essential/UniversalEditor.Essential.csproj +++ b/CSharp/Libraries/UniversalEditor.Essential/UniversalEditor.Essential.csproj @@ -179,6 +179,7 @@ + @@ -199,6 +200,7 @@ +