From d7387171a88d49276ca822f4c8d56a680d035fb2 Mon Sep 17 00:00:00 2001
From: Damon Lu <59256766+WhatDamon@users.noreply.github.com>
Date: Sat, 24 Aug 2024 18:49:46 +0800
Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=8C=BA=E5=8A=A0=E5=85=A5?=
=?UTF-8?q?=E6=9B=B4=E5=A4=9A=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
NCMDumpGUI.csproj | 19 +++++
Properties/Resources.Designer.cs | 63 ++++++++++++++++
Properties/Resources.resx | 120 +++++++++++++++++++++++++++++++
README.md | 14 +++-
WndMain.Designer.cs | 47 +++++++++++-
WndMain.cs | 17 ++++-
WndMain.resx | 3 +
7 files changed, 280 insertions(+), 3 deletions(-)
create mode 100644 Properties/Resources.Designer.cs
create mode 100644 Properties/Resources.resx
diff --git a/NCMDumpGUI.csproj b/NCMDumpGUI.csproj
index de91731..c269f12 100644
--- a/NCMDumpGUI.csproj
+++ b/NCMDumpGUI.csproj
@@ -24,6 +24,10 @@
+
+
+
+
all
@@ -32,4 +36,19 @@
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
\ No newline at end of file
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..db32903
--- /dev/null
+++ b/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace NCMDumpGUI.Properties {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// 返回此类使用的缓存的 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NCMDumpGUI.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 重写当前线程的 CurrentUICulture 属性,对
+ /// 使用此强类型资源类的所有资源查找执行重写。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Properties/Resources.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index fab1d34..99a777f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,9 @@
# NCMDumpGUI
> [!CAUTION]
-> 此应用只用于学习用途,禁止用于商业或违法用途,请在遵守NCM文件提供平台的服务条款下使用本应用,作者对商业或违法使用本软件造成的任何后果不承担任何责任!
+> 此应用只用于学习用途,下载后请在24小时内删除,禁止用于商业或违法用途!请在遵守 NCM 文件提供平台的服务条款下使用本应用,作者对商业或违法使用本软件造成的任何后果不承担任何责任!
+>
+> 使用本软件转换的音频请在不侵犯著作权的前提下使用。如需商业,请从平台或版权所有人购买对应歌曲
这是一个简单程序,使用到了 `ncmdump` 项目实现 ncm 解密功能
@@ -33,6 +35,7 @@
- [x] 基本用户界面
- [x] 异常处理
- [x] 批量处理
+- [x] 播放
- [ ] 窗口置顶
- [ ] 支持使用 `ncmdump.exe`
- [ ] 更详细的状态信息
@@ -41,9 +44,18 @@
## 截图
+_截图来自 `v1.0.1.2`_
+
![在 Windows 11 上运行](/screenshots/Windows11.png)
![在 Windows 7 上运行](/screenshots/Windows7.png)
+## 依赖
+
+- [ncmdump](https://github.com/taurusxin/ncmdump)(MIT 许可证)
+ + [taglib](https://github.com/taglib/taglib)(LGPL 2.1、MPL 1.1 许可证)
+- [NAudio](https://github.com/naudio/NAudio)(MIT 许可证)
+- [Costura.Fody](https://github.com/Fody/Costura)(MIT 许可证)
+
## 鸣谢
本项目使用到了 https://github.com/taurusxin/ncmdump 项目中的 `libncmdump.dll`
\ No newline at end of file
diff --git a/WndMain.Designer.cs b/WndMain.Designer.cs
index cb74ba5..6054716 100644
--- a/WndMain.Designer.cs
+++ b/WndMain.Designer.cs
@@ -44,13 +44,18 @@ private void InitializeComponent()
scanMoreFoldersCheckBox = new CheckBox();
filesizeLabel = new Label();
playGroupBox = new GroupBox();
+ playMoreButton = new Button();
audioProgressLabel = new Label();
playResumeButton = new Button();
audioProgressTrackBar = new TrackBar();
+ playMoreBtnContextMenuStrip = new ContextMenuStrip(components);
+ openWithDefaultPlayerToolStripMenuItem = new ToolStripMenuItem();
+ openFileLocationToolStripMenuItem = new ToolStripMenuItem();
timerTrackBar = new System.Windows.Forms.Timer(components);
statusStrip1.SuspendLayout();
playGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)audioProgressTrackBar).BeginInit();
+ playMoreBtnContextMenuStrip.SuspendLayout();
SuspendLayout();
//
// label1
@@ -180,6 +185,7 @@ private void InitializeComponent()
//
// playGroupBox
//
+ playGroupBox.Controls.Add(playMoreButton);
playGroupBox.Controls.Add(audioProgressLabel);
playGroupBox.Controls.Add(playResumeButton);
playGroupBox.Controls.Add(audioProgressTrackBar);
@@ -191,6 +197,19 @@ private void InitializeComponent()
playGroupBox.TabStop = false;
playGroupBox.Text = "播放";
//
+ // playMoreButton
+ //
+ playMoreButton.Cursor = Cursors.Hand;
+ playMoreButton.Font = new Font("Microsoft YaHei UI", 6F);
+ playMoreButton.Location = new Point(6, 72);
+ playMoreButton.Name = "playMoreButton";
+ playMoreButton.Size = new Size(40, 26);
+ playMoreButton.TabIndex = 3;
+ playMoreButton.Text = "…";
+ playMoreButton.TextAlign = ContentAlignment.TopCenter;
+ playMoreButton.UseVisualStyleBackColor = true;
+ playMoreButton.Click += playMoreButton_Click;
+ //
// audioProgressLabel
//
audioProgressLabel.AutoSize = true;
@@ -206,7 +225,7 @@ private void InitializeComponent()
//
playResumeButton.Location = new Point(6, 29);
playResumeButton.Name = "playResumeButton";
- playResumeButton.Size = new Size(40, 69);
+ playResumeButton.Size = new Size(40, 44);
playResumeButton.TabIndex = 1;
playResumeButton.Text = "▶️";
playResumeButton.UseVisualStyleBackColor = true;
@@ -221,6 +240,27 @@ private void InitializeComponent()
audioProgressTrackBar.TickStyle = TickStyle.Both;
audioProgressTrackBar.Scroll += audioProgressTrackBar_Scroll;
//
+ // playMoreBtnContextMenuStrip
+ //
+ playMoreBtnContextMenuStrip.ImageScalingSize = new Size(24, 24);
+ playMoreBtnContextMenuStrip.Items.AddRange(new ToolStripItem[] { openWithDefaultPlayerToolStripMenuItem, openFileLocationToolStripMenuItem });
+ playMoreBtnContextMenuStrip.Name = "playBtnContextMenuStrip";
+ playMoreBtnContextMenuStrip.Size = new Size(261, 64);
+ //
+ // openWithDefaultPlayerToolStripMenuItem
+ //
+ openWithDefaultPlayerToolStripMenuItem.Name = "openWithDefaultPlayerToolStripMenuItem";
+ openWithDefaultPlayerToolStripMenuItem.Size = new Size(260, 30);
+ openWithDefaultPlayerToolStripMenuItem.Text = "用系统默认播放器打开";
+ openWithDefaultPlayerToolStripMenuItem.Click += openWithDefaultPlayerToolStripMenuItem_Click;
+ //
+ // openFileLocationToolStripMenuItem
+ //
+ openFileLocationToolStripMenuItem.Name = "openFileLocationToolStripMenuItem";
+ openFileLocationToolStripMenuItem.Size = new Size(260, 30);
+ openFileLocationToolStripMenuItem.Text = "打开文件所在位置";
+ openFileLocationToolStripMenuItem.Click += openFileLocationToolStripMenuItem_Click;
+ //
// timerTrackBar
//
timerTrackBar.Tick += timerTrackBar_Tick;
@@ -257,6 +297,7 @@ private void InitializeComponent()
playGroupBox.ResumeLayout(false);
playGroupBox.PerformLayout();
((System.ComponentModel.ISupportInitialize)audioProgressTrackBar).EndInit();
+ playMoreBtnContextMenuStrip.ResumeLayout(false);
ResumeLayout(false);
PerformLayout();
}
@@ -282,5 +323,9 @@ private void InitializeComponent()
private TrackBar audioProgressTrackBar;
private Label audioProgressLabel;
private System.Windows.Forms.Timer timerTrackBar;
+ private ContextMenuStrip playMoreBtnContextMenuStrip;
+ private ToolStripMenuItem openWithDefaultPlayerToolStripMenuItem;
+ private ToolStripMenuItem openFileLocationToolStripMenuItem;
+ private Button playMoreButton;
}
}
diff --git a/WndMain.cs b/WndMain.cs
index 9ce85d1..b852181 100644
--- a/WndMain.cs
+++ b/WndMain.cs
@@ -96,7 +96,7 @@ protected override void WndProc(ref Message m)
case SystemMenuItem.About:
TaskDialog.ShowDialog(this, new TaskDialogPage()
{
- Text = "版本:v1.0.2.0\n基于libncmdump开发\n使用MIT许可证开源\n其他依赖:\n · Costura.Fody\n · NAudio\n当前.NET版本:" + Environment.Version.ToString(),
+ Text = "版本:v1.0.2.1\n基于libncmdump开发\n使用MIT许可证开源\n其他依赖:\n · Costura.Fody\n · NAudio\n当前.NET版本:" + Environment.Version.ToString(),
Heading = "NCMDumpGUI",
Caption = "关于",
Buttons =
@@ -658,5 +658,20 @@ private void WndMain_FormClosed(object sender, FormClosedEventArgs e)
{
Stop();
}
+
+ private void openWithDefaultPlayerToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ Process.Start("explorer", resultAudioPath);
+ }
+
+ private void openFileLocationToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ Process.Start("explorer", $"/select,\"{resultAudioPath}\"");
+ }
+
+ private void playMoreButton_Click(object sender, EventArgs e)
+ {
+ playMoreBtnContextMenuStrip.Show(playMoreButton, new Point(0, playMoreButton.Height));
+ }
}
}
diff --git a/WndMain.resx b/WndMain.resx
index 482c25d..fdeed43 100644
--- a/WndMain.resx
+++ b/WndMain.resx
@@ -126,6 +126,9 @@
True
+
+ 496, 17
+
311, 17