diff --git a/NCMDump.Net.sln b/NCMDump.Net.sln
index c2f7324..302f551 100644
--- a/NCMDump.Net.sln
+++ b/NCMDump.Net.sln
@@ -7,26 +7,26 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCMDumpCore", "NCMDumpCore\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCMDumpCLI", "NCMDumpCLI\NCMDumpCLI.csproj", "{4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NCMDumpGUI", "NCMDumpGUI\NCMDumpGUI.csproj", "{F4B097C1-58BB-4A79-8997-8225639D2A92}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCMDumpGUI", "NCMDumpGUI\NCMDumpGUI.csproj", "{F4B097C1-58BB-4A79-8997-8225639D2A92}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Release|Any CPU.Build.0 = Release|Any CPU
- {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Release|Any CPU.Build.0 = Release|Any CPU
- {F4B097C1-58BB-4A79-8997-8225639D2A92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F4B097C1-58BB-4A79-8997-8225639D2A92}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F4B097C1-58BB-4A79-8997-8225639D2A92}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F4B097C1-58BB-4A79-8997-8225639D2A92}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Debug|x64.ActiveCfg = Debug|x64
+ {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Debug|x64.Build.0 = Debug|x64
+ {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Release|x64.ActiveCfg = Release|x64
+ {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Release|x64.Build.0 = Release|x64
+ {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Debug|x64.ActiveCfg = Debug|x64
+ {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Debug|x64.Build.0 = Debug|x64
+ {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Release|x64.ActiveCfg = Release|x64
+ {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Release|x64.Build.0 = Release|x64
+ {F4B097C1-58BB-4A79-8997-8225639D2A92}.Debug|x64.ActiveCfg = Debug|x64
+ {F4B097C1-58BB-4A79-8997-8225639D2A92}.Debug|x64.Build.0 = Debug|x64
+ {F4B097C1-58BB-4A79-8997-8225639D2A92}.Release|x64.ActiveCfg = Release|x64
+ {F4B097C1-58BB-4A79-8997-8225639D2A92}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/NCMDumpCLI/NCMDumpCLI.csproj b/NCMDumpCLI/NCMDumpCLI.csproj
index 7706245..b8f29a2 100644
--- a/NCMDumpCLI/NCMDumpCLI.csproj
+++ b/NCMDumpCLI/NCMDumpCLI.csproj
@@ -9,7 +9,8 @@
NCMDumpCLI.ico
x64
app.manifest
- 1.3.0
+ 1.4.0
+ x64
diff --git a/NCMDumpCLI/Program.cs b/NCMDumpCLI/Program.cs
index b8b044a..cecd4e4 100644
--- a/NCMDumpCLI/Program.cs
+++ b/NCMDumpCLI/Program.cs
@@ -57,7 +57,6 @@ async void WalkThrough(DirectoryInfo dir)
Console.WriteLine();
}
-
}
}
diff --git a/NCMDumpCore/NCMDump.cs b/NCMDumpCore/NCMDump.cs
index 25eede4..954c349 100644
--- a/NCMDumpCore/NCMDump.cs
+++ b/NCMDumpCore/NCMDump.cs
@@ -11,19 +11,21 @@ public class NCMDump
readonly byte[] coreKey = { 0x68, 0x7A, 0x48, 0x52, 0x41, 0x6D, 0x73, 0x6F, 0x35, 0x6B, 0x49, 0x6E, 0x62, 0x61, 0x78, 0x57 };
readonly byte[] metaKey = { 0x23, 0x31, 0x34, 0x6C, 0x6A, 0x6B, 0x5F, 0x21, 0x5C, 0x5D, 0x26, 0x30, 0x55, 0x3C, 0x27, 0x28 };
+ public NCMDump()
+ {
+ }
private bool ReadHeader(ref MemoryStream ms)
{
byte[] header = new byte[8];
- // Header Should be "CTENFDAM"
ms.Read(header, 0, header.Length);
- return Encoding.ASCII.GetString(header) == "CTENFDAM";
+ // Header Should be "CTENFDAM"
+ return Enumerable.SequenceEqual(header, new byte[] { 067, 084, 069, 078, 070, 068, 065, 077 });
}
private byte[] MakeKeybox(ref MemoryStream ms)
{
// read keybox length
- uint KeyboxLength = ReadUint32(ms);
- //Console.WriteLine($"AES Key Length: {KeyboxLength}");
+ uint KeyboxLength = ReadUint32(ref ms);
// read raw keybox data
var buffer = new byte[KeyboxLength];
@@ -66,7 +68,7 @@ private byte[] MakeKeybox(ref MemoryStream ms)
private MetaInfo ReadMeta(ref MemoryStream ms)
{
// read meta length
- var MetaLength = ReadUint32(ms);
+ var MetaLength = ReadUint32(ref ms);
var RawMetaData = new byte[MetaLength];
ms.Read(RawMetaData, 0, RawMetaData.Length);
for (int i = 0; i < RawMetaData.Length; i++)
@@ -194,7 +196,7 @@ void AddCover(TagLib.File tagfile)
}
}
- private uint ReadUint32(MemoryStream ms)
+ private uint ReadUint32(ref MemoryStream ms)
{
byte[] buffer = new byte[4];
ms.Read(buffer, 0, buffer.Length);
@@ -242,7 +244,7 @@ public async Task ConvertAsync(string path)
ms.Seek(5, SeekOrigin.Current);
// read image length
- var ImageLength = ReadUint32(ms);
+ var ImageLength = ReadUint32(ref ms);
byte[]? ImageData;
if (ImageLength != 0)
{
diff --git a/NCMDumpCore/NCMDumpCore.csproj b/NCMDumpCore/NCMDumpCore.csproj
index 503975d..fbcb88f 100644
--- a/NCMDumpCore/NCMDumpCore.csproj
+++ b/NCMDumpCore/NCMDumpCore.csproj
@@ -4,10 +4,11 @@
net6.0
enable
enable
- 1.3.0
+ 1.4.0
x64
+ x64
diff --git a/NCMDumpGUI/App.xaml b/NCMDumpGUI/App.xaml
index bf4d84f..d82d4ef 100644
--- a/NCMDumpGUI/App.xaml
+++ b/NCMDumpGUI/App.xaml
@@ -4,6 +4,11 @@
xmlns:local="clr-namespace:NCMDumpGUI"
StartupUri="MainWindow.xaml">
-
+
+
+
+
+
+
diff --git a/NCMDumpGUI/MainWindow.xaml b/NCMDumpGUI/MainWindow.xaml
index 455efbd..aef9fa9 100644
--- a/NCMDumpGUI/MainWindow.xaml
+++ b/NCMDumpGUI/MainWindow.xaml
@@ -1,41 +1,39 @@
-
+ mc:Ignorable="d"
+ BorderThickness ="0"
+ Style="{StaticResource WindowBlur}"
+ Title="NCMDumpGUI"
+ Height="480" Width="720"
+ Icon="/NCMDump.png"
+ MinWidth="720" MinHeight="480"
+ ResizeMode="CanResize"
+ WindowStartupLocation="CenterScreen"
+ AllowDrop="True"
+ Closed="Window_Closed">
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
+
+
+
+
-
-
+
diff --git a/NCMDumpGUI/MainWindow.xaml.cs b/NCMDumpGUI/MainWindow.xaml.cs
index 0d55082..8c85fc5 100644
--- a/NCMDumpGUI/MainWindow.xaml.cs
+++ b/NCMDumpGUI/MainWindow.xaml.cs
@@ -4,30 +4,68 @@
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
+using System.Runtime.InteropServices;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
+using System.Windows.Interop;
+using HandyControl;
+using HandyControl.Controls;
namespace NCMDumpGUI
{
+ public enum ACCENTSTATE
+ {
+ ACCENT_DISABLED = 0,
+ ACCENT_ENABLE_GRADIENT = 1,
+ ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
+ ACCENT_ENABLE_BLURBEHIND = 3,
+ ACCENT_ENABLE_ACRYLICBLURBEHIND = 4,
+ ACCENT_INVALID_STATE = 5
+ }
+ [StructLayout(LayoutKind.Sequential)]
+ public struct ACCENTPOLICY
+ {
+ public ACCENTSTATE AccentState;
+ public int AccentFlags;
+ public uint GradientColor;
+ public int AnimationId;
+ }
+ public enum WINDOWCOMPOSITIONATTRIB
+ {
+ WCA_ACCENT_POLICY = 19
+ }
+ [StructLayout(LayoutKind.Sequential)]
+ public struct WINCOMPATTRDATA
+ {
+ public WINDOWCOMPOSITIONATTRIB Attribute;
+ public IntPtr Data;
+ public int DataSize;
+ }
///
/// Interaction logic for MainWindow.xaml
///
- public partial class MainWindow : Window
+ public partial class MainWindow : BlurWindow
{
- NCMDump core = new NCMDump();
+ NCMDump Core = new NCMDump();
+
+ [DllImport("user32.dll")]
+ public static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WINCOMPATTRDATA data);
public ObservableCollection NCMCollection { get; set; }
= new ObservableCollection();
+ IntPtr Hwnd;
+
public MainWindow()
- {
+ {
InitializeComponent();
- //WorkingList.Items.Add(new NCMProcessStatus ( "AAAAA", "Done"));
WorkingList.ItemsSource = NCMCollection;
+ App.Current.Resources["BlurGradientValue"] = 0xaaffffff;
}
private void ListView_SizeChanged(object sender, SizeChangedEventArgs e)
@@ -61,9 +99,8 @@ private void WorkingList_Drop(object sender, System.Windows.DragEventArgs e)
}
}
}
-
-
}
+
private void WalkThrough(DirectoryInfo dir)
{
foreach (DirectoryInfo d in dir.GetDirectories())
@@ -79,22 +116,22 @@ private void WalkThrough(DirectoryInfo dir)
private async void StartButton_Click(object sender, RoutedEventArgs e)
{
- for (int i = 0; i < NCMCollection.Count; i++)
+ Parallel.For(0, NCMCollection.Count, async (i, state) =>
{
- if (NCMCollection[i].FileStatus == "Success") continue;
-
- if (await Task.Run(() => core.ConvertAsync(NCMCollection[i].FilePath)))
- {
- NCMCollection[i].FileStatus = "Success";
- this.UpdateLayout();
- }
- else
+ if (NCMCollection[i].FileStatus != "Success")
{
- NCMCollection[i].FileStatus = "Fail";
- this.UpdateLayout();
- }
-
- }
+ if (await Task.Run(() => Core.ConvertAsync(NCMCollection[i].FilePath)))
+ {
+ NCMCollection[i].FileStatus = "Success";
+ Dispatcher.Invoke(()=> this.UpdateLayout());
+ }
+ else
+ {
+ NCMCollection[i].FileStatus = "Fail";
+ Dispatcher.Invoke(() => this.UpdateLayout());
+ }
+ }
+ });
}
private void SelectFileButton_Click(object sender, RoutedEventArgs e)
@@ -135,5 +172,6 @@ private void Window_Closed(object sender, System.EventArgs e)
{
Environment.Exit(0);
}
+
}
}
diff --git a/NCMDumpGUI/NCMDumpGUI.csproj b/NCMDumpGUI/NCMDumpGUI.csproj
index 753d51e..6b8e1af 100644
--- a/NCMDumpGUI/NCMDumpGUI.csproj
+++ b/NCMDumpGUI/NCMDumpGUI.csproj
@@ -7,8 +7,9 @@
true
NCMDumpCLI.ico
True
- 1.3.0
+ 1.4.0
x64
+ x64
@@ -27,4 +28,12 @@
+
+
+
+
+
+
+
+
diff --git a/NCMDumpGUI/ProgressStatus.cs b/NCMDumpGUI/NCMProcessStatus.cs
similarity index 100%
rename from NCMDumpGUI/ProgressStatus.cs
rename to NCMDumpGUI/NCMProcessStatus.cs
diff --git a/README.md b/README.md
index 42cb327..52a1e09 100644
--- a/README.md
+++ b/README.md
@@ -6,12 +6,18 @@ Decipher .ncm file to mp3 || flac
Highly Optimized Corelib.
-Keep all ID3 tags and cover image.
+Keep ID3 tags and cover image.
## Changelog
+### v1.4
+
+UI adjustment.
+
+Performance Improvement.
+
### v1.3
Bug fix.