Skip to content

Commit 71f969b

Browse files
author decode fixed
1 parent 666cb20 commit 71f969b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

PPMLib/PPMAuthor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public PPMAuthor(string name, ulong id)
1111
Id = id;
1212
}
1313

14-
private string _Name;
14+
internal string _Name;
1515
public string Name { get => ToUnicode(); }
1616
public ulong Id { get; }
1717

PPMLib/PPMFile.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,19 @@ public void Parse(byte[] bytes)
133133

134134
}
135135

136-
public static PPMFile Create(string authorName, ulong authorId, List<PPMFrame> frames, byte[] audio, bool ignoreMetadata = false)
136+
public static PPMFile Create(PPMAuthor author, List<PPMFrame> frames, byte[] audio, bool ignoreMetadata = false)
137137
{
138138
var file = new PPMFile();
139139
file.FrameCount = (ushort)(frames.Count - 1);
140140
file.FormatVersion = 0x24;
141141

142142
if (!ignoreMetadata)
143143
{
144-
file.RootAuthor = new PPMAuthor(authorName, authorId);
145-
file.ParentAuthor = new PPMAuthor(authorName, authorId);
146-
file.CurrentAuthor = new PPMAuthor(authorName, authorId);
144+
file.RootAuthor = author;
145+
file.ParentAuthor = author;
146+
file.CurrentAuthor = author;
147147

148-
string mac6 = string.Join("", BitConverter.GetBytes(authorId).Take(3).Reverse().Select(t => t.ToString("X2")));
148+
string mac6 = string.Join("", BitConverter.GetBytes(author.Id).Take(3).Reverse().Select(t => t.ToString("X2")));
149149
var asm = Assembly.GetEntryAssembly().GetName().Version;
150150
var dt = DateTime.UtcNow;
151151
var fnVM = ((byte)asm.Major).ToString("X2");
@@ -248,9 +248,9 @@ public void Save(string fn)
248248
w.Write((ushort)0x0024);
249249
w.Write((ushort)(IsLocked ? 1 : 0));
250250
w.Write(ThumbnailFrameIndex);
251-
w.Write(Encoding.Unicode.GetBytes(RootAuthor.Name.PadRight(11, '\0')));
252-
w.Write(Encoding.Unicode.GetBytes(ParentAuthor.Name.PadRight(11, '\0')));
253-
w.Write(Encoding.Unicode.GetBytes(CurrentAuthor.Name.PadRight(11, '\0')));
251+
w.Write(Encoding.Unicode.GetBytes(RootAuthor._Name.PadRight(11, '\0')));
252+
w.Write(Encoding.Unicode.GetBytes(ParentAuthor._Name.PadRight(11, '\0')));
253+
w.Write(Encoding.Unicode.GetBytes(CurrentAuthor._Name.PadRight(11, '\0')));
254254
w.Write(ParentAuthor.Id);
255255
w.Write(CurrentAuthor.Id);
256256
w.Write(ParentFilename.Buffer);

PPMTest/Form1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private void button1_Click(object sender, EventArgs e)
7575
//var mp4 = new Mp3Encoder(ppm);
7676
//mp4.EncodeMp3("C:/Users/finti/Desktop/EncodedFlipnotes");
7777

78-
PPMFile aaa = PPMFile.Create(ppm.CurrentAuthor.Name, ppm.CurrentAuthor.Id, ppm.Frames.ToList(), ppm.Audio.SoundData.RawBGM);
78+
PPMFile aaa = PPMFile.Create(ppm.CurrentAuthor, ppm.Frames.ToList(), ppm.Audio.SoundData.RawBGM);
7979
aaa.Save($"{aaa.CurrentFilename}.ppm");
8080
}
8181

0 commit comments

Comments
 (0)