├── OSU player
├── OSU player
│ ├── .gitignore
│ ├── Res
│ │ ├── A.png
│ │ ├── B.png
│ │ ├── C.png
│ │ ├── D.png
│ │ ├── S.png
│ │ ├── SH.png
│ │ ├── Up.png
│ │ ├── X.png
│ │ ├── XH.png
│ │ ├── bg.png
│ │ ├── Next.png
│ │ ├── NextC.png
│ │ ├── NextE.png
│ │ ├── Pin.png
│ │ ├── PinE.png
│ │ ├── Pined.png
│ │ ├── PlayC.png
│ │ ├── PlayE.png
│ │ ├── Stop.png
│ │ ├── StopC.png
│ │ ├── StopE.png
│ │ ├── UpC.png
│ │ ├── UpE.png
│ │ ├── icon.ico
│ │ ├── pause.png
│ │ ├── play.png
│ │ ├── track.png
│ │ ├── PauseC.png
│ │ ├── PauseE.png
│ │ ├── Troogle.png
│ │ ├── BlackBase.png
│ │ ├── VolumeBase.png
│ │ ├── defaultBG.png
│ │ ├── gTrackBar.dll
│ │ ├── trackBase.png
│ │ ├── VolumeHandle.png
│ │ ├── ObjectListView.dll
│ │ └── HtmlBase.txt
│ ├── Lang
│ │ ├── ja.txt
│ │ ├── Template.txt
│ │ ├── ZH-CHT.txt
│ │ ├── ZH-CHS.txt
│ │ ├── en.txt
│ │ └── german.txt
│ ├── GlobalSuppressions.cs
│ ├── Uilties
│ │ ├── PlayerDbSupporter.cs
│ │ ├── About.cs
│ │ ├── ChooseColl.cs
│ │ ├── NotifySystem.cs
│ │ ├── QQ.cs
│ │ ├── SetQQ.cs
│ │ ├── Selfupdate.cs
│ │ ├── SetQQ.Designer.cs
│ │ ├── TaskBarIconMenu.cs
│ │ ├── SetQQ.resx
│ │ ├── Win32.cs
│ │ ├── About.Designer.cs
│ │ ├── ChooseColl.Designer.cs
│ │ └── DelDulp.cs
│ ├── PrivateConfig_Sample.cs
│ ├── DBListView.cs
│ ├── NoFocusButton.cs
│ ├── update.xml
│ ├── HintTextBox.cs
│ ├── OsuFiles
│ │ ├── Deserializer.cs
│ │ ├── StoryBoard
│ │ │ └── SBenum.cs
│ │ ├── AVFiles.cs
│ │ └── BeatmapSet.cs
│ ├── Settings.cs
│ ├── DBListView.Designer.cs
│ ├── HintTextBox.Designer.cs
│ ├── NoFocusButton.Designer.cs
│ ├── BindableToolStripMenuItem.Designer.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Settings.settings
│ │ ├── app.manifest
│ │ └── Settings.Designer.cs
│ ├── ImageButton.Designer.cs
│ ├── BindableToolStripMenuItem.cs
│ ├── ImageButton.cs
│ ├── app.config
│ ├── Language.cs
│ ├── Program.cs
│ ├── ImageButton.resx
│ ├── Graphic
│ │ ├── TSpriteAction.cs
│ │ ├── VideoDecoder.cs
│ │ └── TGraphic.cs
│ └── Mini.cs
└── OSU player.sln
├── update.xml
├── .gitattributes
├── README.md
├── .gitignore
└── changelog.txt
/OSU player/OSU player/.gitignore:
--------------------------------------------------------------------------------
1 | PrivateConfig.cs
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/A.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/A.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/B.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/B.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/C.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/D.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/S.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/S.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/SH.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/SH.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/Up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/Up.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/X.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/XH.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/XH.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/bg.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Lang/ja.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Lang/ja.txt
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/Next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/Next.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/NextC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/NextC.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/NextE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/NextE.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/Pin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/Pin.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/PinE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/PinE.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/Pined.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/Pined.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/PlayC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/PlayC.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/PlayE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/PlayE.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/Stop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/Stop.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/StopC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/StopC.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/StopE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/StopE.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/UpC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/UpC.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/UpE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/UpE.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/icon.ico
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/pause.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/play.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/track.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/track.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/PauseC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/PauseC.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/PauseE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/PauseE.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/Troogle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/Troogle.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/BlackBase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/BlackBase.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/VolumeBase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/VolumeBase.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/defaultBG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/defaultBG.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/gTrackBar.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/gTrackBar.dll
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/trackBase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/trackBase.png
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/VolumeHandle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/VolumeHandle.png
--------------------------------------------------------------------------------
/OSU player/OSU player/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/GlobalSuppressions.cs
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/ObjectListView.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Res/ObjectListView.dll
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/PlayerDbSupporter.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Troogle/OSUplayer/HEAD/OSU player/OSU player/Uilties/PlayerDbSupporter.cs
--------------------------------------------------------------------------------
/update.xml:
--------------------------------------------------------------------------------
1 |
2 | 5.63
3 | Ver 5.63\n不知道还有没有人用2333\n修复了无法打开latest数据库的问题
4 | 0
5 |
6 |
--------------------------------------------------------------------------------
/OSU player/OSU player/PrivateConfig_Sample.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer
2 | {
3 | static class PrivateConfig
4 | {
5 | public static string ScoreHash = "{0}";
6 | public static string BassEmail = "123@123.com";
7 | public static string BassReg = "REG_CODE";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/OSU player/OSU player/DBListView.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 |
3 | namespace OSUplayer
4 | {
5 | public partial class DBListView : ListView
6 | {
7 | public DBListView()
8 | {
9 | InitializeComponent();
10 | SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/OSU player/OSU player/NoFocusButton.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 |
3 | namespace OSUplayer
4 | {
5 | public partial class NoFocusButton : Button
6 | {
7 | public NoFocusButton()
8 | {
9 | InitializeComponent();
10 | }
11 | protected override bool ShowFocusCues
12 | {
13 | get
14 | {
15 | return false;
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/OSU player/OSU player/update.xml:
--------------------------------------------------------------------------------
1 |
2 | https://raw.github.com/Troogle/OSUplayer/master/
3 | 4.10
4 | Ver 4.10\n支持窗口切换大小\n修正可能的开始就崩溃的错误\n修正0kb的音频文件会报错\n修正可能的BG错误\n支持媒体快捷键\nVer 4.00\n支持SB播放(Beta,卡卡TAT)(默认关闭,在选项-播放sb中开启)\n支持后台快捷键(Alt+F5暂停继续,Alt+右下一首)\n支持导出Map音频文件,优化了导出BG文件的处理方式\n修正了暂停再播放之后进度条不动的问题\n修正了内存泄露问题\n修正了默认BG无法显示的问题\n增加了更详细的OSU文件读取错误的报错信息\n增大了显示框(下一版可以调节大小)\n试图修正开启就报错的问题
5 |
6 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/OSU player/OSU player/HintTextBox.cs:
--------------------------------------------------------------------------------
1 | using OSUplayer.Uilties;
2 | using System.ComponentModel;
3 | using System.Windows.Forms;
4 |
5 | namespace OSUplayer
6 | {
7 | public partial class HintTextBox : TextBox
8 | {
9 | public HintTextBox()
10 | {
11 | InitializeComponent();
12 | }
13 | [Localizable(true)]
14 | public string Hint
15 | {
16 | get { return _hint; }
17 | set { _hint = value; Win32.UpdateTextBoxHint(this, _hint); }
18 | }
19 |
20 | private string _hint;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/OSU player/OSU player/OsuFiles/Deserializer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Runtime.Serialization.Formatters;
4 | using System.Runtime.Serialization.Formatters.Binary;
5 |
6 | namespace OSUplayer.OsuFiles
7 | {
8 | static class Deserializer
9 | {
10 | private static BinaryFormatter _formatter;
11 |
12 | public static object Deserialize(Stream stream)
13 | {
14 | if (_formatter == null)
15 | {
16 | _formatter = new BinaryFormatter {AssemblyFormat = FormatterAssemblyStyle.Simple};
17 | }
18 | return _formatter.Deserialize(stream);
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Settings.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer.Properties {
2 | // 通过此类可以处理设置类的特定事件:
3 | // 在更改某个设置的值之前将引发 SettingChanging 事件。
4 | // 在更改某个设置的值之后将引发 PropertyChanged 事件。
5 | // 在加载设置值之后将引发 SettingsLoaded 事件。
6 | // 在保存设置值之前将引发 SettingsSaving 事件。
7 | internal sealed partial class Settings {
8 | public Settings() {
9 | // // 若要为保存和更改设置添加事件处理程序,请取消注释下列行:
10 | //
11 | this.PropertyChanged += Settings_PropertyChanged;
12 | //
13 | // this.SettingsSaving += this.SettingsSavingEventHandler;
14 | //
15 | }
16 |
17 | void Settings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
18 | {
19 | this.Save();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/About.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Windows.Forms;
4 | namespace OSUplayer.Uilties
5 | {
6 | public partial class About : Form
7 | {
8 | public About()
9 | {
10 | InitializeComponent();
11 | }
12 | private void About_Load(object sender, EventArgs e)
13 | {
14 | About_Content.Text = string.Format(About_Content.Text, Core.Version);
15 | About_Profile_Hint.SendToBack();
16 | }
17 | private void About_Program_Link_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
18 | {
19 | Process.Start("https://github.com/Troogle/OSUplayer/");
20 | }
21 | private void About_PictureBox_Click(object sender, EventArgs e)
22 | {
23 | Process.Start("https://osu.ppy.sh/u/3281474");
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/OSU player/OSU player/DBListView.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer
2 | {
3 | partial class DBListView
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region 组件设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | components = new System.ComponentModel.Container();
32 | }
33 |
34 | #endregion
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/OSU player/OSU player/HintTextBox.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer
2 | {
3 | partial class HintTextBox
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region 组件设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | components = new System.ComponentModel.Container();
32 | }
33 |
34 | #endregion
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/OSU player/OSU player/NoFocusButton.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer
2 | {
3 | partial class NoFocusButton
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region 组件设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | components = new System.ComponentModel.Container();
32 | }
33 |
34 | #endregion
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/OSU player/OSU player.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OSU player", "OSU player\OSU player.csproj", "{AE2C38D8-90F2-48AA-84D1-B72263AD1952}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {AE2C38D8-90F2-48AA-84D1-B72263AD1952}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {AE2C38D8-90F2-48AA-84D1-B72263AD1952}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {AE2C38D8-90F2-48AA-84D1-B72263AD1952}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {AE2C38D8-90F2-48AA-84D1-B72263AD1952}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/OSU player/OSU player/BindableToolStripMenuItem.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer
2 | {
3 | partial class BindableToolStripMenuItem
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region 组件设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | components = new System.ComponentModel.Container();
32 | }
33 |
34 | #endregion
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | // 有关程序集的常规信息通过以下
4 | // 特性集控制。更改这些特性值可修改
5 | // 与程序集关联的信息。
6 | [assembly: AssemblyTitle("OSU player")]
7 | [assembly: AssemblyDescription("A Player 4 All")]
8 | [assembly: AssemblyConfiguration("")]
9 | [assembly: AssemblyCompany("Troogle")]
10 | [assembly: AssemblyProduct("OSU player")]
11 | [assembly: AssemblyCopyright("Copyright © 2013 - 2016")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 | // 将 ComVisible 设置为 false 使此程序集中的类型
15 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
16 | // 则将该类型上的 ComVisible 特性设置为 true。
17 | [assembly: ComVisible(false)]
18 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
19 | [assembly: Guid("1cca160c-9ca2-4313-bb8d-b7e6fd8f6547")]
20 | // 程序集的版本信息由下面四个值组成:
21 | //
22 | // 主版本
23 | // 次版本
24 | // 生成号
25 | // 修订号
26 | //
27 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
28 | // 方法是按如下所示使用“*”:
29 | [assembly: AssemblyVersion("5.63.*")]
30 | // [assembly: AssemblyVersion("1.0.0.0")]
31 | // [assembly: AssemblyFileVersion("1.0.0.0")]
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | OSUplayer---A Music Player 4 All Osuers!
2 | ===========
3 | Written in C# with .Net Framework 3.5
4 |
5 | ## Dependencies
6 | [Bass&Bass.Net](http://www.un4seen.com/),
7 | [gTrackBar](http://www.codeproject.com/Articles/35104/gTrackBar-A-Custom-TrackBar-UserControl-VB-NET),
8 | [ObjectListView](http://www.codeproject.com/Articles/16009/A-Much-Easier-to-Use-ListView),
9 | [SmartIrc4net](https://github.com/meebey/SmartIrc4net/),
10 | [C# ID3 Library](http://sourceforge.net/projects/csid3lib/),
11 |
12 | [Microsoft Xna Framework 1.0 Refresh](http://www.microsoft.com/en-us/download/details.aspx?id=2431),
13 | [FFmpeg](http://ffmpeg.org/).
14 |
15 | The last 2 can be found under osu! install folder.
16 | ## Build Instructions
17 | * Create your own version of `PrivateConfig.cs` containing [Bass license](http://bass.radio42.com/bass_register.html).
18 | * Download [dlls.zip](https://drive.google.com/file/d/0BynON0JH3S_ALXJuSFJGUWRLRGc/view?usp=sharing), extract to any place and set reference to appropriate file
19 |
20 | ##LICENSE
21 | This code is licensed under GPLv3
22 |
23 | You have all the rights based on GPLv3
24 |
--------------------------------------------------------------------------------
/OSU player/OSU player/ImageButton.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer
2 | {
3 | partial class ImageButton : System.Windows.Forms.UserControl
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 | ///
10 | /// 清理所有正在使用的资源。
11 | ///
12 | /// 如果应释放托管资源,为 true;否则为 false。
13 | protected override void Dispose(bool disposing)
14 | {
15 | if (disposing && (components != null))
16 | {
17 | components.Dispose();
18 | }
19 | base.Dispose(disposing);
20 | }
21 | #region 组件设计器生成的代码
22 | ///
23 | /// 设计器支持所需的方法 - 不要
24 | /// 使用代码编辑器修改此方法的内容。
25 | ///
26 | private void InitializeComponent()
27 | {
28 | this.SuspendLayout();
29 | //
30 | // Button1
31 | //
32 | this.Name = "Button1";
33 | this.ResumeLayout(false);
34 | }
35 | #endregion
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/OSU player/OSU player/BindableToolStripMenuItem.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Windows.Forms;
3 |
4 | namespace OSUplayer
5 | {
6 | public partial class BindableToolStripMenuItem : ToolStripMenuItem, IBindableComponent
7 | {
8 | private BindingContext bindingContext;
9 | private ControlBindingsCollection dataBindings;
10 |
11 | [Browsable(false)]
12 | public BindingContext BindingContext
13 | {
14 | get
15 | {
16 | if (bindingContext == null)
17 | {
18 | bindingContext = new BindingContext();
19 | }
20 | return bindingContext;
21 | }
22 | set
23 | {
24 | bindingContext = value;
25 | }
26 | }
27 |
28 | [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
29 | public ControlBindingsCollection DataBindings
30 | {
31 | get
32 | {
33 | if (dataBindings == null)
34 | {
35 | dataBindings = new ControlBindingsCollection(this);
36 | }
37 | return dataBindings;
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/OSU player/OSU player/OsuFiles/StoryBoard/SBenum.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer.OsuFiles.StoryBoard
2 | {
3 | public enum ElementType
4 | {
5 | Background,
6 | Video,
7 | Break,
8 | Colour,
9 | Sprite,
10 | Sample,
11 | Animation
12 | }
13 | public enum ElementLayer
14 | {
15 | Background,
16 | Fail,
17 | Pass,
18 | Foreground
19 | }
20 | public enum ElementOrigin
21 | {
22 | TopLeft,
23 | TopCentre,
24 | TopRight,
25 | CentreLeft,
26 | Centre,
27 | CentreRight,
28 | BottomLeft,
29 | BottomCentre,
30 | BottomRight
31 | }
32 | public enum ElementLoopType
33 | {
34 | LoopOnce,
35 | LoopForever
36 | }
37 | public enum EventType
38 | {
39 | //F - fade【隐藏(淡入淡出)】
40 | //M - move【移动】
41 | //S - scale【缩放】
42 | //V - vector scale (width and height separately)【矢量缩放(宽高分别变动)】
43 | //R - rotate【旋转】
44 | //C - colour【颜色】
45 | //L - loop【循环】
46 | //T - Event-triggered loop【事件触发循环】
47 | //P - Parameters【参数】
48 | //Play - 播放sample
49 | F,
50 | MX,
51 | MY,
52 | M,
53 | S,
54 | V,
55 | R,
56 | C,
57 | L,
58 | T,
59 | P,
60 | Play
61 | }
62 | public enum Triggertype
63 | {
64 | HitSoundClap,
65 | HitSoundFinish,
66 | HitSoundWhistle,
67 | Passing,
68 | Failing
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 0
7 |
8 |
9 | 3
10 |
11 |
12 | True
13 |
14 |
15 | True
16 |
17 |
18 | False
19 |
20 |
21 | True
22 |
23 |
24 | 80
25 |
26 |
27 | 80
28 |
29 |
30 | 60
31 |
32 |
33 | False
34 |
35 |
36 | True
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build and Object Folders
2 | bin/
3 | obj/
4 |
5 | #User Specific Files
6 | *.user
7 | *.suo
8 |
9 | ## Ignore Visual Studio temporary files, build results, and
10 | ## files generated by popular Visual Studio add-ons.
11 |
12 | # User-specific files
13 | *.suo
14 | *.user
15 | *.sln.docstates
16 |
17 | # Build results
18 | [Dd]ebug/
19 | [Rr]elease/
20 | x64/
21 | *_i.c
22 | *_p.c
23 | *.ilk
24 | *.meta
25 | *.obj
26 | *.pch
27 | *.pdb
28 | *.pgc
29 | *.pgd
30 | *.rsp
31 | *.sbr
32 | *.tlb
33 | *.tli
34 | *.tlh
35 | *.tmp
36 | *.log
37 | *.vspscc
38 | *.vssscc
39 | .builds
40 |
41 | # Visual C++ cache files
42 | ipch/
43 | *.aps
44 | *.ncb
45 | *.opensdf
46 | *.sdf
47 |
48 | # Visual Studio profiler
49 | *.psess
50 | *.vsp
51 | *.vspx
52 |
53 | # Guidance Automation Toolkit
54 | *.gpState
55 |
56 | # ReSharper is a .NET coding add-in
57 | _ReSharper*
58 |
59 | # NCrunch
60 | *.ncrunch*
61 | .*crunch*.local.xml
62 |
63 | # Installshield output folder
64 | [Ee]xpress
65 |
66 | # DocProject is a documentation generator add-in
67 | DocProject/buildhelp/
68 | DocProject/Help/*.HxT
69 | DocProject/Help/*.HxC
70 | DocProject/Help/*.hhc
71 | DocProject/Help/*.hhk
72 | DocProject/Help/*.hhp
73 | DocProject/Help/Html2
74 | DocProject/Help/html
75 |
76 | # Click-Once directory
77 | publish
78 |
79 | # Publish Web Output
80 | *.Publish.xml
81 |
82 | # Others
83 | [Bb]in
84 | [Oo]bj
85 | sql
86 | TestResults
87 | [Tt]est[Rr]esult*
88 | *.Cache
89 | ClientBin
90 | [Ss]tyle[Cc]op.*
91 | ~$*
92 | *.dbmdl
93 | Generated_Code #added for RIA/Silverlight projects
94 |
95 | # Backup & report files from converting an old project file to a newer
96 | # Visual Studio version. Backup files are not needed, because we have git ;-)
97 | _UpgradeReport_Files/
98 | Backup*/
99 | UpgradeLog*.XML
100 |
101 | # SQL Server files
102 | App_Data/*.mdf
103 | App_Data/*.ldf
104 |
105 | # Windows image file caches
106 | Thumbs.db
107 | ehthumbs.db
108 |
109 | # Folder config file
110 | Desktop.ini
111 |
112 | # Recycle Bin used on file shares
113 | $RECYCLE.BIN/
114 |
115 | # Mac crap
116 | .DS_Store
117 |
118 | dlls
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/ChooseColl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace OSUplayer.Uilties
5 | {
6 | public partial class ChooseColl : Form
7 | {
8 | public ChooseColl()
9 | {
10 | InitializeComponent();
11 | LanguageManager.ApplyLanguage(this);
12 | }
13 | private void ChooseColl_CollectionTitle_List_SelectedIndexChanged(object sender, EventArgs e)
14 | {
15 | if (ChooseColl_CollectionTitle_List.SelectedItems.Count == 0) { return; }
16 | var collectionMaps = Core.Collections[ChooseColl_CollectionTitle_List.SelectedItem.ToString()];
17 | ChooseColl_CollectionContent_List.Items.Clear();
18 | foreach (var mapindex in collectionMaps)
19 | {
20 | ChooseColl_CollectionContent_List.Items.Add(Core.Allsets[mapindex].ToString());
21 | }
22 | }
23 | private void ChooseColl_CollectionTitle_List_MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
24 | {
25 | if (ChooseColl_CollectionTitle_List.SelectedItems.Count == 0) { return; }
26 | Core.CurrentListName = ChooseColl_CollectionTitle_List.SelectedItem.ToString();
27 | NotifySystem.Showtip(1000, LanguageManager.Get("OSUplayer"), String.Format("成功切换到{0}", Core.CurrentListName));
28 | ChooseColl_PlayListCurrentCount.Text = LanguageManager.Get("Current_Count_Text") + Core.PlayList.Count;
29 | if (Core.PlayList.Count == 0)
30 | {
31 | Core.CurrentListName = "Full";
32 | }
33 | this.Dispose();
34 | }
35 | private void ChooseColl_Load(object sender, EventArgs e)
36 | {
37 | ChooseColl_PlayListCurrentCount.Text = LanguageManager.Get("Current_Count_Text") + Core.PlayList.Count;
38 | ChooseColl_CollectionTitle_List.Items.Clear();
39 | foreach (string key in Core.Collections.Keys)
40 | {
41 | ChooseColl_CollectionTitle_List.Items.Add(key);
42 | }
43 | if (ChooseColl_CollectionTitle_List.Items.Count != 0) { ChooseColl_CollectionTitle_List.SelectedIndex = 0; }
44 | this.Width = TextRenderer.MeasureText(ChooseColl_Hint_Label.Text,ChooseColl_Hint_Label.Font).Width + TextRenderer.MeasureText(ChooseColl_PlayListCurrentCount.Text,ChooseColl_PlayListCurrentCount.Font).Width+80;
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
50 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/NotifySystem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Windows.Forms;
4 | using OSUplayer.Properties;
5 |
6 | namespace OSUplayer.Uilties
7 | {
8 | static internal class NotifySystem
9 | {
10 | private static readonly TaskBarIconMenu TrayIconMenuClass = new TaskBarIconMenu();
11 | private static readonly NotifyIcon TaskbarIcon = new NotifyIcon
12 | {
13 | Icon = Resources.icon,
14 | Text = LanguageManager.Get("OSUplayer"),
15 | Visible = true,
16 | ContextMenuStrip = TrayIconMenuClass.TrayIcon_Menu
17 | };
18 | private static EventHandler _clickEvent;
19 | public static void RegisterClick(EventHandler clicktodo)
20 | {
21 | TaskbarIcon.Click -= _clickEvent;
22 | TaskbarIcon.DoubleClick -= _clickEvent;
23 | _clickEvent = clicktodo;
24 | TaskbarIcon.Click += _clickEvent;
25 | TaskbarIcon.DoubleClick += _clickEvent;
26 | }
27 | public static void RegisterMenu(ContextMenuStrip menu)
28 | {
29 | TaskbarIcon.ContextMenuStrip = menu;
30 | }
31 | public static void Showtip(int time, string title, string content, ToolTipIcon icon = ToolTipIcon.Info, bool force = false)
32 | {
33 | if (Settings.Default.ShowPopup || force)
34 | {
35 | TaskbarIcon.ShowBalloonTip(time, title, content, icon);
36 | }
37 | }
38 |
39 | public static void ClearText()
40 | {
41 | QQ.Send2QQ("");
42 | TaskbarIcon.Text = LanguageManager.Get("OSUplayer");
43 | }
44 | private static void SetNotifyIconText(NotifyIcon ni, string text)
45 | {
46 | if (text.Length >= 128)
47 | text = text.Substring(0, 127);//throw new ArgumentOutOfRangeException("Text limited to 127 characters");
48 | var t = typeof(NotifyIcon);
49 | const BindingFlags hidden = BindingFlags.NonPublic | BindingFlags.Instance;
50 | t.GetField("text", hidden).SetValue(ni, text);
51 | if ((bool)t.GetField("added", hidden).GetValue(ni))
52 | t.GetMethod("UpdateIcon", hidden).Invoke(ni, new object[] { true });
53 | }
54 | public static void SetText(string content)
55 | {
56 | SetNotifyIconText(TaskbarIcon, String.Format("OSUPlayer\n{0}", content));
57 | QQ.Send2QQ(content);
58 | TrayIconMenuClass.RefreashMenu();
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/ImageButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Drawing;
4 | using System.Windows.Forms;
5 | namespace OSUplayer
6 | {
7 | public partial class ImageButton
8 | {
9 | public ImageButton()
10 | {
11 | InitializeComponent();
12 | DoubleBuffered = true;
13 | }
14 | [Category("外观"), Description("EnterImage")]
15 | public Image EnterImage { get; set; }
16 | [Category("外观"), Description("ClickImage")]
17 | public Image ClickImage { get; set; }
18 | [Category("外观"), Description("BaseImage")]
19 | public Image BaseImage { get; set; }
20 | protected override void OnMouseMove(MouseEventArgs e)
21 | {
22 | if (Cursor.Position.X > Parent.Location.X + Location.X + Width * 0.1
23 | && Cursor.Position.Y > Parent.Location.Y + Height * 0.15
24 | && Cursor.Position.X < Parent.Location.X + Location.X + Width * 0.9
25 | && Cursor.Position.Y < Parent.Location.Y + Height * 0.85)
26 | {
27 |
28 | BackgroundImage = EnterImage;
29 | base.OnMouseMove(e);
30 | }
31 | else
32 | {
33 | BackgroundImage = BaseImage;
34 | }
35 |
36 | }
37 |
38 | protected override void OnMouseDown(MouseEventArgs e)
39 | {
40 | if (Cursor.Position.X > Parent.Location.X + Location.X + Width * 0.1
41 | && Cursor.Position.Y > Parent.Location.Y + Height * 0.15
42 | && Cursor.Position.X < Parent.Location.X + Location.X + Width * 0.9
43 | && Cursor.Position.Y < Parent.Location.Y + Height * 0.85)
44 | {
45 | BackgroundImage = ClickImage;
46 | base.OnMouseDown(e);
47 | }
48 | }
49 | protected override void OnMouseClick(MouseEventArgs e)
50 | {
51 | if (Parent != null)
52 | {
53 | if (Cursor.Position.X > Parent.Location.X + Location.X + Width * 0.1
54 | && Cursor.Position.Y > Parent.Location.Y + Height * 0.15
55 | && Cursor.Position.X < Parent.Location.X + Location.X + Width * 0.9
56 | && Cursor.Position.Y < Parent.Location.Y + Height * 0.85)
57 | {
58 |
59 | base.OnMouseClick(e);
60 | }
61 | }
62 | }
63 | protected override void OnMouseUp(MouseEventArgs e)
64 | {
65 |
66 | BackgroundImage = EnterImage;
67 |
68 | base.OnMouseUp(e);
69 | }
70 | protected override void OnMouseLeave(EventArgs e)
71 | {
72 | BackgroundImage = BaseImage;
73 | base.OnMouseLeave(e);
74 | }
75 |
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/QQ.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Net;
5 | using System.Reflection;
6 | using OSUplayer.Properties;
7 |
8 | namespace OSUplayer.Uilties
9 | {
10 | ///
11 | /// 获取的QQ信息
12 | ///
13 | public class QQInfo
14 | {
15 | public string Nick { get; private set; }
16 | public string Uin { get; private set; }
17 | static string FindBetween(string source, string begin, string after)
18 | {
19 | var firstIndex = source.IndexOf(begin, StringComparison.Ordinal) + begin.Length;
20 | return source.Substring(
21 | firstIndex, source.IndexOf(after, firstIndex, StringComparison.Ordinal) - firstIndex
22 | );
23 | }
24 | public QQInfo(string uin)
25 | {
26 | Uin = uin;
27 | var request = WebRequest.Create("http://r.qzone.qq.com/cgi-bin/user/cgi_personal_card?uin=" + uin);
28 | var data = request.GetResponse().GetResponseStream();
29 | if (data == null) return;
30 | using (var sr = new StreamReader(data))
31 | {
32 | var html = sr.ReadToEnd();
33 | Nick = FindBetween(html, @"""nickname"":""", @"""");
34 | }
35 | }
36 | }
37 |
38 | public class QQ
39 | {
40 | ///
41 | /// 获取目前登陆QQ列表
42 | ///
43 | public List GetQQList = new List();
44 | public QQ()
45 | {
46 | try
47 | {
48 | foreach (var qq in Directory.GetFiles(@"\\.\Pipe\", "QQ_*_pipe", SearchOption.AllDirectories))
49 | {
50 | GetQQList.Add(new QQInfo(qq.Substring(12, qq.Length - 17)));
51 | }
52 | }
53 | catch
54 | {
55 | }
56 |
57 | }
58 |
59 | ///
60 | /// 推送消息给指定ID
61 | ///
62 | /// 推送的内容
63 | public static void Send2QQ(string str)
64 | {
65 | try
66 | {
67 | if (!Settings.Default.SyncQQ || Settings.Default.QQuin == "")
68 | {
69 | return;
70 | }
71 | var objAdminType = Type.GetTypeFromProgID("QQCPHelper.CPAdder");
72 | var args = new object[4];
73 | args[0] = Settings.Default.QQuin;
74 | args[1] = 65542;
75 | args[2] = str;
76 | args[3] = "";
77 | var objAdmin = Activator.CreateInstance(objAdminType);
78 | objAdminType.InvokeMember("PutRSInfo", BindingFlags.InvokeMethod, null, objAdmin, args);
79 | }
80 | catch
81 | {
82 | NotifySystem.Showtip(1000, LanguageManager.Get("OSUplayer"), LanguageManager.Get("QQ_Push_Fail_Text"));
83 | }
84 | }
85 | }
86 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Lang/Template.txt:
--------------------------------------------------------------------------------
1 | Language_name=
2 |
3 | ##Main_Menu
4 | Main_File_Menu_Text=
5 | Main_File_Run_OSU_Text=
6 | Main_File_Set_OSUPath_Text=
7 | Main_File_Import_OSU_Text=
8 | Main_File_Import_Scores_Text=
9 | Main_File_Re_Import_Scores_Text=
10 | Main_File_Open_Folder_Text=
11 | Main_File_Open_MapFile_Text=
12 | Main_File_Open_SBFile_Text=
13 | Main_File_Export_MP3_Text=
14 | Main_File_Export_Background_Text=
15 | Main_File_Exit_Text=
16 | Main_Tool_Menu_Text=
17 | Main_Tool_Search_Dulplate_Text=
18 | Main_Tool_Export_Playlist_Text=
19 | Main_Tool_Export_Playlist_MP3_Text=
20 | Main_Option_Menu_Text=
21 | Main_Option_Play_Fx_Text=
22 | Main_Option_Play_Video_Text=
23 | Main_Option_PlayMode_Text=
24 | Main_Option_PlayMode_Normal_Text=
25 | Main_Option_PlayMode_Repeat_Text=
26 | Main_Option_PlayMode_Random_Text=
27 | Main_Option_Sync_QQ_Text=
28 | Main_Option_Select_QQ_Text=
29 | Main_Option_Play_SB_Text=
30 | Main_Option_Show_Popup_Text=
31 | Main_About_Text=
32 | Main_LanguageSelect_Text=
33 | Main_QQ_Hint_Label_Text=
34 |
35 | ##Main_Header
36 | Main_Music_Hint_Label_Text=
37 | Main_Fx_Hint_Label_Text=
38 | Main_Mini_Switcher_Text=
39 | Main_Collections_Text=
40 | Main_CurrentList_Text=
41 |
42 | ##Main_Control
43 | Main_Play_Text=
44 | Main_Pause_Text=
45 | Main_Stop_Text=
46 | Main_PlayNext_Text=
47 | Main_PlayPrev_Text=
48 | Main_Jump_OSU_Text=
49 | Main_Volume_Hint_Label_Text=
50 |
51 | ##Main_Difflist
52 | Main_PageView_Page1_Text=
53 | Main_ListDetail_Key_Text=
54 | Main_ListDetail_Value_Text=
55 | Main_ListDetail_Title=
56 | Main_ListDetail_Artist=
57 | Main_ListDetail_Mapper=
58 | Main_ListDetail_Source=
59 | Main_ListDetail_Mode=
60 | Main_ListDetail_WAVPath=
61 | Main_ListDetail_BGPath=
62 | Main_ListDetail_VideoPath=
63 | Main_ListDetail_FileVersion=
64 | Main_PageView_Page2_Text=
65 | Main_PageView_Page3_Text=
66 | Main_PageView_Page4_Text=
67 | Main_Sytle_Label_Text=
68 | Main_Option_Play_Fx_Box_Text=
69 | Main_Option_Play_Video_Box_Text=
70 | Main_Option_Play_SB_Box_Text=
71 |
72 | ##Main_RightClick
73 | Main_PlayList_RightClick_Copy_Current_Name_Text=
74 | Main_PlayList_RightClick_Delete_One_Text=
75 | Main_PlayList_RightClick_Export_MP3_Text=
76 | Main_PlayList_RightClick_Open_In_OSU_Text=
77 |
78 | ##Tips
79 | Core_Init_Text=
80 | Core_Error_Osupath_Text=
81 | Core_Osupath_Tip_Text=
82 | Core_Init_Finish_Text=
83 | Core_Missing_Song_Text=
84 | Core_Missing_MP3_Text=
85 | BG_Loss_Tip_Text=
86 | Core_Current_Playing_Text=
87 | Save_Complete=
88 | Saving=
89 | Comfirm_Exit_Text=
90 |
91 | ##QQ
92 | QQ_Push_Fail_Text=
93 | SetQQ_GetQQ_Text=
94 | SetQQ_OK_Text=
95 | SetQQ_MainView_Nickname_Text=
96 | SetQQ_MainView_ID_Text=
97 | SetQQ_ClearQQ_Text=
98 | SetQQ_NoQQ_Text=
99 | SetQQ_NoInput_Text=
100 | SetQQ_Error_Text=
101 | SetQQ_AutoQQ_Text=
102 |
103 | ##About
104 | About_Profile_Hint_Text=
105 |
106 | ##ChooseColl
107 | Refresh_Complete_Text=
108 | Current_Count_Text=
109 | ChooseColl_Hint_Label_Text=
110 | ChooseColl_PlayListCurrentCount_Text=
111 |
112 | ##Update
113 | Update_Error_Text=
114 | Update_Normal_Text=
115 | Update_Downloading_Text=
116 | Update_Backgrounddownload_Text=
117 | Update_Restart_Text=
118 |
119 | ##DelDulp
120 | DelDulp_DeleteSelected_Text=
121 | DelDulp_Cancel_Text=
122 | DelDulp_StartSearch_Text=
123 | DelDulp_AutoSelect_Text=
124 | DelDulp_ClearSelected_Text=
125 | Scan_Folder_Text=
126 | Get_Song_Info_Text=
127 | Scan_Duplicate_Text=
128 | Scan_Zero_Text=
129 | Scan_Complete_Text=
130 | Delete_All_Text=
131 | Delete_Comfirm_Text=
132 | Delete_Complete_Text=
133 |
134 | ##TrayIcon
135 | TrayIcon_Aritst_Text=
136 | TrayIcon_Title_Text=
137 | TrayIcon_Diff_Text=
138 | TrayIcon_Play_Pause_Text=
139 | TrayIcon_PlayNext_Text=
140 | TrayIcon_PlayPrev_Text=
141 | TrayIcon_Exit_Text=
142 |
143 | ##General
144 | OSUplayer=
145 | Error_Text=
146 | Tip_Text=
147 |
--------------------------------------------------------------------------------
/OSU player/OSU player/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 0
13 |
14 |
15 | 3
16 |
17 |
18 | True
19 |
20 |
21 | True
22 |
23 |
24 | False
25 |
26 |
27 | True
28 |
29 |
30 | 80
31 |
32 |
33 | 80
34 |
35 |
36 | 60
37 |
38 |
39 | False
40 |
41 |
42 | True
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 0
51 |
52 |
53 | 3
54 |
55 |
56 | True
57 |
58 |
59 | True
60 |
61 |
62 | False
63 |
64 |
65 | True
66 |
67 |
68 | 1
69 |
70 |
71 | 0.8
72 |
73 |
74 | 0.6
75 |
76 |
77 | False
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Res/HtmlBase.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | OSUPlayer
6 |
121 |
122 |
123 |
124 |
125 |
126 | | No |
127 | Map Name |
128 | BeatmapSet ID |
129 | Bloodcat.com |
130 | Loli.al |
131 | Mengsky.net |
132 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Language.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Linq;
4 | using System.Reflection;
5 |
6 | namespace OSUplayer
7 | {
8 | class Language
9 | {
10 | private readonly Dictionary content = new Dictionary();
11 | public string Get(string name)
12 | {
13 | return content.ContainsKey(name) ? content[name] : "";
14 | }
15 | public Language(Stream rawstream)
16 | {
17 | using (var raw = new StreamReader(rawstream))
18 | {
19 | while (!raw.EndOfStream)
20 | {
21 | var line = raw.ReadLine();
22 | if (line == ""||line.StartsWith("##")) continue;
23 | line = line.Replace(@"\n", "\n");
24 | var pos = line.IndexOf("=");
25 | content.Add(line.Substring(0, pos), line.Substring(pos + 1));
26 | }
27 | }
28 | }
29 | }
30 | static class LanguageManager
31 | {
32 | private static Dictionary _language;
33 | private static string _current;
34 | public static string Current
35 | {
36 | get
37 | {
38 | return _current;
39 | }
40 | set
41 | {
42 | _current = _language.ContainsKey(value) ? value : "简体中文";
43 | }
44 | }
45 | public static IEnumerable LanguageList
46 | {
47 | get { return _language.Keys.ToList(); }
48 | }
49 | public static string Get(string name)
50 | {
51 | var ret = _language[Current].Get(name);
52 | return ret != "" ? ret : _language["简体中文"].Get(name);
53 | }
54 | public static void ApplyLanguage(System.Windows.Forms.Form oriForm)
55 | {
56 | foreach (var controlbase in (oriForm.GetType().GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.NonPublic)))
57 | {
58 | var control = controlbase.GetValue(oriForm);
59 | if (control == null) continue;
60 | var name = control.GetType().GetProperty("Name");
61 | if (name == null) continue;
62 | var nameValue = controlbase.Name;
63 | //name.GetValue(control, null).ToString();
64 | var text = control.GetType().GetProperty("Text");
65 | if (text == null) continue;
66 | var totext = Get(nameValue + "_Text");
67 | if (totext == "") continue;
68 | text.SetValue(control, totext, null);
69 | }
70 | }
71 | public static void InitLanguage(string name)
72 | {
73 | _language = new Dictionary();
74 | var assembly = Assembly.GetExecutingAssembly();
75 | var rawlanguage = new Language(assembly.GetManifestResourceStream("OSUplayer.Lang.zh-CHS.txt"));
76 | _language.Add(rawlanguage.Get("Language_name"), rawlanguage);
77 | rawlanguage = new Language(assembly.GetManifestResourceStream("OSUplayer.Lang.zh-CHT.txt"));
78 | _language.Add(rawlanguage.Get("Language_name"), rawlanguage);
79 | rawlanguage = new Language(assembly.GetManifestResourceStream("OSUplayer.Lang.en.txt"));
80 | _language.Add(rawlanguage.Get("Language_name"), rawlanguage);
81 | rawlanguage = new Language(assembly.GetManifestResourceStream("OSUplayer.Lang.ja.txt"));
82 | _language.Add(rawlanguage.Get("Language_name"), rawlanguage);
83 | var alllange = assembly.GetManifestResourceNames();
84 | if (alllange.Contains(string.Format("OSUplayer.Lang.{0}.txt", name)))
85 | {
86 | rawlanguage = new Language(assembly.GetManifestResourceStream(string.Format("OSUplayer.Lang.{0}.txt", name)));
87 | Current = rawlanguage.Get("Language_name");
88 | }
89 | else
90 | {
91 | Current = "";
92 | }
93 | }
94 | }
95 | }
--------------------------------------------------------------------------------
/changelog.txt:
--------------------------------------------------------------------------------
1 | Ver 5.63 16.7.9
2 | 修正无法打开latest数据库
3 | Ver 5.62 15.4.14
4 | 修正无限找不到曲子
5 | Ver 5.61 14.8.31
6 | 修正自动更新后可能播放不能
7 | Ver 5.60 14.8.30
8 | 支持DT/NC播放
9 | 支持播放上一曲(快捷键仍然适用)
10 | 支持列表排序
11 | 增加日语语言
12 | 修正最小化时CPU占用率过高
13 | Ver 5.50 14.8.21
14 | 播放列表改为切换Collection
15 | 导出当前播放列表功能(html或MP3)
16 | 右击当前歌曲可以在osu中打开或者复制名称
17 | 导出的MP3会根据osu文件修改ID3标签
18 | 优化QQ号获取逻辑
19 | 增加英文语言
20 | 界面整体重构
21 | 正在播放的歌曲更显眼了
22 | 修正播放暂停的混乱
23 | 修复滑条不能直接点击跳转
24 | 修复最小化到托盘的一些bug
25 | 修复成绩数据库读取出错
26 | 修复托盘图标不能用右击退出
27 | Ver 5.40 14.8.5
28 | 进一步修正OSUv13带来的问题
29 | (表示平时实在是太忙)
30 | Ver 5.30 14.6.14
31 | 修正搜索使用不能
32 | 默认中文(因为还没有英文翻译TAT)
33 | Ver 5.20 14.6.14
34 | 修正OSU数据库格式升级带来的问题
35 | 基本的语言切换(繁体中文only)
36 | Ver 5.00 14.2.18
37 | 界面调整及代码重构
38 | 增加删除单曲功能
39 | 增加最小化到任务栏的功能
40 | 增加跳转osu游戏的按钮 Fixed #15
41 | 增加去除气泡提示的功能 Fixed #48
42 | 托盘图标功能加强 Fixed #51
43 | 优化自动更新 Fixed #4
44 | 多语言框架的实现 #43
45 | 修正BG/video/SB拉伸问题
46 | 修正SB解析的问题
47 | 修正暂停时关闭窗口会播放的问题
48 | 修正空的osu文件的问题 Fixed #45
49 | Map信息更加详细 Fixed #17
50 | 多线程刷新播放列表
51 | Ver 4.10 13.11.21
52 | 支持窗口切换大小 Fixed #39
53 | 修正可能的开始就崩溃的错误
54 | 修正0kb的音频文件会报错
55 | 修正可能的BG错误
56 | 支持媒体快捷键
57 | Ver 4.00 13.11.16
58 | 支持SB播放(Beta,默认关闭,转用XNA) #1
59 | 支持后台快捷键(Alt+F5暂停继续,Alt+右下一首) Fixed #34
60 | 支持导出Map音频文件,优化了导出BG文件的处理方式 Fixed #32
61 | 修正了内存泄露问题(OutOfMemory)
62 | 修正了暂停再播放之后进度条不动的问题
63 | 修正了默认BG无法显示的问题
64 | 增加了更详细的OSU文件读取错误的报错信息
65 | 增大了显示框(下一版可以调节大小)
66 | 试图修正开启就报错的问题
67 | 优化Render占用
68 | Ver 3.33 13.11.15
69 | 制止重复运行程序
70 | 优化Mini贴边检测
71 | 错误日志
72 | 修正了可能的DeviceLost错误
73 | 修正了可能的OSU文件读取错误
74 | 全面消灭弹出框,使用气泡
75 | 切换歌曲气泡弹出显示
76 | Ver 3.30 13.11.14
77 | QQ自动刷新,手动输入功能(#33)
78 | 减少CPU使用率
79 | 弃用GDI+,全面使用MDX
80 | 重写Storyboard的读取
81 | 重写Beatmap的读取(使用StreamReader)
82 | 更换了默认的BG
83 | Ver 3.20 13.11.13
84 | 使用FFMPEG解码(与osu核心相同) 杜绝花屏(Fixed #23 #11 #36?)
85 | 更好的版本控制
86 | 添加在线版本统计及错误统计功能
87 | 修正QQ号溢出问题 (part of #33)
88 | 搜索框的改进,输入后自动搜索,按esc清空 (part of #35)
89 | 修正了设置无法保存的问题
90 | Ver 3.15 13.11.12
91 | 感谢JixunMoe的修正!
92 | 增加回车搜索, 搜索时继续播放音乐
93 | 添加了程序图标 感谢Noatalgika!>< (Fixed #25)
94 | 修正更新提示错乱的问题 (Fixed #30)
95 | 修正快速点击下一首程序卡死 (Fixed #24)
96 | Ver 3.10 13.11.10
97 | 修正播放列表为空时程序出错
98 | 去除是否导入scrores.db提问
99 | 增加了Mini播放器自动隐藏功能
100 | 修正读取分数的Mods有误 (Fixed #28)
101 | 修正Mini默认音量最大问题 (Fixed #28)
102 | 修正遇到一些奇葩Map时不跳出 (Fixed #27)
103 | 修正有人会删音频文件- -b (Fixed #18)
104 | 默认显示日文名 (Fixed #26)
105 | 增加保存BG功能 (Fixed #22)
106 | 成绩信息排序 (Fixed #29)
107 | Ver 3.05 13.11.8
108 | 修正了Mini Player错位的问题
109 | 修正了选择QQ窗口按钮显示不全
110 | 导入收藏部分增加清空列表的功能
111 | 修正了Mini与Main播放状态不同步的问题
112 | 自动更新可以显示版本亮点了~
113 | 修正进度条拖动带来的奇妙问题
114 | 修正无限播放下一曲
115 | Ver 3.00 13.11.8
116 | 完成Mini Player
117 | Ver 2.95 13.11.8
118 | 修改UI
119 | 修正调整窗口大小的一个错误
120 | 修正删除重复map窗口的错误
121 | 修正删除不存在map的错误
122 | Ver 2.9 13.11.7
123 | 修正了获取当前在线QQ号中的一个错误
124 | 修正了自动更新的一个错误
125 | 程序结构优化,分离界面与播放逻辑
126 | 完成导入Collections的功能
127 | Ver 2.8 13.11.5
128 | 程序界面美化&优化
129 | 添加列出score显示rank标志
130 | 添加面板收起功能
131 | 修正不开音效可能会引起程序崩溃的BUG
132 | 可以清空已经设置的QQ号
133 | 优化删除重复map的功能,显示进度
134 | Ver 2.7.1 13.11.4
135 | 修正暂停按钮无效的问题
136 | 修正无法搜索到tag的问题
137 | Ver 2.7 13.11.3
138 | 调整界面
139 | 加入皮肤切换功能
140 | 去除删Video提示
141 | Ver 2.6 13.11.2
142 | 导入Collections的功能
143 | 删除重复Beatmap的功能
144 | 调整界面及数据逻辑
145 | Ver 2.5 13.11.2
146 | 初始化时加载osu!.db,不扫描目录
147 | 全局异常处理
148 | 彻底(?)解决爆音和音频时间不正确问题、
149 | 清理代码
150 | Ver 2.4.1 13.11.1
151 | 修复了音频设置读取不生效的bug
152 | 修复了bg/video被删出错的bug
153 | Ver 2.4 13.11.1
154 | 支持读取scores.db并显示
155 | Ver 2.3 13.11.1
156 | 修正了暂停停止按钮无效的BUG
157 | 修正了自定义音效的解析BUG
158 | 修复了hitnormal不播放的BUG
159 | 提高了音效的播放声道来避免爆音
160 | 保存音频设置
161 | 读取diff时按照难度从高到低排序(难度由总hit数决定)
162 | Ver 2.1 13.10.31
163 | 播放列表功能
164 | Ver 2.05 13.10.29
165 | 错误修正
166 | Ver 2.0 13.10.29
167 | 使用VLC 脱离MDX环境
168 | 音效播放的改进
169 | Ver 1.7 13.10.29
170 | 设置保存
171 | 关于窗口
172 | Ver 1.6 13.10.28
173 | 音效回放
174 | 错误修正
175 | Ver 1.5 13.10.27
176 | 使用Bass模块播放音频
177 | 代码整理及规范
178 | 完成GUI窗体的所有逻辑
179 | Ver 1.3 13.10.27
180 | 查找功能
181 | Ver 1.2 13.10.26
182 | 窗体逻辑的重新设计
183 | 多线程初始化
184 | 下一首曲子功能
185 | Ver 1.1 13.10.25
186 | 不再使用独立设置QQ状态模块
187 | 图形界面的初步实现
188 | Ver 1.0 13.10.24
189 | 音频播放的实现
190 | Ver 0.8.0 13.10.22
191 | 更名为OSU player
192 | 在C#环境下重写所有代码
193 | Ver 0.5.0 13.10.20
194 | HitObject部分
195 | StoryBoard的读取
196 | 支持视频进度条拖拽
197 | UI的调整
198 | Ver 0.2.0 13.10.18
199 | Timing部分
200 | 支持视频进度条拖拽
201 | Ver 0.1.2 13.10.15
202 | 初始化性能提升
203 | 清理代码
204 | Ver 0.1.0 13.10.13
205 | 第一个可以用的版本(囧
206 | 使用MDX播放视频,Drawing类绘制bg
207 | Ver 0.0.7 13.10.13
208 | 自定义音效的支持
209 | Ver 0.0.5 13.10.12
210 | OSU格式文件读取&GUI构架
211 | Ver 0.0.2 13.10.11
212 | 开始编写SB架构
213 | Ver 0.0.1 13.10.9
214 | QQ状态同步&自动升级功能
215 | 13.10.8
216 | 开始编写 OSU_Toolbox
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/SetQQ.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Text.RegularExpressions;
5 | using System.Windows.Forms;
6 | using OSUplayer.Properties;
7 |
8 | namespace OSUplayer.Uilties
9 | {
10 | public partial class SetQQ : Form
11 | {
12 | private readonly BackgroundWorker refreash = new BackgroundWorker();
13 | private readonly QQ qq = new QQ();
14 | private List QQInfos = new List();
15 |
16 | public SetQQ()
17 | {
18 | InitializeComponent();
19 | refreash.DoWork += refreash_DoWork;
20 | }
21 |
22 | private void SetQQ_OK_Click(object sender, EventArgs e)
23 | {
24 | if (SetQQ_MainView.Visible)
25 | {
26 | try
27 | {
28 | Settings.Default.QQuin = SetQQ_MainView.SelectedItems[0].Text;
29 | if (Settings.Default.QQuin == LanguageManager.Get("SetQQ_ClearQQ_Text"))
30 | {
31 | Settings.Default.QQuin = "0";
32 | }
33 | Dispose();
34 | }
35 | catch (Exception)
36 | {
37 | if (SetQQ_MainView.SelectedItems.Count == 0)
38 | {
39 | MessageBox.Show(LanguageManager.Get("SetQQ_NoQQ_Text"), LanguageManager.Get("Tip_Text"));
40 | }
41 | else
42 | {
43 | Settings.Default.QQuin = "0";
44 | Settings.Default.SyncQQ = false;
45 | Dispose();
46 | }
47 | }
48 | }
49 | else
50 | {
51 | var isNumeric = new Regex(@"^\d+$");
52 | if ((!isNumeric.IsMatch(SetQQ_Manual.Text)) || (SetQQ_Manual.Text.Trim() == ""))
53 | {
54 | MessageBox.Show(LanguageManager.Get("SetQQ_NoInput_Text"), LanguageManager.Get("Tip_Text"));
55 | }
56 | else
57 | {
58 | Settings.Default.QQuin = SetQQ_Manual.Text;
59 | Settings.Default.SyncQQ = Settings.Default.QQuin != "0";
60 | Dispose();
61 | }
62 | }
63 | }
64 |
65 | private void RefreshQQ(object sender, EventArgs e)
66 | {
67 | Focus();
68 | SetQQ_MainView.Items.Clear();
69 | QQInfos = qq.GetQQList;
70 | try
71 | {
72 | ListViewItem tmpl;
73 | foreach (var t in QQInfos)
74 | {
75 | tmpl = new ListViewItem(t.Uin);
76 | tmpl.SubItems.Add(t.Nick);
77 | SetQQ_MainView.Items.Add(tmpl);
78 | }
79 | tmpl = new ListViewItem(LanguageManager.Get("SetQQ_ClearQQ_Text"));
80 | tmpl.SubItems.Add("");
81 | SetQQ_MainView.Items.Add(tmpl);
82 | }
83 | catch (Exception)
84 | {
85 | MessageBox.Show(LanguageManager.Get("SetQQ_Error_Text"), LanguageManager.Get("Error_Text"));
86 | }
87 | }
88 |
89 | private void refreash_DoWork(object sender, DoWorkEventArgs e)
90 | {
91 | if (InvokeRequired)
92 | {
93 | BeginInvoke(new EventHandler(RefreshQQ));
94 | }
95 | else
96 | {
97 | RefreshQQ(null, null);
98 | }
99 | }
100 |
101 | private void SetQQ_GetQQ_Click(object sender, EventArgs e)
102 | {
103 | if (SetQQ_MainView.Visible)
104 | {
105 | SetQQ_GetQQ.Text = LanguageManager.Get("SetQQ_AutoQQ_Text");
106 | SetQQ_MainView.Visible = false;
107 | SetQQ_Manual.Visible = true;
108 | }
109 | else
110 | {
111 | SetQQ_GetQQ.Text = LanguageManager.Get("SetQQ_GetQQ_Text");
112 | SetQQ_MainView.Visible = true;
113 | SetQQ_Manual.Visible = false;
114 | }
115 | }
116 |
117 | private void Form2_Load(object sender, EventArgs e)
118 | {
119 | refreash.RunWorkerAsync();
120 | }
121 | }
122 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Lang/ZH-CHT.txt:
--------------------------------------------------------------------------------
1 | Language_name=繁體中文
2 |
3 | ##Main_Menu
4 | Main_File_Menu_Text=文件(&F)
5 | Main_File_Run_OSU_Text=開啟OSU!
6 | Main_File_Set_OSUPath_Text=手動指定OSU目錄
7 | Main_File_Import_OSU_Text=與OSU數據庫同步
8 | Main_File_Import_Scores_Text=匯入scores.db
9 | Main_File_Re_Import_Scores_Text=重新匯入scores.db
10 | Main_File_Open_Folder_Text=打開曲目文件夾
11 | Main_File_Open_MapFile_Text=打開譜面文件
12 | Main_File_Open_SBFile_Text=打開Storyboard文件
13 | Main_File_Export_MP3_Text=匯出音訊文件
14 | Main_File_Export_Background_Text=匯出背景
15 | Main_File_Exit_Text=退出
16 | Main_Tool_Menu_Text=工具(&T)
17 | Main_Tool_Search_Dulplate_Text=掃描重複歌曲
18 | Main_Tool_Export_Playlist_Text=匯出目前播放列表(html)
19 | Main_Tool_Export_Playlist_MP3_Text=匯出目前播放列表音訊
20 | Main_Option_Menu_Text=選項(&O)
21 | Main_Option_Play_Fx_Text=打擊音效
22 | Main_Option_Play_Video_Text=背景影片
23 | Main_Option_PlayMode_Text=播放模式
24 | Main_Option_PlayMode_Normal_Text=順序播放
25 | Main_Option_PlayMode_Repeat_Text=單曲循環
26 | Main_Option_PlayMode_Random_Text=隨機播放
27 | Main_Option_Sync_QQ_Text=QQ狀態同步
28 | Main_Option_Select_QQ_Text=選擇QQ
29 | Main_Option_Play_SB_Text=StoryBoard
30 | Main_Option_Show_Popup_Text=通知區域氣泡
31 | Main_About_Text=關於(&A)
32 | Main_LanguageSelect_Text=語言
33 | Main_QQ_Hint_Label_Text=目前同步的QQ帳號:
34 |
35 | ##Main_Header
36 | Main_Music_Hint_Label_Text=音樂
37 | Main_Fx_Hint_Label_Text=音效
38 | Main_Mini_Switcher_Text=↓
39 | Main_Collections_Text=切換收藏夾
40 | Main_CurrentList_Text=當前列表:
41 |
42 | ##Main_Control
43 | Main_Play_Text=播放
44 | Main_Pause_Text=暫停
45 | Main_Stop_Text=停止
46 | Main_PlayNext_Text=→
47 | Main_PlayPrev_Text=←
48 | Main_Jump_OSU_Text=O
49 | Main_Volume_Hint_Label_Text=音量
50 |
51 | ##Main_Difflist
52 | Main_PageView_Page1_Text=譜面信息
53 | Main_ListDetail_Key_Text=Key
54 | Main_ListDetail_Value_Text=Value
55 | Main_ListDetail_Title=
56 | Main_ListDetail_Artist=
57 | Main_ListDetail_Mapper=
58 | Main_ListDetail_Source=
59 | Main_ListDetail_Mode=
60 | Main_ListDetail_WAVPath=
61 | Main_ListDetail_BGPath=
62 | Main_ListDetail_VideoPath=
63 | Main_ListDetail_FileVersion=
64 | Main_PageView_Page2_Text=成績信息
65 | Main_PageView_Page3_Text=難度
66 | Main_PageView_Page4_Text=
67 | Main_Sytle_Label_Text=
68 | Main_Option_Play_Fx_Box_Text=打擊音效
69 | Main_Option_Play_Video_Box_Text=背景影片
70 | Main_Option_Play_SB_Box_Text=StoryBoard
71 |
72 | ##Main_RightClick
73 | Main_PlayList_RightClick_Copy_Current_Name_Text=複製當前歌曲名稱
74 | Main_PlayList_RightClick_Delete_One_Text=刪除單曲
75 | Main_PlayList_RightClick_Export_MP3_Text=匯出當前MP3
76 | Main_PlayList_RightClick_Open_In_OSU_Text=在OSU中打開
77 |
78 | ##Tips
79 | Core_Init_Text=正在初始化...
80 | Core_Error_Osupath_Text=自動偵測遊戲目錄位置失敗! 請手動設置
81 | Core_Osupath_Tip_Text=請選擇存放osu!.exe的資料夾
82 | Core_Init_Finish_Text=初始化完畢,發現曲目{0}個
83 | Core_Missing_Song_Text=缺少音樂文件
84 | Core_Missing_MP3_Text=缺少音訊文件
85 | BG_Loss_Tip_Text=缺少背景圖片
86 | Core_Current_Playing_Text=正在播放
87 | Save_Complete=保存成功!
88 | Saving=正在保存...
89 | Comfirm_Exit_Text=您確認要關閉本程式?
90 |
91 | ##QQ
92 | QQ_Push_Fail_Text=QQ推送失敗!
93 | SetQQ_GetQQ_Text=手動輸入QQ號
94 | SetQQ_OK_Text=確定
95 | SetQQ_MainView_Nickname_Text=暱稱
96 | SetQQ_MainView_ID_Text=ID
97 | SetQQ_ClearQQ_Text=清空QQ號
98 | SetQQ_NoQQ_Text=請輸入QQ號
99 | SetQQ_NoInput_Text=請輸入QQ號
100 | SetQQ_Error_Text=偵測當前在線QQ失敗!
101 | SetQQ_AutoQQ_Text=自動偵測
102 |
103 | ##About
104 | About_Profile_Hint_Text=(Click for osu! userpage)
105 |
106 | ##ChooseColl
107 | Refresh_Complete_Text=重新整理完成!
108 | Current_Count_Text=目前播放列表曲目數量:
109 | ChooseColl_Hint_Label_Text=按兩下收藏夾
110 | ChooseColl_PlayListCurrentCount_Text=目前播放列表曲目數量:
111 |
112 | ##Update
113 | Update_Error_Text=更新設定檔錯誤!
114 | Update_Normal_Text=新版本 {0} 發佈了~\n更新內容:\n{1}
115 | Update_Downloading_Text=下載更新中…
116 | Update_Backgrounddownload_Text=程式將於背景下載更新
117 | Update_Restart_Text=程式將重新啟動以完成更新
118 |
119 | ##DelDulp
120 | DelDulp_DeleteSelected_Text=刪除選取項目
121 | DelDulp_Cancel_Text=取消
122 | DelDulp_StartSearch_Text=開始搜索
123 | DelDulp_AutoSelect_Text=自動選擇
124 | DelDulp_ClearSelected_Text=取消選取
125 | Scan_Folder_Text=掃描歌曲目錄{0}/{1}
126 | Get_Song_Info_Text=擷取歌曲資訊{0}/{1}
127 | Scan_Duplicate_Text=掃描重複譜面{0}/{1}
128 | Scan_Zero_Text=找不到重複譜面
129 | Scan_Complete_Text=掃描完成,發現{0}個重複譜面
130 | Delete_All_Text=共{0}個被選取,確定繼續?
131 | Delete_Comfirm_Text=將刪除{0}個,確定繼續?
132 | Delete_Complete_Text=刪除完成,共刪除{0}個
133 |
134 | ##TrayIcon
135 | TrayIcon_Aritst_Text=歌手:
136 | TrayIcon_Title_Text=標題:
137 | TrayIcon_Diff_Text=難度:
138 | TrayIcon_Play_Pause_Text=播放/暫停
139 | TrayIcon_PlayNext_Text=下一首
140 | TrayIcon_PlayPrev_Text=上一首
141 | TrayIcon_Exit_Text=退出
142 |
143 | ##General
144 | OSUplayer=OSUplayer
145 | Error_Text=錯誤
146 | Tip_Text=提示
--------------------------------------------------------------------------------
/OSU player/OSU player/Lang/ZH-CHS.txt:
--------------------------------------------------------------------------------
1 | Language_name=简体中文
2 |
3 | ##Main_Menu
4 | Main_File_Menu_Text=文件(&F)
5 | Main_File_Run_OSU_Text=运行OSU!
6 | Main_File_Set_OSUPath_Text=手动指定OSU目录
7 | Main_File_Import_OSU_Text=与OSU数据库同步
8 | Main_File_Import_Scores_Text=导入scores.db
9 | Main_File_Re_Import_Scores_Text=重新导入scores.db
10 | Main_File_Open_Folder_Text=打开曲目文件夹
11 | Main_File_Open_MapFile_Text=打开谱面文件
12 | Main_File_Open_SBFile_Text=打开SB文件
13 | Main_File_Export_MP3_Text=导出音频文件
14 | Main_File_Export_Background_Text=导出BG
15 | Main_File_Exit_Text=退出
16 | Main_Tool_Menu_Text=工具(&T)
17 | Main_Tool_Search_Dulplate_Text=重复歌曲扫描
18 | Main_Tool_Export_Playlist_Text=导出当前播放列表(html)
19 | Main_Tool_Export_Playlist_MP3_Text=导出当前播放列表音频
20 | Main_Option_Menu_Text=选项(&O)
21 | Main_Option_Play_Fx_Text=音效开关
22 | Main_Option_Play_Video_Text=视频开关
23 | Main_Option_PlayMode_Text=播放模式
24 | Main_Option_PlayMode_Normal_Text=顺序播放
25 | Main_Option_PlayMode_Repeat_Text=单曲循环
26 | Main_Option_PlayMode_Random_Text=随机播放
27 | Main_Option_Sync_QQ_Text=QQ状态同步
28 | Main_Option_Select_QQ_Text=选择QQ
29 | Main_Option_Play_SB_Text=SB开关
30 | Main_Option_Show_Popup_Text=显示气泡
31 | Main_About_Text=关于(&A)
32 | Main_LanguageSelect_Text=语言
33 | Main_QQ_Hint_Label_Text=当前同步QQ:
34 |
35 | ##Main_Header
36 | Main_Music_Hint_Label_Text=音乐
37 | Main_Fx_Hint_Label_Text=音效
38 | Main_Mini_Switcher_Text=↓
39 | Main_Collections_Text=切换收藏
40 | Main_CurrentList_Text=当前列表:
41 |
42 | ##Main_Control
43 | Main_Play_Text=播放
44 | Main_Pause_Text=暂停
45 | Main_Stop_Text=停止
46 | Main_PlayNext_Text=→
47 | Main_PlayPrev_Text=←
48 | Main_Jump_OSU_Text=O
49 | Main_Volume_Hint_Label_Text=音量
50 |
51 | ##Main_Difflist
52 | Main_PageView_Page1_Text=Map信息
53 | Main_ListDetail_Key_Text=Key
54 | Main_ListDetail_Value_Text=Value
55 | Main_ListDetail_Title=歌曲名称
56 | Main_ListDetail_Artist=歌手
57 | Main_ListDetail_Mapper=作者
58 | Main_ListDetail_Source=来源
59 | Main_ListDetail_Mode=模式
60 | Main_ListDetail_WAVPath=音频文件名称
61 | Main_ListDetail_BGPath=背景文件名称
62 | Main_ListDetail_VideoPath=视频文件名称
63 | Main_ListDetail_FileVersion=OSU文件版本
64 | Main_PageView_Page2_Text=成绩信息
65 | Main_PageView_Page3_Text=Diff信息
66 | Main_PageView_Page4_Text=特殊选项
67 | Main_Sytle_Label_Text=播放预置
68 | Main_Option_Play_Fx_Box_Text=音效开关
69 | Main_Option_Play_Video_Box_Text=视频开关
70 | Main_Option_Play_SB_Box_Text=SB开关
71 |
72 | ##Main_RightClick
73 | Main_PlayList_RightClick_Copy_Current_Name_Text=复制当前歌曲名称
74 | Main_PlayList_RightClick_Delete_One_Text=删除单首
75 | Main_PlayList_RightClick_Export_MP3_Text=导出当前MP3
76 | Main_PlayList_RightClick_Open_In_OSU_Text=在OSU中打开
77 |
78 | ##Tips
79 | Core_Init_Text=正在初始化...
80 | Core_Error_Osupath_Text=读取游戏目录出错! 请手动指定
81 | Core_Osupath_Tip_Text=请选择与osu!.exe同级的目录~
82 | Core_Init_Finish_Text=初始化完毕,发现曲目{0}个
83 | Core_Missing_Song_Text=没事删什么曲子啊><
84 | Core_Missing_MP3_Text=音频文件你都删!><
85 | BG_Loss_Tip_Text=没事删什么BG TAT
86 | Core_Current_Playing_Text=正在播放
87 | Save_Complete=保存成功!
88 | Saving=正在保存...
89 | Comfirm_Exit_Text=确认退出?
90 |
91 | ##QQ
92 | QQ_Push_Fail_Text=QQ推送失败!
93 | SetQQ_GetQQ_Text=手动获取
94 | SetQQ_OK_Text=确定
95 | SetQQ_MainView_Nickname_Text=昵称
96 | SetQQ_MainView_ID_Text=ID
97 | SetQQ_ClearQQ_Text=清空QQ号
98 | SetQQ_NoQQ_Text=别卖萌不选啊-0-
99 | SetQQ_NoInput_Text=亲正常点~请输入QQ号~~
100 | SetQQ_Error_Text=获取当前在线QQ出错!
101 | SetQQ_AutoQQ_Text=自动获取
102 |
103 | ##About
104 | About_Profile_Hint_Text=(Click for osu! userpage)
105 |
106 | ##ChooseColl
107 | Refresh_Complete_Text=刷新完毕!
108 | Current_Count_Text=当前播放列表曲目数:
109 | ChooseColl_Hint_Label_Text=双击Collection名称切换
110 | ChooseColl_PlayListCurrentCount_Text=当前播放列表曲目数:
111 |
112 | ##Update
113 | Update_Error_Text=更新配置文件出错!
114 | Update_Normal_Text=新版本 {0} 发布了~\n更新内容:\n{1}
115 | Update_Downloading_Text=下载更新ing
116 | Update_Backgrounddownload_Text=程序将在后台下载更新
117 | Update_Restart_Text=程序将重启完成升级
118 |
119 | ##DelDulp
120 | DelDulp_DeleteSelected_Text=删除选中
121 | DelDulp_Cancel_Text=取消
122 | DelDulp_StartSearch_Text=开始查找
123 | DelDulp_AutoSelect_Text=自动选择
124 | DelDulp_ClearSelected_Text=清除选中
125 | Scan_Folder_Text=扫描歌曲目录{0}/{1}
126 | Get_Song_Info_Text=获得歌曲信息{0}/{1}
127 | Scan_Duplicate_Text=寻找重复map{0}/{1}
128 | Scan_Zero_Text=没有神马要删除的!><
129 | Scan_Complete_Text=扫描完毕,发现重复曲目{0}个
130 | Delete_All_Text=有{0}组被全部选中,确定继续?
131 | Delete_Comfirm_Text=将删除{0}个,确定继续?
132 | Delete_Complete_Text=删除完毕,共删除{0}个
133 |
134 | ##TrayIcon
135 | TrayIcon_Aritst_Text=歌手:
136 | TrayIcon_Title_Text=标题:
137 | TrayIcon_Diff_Text=难度名:
138 | TrayIcon_Play_Pause_Text=播放/暂停
139 | TrayIcon_PlayNext_Text=下一首
140 | TrayIcon_PlayPrev_Text=上一首
141 | TrayIcon_Exit_Text=退出
142 |
143 | ##General
144 | OSUplayer=OSUplayer
145 | Error_Text=错误
146 | Tip_Text=提示
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/Selfupdate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Net;
5 | using System.Reflection;
6 | using System.Windows.Forms;
7 | using System.Xml;
8 | using Ionic.Zip;
9 |
10 | namespace OSUplayer.Uilties
11 | {
12 | public static class Selfupdate
13 | {
14 | private static readonly XmlDocument UpDateXml = new XmlDocument();
15 | const string Url = "https://raw.github.com/Troogle/OSUplayer/master/";
16 | private const string Upfile = "http://troogle.pw/OSUplayer.zip";
17 | private static void Download(string url)
18 | {
19 | try
20 | {
21 | UpDateXml.Load(new XmlTextReader(url));
22 | string newver = UpDateXml.SelectNodes("/Xml/Version")[0].InnerText;
23 | string text = UpDateXml.SelectNodes("/Xml/Text")[0].InnerText.Replace(@"\n", "\n");
24 | string full = "0";
25 | var xmlNodeList = UpDateXml.SelectNodes("/Xml/Full");
26 | if (xmlNodeList != null && xmlNodeList.Count != 0)
27 | {
28 | full = xmlNodeList[0].InnerText;
29 | }
30 | if (newver.CompareTo(Core.Version) > 0)
31 | {
32 | var res = MessageBox.Show(string.Format(LanguageManager.Get("Update_Normal_Text"), newver, text), LanguageManager.Get("Tip_Text"),
33 | MessageBoxButtons.OKCancel,MessageBoxIcon.Information);
34 | if (res == DialogResult.OK)
35 | {
36 | if (full == "1")
37 | {
38 | Process.Start(UpDateXml.SelectNodes("/Xml/Link")[0].InnerText);
39 | return;
40 | }
41 | NotifySystem.Showtip(1000, LanguageManager.Get("Tip_Text"), LanguageManager.Get("Update_Downloading_Text"));
42 | MessageBox.Show(LanguageManager.Get("Update_Backgrounddownload_Text"), LanguageManager.Get("Tip_Text"), MessageBoxButtons.OK, MessageBoxIcon.Information);
43 | Update();
44 | }
45 | }
46 |
47 | /*
48 | try
49 | {
50 | WebRequest request = WebRequest.Create("http://wenwo.at/counter.php?counter=" + Core.Version);
51 | request.Credentials = CredentialCache.DefaultCredentials;
52 | request.Timeout = 20000;
53 | request.GetResponse();
54 | }
55 | catch
56 | {
57 | }
58 | */
59 | }
60 | catch (Exception)
61 | {
62 | MessageBox.Show(LanguageManager.Get("Update_Error_Text"), LanguageManager.Get("Error_Text"), MessageBoxButtons.OK, MessageBoxIcon.Error);
63 | }
64 | }
65 | private static void Update()
66 | {
67 | var req = (HttpWebRequest)WebRequest.Create(Upfile);
68 | var res = (HttpWebResponse)req.GetResponse();
69 | using (var instream = res.GetResponseStream())
70 | {
71 | using (var outstream = File.Create("OSUplayer.zip"))
72 | {
73 | byte[] buffer = new byte[1024];
74 | int count;
75 | do
76 | {
77 | count = instream.Read(buffer, 0, buffer.Length);
78 | if (count > 0)
79 | outstream.Write(buffer, 0, count);
80 | }
81 | while (count > 0);
82 | }
83 | }
84 | string filename = Assembly.GetExecutingAssembly().Location;
85 | if (File.Exists(filename + ".detele")) File.Delete(filename + ".delete");
86 | File.Move(filename, filename + ".delete");
87 | using (var sourceFile = new ZipFile("OSUplayer.zip"))
88 | {
89 | sourceFile.ExtractSelectedEntries("OSUplayer.exe", ExtractExistingFileAction.OverwriteSilently);
90 | }
91 | File.Move("OSUplayer.exe", filename);
92 | File.Delete("OSUplayer.zip");
93 | File.Delete("list.db");
94 | MessageBox.Show(LanguageManager.Get("Update_Restart_Text"), LanguageManager.Get("Tip_Text"), MessageBoxButtons.OK, MessageBoxIcon.Information);
95 | var proc = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location));
96 | var p = new Process { StartInfo = { FileName = filename } };
97 | p.Start();
98 | foreach (var pr in proc)
99 | {
100 | pr.Kill();
101 | }
102 | }
103 | public static void check_update()
104 | {
105 | Download(Url + "update.xml");
106 | }
107 | }
108 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Program.cs:
--------------------------------------------------------------------------------
1 | using OSUplayer.Uilties;
2 | using System;
3 | using System.IO;
4 | using System.Reflection;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Windows.Forms;
8 | namespace OSUplayer
9 | {
10 | static class Program
11 | {
12 | private static Mutex _mutex;
13 | ///
14 | /// 应用程序的主入口点。
15 | ///
16 | [STAThread]
17 | static void Main()
18 | {
19 | Application.SetCompatibleTextRenderingDefault(false);
20 | //设置应用程序处理异常方式:ThreadException处理
21 | Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
22 | //处理UI线程异常
23 | Application.ThreadException += Application_ThreadException;
24 | //处理非UI线程异常
25 | AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
26 | Application.EnableVisualStyles();
27 | try
28 | {
29 | bool ret;
30 | _mutex = new Mutex(true, Application.ProductName, out ret);
31 | if (!ret)
32 | {
33 | MessageBox.Show(@"The Program is already running!", @"Tips", MessageBoxButtons.OK, MessageBoxIcon.Information);
34 | Application.ExitThread();
35 | return;
36 | }
37 | var filename = Assembly.GetExecutingAssembly().Location;
38 | if (File.Exists(filename + ".detele")) File.Delete(filename + ".delete");
39 | if (!File.Exists("bass_fx.dll"))
40 | if (File.Exists(Path.Combine(Properties.Settings.Default.OSUpath, "bass_fx.dll")))
41 | File.Copy(Path.Combine(Properties.Settings.Default.OSUpath, "bass_fx.dll"), "bass_fx.dll");
42 | else
43 | MessageBox.Show(@"如果不能播放,请重新下载完整包!\nPlease re-download the full pack if it can't play!", @"Tips", MessageBoxButtons.OK, MessageBoxIcon.Information);
44 | Un4seen.Bass.BassNet.Registration(PrivateConfig.BassEmail, PrivateConfig.BassReg);
45 | Un4seen.Bass.AddOn.Fx.BassFx.LoadMe();
46 | LanguageManager.InitLanguage(System.Globalization.CultureInfo.CurrentCulture.Name);
47 | /*var mainwindow = new Main();
48 | mainwindow.Show();
49 | while (mainwindow.Created)
50 | {
51 | Application.DoEvents();
52 | Core.Render();
53 | Thread.Sleep(5);
54 | }*/
55 | Application.Run(new Main());
56 | }
57 | #region 异常处理
58 | catch (Exception ex)
59 | {
60 | GetExceptionMsg(ex);
61 | NotifySystem.Showtip(1000, "发生了一些令人悲伤的事情><", "程序将试图继续运行", ToolTipIcon.Error);
62 | }
63 | }
64 | static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
65 | {
66 | GetExceptionMsg(e.Exception);
67 | NotifySystem.Showtip(1000, "发生了一些令人悲伤的事情><", "程序将试图继续运行", ToolTipIcon.Error);
68 | }
69 | static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
70 | {
71 | GetExceptionMsg(e.ExceptionObject as Exception);
72 | NotifySystem.Showtip(1000, "发生了一些令人悲伤的事情><", "程序将试图继续运行", ToolTipIcon.Error);
73 | }
74 |
75 | ///
76 | /// 记录自定义异常消息
77 | ///
78 | /// 异常对象
79 | static void GetExceptionMsg(Exception ex)
80 | {
81 | /*
82 | try
83 | {
84 | WebRequest request;
85 | if (ex != null)
86 | {
87 | int start = ex.StackTrace.IndexOf("OSUplayer");
88 | request = WebRequest.Create("http://wenwo.at/counter.php?error=" + ex.GetType().Name + ex.Message + " " + ex.StackTrace.Substring(start, 300 > ex.StackTrace.Length - start - 1 ? ex.StackTrace.Length - start - 1 : 300));
89 | request.Credentials = CredentialCache.DefaultCredentials;
90 | request.Timeout = 2000;
91 | request.GetResponse();
92 | }
93 | }
94 | catch
95 | {
96 | return;
97 | }
98 | */
99 | var sb = new StringBuilder();
100 | if (ex == null) return;
101 | sb.AppendLine("【异常类型】:" + ex.GetType().Name);
102 | sb.AppendLine("【异常信息】:" + ex.Message);
103 | sb.AppendLine("【堆栈调用】:" + ex.StackTrace);
104 | using (var writer = File.AppendText("Errlog.txt"))
105 | {
106 | writer.WriteLine(sb.ToString());
107 | }
108 | }
109 | #endregion
110 | }
111 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/OsuFiles/AVFiles.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Un4seen.Bass;
3 |
4 | namespace OSUplayer.OsuFiles
5 | {
6 | public interface IAudiofile
7 | {
8 | double Durnation { get; }
9 | double Position { get; }
10 | bool Isplaying { get; }
11 | float Volume { get; set; }
12 | void Play(float volume);
13 | void Pause();
14 | void Stop();
15 | void Seek(double time);
16 | void Open(string path);
17 | }
18 |
19 | ///
20 | /// Class for Audio Playback
21 | ///
22 | public class BassAudio : IDisposable, IAudiofile
23 | {
24 | private const int Interval = 1;
25 | private int _channel;
26 | private bool _isPaused;
27 | private bool _isopened;
28 | private float _freq;
29 | private BASSTimer _timer = new BASSTimer();
30 |
31 | public static void Init()
32 | {
33 | Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
34 | }
35 | public BASSTimer UpdateTimer
36 | {
37 | get { return _timer; }
38 | //set { UpdateTimer = value; }
39 | }
40 |
41 | public void setFreq(float factor)
42 | {
43 | Bass.BASS_ChannelSetAttribute(_channel, BASSAttribute.BASS_ATTRIB_TEMPO, 1.0f);
44 | Bass.BASS_ChannelSetAttribute(_channel, BASSAttribute.BASS_ATTRIB_FREQ, _freq * factor);
45 | }
46 |
47 | public void setTempo(float factor)
48 | {
49 | Bass.BASS_ChannelSetAttribute(_channel, BASSAttribute.BASS_ATTRIB_FREQ, _freq);
50 | Bass.BASS_ChannelSetAttribute(_channel, BASSAttribute.BASS_ATTRIB_TEMPO, factor);
51 | }
52 | public double Durnation
53 | {
54 | get { return Bass.BASS_ChannelBytes2Seconds(_channel, Bass.BASS_ChannelGetLength(_channel)); }
55 | }
56 |
57 | public double Position
58 | {
59 | get { return Bass.BASS_ChannelBytes2Seconds(_channel, Bass.BASS_ChannelGetPosition(_channel)); }
60 | }
61 |
62 | public bool Isplaying
63 | {
64 | get { return Bass.BASS_ChannelIsActive(_channel) == BASSActive.BASS_ACTIVE_PLAYING; }
65 | }
66 |
67 | public void Play(float volume)
68 | {
69 | _timer.Stop();
70 | if (!_isopened) return;
71 | if (_channel != 0 && Bass.BASS_ChannelPlay(_channel, true))
72 | {
73 | _timer.Start();
74 | _isPaused = false;
75 | }
76 | else
77 | {
78 | throw new FormatException(Bass.BASS_ErrorGetCode().ToString());
79 | }
80 | Volume = volume;
81 | }
82 |
83 | public void Pause()
84 | {
85 | if (_isPaused)
86 | {
87 | _timer.Start();
88 | Bass.BASS_ChannelPlay(_channel, false);
89 | }
90 | else
91 | {
92 | _timer.Stop();
93 | Bass.BASS_ChannelPause(_channel);
94 | }
95 | _isPaused = !_isPaused;
96 | }
97 |
98 | public void Stop()
99 | {
100 | _timer.Stop();
101 | _isPaused = true;
102 | Bass.BASS_ChannelStop(_channel);
103 | }
104 |
105 | public void Seek(double time)
106 | {
107 | Bass.BASS_ChannelSetPosition(_channel, Bass.BASS_ChannelSeconds2Bytes(_channel, time));
108 | }
109 |
110 | public float Volume
111 | {
112 | get
113 | {
114 | float vol = 1.0f;
115 | Bass.BASS_ChannelGetAttribute(_channel, BASSAttribute.BASS_ATTRIB_VOL, ref vol);
116 | return vol;
117 | }
118 | set { Bass.BASS_ChannelSetAttribute(_channel, BASSAttribute.BASS_ATTRIB_VOL, value); }
119 | }
120 |
121 | public void Open(string path)
122 | {
123 | _timer = new BASSTimer(Interval);
124 | Bass.BASS_StreamFree(_channel);
125 | _channel = Bass.BASS_StreamCreateFile(path, 0, 0, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_PRESCAN | BASSFlag.BASS_STREAM_DECODE);
126 | _channel = Un4seen.Bass.AddOn.Fx.BassFx.BASS_FX_TempoCreate(_channel, 0);
127 | _isopened = true;
128 |
129 | if (_channel == 0)
130 | {
131 | //throw (new FormatException(Bass.BASS_ErrorGetCode().ToString()));
132 | _isopened = false;
133 | }
134 | Bass.BASS_ChannelGetAttribute(_channel, BASSAttribute.BASS_ATTRIB_FREQ, ref _freq);
135 | }
136 |
137 | public void Dispose()
138 | {
139 | Dispose(true);
140 | _isopened = false;
141 | }
142 |
143 | private void Dispose(bool disposing)
144 | {
145 | if (disposing)
146 | {
147 | Bass.BASS_Stop();
148 | Bass.BASS_Free();
149 | }
150 | _timer.Dispose();
151 | }
152 | }
153 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Lang/en.txt:
--------------------------------------------------------------------------------
1 | Language_name=English
2 |
3 | ##Main_Menu
4 | Main_File_Menu_Text=File(&F)
5 | Main_File_Run_OSU_Text=Run OSU!
6 | Main_File_Set_OSUPath_Text=Specify OSU path manually
7 | Main_File_Import_OSU_Text=Sync with OSU database
8 | Main_File_Import_Scores_Text=Import Scores.db
9 | Main_File_Re_Import_Scores_Text=Re-import Scores.db
10 | Main_File_Open_Folder_Text=Open song folder
11 | Main_File_Open_MapFile_Text=Open beatmap file
12 | Main_File_Open_SBFile_Text=Open storyboard file
13 | Main_File_Export_MP3_Text=Export sound
14 | Main_File_Export_Background_Text=Export background
15 | Main_File_Exit_Text=Exit
16 | Main_Tool_Menu_Text=Tools(&T)
17 | Main_Tool_Search_Dulplate_Text=Scan repeated songs
18 | Main_Tool_Export_Playlist_Text=Export current playlist into HTML
19 | Main_Tool_Export_Playlist_MP3_Text=Export current playlist sound
20 | Main_Option_Menu_Text=Options(&O)
21 | Main_Option_Play_Fx_Text=Hitsound
22 | Main_Option_Play_Video_Text=Background Video
23 | Main_Option_PlayMode_Text=Play mode
24 | Main_Option_PlayMode_Normal_Text=Normally
25 | Main_Option_PlayMode_Repeat_Text=Repeatly
26 | Main_Option_PlayMode_Random_Text=Randomly
27 | Main_Option_Sync_QQ_Text=QQ Status Sync
28 | Main_Option_Select_QQ_Text=Select QQ
29 | Main_Option_Play_SB_Text=StoryBoard
30 | Main_Option_Show_Popup_Text=System tray PopUp
31 | Main_About_Text=About(&A)
32 | Main_LanguageSelect_Text=Language
33 | Main_QQ_Hint_Label_Text=Current Sync QQ:
34 |
35 | ##Main_Header
36 | Main_Music_Hint_Label_Text=Music
37 | Main_Fx_Hint_Label_Text=Fx
38 | Main_Mini_Switcher_Text=↓
39 | Main_Collections_Text=Switch Collections
40 | Main_CurrentList_Text=Current Playlist:
41 |
42 | ##Main_Control
43 | Main_Play_Text=Play
44 | Main_Pause_Text=Pause
45 | Main_Stop_Text=Stop
46 | Main_PlayNext_Text=→
47 | Main_PlayPrev_Text=←
48 | Main_Jump_OSU_Text=O
49 | Main_Volume_Hint_Label_Text=Vol
50 |
51 | ##Main_Difflist
52 | Main_PageView_Page1_Text=Info
53 | Main_ListDetail_Key_Text=Key
54 | Main_ListDetail_Value_Text=Value
55 | Main_ListDetail_Title=Title
56 | Main_ListDetail_Artist=Artist
57 | Main_ListDetail_Mapper=Mapper
58 | Main_ListDetail_Source=Source
59 | Main_ListDetail_Mode=Mode
60 | Main_ListDetail_WAVPath=WAVPath
61 | Main_ListDetail_BGPath=BGPath
62 | Main_ListDetail_VideoPath=VideoPath
63 | Main_ListDetail_FileVersion=OSUFileVersion
64 | Main_PageView_Page2_Text=Result
65 | Main_PageView_Page3_Text=Difficulty
66 | Main_PageView_Page4_Text=Special
67 | Main_Sytle_Label_Text=Presets
68 | Main_Option_Play_Fx_Box_Text=Hitsound
69 | Main_Option_Play_Video_Box_Text=Background Video
70 | Main_Option_Play_SB_Box_Text=StoryBoard
71 |
72 | ##Main_RightClick
73 | Main_PlayList_RightClick_Copy_Current_Name_Text=Copy current song name
74 | Main_PlayList_RightClick_Delete_One_Text=Delete
75 | Main_PlayList_RightClick_Export_MP3_Text=Export current MP3
76 | Main_PlayList_RightClick_Open_In_OSU_Text=Open in OSU
77 |
78 | ##Tips
79 | Core_Init_Text=Initializing...
80 | Core_Error_Osupath_Text=Auto detect osu! path fail! Please specify it manually!
81 | Core_Osupath_Tip_Text=Choose the folder which contains osu!.exe
82 | Core_Init_Finish_Text=Initialize completed. Found {0} Songs
83 | Core_Missing_Song_Text=Music file missing
84 | Core_Missing_MP3_Text=Sound file missing
85 | BG_Loss_Tip_Text=Background image missing
86 | Core_Current_Playing_Text=Playing
87 | Save_Complete=Save success!
88 | Saving=Saving Files...
89 | Comfirm_Exit_Text=Are you sure to exit?
90 |
91 | ##QQ
92 | QQ_Push_Fail_Text=QQ Sync Fail!
93 | SetQQ_GetQQ_Text=Type QQNumber
94 | SetQQ_OK_Text=OK
95 | SetQQ_MainView_Nickname_Text=Nickname
96 | SetQQ_MainView_ID_Text=ID
97 | SetQQ_ClearQQ_Text=Clear QQNumber
98 | SetQQ_NoQQ_Text=Please enter QQNumber!
99 | SetQQ_NoInput_Text=Please enter QQNumber!
100 | SetQQ_Error_Text=Detect current online QQ Failed!
101 | SetQQ_AutoQQ_Text=Auto Detect
102 |
103 | ##About
104 | About_Profile_Hint_Text=(Click for osu! userpage)
105 |
106 | ##ChooseColl
107 | Refresh_Complete_Text=Refresh Success!
108 | Current_Count_Text=Number of songs in the current playlist:
109 | ChooseColl_Hint_Label_Text=Double click your Collections
110 | ChooseColl_PlayListCurrentCount_Text=Number of songs in the current playlist:
111 |
112 | ##Update
113 | Update_Error_Text=Update profile error!
114 | Update_Normal_Text=New Version: {0} released!~\nNew feature or change:\n{1}
115 | Update_Downloading_Text=Downloading updates…
116 | Update_Backgrounddownload_Text=Updates would be download in the background.
117 | Update_Restart_Text=The program would restart to finish update.
118 |
119 | ##DelDulp
120 | DelDulp_DeleteSelected_Text=Delect selected items
121 | DelDulp_Cancel_Text=Cancel
122 | DelDulp_StartSearch_Text=Start Search
123 | DelDulp_AutoSelect_Text=Auto Select
124 | DelDulp_ClearSelected_Text=Unselect all
125 | Scan_Folder_Text=Scaning songs folder: {0}/{1}
126 | Get_Song_Info_Text=Gathering songs information: {0}/{1}
127 | Scan_Duplicate_Text=Searching repeated beatmaps: {0}/{1}
128 | Scan_Zero_Text=Repeated beatmap does not exist!
129 | Scan_Complete_Text=Scan completed. Found {0} repeated songs.
130 | Delete_All_Text={0} items are selected, Continue?
131 | Delete_Comfirm_Text=It will delete {0} songs. Continue?
132 | Delete_Complete_Text=Delected {0} repeated songs.
133 |
134 | ##TrayIcon
135 | TrayIcon_Aritst_Text=Current Aritst:
136 | TrayIcon_Title_Text=Current Title:
137 | TrayIcon_Diff_Text=Current Difficulty:
138 | TrayIcon_Play_Pause_Text=Play/Pause
139 | TrayIcon_PlayNext_Text=Play Next
140 | TrayIcon_PlayPrev_Text=Play Previous
141 | TrayIcon_Exit_Text=Exit
142 |
143 | ##General
144 | OSUplayer=OSUplayer
145 | Error_Text=Error
146 | Tip_Text=Tips
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/SetQQ.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer.Uilties
2 | {
3 | partial class SetQQ
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 | ///
10 | /// Clean up any resources being used.
11 | ///
12 | /// true if managed resources should be disposed; otherwise, false.
13 | protected override void Dispose(bool disposing)
14 | {
15 | if (disposing && (components != null))
16 | {
17 | components.Dispose();
18 | }
19 | base.Dispose(disposing);
20 | }
21 | #region Windows Form Designer generated code
22 | ///
23 | /// Required method for Designer support - do not modify
24 | /// the contents of this method with the code editor.
25 | ///
26 | private void InitializeComponent()
27 | {
28 | this.SetQQ_MainView = new System.Windows.Forms.ListView();
29 | this.SetQQ_MainView_ID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
30 | this.SetQQ_MainView_Nickname = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
31 | this.SetQQ_GetQQ = new System.Windows.Forms.Button();
32 | this.SetQQ_OK = new System.Windows.Forms.Button();
33 | this.SetQQ_Manual = new System.Windows.Forms.TextBox();
34 | this.SuspendLayout();
35 | //
36 | // SetQQ_MainView
37 | //
38 | this.SetQQ_MainView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
39 | this.SetQQ_MainView_ID,
40 | this.SetQQ_MainView_Nickname});
41 | this.SetQQ_MainView.FullRowSelect = true;
42 | this.SetQQ_MainView.GridLines = true;
43 | this.SetQQ_MainView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
44 | this.SetQQ_MainView.HideSelection = false;
45 | this.SetQQ_MainView.Location = new System.Drawing.Point(12, 12);
46 | this.SetQQ_MainView.MultiSelect = false;
47 | this.SetQQ_MainView.Name = "SetQQ_MainView";
48 | this.SetQQ_MainView.Size = new System.Drawing.Size(230, 193);
49 | this.SetQQ_MainView.TabIndex = 1;
50 | this.SetQQ_MainView.UseCompatibleStateImageBehavior = false;
51 | this.SetQQ_MainView.View = System.Windows.Forms.View.Details;
52 | //
53 | // SetQQ_MainView_ID
54 | //
55 | this.SetQQ_MainView_ID.Text = "ID";
56 | this.SetQQ_MainView_ID.Width = 100;
57 | //
58 | // SetQQ_MainView_Nickname
59 | //
60 | this.SetQQ_MainView_Nickname.Text = "昵称";
61 | this.SetQQ_MainView_Nickname.Width = 100;
62 | //
63 | // SetQQ_GetQQ
64 | //
65 | this.SetQQ_GetQQ.Location = new System.Drawing.Point(248, 52);
66 | this.SetQQ_GetQQ.Name = "SetQQ_GetQQ";
67 | this.SetQQ_GetQQ.Size = new System.Drawing.Size(97, 30);
68 | this.SetQQ_GetQQ.TabIndex = 2;
69 | this.SetQQ_GetQQ.Text = "手动获取";
70 | this.SetQQ_GetQQ.Click += new System.EventHandler(this.SetQQ_GetQQ_Click);
71 | //
72 | // SetQQ_OK
73 | //
74 | this.SetQQ_OK.Location = new System.Drawing.Point(248, 122);
75 | this.SetQQ_OK.Name = "SetQQ_OK";
76 | this.SetQQ_OK.Size = new System.Drawing.Size(97, 27);
77 | this.SetQQ_OK.TabIndex = 3;
78 | this.SetQQ_OK.Text = "确定";
79 | this.SetQQ_OK.Click += new System.EventHandler(this.SetQQ_OK_Click);
80 | //
81 | // SetQQ_Manual
82 | //
83 | this.SetQQ_Manual.Location = new System.Drawing.Point(12, 86);
84 | this.SetQQ_Manual.Name = "SetQQ_Manual";
85 | this.SetQQ_Manual.Size = new System.Drawing.Size(230, 25);
86 | this.SetQQ_Manual.TabIndex = 4;
87 | this.SetQQ_Manual.Visible = false;
88 | //
89 | // SetQQ
90 | //
91 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
92 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
93 | this.ClientSize = new System.Drawing.Size(357, 217);
94 | this.Controls.Add(this.SetQQ_Manual);
95 | this.Controls.Add(this.SetQQ_OK);
96 | this.Controls.Add(this.SetQQ_GetQQ);
97 | this.Controls.Add(this.SetQQ_MainView);
98 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
99 | this.MaximizeBox = false;
100 | this.Name = "SetQQ";
101 | //
102 | //
103 | //
104 | this.Text = "QQ";
105 | this.Load += new System.EventHandler(this.Form2_Load);
106 | this.ResumeLayout(false);
107 | this.PerformLayout();
108 |
109 | }
110 | #endregion
111 | private System.Windows.Forms.ListView SetQQ_MainView;
112 | private System.Windows.Forms.Button SetQQ_GetQQ;
113 | private System.Windows.Forms.Button SetQQ_OK;
114 | private System.Windows.Forms.ColumnHeader SetQQ_MainView_Nickname;
115 | private System.Windows.Forms.ColumnHeader SetQQ_MainView_ID;
116 | private System.Windows.Forms.TextBox SetQQ_Manual;
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Lang/german.txt:
--------------------------------------------------------------------------------
1 | Language_name=German
2 |
3 | ##Main_Menu
4 | Main_File_Menu_Text=Datei(&F)
5 | Main_File_Run_OSU_Text=Lauft OSU!
6 | Main_File_Set_OSUPath_Text=Gebt OSU Pfad manuell
7 | Main_File_Import_OSU_Text=Sync mit OSU Databank
8 | Main_File_Import_Scores_Text=Importiert Scores.db
9 | Main_File_Re_Import_Scores_Text=Re-importiert Scores.db
10 | Main_File_Open_Folder_Text=Öffnet song folder
11 | Main_File_Open_MapFile_Text=Öffnet Beatmap Datei
12 | Main_File_Open_SBFile_Text=Öffnet storyboard Datei
13 | Main_File_Export_MP3_Text=Exportiert sound
14 | Main_File_Export_Background_Text=Exportiert background
15 | Main_File_Exit_Text=Beenden
16 | Main_Tool_Menu_Text=Tools(&T)
17 | Main_Tool_Search_Dulplate_Text=Scanen repeated songs
18 | Main_Tool_Export_Playlist_Text= current playlist into HTML
19 | Main_Tool_Export_Playlist_MP3_Text=Exportiert current playlist sound
20 | Main_Option_Menu_Text=Optionen(&O)
21 | Main_Option_Play_Fx_Text=Hitsound
22 | Main_Option_Play_Video_Text=Background Video
23 | Main_Option_PlayMode_Text=Play mode
24 | Main_Option_PlayMode_Normal_Text=Normalerweise
25 | Main_Option_PlayMode_Repeat_Text=Wiederholt
26 | Main_Option_PlayMode_Random_Text=Zufällig
27 | Main_Option_Sync_QQ_Text=QQ Status Sync
28 | Main_Option_Select_QQ_Text=Auswählt QQ
29 | Main_Option_Play_SB_Text=StoryBoard
30 | Main_Option_Show_Popup_Text=System tray PopUp
31 | Main_About_Text=Über(&A)
32 | Main_LanguageSelect_Text=Sprache
33 | Main_QQ_Hint_Label_Text=Current Sync QQ:
34 |
35 | ##Main_Header
36 | Main_Music_Hint_Label_Text=Musik
37 | Main_Fx_Hint_Label_Text=Fx
38 | Main_Mini_Switcher_Text=↓
39 | Main_Collections_Text=Switch Collections
40 | Main_CurrentList_Text=Current Playlist:
41 |
42 | ##Main_Control
43 | Main_Play_Text=Spielen
44 | Main_Pause_Text=Pause
45 | Main_Stop_Text=Stopp
46 | Main_PlayNext_Text=→
47 | Main_PlayPrev_Text=←
48 | Main_Jump_OSU_Text=O
49 | Main_Volume_Hint_Label_Text=Vol
50 |
51 | ##Main_Difflist
52 | Main_PageView_Page1_Text=Info
53 | Main_ListDetail_Key_Text=Key
54 | Main_ListDetail_Value_Text=Value
55 | Main_ListDetail_Title=Nach Title
56 | Main_ListDetail_Artist=Nach Künstler
57 | Main_ListDetail_Mapper=Nach Ersteller
58 | Main_ListDetail_Source=Nach Source
59 | Main_ListDetail_Mode=Nach Modus
60 | Main_ListDetail_WAVPath=WAVPath
61 | Main_ListDetail_BGPath=BGPath
62 | Main_ListDetail_VideoPath=VideoPath
63 | Main_ListDetail_FileVersion=OSUFileVersion
64 | Main_PageView_Page2_Text=Status
65 | Main_PageView_Page3_Text=Schwierigkeit
66 | Main_PageView_Page4_Text=Besonderes
67 | Main_Sytle_Label_Text=Presets
68 | Main_Option_Play_Fx_Box_Text=Hitsound
69 | Main_Option_Play_Video_Box_Text=Background Video
70 | Main_Option_Play_SB_Box_Text=StoryBoard
71 |
72 | ##Main_RightClick
73 | Main_PlayList_RightClick_Copy_Current_Name_Text=Kopiert aktuelle song name
74 | Main_PlayList_RightClick_Delete_One_Text=Löschen
75 | Main_PlayList_RightClick_Export_MP3_Text=Exportiert aktuelle MP3
76 | Main_PlayList_RightClick_Open_In_OSU_Text=Open in OSU
77 |
78 | ##Tips
79 | Core_Init_Text=Initialisieren...
80 | Core_Error_Osupath_Text=Auto detect osu! path fail! Please specify it manually!
81 | Core_Osupath_Tip_Text=Auswählt der Ordner, die osu!.exe erhältet
82 | Core_Init_Finish_Text=INitialisieren abgeschlossen. {0} Songs gefunden
83 | Core_Missing_Song_Text=Musik Datei fehlt
84 | Core_Missing_MP3_Text=Sound Datei fehlt
85 | BG_Loss_Tip_Text=Background Datei fehlt
86 | Core_Current_Playing_Text=Spielen
87 | Save_Complete=Speichern Erfolg!
88 | Saving=Daei speichern...
89 | Comfirm_Exit_Text=Sind Sie sicher, um zu beenden?
90 |
91 | ##QQ
92 | QQ_Push_Fail_Text=QQ Sync ausfallen!
93 | SetQQ_GetQQ_Text=Type QQNumber
94 | SetQQ_OK_Text=OK
95 | SetQQ_MainView_Nickname_Text=Spitzname
96 | SetQQ_MainView_ID_Text=ID
97 | SetQQ_ClearQQ_Text=Clear QQNumber
98 | SetQQ_NoQQ_Text=Please enter QQNumber!
99 | SetQQ_NoInput_Text=Please enter QQNumber!
100 | SetQQ_Error_Text=Detect aktuelle online QQ ausfallen!
101 | SetQQ_AutoQQ_Text=Erkennen Automatische
102 |
103 | ##About
104 | About_Profile_Hint_Text=(Click for osu! userpage)
105 |
106 | ##ChooseColl
107 | Refresh_Complete_Text=Aktualisieren Success!
108 | Current_Count_Text=Anzahl der Songs in der aktuellen Playlist:
109 | ChooseColl_Hint_Label_Text=Doppelklick deine Sammlungen
110 | ChooseColl_PlayListCurrentCount_Text=Anzahl der Songs in der aktuellen Playlist:
111 |
112 | ##Update
113 | Update_Error_Text=Profil aktualisieren Fehler!
114 | Update_Normal_Text=Neue Version: {0} freigegebt!~\nNeue Funktionen oder Änderungen:\n{1}
115 | Update_Downloading_Text=Herunterladen updates...
116 | Update_Backgrounddownload_Text=Updates würde im Hintergrung heruntergeladen.
117 | Update_Restart_Text=Das Programm würde neu starten, um die Aktualisierung zu beenden.
118 |
119 | ##DelDulp
120 | DelDulp_DeleteSelected_Text=Löschen die ausgewählte Datei
121 | DelDulp_Cancel_Text=Absagen
122 | DelDulp_StartSearch_Text=Starten Suchen
123 | DelDulp_AutoSelect_Text=Auto Select
124 | DelDulp_ClearSelected_Text=Unselect all
125 | Scan_Folder_Text=Scannen songs folder: {0}/{1}
126 | Get_Song_Info_Text=Sammeln songs Information: {0}/{1}
127 | Scan_Duplicate_Text=Suchen wiederholte beatmaps: {0}/{1}
128 | Scan_Zero_Text=Wiederholte beatmap existiert nicht!
129 | Scan_Complete_Text=Scannen abgeschlossen. {0} wiederholte songs gefunden.
130 | Delete_All_Text={0} items werden ausgewählt, fortsetzen?
131 | Delete_Comfirm_Text=Löschen {0} songs. fortsetzen?
132 | Delete_Complete_Text={0} wiederholte songs löscht.
133 |
134 | ##TrayIcon
135 | TrayIcon_Aritst_Text=Aktuelle Künstler:
136 | TrayIcon_Title_Text=Aktuelle Titel:
137 | TrayIcon_Diff_Text=Aktuelle Schwierigkeit:
138 | TrayIcon_Play_Pause_Text=Play/Pause
139 | TrayIcon_PlayNext_Text=Play weiter
140 | TrayIcon_PlayPrev_Text=Play früher
141 | TrayIcon_Exit_Text=Beenden
142 |
143 | ##General
144 | OSUplayer=OSUplayer
145 | Error_Text=Fehler
146 | Tip_Text=Tipp
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/TaskBarIconMenu.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using System.Windows.Forms;
3 | using System;
4 |
5 | namespace OSUplayer.Uilties
6 | {
7 | class TaskBarIconMenu : IDisposable
8 | {
9 |
10 | public ContextMenuStrip TrayIcon_Menu;
11 | private ToolStripLabel TrayIcon_Artist;
12 | private ToolStripLabel TrayIcon_Title;
13 | private ToolStripLabel TrayIcon_Diff;
14 | private ToolStripMenuItem TrayIcon_Play;
15 | private ToolStripMenuItem TrayIcon_PlayNext;
16 | private ToolStripMenuItem TrayIcon_PlayPrev;
17 | private ToolStripMenuItem TrayIcon_Exit;
18 | public void Dispose()
19 | {
20 | if (TrayIcon_Menu != null)
21 | {
22 | TrayIcon_Menu.Dispose();
23 | TrayIcon_Menu = null;
24 | }
25 | if (TrayIcon_Artist != null)
26 | {
27 | TrayIcon_Artist.Dispose();
28 | TrayIcon_Artist = null;
29 | }
30 | if (TrayIcon_Title != null)
31 | {
32 | TrayIcon_Title.Dispose();
33 | TrayIcon_Title = null;
34 | }
35 | if (TrayIcon_Diff != null)
36 | {
37 | TrayIcon_Diff.Dispose();
38 | TrayIcon_Diff = null;
39 | }
40 | if (TrayIcon_Play != null)
41 | {
42 | TrayIcon_Play.Dispose();
43 | TrayIcon_Play = null;
44 | }
45 | if (TrayIcon_PlayNext != null)
46 | {
47 | TrayIcon_PlayNext.Dispose();
48 | TrayIcon_PlayNext = null;
49 | }
50 | if (TrayIcon_Exit != null)
51 | {
52 | TrayIcon_Exit.Dispose();
53 | TrayIcon_Exit = null;
54 | }
55 | }
56 | public TaskBarIconMenu()
57 | {
58 | TrayIcon_Menu = new ContextMenuStrip();
59 | TrayIcon_Artist = new ToolStripLabel();
60 | TrayIcon_Title = new ToolStripLabel();
61 | TrayIcon_Diff = new ToolStripLabel();
62 | TrayIcon_Play = new ToolStripMenuItem();
63 | TrayIcon_PlayNext = new ToolStripMenuItem();
64 | TrayIcon_PlayPrev = new ToolStripMenuItem();
65 | TrayIcon_Exit = new ToolStripMenuItem();
66 | TrayIcon_Menu.SuspendLayout();
67 |
68 | TrayIcon_Menu.Items.AddRange(new ToolStripItem[] {
69 | TrayIcon_Artist,
70 | TrayIcon_Title,
71 | TrayIcon_Diff,
72 | TrayIcon_Play,
73 | TrayIcon_PlayNext,
74 | TrayIcon_PlayPrev,
75 | TrayIcon_Exit});
76 | TrayIcon_Menu.Name = "TrayIcon_Menu";
77 | TrayIcon_Menu.Size = new Size(176, 176);
78 | // TrayIcon_Artist
79 | TrayIcon_Artist.Name = "TrayIcon_Artist";
80 | TrayIcon_Artist.Text = LanguageManager.Get("TrayIcon_Aritst_Text");
81 | TrayIcon_Artist.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Bold, GraphicsUnit.Point, 134);
82 | // TrayIcon_Title
83 | TrayIcon_Title.Name = "TrayIcon_Title";
84 | TrayIcon_Title.Text = LanguageManager.Get("TrayIcon_Title_Text");
85 | TrayIcon_Title.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Bold, GraphicsUnit.Point, 134);
86 | // TrayIcon_Diff
87 | TrayIcon_Diff.Name = "TrayIcon_Diff";
88 | TrayIcon_Diff.Text = LanguageManager.Get("TrayIcon_Diff_Text");
89 | TrayIcon_Diff.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Bold, GraphicsUnit.Point, 134);
90 | // TrayIcon_Play
91 | TrayIcon_Play.Name = "TrayIcon_Play";
92 | TrayIcon_Play.Text = LanguageManager.Get("TrayIcon_Play_Pause_Text");
93 | TrayIcon_Play.Click += delegate { SendKeys.Send("%{F5}"); };
94 | // TrayIcon_PlayNext
95 | TrayIcon_PlayNext.Name = "TrayIcon_PlayNext";
96 | TrayIcon_PlayNext.Text = LanguageManager.Get("TrayIcon_PlayNext_Text");
97 | TrayIcon_PlayNext.Click += delegate { SendKeys.Send("%{RIGHT}"); };
98 | // TrayIcon_PlayNext
99 | TrayIcon_PlayPrev.Name = "TrayIcon_PlayPrev";
100 | TrayIcon_PlayPrev.Text = LanguageManager.Get("TrayIcon_PlayPrev_Text");
101 | TrayIcon_PlayPrev.Click += delegate { SendKeys.Send("%{LEFT}"); };
102 | // TrayIcon_Exit
103 | TrayIcon_Exit.Name = "TrayIcon_Exit";
104 | TrayIcon_Exit.Text = LanguageManager.Get("TrayIcon_Exit_Text");
105 | TrayIcon_Exit.Click += delegate
106 | {
107 | if (
108 | MessageBox.Show(LanguageManager.Get("Comfirm_Exit_Text"), LanguageManager.Get("Tip_Text"),
109 | MessageBoxButtons.YesNo) != DialogResult.Yes) return;
110 | Core.MainIsVisible = false;
111 | Core.Exit();
112 | Environment.Exit(0);
113 | };
114 | TrayIcon_Menu.ResumeLayout(false);
115 | }
116 | public void RefreashMenu()
117 | {
118 | if (Core.CurrentBeatmap == null) return;
119 | TrayIcon_Artist.Text = LanguageManager.Get("TrayIcon_Aritst_Text") + Core.CurrentBeatmap.Artist;
120 | TrayIcon_Title.Text = LanguageManager.Get("TrayIcon_Title_Text") + Core.CurrentBeatmap.Title;
121 | TrayIcon_Diff.Text = LanguageManager.Get("TrayIcon_Diff_Text") + Core.CurrentBeatmap.Version;
122 | TrayIcon_Play.Text = LanguageManager.Get("TrayIcon_Play_Pause_Text");
123 | TrayIcon_PlayNext.Text = LanguageManager.Get("TrayIcon_PlayNext_Text");
124 | TrayIcon_PlayPrev.Text = LanguageManager.Get("TrayIcon_PlayPrev_Text");
125 | TrayIcon_Exit.Text = LanguageManager.Get("TrayIcon_Exit_Text");
126 | }
127 | }
128 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/ImageButton.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | text/microsoft-resx
99 |
100 |
101 | 2.0
102 |
103 |
104 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
105 |
106 |
107 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
108 |
109 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/SetQQ.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/Win32.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Drawing;
5 | using System.Runtime.InteropServices;
6 | using System.Windows.Forms;
7 | // ReSharper disable All
8 | namespace OSUplayer.Uilties
9 | {
10 | [Flags]
11 | public enum KeyModifiers
12 | {
13 | None = 0,
14 | Alt = 1,
15 | Control = 2,
16 | Shift = 4,
17 | Windows = 8
18 | }
19 | public delegate void HotkeyEventHandler(int hotKeyID);
20 | static class Win32
21 | {
22 | #region 删除API
23 | private const int FO_DELETE = 0x3;
24 | private const ushort FOF_ALLOWUNDO = 0x40;
25 | private const ushort FOF_WANTNUKEWARNING = 0x4000;
26 | [DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
27 | private static extern int SHFileOperation([In, Out] Shfileopstruct str);
28 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
29 | private class Shfileopstruct
30 | {
31 | public IntPtr hwnd;
32 | public UInt32 wFunc;
33 | public string pFrom;
34 | public string pTo;
35 | public UInt16 fFlags;
36 | public Int32 fAnyOperationsAborted;
37 | public IntPtr hNameMappings;
38 | public string lpszProgressTitle;
39 | }
40 | public static int Delete(List path)
41 | {
42 | var pm = new Shfileopstruct {wFunc = FO_DELETE, pFrom = path[0]};
43 | for (var i = 1; i < path.Count; i++)
44 | {
45 | pm.pFrom += '\0' + path[i];
46 | }
47 | pm.pFrom += '\0';
48 | pm.pTo = null;
49 | pm.fFlags = FOF_ALLOWUNDO | FOF_WANTNUKEWARNING;
50 | return SHFileOperation(pm);
51 | }
52 | #endregion
53 | #region 热键API
54 | [DllImport("user32.dll")]
55 | public static extern UInt32 RegisterHotKey(IntPtr hWnd, UInt32 id, UInt32 fsModifiers, UInt32 vk);
56 | [DllImport("user32.dll")]
57 | public static extern UInt32 UnregisterHotKey(IntPtr hWnd, UInt32 id);
58 | [DllImport("kernel32.dll")]
59 | public static extern UInt32 GlobalAddAtom(String lpString);
60 | [DllImport("kernel32.dll")]
61 | public static extern UInt32 GlobalDeleteAtom(UInt32 nAtom);
62 | #endregion
63 | #region 窗体API
64 | [DllImport("gdi32.dll")]
65 | private static extern int CreateRoundRectRgn(int x1, int y1, int x2, int y2, int x3, int y3);
66 | [DllImport("user32.dll")]
67 | private static extern int SetWindowRgn(IntPtr hwnd, int hRgn, Boolean bRedraw);
68 | [DllImport("gdi32.dll", EntryPoint = "DeleteObject", CharSet = CharSet.Ansi)]
69 | private static extern int DeleteObject(int hObject);
70 | [DllImport("user32.dll", CharSet = CharSet.Unicode)]
71 | private static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, string lParam);
72 | [DllImport("user32.dll", CharSet = CharSet.Unicode)]
73 | private static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
74 | [DllImport("user32.dll")]
75 | private static extern bool ReleaseCapture();
76 | // ReSharper disable InconsistentNaming
77 | private const int WM_NCLBUTTONDOWN = 0x00A1;
78 | private const int HTCAPTION = 2;
79 | private const uint EM_SETCUEBANNER = 0x1501;
80 | // ReSharper restore InconsistentNaming
81 | [DllImport("User32.dll")]
82 | public static extern bool PtInRect(ref Rectangle r, Point p);
83 | ///
84 | /// 设置窗体的圆角矩形
85 | ///
86 | /// 需要设置的窗体
87 | /// 圆角矩形的半径
88 | public static void SetFormRoundRectRgn(Form form, int rgnRadius)
89 | {
90 | var hRgn = 0;
91 | hRgn = CreateRoundRectRgn(0, 0, form.Width + 1, form.Height + 1, rgnRadius, rgnRadius);
92 | SetWindowRgn(form.Handle, hRgn, true);
93 | DeleteObject(hRgn);
94 | }
95 | public static void MoveWindow(Form form)
96 | {
97 | ReleaseCapture();
98 | SendMessage(form.Handle, WM_NCLBUTTONDOWN, (IntPtr)HTCAPTION, IntPtr.Zero);
99 | }
100 |
101 | public static void UpdateTextBoxHint(TextBox box,string text)
102 | {
103 | SendMessage(box.Handle, EM_SETCUEBANNER, (IntPtr)1, text);
104 | }
105 | #endregion
106 | }
107 | public class HotkeyHelper : IMessageFilter
108 | {
109 |
110 | private Hashtable keyIDs = new Hashtable();
111 | private IntPtr hWnd;
112 | public event HotkeyEventHandler OnHotkey;
113 |
114 | public HotkeyHelper(IntPtr hWnd)
115 | {
116 | this.hWnd = hWnd;
117 | Application.AddMessageFilter(this);
118 | }
119 | public int RegisterHotkey(Keys key, KeyModifiers keyflags)
120 | {
121 | UInt32 hotkeyid = Win32.GlobalAddAtom(Guid.NewGuid().ToString());
122 | Win32.RegisterHotKey((IntPtr)hWnd, hotkeyid, (UInt32)keyflags, (UInt32)key);
123 | keyIDs.Add(hotkeyid, hotkeyid);
124 | return (int)hotkeyid;
125 | }
126 | public void UnregisterHotkeys()
127 | {
128 | //Application.RemoveMessageFilter(this);
129 | foreach (UInt32 key in keyIDs.Values)
130 | {
131 | Win32.UnregisterHotKey(hWnd, key);
132 | Win32.GlobalDeleteAtom(key);
133 | }
134 | keyIDs.Clear();
135 | OnHotkey = null;
136 | }
137 | public bool PreFilterMessage(ref Message m)
138 | {
139 | if (m.Msg != 0x312) return false;
140 | if (OnHotkey == null) return false;
141 | foreach (UInt32 key in keyIDs.Values)
142 | {
143 | if ((UInt32) m.WParam != key) continue;
144 | OnHotkey((int)m.WParam);
145 | return true;
146 | }
147 | return false;
148 | }
149 | }
150 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/About.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer.Uilties
2 | {
3 | partial class About
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 | ///
10 | /// Clean up any resources being used.
11 | ///
12 | /// true if managed resources should be disposed; otherwise, false.
13 | protected override void Dispose(bool disposing)
14 | {
15 | if (disposing && (components != null))
16 | {
17 | components.Dispose();
18 | }
19 | base.Dispose(disposing);
20 | }
21 | #region Windows Form Designer generated code
22 | ///
23 | /// Required method for Designer support - do not modify
24 | /// the contents of this method with the code editor.
25 | ///
26 | private void InitializeComponent()
27 | {
28 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About));
29 | this.About_Program_Link = new System.Windows.Forms.LinkLabel();
30 | this.About_Profile_Hint = new System.Windows.Forms.Label();
31 | this.About_PictureBox = new System.Windows.Forms.PictureBox();
32 | this.About_Content = new System.Windows.Forms.Label();
33 | ((System.ComponentModel.ISupportInitialize)(this.About_PictureBox)).BeginInit();
34 | this.SuspendLayout();
35 | //
36 | // About_Program_Link
37 | //
38 | this.About_Program_Link.AutoSize = true;
39 | this.About_Program_Link.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
40 | this.About_Program_Link.Location = new System.Drawing.Point(219, 224);
41 | this.About_Program_Link.Name = "About_Program_Link";
42 | this.About_Program_Link.Size = new System.Drawing.Size(300, 20);
43 | this.About_Program_Link.TabIndex = 1;
44 | this.About_Program_Link.TabStop = true;
45 | this.About_Program_Link.Text = "https://github.com/Troogle/OSUplayer/";
46 | this.About_Program_Link.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.About_Program_Link_LinkClicked);
47 | //
48 | // About_Profile_Hint
49 | //
50 | this.About_Profile_Hint.AutoSize = true;
51 | this.About_Profile_Hint.BackColor = System.Drawing.Color.Transparent;
52 | this.About_Profile_Hint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
53 | this.About_Profile_Hint.Location = new System.Drawing.Point(20, 209);
54 | this.About_Profile_Hint.Name = "About_Profile_Hint";
55 | this.About_Profile_Hint.Size = new System.Drawing.Size(185, 20);
56 | this.About_Profile_Hint.TabIndex = 2;
57 | this.About_Profile_Hint.Text = "(Click for osu! userpage)";
58 | //
59 | // About_PictureBox
60 | //
61 | this.About_PictureBox.Image = ((System.Drawing.Image)(resources.GetObject("About_PictureBox.Image")));
62 | this.About_PictureBox.InitialImage = ((System.Drawing.Image)(resources.GetObject("About_PictureBox.InitialImage")));
63 | this.About_PictureBox.Location = new System.Drawing.Point(12, 12);
64 | this.About_PictureBox.Name = "About_PictureBox";
65 | this.About_PictureBox.Size = new System.Drawing.Size(200, 200);
66 | this.About_PictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
67 | this.About_PictureBox.TabIndex = 0;
68 | this.About_PictureBox.TabStop = false;
69 | this.About_PictureBox.Click += new System.EventHandler(this.About_PictureBox_Click);
70 | //
71 | // About_Content
72 | //
73 | this.About_Content.Font = new System.Drawing.Font("微软雅黑", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
74 | this.About_Content.Location = new System.Drawing.Point(216, 4);
75 | this.About_Content.Name = "About_Content";
76 | this.About_Content.Size = new System.Drawing.Size(300, 208);
77 | this.About_Content.TabIndex = 3;
78 | this.About_Content.Text = "OSU Player Ver {0}\r\nDeveloped By Troogle\r\n\r\nThanks for bugs fixing and developing" +
79 | ":\r\nchrisyan,JiXun,Renge Miyauchi\r\n\r\nSpecial Thanks:\r\nWeiren,Muscipular\r\n\r\nThx fo" +
80 | "r using~";
81 | //
82 | // About
83 | //
84 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
85 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
86 | this.BackColor = System.Drawing.SystemColors.ButtonFace;
87 | this.ClientSize = new System.Drawing.Size(528, 253);
88 | this.Controls.Add(this.About_Content);
89 | this.Controls.Add(this.About_Profile_Hint);
90 | this.Controls.Add(this.About_Program_Link);
91 | this.Controls.Add(this.About_PictureBox);
92 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
93 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
94 | this.MaximizeBox = false;
95 | this.MinimizeBox = false;
96 | this.Name = "About";
97 | this.Text = "About";
98 | this.Load += new System.EventHandler(this.About_Load);
99 | ((System.ComponentModel.ISupportInitialize)(this.About_PictureBox)).EndInit();
100 | this.ResumeLayout(false);
101 | this.PerformLayout();
102 |
103 | }
104 | #endregion
105 | private System.Windows.Forms.PictureBox About_PictureBox;
106 | private System.Windows.Forms.LinkLabel About_Program_Link;
107 | private System.Windows.Forms.Label About_Profile_Hint;
108 | private System.Windows.Forms.Label About_Content;
109 | }
110 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.34014
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace OSUplayer.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
29 | public string QQuin {
30 | get {
31 | return ((string)(this["QQuin"]));
32 | }
33 | set {
34 | this["QQuin"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("3")]
41 | public int NextMode {
42 | get {
43 | return ((int)(this["NextMode"]));
44 | }
45 | set {
46 | this["NextMode"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
53 | public bool PlayFx {
54 | get {
55 | return ((bool)(this["PlayFx"]));
56 | }
57 | set {
58 | this["PlayFx"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
65 | public bool PlayVideo {
66 | get {
67 | return ((bool)(this["PlayVideo"]));
68 | }
69 | set {
70 | this["PlayVideo"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
77 | public bool PlaySB {
78 | get {
79 | return ((bool)(this["PlaySB"]));
80 | }
81 | set {
82 | this["PlaySB"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
89 | public bool SyncQQ {
90 | get {
91 | return ((bool)(this["SyncQQ"]));
92 | }
93 | set {
94 | this["SyncQQ"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("80")]
101 | public int Allvolume {
102 | get {
103 | return ((int)(this["Allvolume"]));
104 | }
105 | set {
106 | this["Allvolume"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("80")]
113 | public int Musicvolume {
114 | get {
115 | return ((int)(this["Musicvolume"]));
116 | }
117 | set {
118 | this["Musicvolume"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("60")]
125 | public int Fxvolume {
126 | get {
127 | return ((int)(this["Fxvolume"]));
128 | }
129 | set {
130 | this["Fxvolume"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
137 | public bool Upgraded {
138 | get {
139 | return ((bool)(this["Upgraded"]));
140 | }
141 | set {
142 | this["Upgraded"] = value;
143 | }
144 | }
145 |
146 | [global::System.Configuration.UserScopedSettingAttribute()]
147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
148 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
149 | public bool ShowPopup {
150 | get {
151 | return ((bool)(this["ShowPopup"]));
152 | }
153 | set {
154 | this["ShowPopup"] = value;
155 | }
156 | }
157 |
158 | [global::System.Configuration.UserScopedSettingAttribute()]
159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
160 | [global::System.Configuration.DefaultSettingValueAttribute("")]
161 | public string OSUpath {
162 | get {
163 | return ((string)(this["OSUpath"]));
164 | }
165 | set {
166 | this["OSUpath"] = value;
167 | }
168 | }
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/ChooseColl.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace OSUplayer.Uilties
2 | {
3 | partial class ChooseColl
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 | ///
10 | /// Clean up any resources being used.
11 | ///
12 | /// true if managed resources should be disposed; otherwise, false.
13 | protected override void Dispose(bool disposing)
14 | {
15 | if (disposing && (components != null))
16 | {
17 | components.Dispose();
18 | }
19 | base.Dispose(disposing);
20 | }
21 | #region Windows Form Designer generated code
22 | ///
23 | /// Required method for Designer support - do not modify
24 | /// the contents of this method with the code editor.
25 | ///
26 | private void InitializeComponent()
27 | {
28 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChooseColl));
29 | this.ChooseColl_CollectionTitle_List = new System.Windows.Forms.ListBox();
30 | this.ChooseColl_CollectionContent_List = new System.Windows.Forms.ListBox();
31 | this.ChooseColl_Hint_Label = new System.Windows.Forms.Label();
32 | this.ChooseColl_PlayListCurrentCount = new System.Windows.Forms.Label();
33 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
34 | this.tableLayoutPanel1.SuspendLayout();
35 | this.SuspendLayout();
36 | //
37 | // ChooseColl_CollectionTitle_List
38 | //
39 | this.ChooseColl_CollectionTitle_List.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)));
41 | this.ChooseColl_CollectionTitle_List.FormattingEnabled = true;
42 | this.ChooseColl_CollectionTitle_List.ItemHeight = 15;
43 | this.ChooseColl_CollectionTitle_List.Location = new System.Drawing.Point(12, 36);
44 | this.ChooseColl_CollectionTitle_List.Name = "ChooseColl_CollectionTitle_List";
45 | this.ChooseColl_CollectionTitle_List.Size = new System.Drawing.Size(130, 259);
46 | this.ChooseColl_CollectionTitle_List.TabIndex = 0;
47 | this.ChooseColl_CollectionTitle_List.SelectedIndexChanged += new System.EventHandler(this.ChooseColl_CollectionTitle_List_SelectedIndexChanged);
48 | this.ChooseColl_CollectionTitle_List.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.ChooseColl_CollectionTitle_List_MouseDoubleClick);
49 | //
50 | // ChooseColl_CollectionContent_List
51 | //
52 | this.ChooseColl_CollectionContent_List.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
53 | | System.Windows.Forms.AnchorStyles.Left)
54 | | System.Windows.Forms.AnchorStyles.Right)));
55 | this.ChooseColl_CollectionContent_List.FormattingEnabled = true;
56 | this.ChooseColl_CollectionContent_List.ItemHeight = 15;
57 | this.ChooseColl_CollectionContent_List.Location = new System.Drawing.Point(148, 36);
58 | this.ChooseColl_CollectionContent_List.Name = "ChooseColl_CollectionContent_List";
59 | this.ChooseColl_CollectionContent_List.Size = new System.Drawing.Size(326, 259);
60 | this.ChooseColl_CollectionContent_List.TabIndex = 1;
61 | //
62 | // ChooseColl_Hint_Label
63 | //
64 | this.ChooseColl_Hint_Label.AutoSize = true;
65 | this.ChooseColl_Hint_Label.Location = new System.Drawing.Point(3, 0);
66 | this.ChooseColl_Hint_Label.Name = "ChooseColl_Hint_Label";
67 | this.ChooseColl_Hint_Label.Size = new System.Drawing.Size(177, 15);
68 | this.ChooseColl_Hint_Label.TabIndex = 0;
69 | this.ChooseColl_Hint_Label.Text = "双击Collection名称切换";
70 | //
71 | // ChooseColl_PlayListCurrentCount
72 | //
73 | this.ChooseColl_PlayListCurrentCount.AutoSize = true;
74 | this.ChooseColl_PlayListCurrentCount.Location = new System.Drawing.Point(186, 0);
75 | this.ChooseColl_PlayListCurrentCount.Name = "ChooseColl_PlayListCurrentCount";
76 | this.ChooseColl_PlayListCurrentCount.Size = new System.Drawing.Size(157, 15);
77 | this.ChooseColl_PlayListCurrentCount.TabIndex = 4;
78 | this.ChooseColl_PlayListCurrentCount.Text = "当前播放列表曲目数:";
79 | //
80 | // tableLayoutPanel1
81 | //
82 | this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
83 | | System.Windows.Forms.AnchorStyles.Right)));
84 | this.tableLayoutPanel1.AutoSize = true;
85 | this.tableLayoutPanel1.ColumnCount = 2;
86 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
87 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
88 | this.tableLayoutPanel1.Controls.Add(this.ChooseColl_Hint_Label, 0, 0);
89 | this.tableLayoutPanel1.Controls.Add(this.ChooseColl_PlayListCurrentCount, 1, 0);
90 | this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12);
91 | this.tableLayoutPanel1.Name = "tableLayoutPanel1";
92 | this.tableLayoutPanel1.RowCount = 1;
93 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
94 | this.tableLayoutPanel1.Size = new System.Drawing.Size(455, 18);
95 | this.tableLayoutPanel1.TabIndex = 5;
96 | //
97 | // ChooseColl
98 | //
99 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
100 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
101 | this.ClientSize = new System.Drawing.Size(479, 301);
102 | this.Controls.Add(this.tableLayoutPanel1);
103 | this.Controls.Add(this.ChooseColl_CollectionContent_List);
104 | this.Controls.Add(this.ChooseColl_CollectionTitle_List);
105 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
106 | this.Name = "ChooseColl";
107 | this.Text = "ChooseColl";
108 | this.Load += new System.EventHandler(this.ChooseColl_Load);
109 | this.tableLayoutPanel1.ResumeLayout(false);
110 | this.tableLayoutPanel1.PerformLayout();
111 | this.ResumeLayout(false);
112 | this.PerformLayout();
113 |
114 | }
115 | #endregion
116 | private System.Windows.Forms.ListBox ChooseColl_CollectionTitle_List;
117 | private System.Windows.Forms.ListBox ChooseColl_CollectionContent_List;
118 | private System.Windows.Forms.Label ChooseColl_Hint_Label;
119 | private System.Windows.Forms.Label ChooseColl_PlayListCurrentCount;
120 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
121 | }
122 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Graphic/TSpriteAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace OSUplayer.Graphic
5 | {
6 | ///
7 | /// 精灵动作
8 | ///
9 | internal class TSpriteAction
10 | {
11 | private readonly List _actionList;
12 | private readonly bool _isKeepValue; //非循环动作在结束后是否保持值
13 | private float _k,_a, _b;
14 | private int _currentIndex;
15 | private int _easing; //计算类型
16 | public bool IsActive; //是否是首项
17 | private bool _isLoop; //动作是否循环
18 | private bool _isOver; //动作是否执行完
19 |
20 | #region 访问器
21 |
22 | ///
23 | /// 获取动作的值
24 | ///
25 | public float CurrentValue { get; private set; }
26 |
27 | ///
28 | /// 获取该动作是否可用(即动作结点数量大于等于1)
29 | ///
30 | public bool Enable { get; private set; }
31 |
32 | #endregion
33 |
34 | ///
35 | /// 创建一个精灵动作实例
36 | ///
37 | /// 动作列表
38 | /// 是否循环
39 | /// 动作结束后是否保持值
40 | public TSpriteAction(List pActionList, bool pIsLoop = false, bool pIsKeepValue = true)
41 | {
42 | if (pActionList.Count == 0)
43 | {
44 | Enable = false;
45 | IsActive = false;
46 | }
47 | else
48 | {
49 | _actionList = pActionList;
50 | _actionList.Sort();
51 | _isLoop = pIsLoop;
52 | _isKeepValue = pIsKeepValue;
53 | IsActive = false;
54 | Reset();
55 | }
56 | }
57 |
58 |
59 | ///
60 | /// 创建一个空白精灵动作实例
61 | ///
62 | public TSpriteAction()
63 | {
64 | //this.actionList = new TActionNode[0];
65 | _isLoop = false;
66 | _isKeepValue = false;
67 | _currentIndex = 0;
68 | CurrentValue = 0;
69 | _k = 0;
70 | _b = 0;
71 | Enable = false;
72 | _isOver = true;
73 | }
74 |
75 |
76 | ///
77 | /// 更新动作的值
78 | ///
79 | public void Update(int currentTime)
80 | {
81 | if (_isOver) return;
82 | if (_actionList.Count == 1)
83 | {
84 | if (currentTime < _actionList[0].Time) return;
85 | CurrentValue = _actionList[0].Value;
86 | _isOver = true;
87 | IsActive = true;
88 | Enable = false;
89 | }
90 | else
91 | {
92 | if (!IsActive)
93 | {
94 | if (currentTime >= _actionList[0].Time)
95 | {
96 | _a = _actionList[1].Value - _actionList[0].Value;
97 | _b = _actionList[1].Time - _actionList[0].Time;
98 | _k = _a/_b;
99 | _easing = _actionList[0].Easing;
100 | CurrentValue = _actionList[0].Value;
101 | IsActive = true;
102 | }
103 | }
104 | else
105 | {
106 | //根据结点设置k和b
107 | if (currentTime >= _actionList[_currentIndex + 1].Time)
108 | {
109 | // while //跳帧
110 | // (this.currentIndex < this.actionList.Count - 2//不是最后一个
111 | // && CurrentTime >= actionList[currentIndex + 1].Time)//到了下一个节点,更新abk
112 | // {
113 |
114 | // }
115 | if (_currentIndex < _actionList.Count - 2)
116 | {
117 | _currentIndex++;
118 | _a = _actionList[_currentIndex + 1].Value - _actionList[_currentIndex].Value;
119 | _b = _actionList[_currentIndex + 1].Time - _actionList[_currentIndex].Time;
120 | _k = _a/_b;
121 | _easing = _actionList[_currentIndex].Easing;
122 | CurrentValue = _actionList[_currentIndex].Value;
123 | }
124 | else
125 | {
126 | _isOver = true;
127 | if (_isKeepValue)
128 | {
129 | CurrentValue = _actionList[_actionList.Count - 1].Value;
130 | return;
131 | }
132 | Enable = false;
133 | CurrentValue = 0;
134 | return;
135 | }
136 | }
137 | /* if (this.easing == 3)
138 | {
139 | if (!isActive)
140 | {
141 | this.currentValue = this.actionList[currentIndex].Value;
142 | this.isActive = true;
143 | return;
144 | }
145 | this.currentValue = (int)this.currentValue | (int)this.actionList[this.currentIndex].Value;
146 | if (CurrentTime >= actionList[currentIndex].ETime)
147 | {
148 | this.currentValue = (int)this.currentValue & (~(int)this.actionList[this.currentIndex].SValue);
149 | if (this.currentIndex < this.actionList.Count - 1)
150 | {
151 | currentIndex++;
152 | this.currentValue = (int)this.currentValue | (int)this.actionList[this.currentIndex].SValue;
153 | }
154 | else
155 | {
156 | this.isOver = true;
157 | this.currentValue = 0;
158 | }
159 | }
160 | return;
161 | }*/
162 |
163 | //根据k和b算出值
164 | int elapsedTime = currentTime - _actionList[_currentIndex].Time;
165 | switch (_easing)
166 | {
167 | case 0:
168 | CurrentValue = _k*elapsedTime + _actionList[_currentIndex].Value;
169 | break;
170 | case 1:
171 | CurrentValue = (float) Math.Sqrt(_b*_b - _k*_k*(elapsedTime - _a)*(elapsedTime - _a))
172 | + _actionList[_currentIndex].Value;
173 | break;
174 | case 2:
175 | CurrentValue = _b - (float) Math.Sqrt(_b*_b - _k*_k*elapsedTime*elapsedTime)
176 | + _actionList[_currentIndex].Value;
177 | break;
178 | case 4: //endtime之后
179 | CurrentValue = _actionList[_currentIndex].Value;
180 | break; //currentvalue不变
181 | }
182 | }
183 | }
184 | }
185 |
186 |
187 | ///
188 | /// 设置某一结点的值
189 | ///
190 | /// 结点索引
191 | /// 欲设置的值
192 | public void SetValue(int pIndex, float pValue)
193 | {
194 | _actionList[pIndex].Value = pValue;
195 | }
196 |
197 |
198 | ///
199 | /// 设置某一结点的时间
200 | ///
201 | /// 结点索引
202 | /// 欲设置的时间
203 | public void SetTime(int pIndex, int pTime)
204 | {
205 | _actionList[pIndex].Time = pTime;
206 | }
207 |
208 |
209 | ///
210 | /// 重新开始动作
211 | ///
212 | private void Reset()
213 | {
214 | _currentIndex = 0;
215 | CurrentValue = 0;
216 | _k = 0;
217 | _b = 0;
218 | Enable = true;
219 | _isOver = false;
220 | _easing = 0;
221 | }
222 | }
223 |
224 |
225 | ///
226 | /// 动作结点
227 | ///
228 | public class TActionNode : IComparable
229 | {
230 | private int _time;
231 |
232 | #region 访问器
233 |
234 | public TActionNode(int pTime, float pValue, int pEasing)
235 | {
236 | _time = pTime;
237 | Value = pValue;
238 | Easing = pEasing;
239 | }
240 |
241 | ///
242 | /// 获取或设置结点的时间
243 | ///
244 | public int Time
245 | {
246 | set { _time = value; }
247 | get { return _time; }
248 | }
249 |
250 | ///
251 | /// 获取或设置结点的动作值
252 | ///
253 | public float Value { get; set; }
254 |
255 | ///
256 | /// 获取或设置结点的缓冲值
257 | ///
258 | public int Easing { get; private set; }
259 |
260 | #endregion
261 |
262 | public int CompareTo(TActionNode other)
263 | {
264 | return _time.CompareTo(other._time);
265 | }
266 | }
267 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Mini.cs:
--------------------------------------------------------------------------------
1 | using OSUplayer.Properties;
2 | using OSUplayer.Uilties;
3 | using System;
4 | using System.Drawing;
5 | using System.Windows.Forms;
6 | namespace OSUplayer
7 | {
8 | public partial class Mini : Form
9 | {
10 | public Mini()
11 | {
12 | InitializeComponent();
13 |
14 | }
15 | private bool Front;
16 | private bool seeking = false;
17 | #region 有关窗体的设置
18 | protected override void OnMouseDown(MouseEventArgs e)
19 | {
20 | base.OnMouseDown(e);
21 | if (e.Button == MouseButtons.Left)
22 | {
23 | Win32.MoveWindow(this);
24 | }
25 | }
26 | protected override void OnMouseEnter(EventArgs e)
27 | {
28 | base.OnMouseEnter(e);
29 | Opacity = 1d;
30 | }
31 | protected override void OnMouseLeave(EventArgs e)
32 | {
33 | base.OnMouseLeave(e);
34 | if (Bounds.Contains(Cursor.Position)) { return; }
35 | Opacity = 0.5d;
36 | }
37 | #endregion
38 | private void imageButton4_Click(object sender, EventArgs e)
39 | {
40 | hotkeyHelper.UnregisterHotkeys();
41 | Dispose();
42 | }
43 |
44 | private void Mini_Load(object sender, EventArgs e)
45 | {
46 | Front = false;
47 | Win32.SetFormRoundRectRgn(this, 12);
48 | Mini_Volume_TrackBar.Value = (int)(100 * Settings.Default.Allvolume);
49 | if (!Bounds.Contains(Cursor.Position)) { Opacity = 0.5d; }
50 | if (Core.Isplaying)
51 | {
52 | Mini_Seek_TrackBar.MaxValue = (int)Core.Durnation * 1000;
53 | Mini_Seek_TrackBar.Enabled = true;
54 | Artist = Core.CurrentBeatmap.Artist;
55 | Title = Core.CurrentBeatmap.Title;
56 | Mini_UpdateTimer.Enabled = true;
57 | SetPlay(false);
58 | Mini_Stop.Enabled = true;
59 | }
60 | }
61 |
62 | private void imageButton2_Click(object sender, EventArgs e)
63 | {
64 | Stop();
65 | }
66 |
67 | private void imageButton1_Click(object sender, EventArgs e)
68 | {
69 | if (!Mini_Stop.Enabled) { Play(); Core.SetHistory(init:true); }
70 | else
71 | {
72 | if (!Core.Isplaying)
73 | {
74 | Resume();
75 | }
76 | else
77 | {
78 | Pause();
79 | }
80 | }
81 | }
82 |
83 | private void imageButton3_Click(object sender, EventArgs e)
84 | {
85 | Stop();
86 | PlayNext();
87 | }
88 |
89 | private void imageButton5_Click(object sender, EventArgs e)
90 | {
91 | if (Front)
92 | {
93 | Front = false;
94 | TopMost = false;
95 | Mini_Pin.BackgroundImage = Resources.Pin;
96 | Mini_Pin.BaseImage = Resources.Pin;
97 | Mini_Pin.ClickImage = Resources.Pined;
98 | Mini_Pin.EnterImage = Resources.PinE;
99 | }
100 | else
101 | {
102 | Front = true;
103 | TopMost = true;
104 | Mini_Pin.BackgroundImage = Resources.Pined;
105 | Mini_Pin.BaseImage = Resources.Pined;
106 | Mini_Pin.ClickImage = Resources.Pin;
107 | Mini_Pin.EnterImage = Resources.Pined;
108 | }
109 | }
110 | private void SetPlay(bool play)
111 | {
112 | if (play)
113 | {
114 | Mini_Play.BackgroundImage = Resources.play;
115 | Mini_Play.BaseImage = Resources.play;
116 | Mini_Play.ClickImage = Resources.PlayC;
117 | Mini_Play.EnterImage = Resources.PlayE;
118 | }
119 | else
120 | {
121 | Mini_Play.BackgroundImage = Resources.Pause;
122 | Mini_Play.BaseImage = Resources.Pause;
123 | Mini_Play.ClickImage = Resources.PauseC;
124 | Mini_Play.EnterImage = Resources.PauseE;
125 | }
126 | }
127 | private void Stop()
128 | {
129 | Mini_UpdateTimer.Enabled = false;
130 | Core.Stop();
131 | Mini_Seek_TrackBar.Enabled = false;
132 | Mini_Seek_TrackBar.Value = 0;
133 | Mini_Stop.Enabled = false;
134 | SetPlay(true);
135 | Artist = "";
136 | Title = "";
137 | }
138 | private void Play()
139 | {
140 | if (Core.PlayList.Count == 0) return;
141 | Mini_UpdateTimer.Enabled = true;
142 | Core.Play();
143 | Mini_Seek_TrackBar.Enabled = true;
144 | SetPlay(false);
145 | Mini_Stop.Enabled = true;
146 | Mini_Seek_TrackBar.MaxValue = (int)Core.Durnation * 1000;
147 | Mini_Artist_Label.Refresh();
148 | Mini_Title_Label.Refresh();
149 | Artist = Core.CurrentBeatmap.Artist;
150 | Title = Core.CurrentBeatmap.Title;
151 | }
152 | private void Pause()
153 | {
154 | Mini_UpdateTimer.Enabled = false;
155 | Core.PauseOrResume();
156 | SetPlay(true);
157 | }
158 | private void Resume()
159 | {
160 | Core.PauseOrResume();
161 | SetPlay(false);
162 | }
163 | private void PlayNext()
164 | {
165 | Mini_UpdateTimer.Enabled = false;
166 | Artist = "";
167 | Title = "";
168 | if (Core.PlayList.Count == 0) return;
169 | int next = Core.GetNext();
170 | Play();
171 | }
172 |
173 | private void UpdateTimer_Tick(object sender, EventArgs e)
174 | {
175 |
176 | Mini_Seek_TrackBar.Value = (int)Core.Position * 1000;
177 | Mini_Time_Label.Text = String.Format("{0}:{1:D2} | {2}:{3:D2}", (int)Core.Position / 60,
178 | (int)Core.Position % 60, (int)Core.Durnation / 60,
179 | (int)Core.Durnation % 60);
180 | if (Core.Willnext) { Stop(); PlayNext(); }
181 | }
182 |
183 | private void TrackVolume_ValueChanged(object sender, EventArgs e)
184 | {
185 | Core.SetVolume(1, Mini_Volume_TrackBar.Value);
186 | }
187 |
188 | private void TrackSeek_ValueChanged(object sender, EventArgs e)
189 | {
190 | if (seeking)
191 | {
192 | Core.Seek((double)Mini_Seek_TrackBar.Value / 1000);
193 | }
194 | }
195 |
196 | private void TrackSeek_MouseDown(object sender, MouseEventArgs e)
197 | {
198 | seeking = true;
199 | }
200 |
201 | private void TrackSeek_MouseUp(object sender, MouseEventArgs e)
202 | {
203 | seeking = false;
204 | }
205 | private PointF pA;
206 | private PointF pB;
207 | private string tempA;
208 | private string tempB;
209 | private string Title;
210 | private string Artist;
211 | private readonly Brush brush = Brushes.White;
212 | private SizeF s;
213 | private Graphics g;
214 | private void GUITimer_Tick(object sender, EventArgs e)
215 | {
216 | var Rects = new Rectangle(Left, Top, Left + Width, Top + Height);
217 | if ((Top < 0 && Win32.PtInRect(ref Rects, Cursor.Position)))
218 | {
219 | Top = 0;
220 | }
221 | else
222 | {
223 | if (Top > -5 && Top < 5 && !(Win32.PtInRect(ref Rects, Cursor.Position)))
224 | {
225 | Top = 2 - Height;
226 | }
227 | }
228 | g = Mini_Artist_Label.CreateGraphics();
229 | if (g.MeasureString(Artist, Mini_Artist_Label.Font).Width > Mini_Artist_Label.Width)
230 | {
231 | Mini_Artist_Label.Refresh();
232 | s = g.MeasureString(Artist, Mini_Artist_Label.Font);//测量文字长度
233 | if (tempA != Artist)//文字改变时,重新显示
234 | {
235 | pA = new PointF(Mini_Artist_Label.Size.Width, 0);
236 | tempA = Artist;
237 | }
238 | else
239 | pA = new PointF(pA.X - 10, 0);//每次偏移10
240 | if (pA.X <= -s.Width)
241 | pA = new PointF(Mini_Artist_Label.Size.Width, 0);
242 | g.DrawString(Artist, Mini_Artist_Label.Font, brush, pA);
243 | }
244 | else { Mini_Artist_Label.Text = Artist; }
245 | g = Mini_Title_Label.CreateGraphics();
246 | if (g.MeasureString(Title, Mini_Title_Label.Font).Width > Mini_Title_Label.Width)
247 | {
248 | Mini_Title_Label.Refresh();
249 | s = g.MeasureString(Title, Mini_Title_Label.Font);//测量文字长度
250 | if (tempB != Title)//文字改变时,重新显示
251 | {
252 | pB = new PointF(Mini_Title_Label.Size.Width, 0);
253 | tempB = Title;
254 | }
255 | else
256 | pB = new PointF(pB.X - 10, 0);//每次偏移10
257 | if (pB.X <= -s.Width)
258 | pB = new PointF(Mini_Title_Label.Size.Width, 0);
259 | g.DrawString(Title, Mini_Title_Label.Font, brush, pB);
260 | }
261 | else { Mini_Title_Label.Text = Title; }
262 | }
263 | HotkeyHelper hotkeyHelper;
264 | int playKey;
265 | int nextKey;
266 | int playKey1;
267 | int playKey2;
268 | int nextKey1;
269 | private void Mini_Shown(object sender, EventArgs e)
270 | {
271 | hotkeyHelper = new HotkeyHelper(Handle);
272 | playKey = hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt);
273 | playKey1 = hotkeyHelper.RegisterHotkey(Keys.Play, KeyModifiers.None);
274 | playKey2 = hotkeyHelper.RegisterHotkey(Keys.Pause, KeyModifiers.None);
275 | nextKey = hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt);
276 | nextKey1 = hotkeyHelper.RegisterHotkey(Keys.MediaNextTrack, KeyModifiers.None);
277 | hotkeyHelper.OnHotkey += OnHotkey;
278 | }
279 | private void OnHotkey(int hotkeyID)
280 | {
281 | if (hotkeyID == playKey || hotkeyID == playKey1 || hotkeyID == playKey2)
282 | {
283 | imageButton1_Click(null, EventArgs.Empty);
284 | }
285 | else if (hotkeyID == nextKey || hotkeyID == nextKey1)
286 | {
287 | imageButton3_Click(null, EventArgs.Empty);
288 | }
289 | }
290 | }
291 | }
292 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Uilties/DelDulp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Windows.Forms;
8 | using OSUplayer.Properties;
9 | using OSUplayer.OsuFiles;
10 | namespace OSUplayer.Uilties
11 | {
12 | public partial class DelDulp : Form
13 | {
14 | public DelDulp()
15 | {
16 | InitializeComponent();
17 | LanguageManager.ApplyLanguage(this);
18 | }
19 | private readonly List _allBeatmap = new List();
20 | private readonly Dictionary> _dulpdict = new Dictionary>();
21 | private int _ok;
22 | private int _all = 1;
23 | private void Scanforset(string path)
24 | {
25 | string[] osufiles = Directory.GetFiles(path, "*.osu");
26 | if (osufiles.Length != 0)
27 | {
28 | foreach (var osufile in osufiles)
29 | {
30 | var tmp = new Beatmap(osufile, path);
31 | _allBeatmap.Add(tmp);
32 | }
33 | BackgroundWorker1.ReportProgress(0);
34 | }
35 | else
36 | {
37 | var tmpfolder = Directory.GetDirectories(path);
38 | _all += tmpfolder.Length;
39 | BackgroundWorker1.ReportProgress(0);
40 | foreach (string subfolder in tmpfolder)
41 | {
42 | Scanforset(subfolder);
43 | }
44 | }
45 | _ok++;
46 | }
47 | private void Gethashs()
48 | {
49 | for (int i = 0; i < _allBeatmap.Count; i++)
50 | {
51 | _allBeatmap[i].GetHash();
52 | BackgroundWorker2.ReportProgress(i);
53 | }
54 | }
55 | private void Scanfordul(int index)
56 | {
57 | BackgroundWorker3.ReportProgress(0);
58 | var hash = _allBeatmap[index].GetHash();
59 | var tmp = new List {index};
60 | for (var i = index + 1; i < _allBeatmap.Count; i++)
61 | {
62 | if (hash == _allBeatmap[i].GetHash())
63 | {
64 | tmp.Add(i);
65 | }
66 | }
67 | if (tmp.Count == 1) return;
68 | if (!_dulpdict.ContainsKey(hash)) { _dulpdict.Add(hash, tmp); }
69 | else
70 | {
71 | _dulpdict[hash].AddRange(tmp);
72 | }
73 | }
74 | private void Adddul()
75 | {
76 | var now = 0;
77 | foreach (var md5 in _dulpdict.Keys)
78 | {
79 | var nowcolor = (now % 2 == 0) ? Color.White : Color.WhiteSmoke;
80 | foreach (var mapcount in _dulpdict[md5])
81 | {
82 | var tmp = new ListViewItem(_allBeatmap[mapcount].Location) { BackColor = nowcolor };
83 | tmp.SubItems.Add(md5);
84 | DelDulp_MainView.Items.Add(tmp);
85 | }
86 | now++;
87 | }
88 | DelDulp_MainView.Columns[0].Width = -1;
89 | DelDulp_DeleteSelected.Enabled = true;
90 | DelDulp_AutoSelect.Enabled = true;
91 | DelDulp_ClearSelected.Enabled = true;
92 | }
93 | private void BackgroundWorker1DoWork(object sender, DoWorkEventArgs e)
94 | {
95 | DelDulp_Status_Label.Text = String.Format(LanguageManager.Get("Scan_Folder_Text"), 0, 0);
96 | Scanforset(e.Argument.ToString());
97 | }
98 | private void BackgroundWorker1ProgressChanged(object sender, ProgressChangedEventArgs e)
99 | {
100 | DelDulp_ProgressBar.Maximum = _all;
101 | DelDulp_ProgressBar.Value = _ok;
102 | DelDulp_Status_Label.Text = String.Format(LanguageManager.Get("Scan_Folder_Text"), _ok, _all);
103 | }
104 | private void BackgroundWorker1RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
105 | {
106 | for (var i = 1; i < _allBeatmap.Count; i++)
107 | {
108 | while (i < _allBeatmap.Count && _allBeatmap[i].Location == _allBeatmap[i - 1].Location) { _allBeatmap.RemoveAt(i); }
109 | }
110 | DelDulp_ProgressBar.Maximum = _allBeatmap.Count;
111 | DelDulp_ProgressBar.Value = 0;
112 | BackgroundWorker2.RunWorkerAsync(0);
113 | }
114 | private void DelDulp_StartSearch_Click(object sender, EventArgs e)
115 | {
116 | DelDulp_StartSearch.Enabled = false;
117 | DelDulp_Cancel.Enabled = false;
118 | try
119 | {
120 | if (Directory.Exists(Path.Combine(Settings.Default.OSUpath, "Songs")))
121 | {
122 | BackgroundWorker1.RunWorkerAsync(Path.Combine(Settings.Default.OSUpath, "Songs"));
123 | }
124 | }
125 | catch (SystemException ex)
126 | {
127 | Console.WriteLine(ex.StackTrace);
128 | throw (new FormatException("Failed to read song path", ex));
129 | }
130 | }
131 | private void BackgroundWorker2DoWork(object sender, DoWorkEventArgs e)
132 | {
133 | Gethashs();
134 | }
135 | private void BackgroundWorker2ProgressChanged(object sender, ProgressChangedEventArgs e)
136 | {
137 | DelDulp_ProgressBar.Value++;
138 | DelDulp_Status_Label.Text = String.Format(LanguageManager.Get("Get_Song_Info_Text"), DelDulp_ProgressBar.Value, _allBeatmap.Count);
139 | }
140 | private void BackgroundWorker2RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
141 | {
142 | DelDulp_ProgressBar.Value = 0;
143 | BackgroundWorker3.RunWorkerAsync(0);
144 | }
145 | private void BackgroundWorker3DoWork(object sender, DoWorkEventArgs e)
146 | {
147 | for (var i = 0; i < _allBeatmap.Count; i++)
148 | {
149 | Scanfordul(i);
150 | }
151 | }
152 | private void BackgroundWorker3ProgressChanged(object sender, ProgressChangedEventArgs e)
153 | {
154 | DelDulp_ProgressBar.Value++;
155 | DelDulp_Status_Label.Text = String.Format(LanguageManager.Get("Scan_Duplicate_Text"), DelDulp_ProgressBar.Value, _allBeatmap.Count);
156 | }
157 | private void BackgroundWorker3RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
158 | {
159 | if (_dulpdict.Count == 0) { MessageBox.Show(LanguageManager.Get("Scan_Zero_Text")); Dispose(); }
160 | else
161 | {
162 | NotifySystem.Showtip(1000, "OSUplayer", string.Format(LanguageManager.Get("Scan_Complete_Text"), _dulpdict.Count));
163 | DelDulp_Status_Label.Text = string.Format(LanguageManager.Get("Scan_Complete_Text"), _dulpdict.Count);
164 | Adddul();
165 | }
166 | DelDulp_Cancel.Enabled = true;
167 | }
168 | private void DelDulp_DeleteSelected_Click(object sender, EventArgs e)
169 | {
170 | if (DelDulp_MainView.CheckedItems.Count == 0)
171 | {
172 | MessageBox.Show(LanguageManager.Get("Scan_Zero_Text"));
173 | return;
174 | }
175 | var count = 0;
176 | for (var i = 0; i < DelDulp_MainView.Items.Count; i++)
177 | {
178 | var md5 = DelDulp_MainView.Items[i].SubItems[1].Text;
179 | var con = 0;
180 | while (i + con < DelDulp_MainView.Items.Count
181 | && DelDulp_MainView.Items[i + con].Checked
182 | && con < _dulpdict[md5].Count) { con++; }
183 | if (con == _dulpdict[md5].Count) { count++; }
184 | i += _dulpdict[md5].Count - 1;
185 | }
186 | if (count != 0)
187 | {
188 | if (MessageBox.Show(string.Format(LanguageManager.Get("Delete_All_Text"), count), LanguageManager.Get("Tip_Text"), MessageBoxButtons.YesNo) != DialogResult.Yes) { return; }
189 | }
190 | if (
191 | MessageBox.Show(string.Format(LanguageManager.Get("Delete_Comfirm_Text"), DelDulp_MainView.CheckedItems.Count),
192 | LanguageManager.Get("Tip_Text"), MessageBoxButtons.YesNo) != DialogResult.Yes) return;
193 | var filedelete = (from ListViewItem item in DelDulp_MainView.CheckedItems select item.Text).ToList();
194 | Win32.Delete(filedelete);
195 | NotifySystem.Showtip(1000, LanguageManager.Get("OSUplayer"), string.Format(LanguageManager.Get("Delete_Complete_Text"), DelDulp_MainView.CheckedItems.Count));
196 | Dispose();
197 | }
198 | private void DelDulp_MainView_SizeChanged(object sender, EventArgs e)
199 | {
200 | if (DelDulp_MainView.Width > DelDulp_MainView.Columns[0].Width)
201 | { DelDulp_MainView.Columns[0].Width = DelDulp_MainView.Width - 10; }
202 | }
203 | private void DelDulp_AutoSelect_Click(object sender, EventArgs e)
204 | {
205 | DelDulp_MainView.Select();
206 | DelDulp_MainView.SelectedItems.Clear();
207 | foreach (ListViewItem tmp in DelDulp_MainView.CheckedItems)
208 | {
209 | tmp.Checked = false;
210 | }
211 | for (var i = 0; i < DelDulp_MainView.Items.Count - 1; i++)
212 | {
213 | if (DelDulp_MainView.Items[i].BackColor == DelDulp_MainView.Items[i + 1].BackColor)
214 | {
215 | DelDulp_MainView.Items[i].Selected = true;
216 | DelDulp_MainView.Items[i].Checked = true;
217 | continue;
218 | }
219 | DelDulp_MainView.Items[i].Selected = false;
220 | DelDulp_MainView.Items[i].Checked = false;
221 | }
222 | }
223 | private void DelDulp_Cancel_Click(object sender, EventArgs e)
224 | {
225 | Dispose();
226 | }
227 | private void DelDulp_MainView_SelectedIndexChanged(object sender, EventArgs e)
228 | {
229 | foreach (ListViewItem tmp in DelDulp_MainView.SelectedItems)
230 | {
231 | tmp.Checked = true;
232 | }
233 | }
234 | private void DelDulp_ClearSelected_Click(object sender, EventArgs e)
235 | {
236 | DelDulp_MainView.SelectedItems.Clear();
237 | foreach (ListViewItem tmp in DelDulp_MainView.CheckedItems)
238 | {
239 | tmp.Checked = false;
240 | }
241 | }
242 | private void DelDulp_FormClosing(object sender, FormClosingEventArgs e)
243 | {
244 | if (!DelDulp_Cancel.Enabled) { e.Cancel = true; }
245 | }
246 | }
247 | }
248 |
--------------------------------------------------------------------------------
/OSU player/OSU player/Graphic/VideoDecoder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Runtime.InteropServices;
4 | using System.Threading;
5 | // ReSharper disable All
6 | namespace OSUplayer.Graphic
7 | {
8 | public class VideoDecoder : IDisposable
9 | {
10 | public delegate void EndOfFileHandler();
11 |
12 | private const int PIXEL_FORMAT = 6;
13 | private readonly byte[][] FrameBuffer;
14 | private readonly double[] FrameBufferTimes;
15 |
16 | public int BufferSize;
17 | public double FrameDelay;
18 | private IntPtr buffer;
19 | private FFmpeg.AVCodecContext codecCtx;
20 | private double currentDisplayTime;
21 | private Thread decodingThread;
22 | private FFmpeg.AVFormatContext formatContext;
23 | private int frameFinished;
24 | private bool isDisposed;
25 | private double lastPts;
26 | private IntPtr pCodec;
27 | private IntPtr pCodecCtx;
28 | private IntPtr pFormatCtx;
29 | private IntPtr pFrame;
30 | private IntPtr pFrameRGB;
31 | private IntPtr packet;
32 | private int readCursor;
33 | private FFmpeg.AVStream stream;
34 | private GCHandle streamHandle;
35 | private bool videoOpened;
36 | private int videoStream;
37 | private int writeCursor;
38 |
39 | public VideoDecoder(int bufferSize)
40 | {
41 | BufferSize = bufferSize;
42 | FrameBufferTimes = new double[BufferSize];
43 | FrameBuffer = new byte[BufferSize][];
44 | FFmpeg.av_register_all();
45 | videoOpened = false;
46 | }
47 |
48 | public double CurrentTime
49 | {
50 | get { return currentDisplayTime; }
51 | }
52 |
53 | public int height
54 | {
55 | get { return codecCtx.height; }
56 | }
57 |
58 | public double Length
59 | {
60 | get
61 | {
62 | long duration = stream.duration;
63 | if (duration < 0L)
64 | {
65 | return 36000000.0;
66 | }
67 | return (duration*FrameDelay);
68 | }
69 | }
70 |
71 | private double startTimeMs
72 | {
73 | get { return ((0x3e8L*stream.start_time)*FrameDelay); }
74 | }
75 |
76 | public int width
77 | {
78 | get { return codecCtx.width; }
79 | }
80 |
81 | public void Dispose()
82 | {
83 | Dispose(true);
84 | }
85 |
86 | private void Decode()
87 | {
88 | try
89 | {
90 | while (true)
91 | {
92 | bool flag = false;
93 | lock (this)
94 | {
95 | while (((writeCursor - readCursor) < BufferSize) &&
96 | (FFmpeg.av_read_frame(pFormatCtx, packet) >= 0))
97 | {
98 | if (Marshal.ReadInt32(packet, 0x18) == videoStream)
99 | {
100 | double num = Marshal.ReadInt64(packet, 8);
101 | IntPtr buf = Marshal.ReadIntPtr(packet, 0x10);
102 | int num2 = Marshal.ReadInt32(packet, 20);
103 | FFmpeg.avcodec_decode_video(pCodecCtx, pFrame, ref frameFinished, buf, num2);
104 | if (((frameFinished != 0) && (Marshal.ReadIntPtr(packet, 0x10) != IntPtr.Zero)) &&
105 | (FFmpeg.img_convert(pFrameRGB, 6, pFrame, (int) codecCtx.pix_fmt, codecCtx.width,
106 | codecCtx.height) == 0))
107 | {
108 | Marshal.Copy(Marshal.ReadIntPtr(pFrameRGB), FrameBuffer[writeCursor%BufferSize], 0,
109 | FrameBuffer[writeCursor%BufferSize].Length);
110 | FrameBufferTimes[writeCursor%BufferSize] = ((num - stream.start_time)*FrameDelay)*
111 | 1000.0;
112 | writeCursor++;
113 | lastPts = num;
114 | flag = true;
115 | }
116 | }
117 | }
118 | }
119 | if (!flag)
120 | {
121 | Thread.Sleep(15);
122 | }
123 | }
124 | }
125 | catch (ThreadAbortException)
126 | {
127 | }
128 | catch (Exception exception)
129 | {
130 | using (StreamWriter writer = File.CreateText("video-debug.txt"))
131 | {
132 | writer.WriteLine(exception.ToString());
133 | }
134 | }
135 | }
136 |
137 | public void Dispose(bool disposing)
138 | {
139 | if (!isDisposed)
140 | {
141 | isDisposed = true;
142 | if (decodingThread != null)
143 | {
144 | decodingThread.Abort();
145 | }
146 | try
147 | {
148 | Marshal.FreeHGlobal(packet);
149 | Marshal.FreeHGlobal(buffer);
150 | }
151 | catch
152 | {
153 | }
154 | try
155 | {
156 | FFmpeg.av_free(pFrameRGB);
157 | FFmpeg.av_free(pFrame);
158 | }
159 | catch
160 | {
161 | }
162 | try
163 | {
164 | streamHandle.Free();
165 | }
166 | catch
167 | {
168 | }
169 | frameFinished = 0;
170 | try
171 | {
172 | FFmpeg.avcodec_close(pCodecCtx);
173 | FFmpeg.av_close_input_file(pFormatCtx);
174 | }
175 | catch
176 | {
177 | }
178 | }
179 | }
180 |
181 | ~VideoDecoder()
182 | {
183 | Dispose(false);
184 | }
185 |
186 | public byte[] GetFrame(int time)
187 | {
188 | while ((readCursor < (writeCursor - 1)) && (FrameBufferTimes[(readCursor + 1)%BufferSize] <= time))
189 | {
190 | readCursor++;
191 | }
192 | if (readCursor < writeCursor)
193 | {
194 | currentDisplayTime = FrameBufferTimes[readCursor%BufferSize];
195 | return FrameBuffer[readCursor%BufferSize];
196 | }
197 | return null;
198 | }
199 |
200 | public bool Open(string path)
201 | {
202 | FileStream inStream = File.OpenRead(path);
203 | OpenStream(inStream);
204 | return true;
205 | }
206 |
207 | public bool Open(byte[] bytes)
208 | {
209 | if ((bytes == null) || (bytes.Length == 0))
210 | {
211 | return false;
212 | }
213 | streamHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
214 | IntPtr ptr = streamHandle.AddrOfPinnedObject();
215 | if (videoOpened)
216 | {
217 | return false;
218 | }
219 | videoOpened = true;
220 | string filename = string.Concat(new object[] {"memory:", ptr, "|", bytes.Length});
221 | if (FFmpeg.av_open_input_file(out pFormatCtx, filename, IntPtr.Zero, bytes.Length, IntPtr.Zero) != 0)
222 | {
223 | throw new Exception("Couldn't open input file");
224 | }
225 | if (FFmpeg.av_find_stream_info(pFormatCtx) < 0)
226 | {
227 | throw new Exception("Couldn't find stream info");
228 | }
229 | FFmpeg.dump_format(pFormatCtx, 0, filename, 0);
230 | formatContext = (FFmpeg.AVFormatContext) Marshal.PtrToStructure(pFormatCtx, typeof (FFmpeg.AVFormatContext));
231 | videoStream = -1;
232 | int num2 = formatContext.nb_streams;
233 | for (int i = 0; i < num2; i++)
234 | {
235 | var _stream =
236 | (FFmpeg.AVStream) Marshal.PtrToStructure(formatContext.streams[i], typeof (FFmpeg.AVStream));
237 | var context =
238 | (FFmpeg.AVCodecContext) Marshal.PtrToStructure(_stream.codec, typeof (FFmpeg.AVCodecContext));
239 | if (context.codec_type == FFmpeg.CodecType.CODEC_TYPE_VIDEO)
240 | {
241 | videoStream = i;
242 | this.stream = _stream;
243 | codecCtx = context;
244 | pCodecCtx = this.stream.codec;
245 | break;
246 | }
247 | }
248 | if (videoStream == -1)
249 | {
250 | throw new Exception("couldn't find video stream");
251 | }
252 | FrameDelay = FFmpeg.av_q2d(stream.time_base);
253 | pCodec = FFmpeg.avcodec_find_decoder(codecCtx.codec_id);
254 | if (pCodec == IntPtr.Zero)
255 | {
256 | throw new Exception("couldn't find decoder");
257 | }
258 | if (FFmpeg.avcodec_open(pCodecCtx, pCodec) < 0)
259 | {
260 | throw new Exception("couldn't open codec");
261 | }
262 | pFrame = FFmpeg.avcodec_alloc_frame();
263 | pFrameRGB = FFmpeg.avcodec_alloc_frame();
264 | if (pFrameRGB == IntPtr.Zero)
265 | {
266 | throw new Exception("couldn't allocate RGB frame");
267 | }
268 | int cb = FFmpeg.avpicture_get_size(6, codecCtx.width, codecCtx.height);
269 | buffer = Marshal.AllocHGlobal(cb);
270 | FFmpeg.avpicture_fill(pFrameRGB, buffer, 6, codecCtx.width, codecCtx.height);
271 | packet = Marshal.AllocHGlobal(0x39);
272 | for (int j = 0; j < BufferSize; j++)
273 | {
274 | FrameBuffer[j] = new byte[(width*height)*4];
275 | }
276 | decodingThread = new Thread(Decode);
277 | decodingThread.IsBackground = true;
278 | decodingThread.Start();
279 | return true;
280 | }
281 |
282 | public bool OpenStream(Stream inStream)
283 | {
284 | var buffer = new byte[inStream.Length];
285 | inStream.Read(buffer, 0, (int) inStream.Length);
286 | return Open(buffer);
287 | }
288 |
289 | public void Seek(int time)
290 | {
291 | lock (this)
292 | {
293 | int flags = 0;
294 | double num2 = ((time/1000.0)/FrameDelay) + stream.start_time;
295 | if (num2 < lastPts)
296 | {
297 | flags = 1;
298 | }
299 | FFmpeg.av_seek_frame(pFormatCtx, videoStream, (long) num2, flags);
300 | readCursor = 0;
301 | writeCursor = 0;
302 | }
303 | }
304 | }
305 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/Graphic/TGraphic.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Xna.Framework;
3 | using Microsoft.Xna.Framework.Graphics;
4 | using OSUplayer.OsuFiles.StoryBoard;
5 | using Device = Microsoft.Xna.Framework.Graphics.GraphicsDevice;
6 |
7 | namespace OSUplayer.Graphic
8 | {
9 | ///
10 | /// MDX静态图像基类
11 | ///
12 | internal class StaticGraphic
13 | {
14 | //protected Texture2D texture;
15 | protected byte Alpha;
16 | protected Color Color;
17 | protected int CurrentFrameIndex; //当前材质行索引
18 | protected int FrameCount; //材质行总数
19 | protected float Layer;
20 | //protected Matrix scaleMatrix, transformMatrix, rotateMatrix;
21 |
22 | protected Vector2 Origin; //坐标轴位置
23 |
24 | ///
25 | /// 0x0=none,1=H,2=V,4=A
26 | ///
27 | public byte Parameter;
28 |
29 | protected Vector2 Position; //显示位置
30 | protected float Rotate; //旋转角度
31 | protected Vector2 Scale; //缩放比例
32 | protected Texture2D[] Texturearray;
33 |
34 | //protected Rectangle rectangle;
35 |
36 |
37 | public StaticGraphic(Device graphicDevice, string source, Vector2 position,
38 | float rotate, float scale, Color color, byte alpha, byte parameter)
39 | {
40 | Texturearray = new[] {Texture2D.FromFile(graphicDevice, source)};
41 | Origin = new Vector2(0, 0);
42 | Position = position;
43 | Rotate = rotate;
44 | Scale = new Vector2(scale, scale);
45 | Layer = 0;
46 | Color = color;
47 | Alpha = alpha;
48 | Parameter = parameter;
49 | CurrentFrameIndex = 0;
50 | }
51 |
52 | protected StaticGraphic()
53 | {
54 | }
55 |
56 | ///
57 | /// 绘制图像
58 | ///
59 | public void Draw(SpriteBatch sprite)
60 | {
61 | var tmp = new SpriteEffects();
62 | if ((Parameter & 1) == 1)
63 | {
64 | tmp = SpriteEffects.FlipHorizontally;
65 | }
66 | if ((Parameter & 2) == 2)
67 | {
68 | tmp = tmp | SpriteEffects.FlipVertically;
69 | }
70 | Color = new Color(Color.R, Color.G, Color.B, Alpha);
71 | sprite.Draw(Texturearray[CurrentFrameIndex], Position, null, Color, Rotate, Origin, Scale, tmp, Layer);
72 | }
73 | }
74 |
75 |
76 | ///
77 | /// MDX带有动作列表的图像基类
78 | ///
79 | internal class TGraphic : StaticGraphic
80 | {
81 | private readonly ElementLoopType _loop;
82 | private readonly int _mSPerFrame; // 帧动画的速率
83 | private readonly ElementOrigin _origin;
84 | private TSpriteAction _alphaAction;
85 | private TSpriteAction _colorAction;
86 | private int _msLastFrame; //上次记录的时间
87 | private TSpriteAction _parameterAction;
88 | private TSpriteAction _rotateAction;
89 | private TSpriteAction _scaleXAction;
90 | private TSpriteAction _scaleYAction;
91 | private TSpriteAction _xAction;
92 | private TSpriteAction _yAction;
93 |
94 | public TGraphic(SBelement element, Texture2D[] file)
95 | {
96 | switch (element.Type)
97 | {
98 | case ElementType.Sprite:
99 | {
100 | Texturearray = file;
101 | FrameCount = 1;
102 | CurrentFrameIndex = 0;
103 | _msLastFrame = 0;
104 | _mSPerFrame = 16;
105 | Position = new Vector2(element.X0, element.Y0);
106 | Origin = Getorigin(Texturearray[0], element.Origin);
107 | break;
108 | }
109 | case ElementType.Animation:
110 | {
111 | Texturearray = file;
112 | FrameCount = element.FrameCount;
113 | _mSPerFrame = element.Framedelay;
114 | _loop = element.Looptype;
115 | CurrentFrameIndex = 0;
116 | _msLastFrame = 0;
117 | Position = new Vector2(element.X0, element.Y0);
118 | //this.texture = texturearray[0];
119 | Origin = Getorigin(Texturearray[0], element.Origin);
120 | break;
121 | }
122 | default:
123 | throw (new FormatException("Failed to resolve .osb file"));
124 | }
125 | _origin = element.Origin;
126 | Color = Color.White;
127 | Alpha = 0;
128 | Parameter = 0;
129 | Rotate = 0f;
130 | if (element.Layers == ElementLayer.Background)
131 | {
132 | Layer = 0.9f - element.Z*0.000001f;
133 | }
134 | else
135 | {
136 | Layer = 0.5f - element.Z*0.000001f;
137 | }
138 | Scale = new Vector2(1f, 1f);
139 | // this.InitSpriteAction();
140 | }
141 |
142 | /* ///
143 | /// 创建一个多帧TGraphic实例
144 | ///
145 | /// 显示设备
146 | /// 要绘制的图像
147 | /// 绘制坐标
148 | /// 旋转中心
149 | /// 总帧数
150 | /// FPS
151 | public TGraphic(Device graphicDevice, Bitmap bitmap, Vector3 pPosition, Vector3 pCenter,
152 | int pFrameCount, int pFPS)
153 | : base(graphicDevice, bitmap, pPosition, 0f, 1f, Color.White, 255, 0)
154 | {
155 | this.frameCount = pFrameCount;
156 | this.currentFrameIndex = 0;
157 | this.mSPerFrame = (int)(1f / pFPS * 1000);
158 | this.msLastFrame = 0;
159 | this.center = pCenter;
160 | this.InitSpriteAction();
161 | }
162 |
163 | ///
164 | /// 创建一个单帧TGraphic实例
165 | ///
166 | /// 显示设备
167 | /// 要绘制的图像
168 | /// 绘制坐标
169 | /// 旋转中心
170 | public TGraphic(Device graphicDevice, Bitmap bitmap, Vector3 pPosition, Vector3 pCenter)
171 | : base(graphicDevice, bitmap, pPosition, 0f, 1f, Color.White, 255, 0)
172 | {
173 | this.center = pCenter;
174 | this.frameCount = 1;
175 | this.currentFrameIndex = 0;
176 | this.msLastFrame = 0;
177 | this.mSPerFrame = 16;
178 | this.InitSpriteAction();
179 | }*/
180 |
181 | private static Vector2 Getorigin(Texture2D texture, ElementOrigin origin)
182 | {
183 | var id = (int) origin;
184 | float x = (float) (id%3)/2*texture.Width;
185 | float y = (float) (id - id%3)/6*texture.Height;
186 | return new Vector2(x, y);
187 | }
188 |
189 | ///
190 | /// 更新图像
191 | ///
192 | public virtual void Update(int currentTime)
193 | {
194 | //处理动作更新
195 | //
196 | if (_alphaAction.Enable)
197 | {
198 | _alphaAction.Update(currentTime);
199 | Alpha = (byte) _alphaAction.CurrentValue; //默认就是0,ok~
200 | }
201 | if (_colorAction.Enable)
202 | {
203 | _colorAction.Update(currentTime);
204 | var colorv = (int) _colorAction.CurrentValue;
205 | if (_colorAction.IsActive)
206 | {
207 | Color = new Color((byte) (colorv >> 0x10), (byte) (colorv >> 8), (byte) colorv);
208 | }
209 | }
210 | if (_xAction.Enable)
211 | {
212 | _xAction.Update(currentTime);
213 | if (_xAction.IsActive)
214 | {
215 | Position.X = _xAction.CurrentValue;
216 | }
217 | }
218 | if (_yAction.Enable)
219 | {
220 | _yAction.Update(currentTime);
221 | if (_yAction.IsActive)
222 | {
223 | Position.Y = _yAction.CurrentValue;
224 | }
225 | }
226 | if (_scaleXAction.Enable)
227 | {
228 | _scaleXAction.Update(currentTime);
229 | if (_scaleXAction.IsActive)
230 | {
231 | Scale.X = _scaleXAction.CurrentValue;
232 | }
233 | }
234 | if (_scaleYAction.Enable)
235 | {
236 | _scaleYAction.Update(currentTime);
237 | if (_scaleYAction.IsActive)
238 | {
239 | Scale.Y = _scaleYAction.CurrentValue;
240 | }
241 | }
242 | if (_rotateAction.Enable)
243 | {
244 | _rotateAction.Update(currentTime);
245 | Rotate = _rotateAction.CurrentValue; //默认就是0,ok~
246 | }
247 | if (_parameterAction.Enable)
248 | {
249 | _parameterAction.Update(currentTime);
250 | Parameter = (byte) _parameterAction.CurrentValue; //默认就是0,ok~
251 | }
252 |
253 | // 处理帧更新
254 | //
255 | if (FrameCount <= 1) return;
256 | if (currentTime - _msLastFrame < _mSPerFrame) return;
257 | _msLastFrame = currentTime;
258 | CurrentFrameIndex++;
259 | if (CurrentFrameIndex == FrameCount)
260 | {
261 | if (_loop == ElementLoopType.LoopForever)
262 | {
263 | CurrentFrameIndex = 0;
264 | }
265 | else
266 | {
267 | CurrentFrameIndex = FrameCount - 1;
268 | }
269 | }
270 | //this.texture = texturearray[currentFrameIndex];
271 | Origin = Getorigin(Texturearray[CurrentFrameIndex], _origin);
272 | }
273 |
274 | #region 设置动作
275 |
276 | ///
277 | /// 初始化精灵动作
278 | ///
279 | private void InitSpriteAction()
280 | {
281 | _alphaAction = new TSpriteAction();
282 | _xAction = new TSpriteAction();
283 | _yAction = new TSpriteAction();
284 | _scaleXAction = new TSpriteAction();
285 | _scaleYAction = new TSpriteAction();
286 | _rotateAction = new TSpriteAction();
287 | _colorAction = new TSpriteAction();
288 | _parameterAction = new TSpriteAction();
289 | }
290 |
291 | ///
292 | /// 设置Alpha动作
293 | ///
294 | public void SetAlphaAction(TSpriteAction pAlphaAction)
295 | {
296 | _alphaAction = pAlphaAction;
297 | }
298 |
299 | ///
300 | /// 设置X轴动作
301 | ///
302 | public void SetXAction(TSpriteAction pXAction)
303 | {
304 | _xAction = pXAction;
305 | }
306 |
307 | ///
308 | /// 设置Y轴动作
309 | ///
310 | public void SetYAction(TSpriteAction pYAction)
311 | {
312 | _yAction = pYAction;
313 | }
314 |
315 | ///
316 | /// 设置ScaleX动作
317 | ///
318 | public void SetScaleXAction(TSpriteAction pScaleAction)
319 | {
320 | _scaleXAction = pScaleAction;
321 | }
322 |
323 | ///
324 | /// 设置ScaleY动作
325 | ///
326 | public void SetScaleYAction(TSpriteAction pScaleAction)
327 | {
328 | _scaleYAction = pScaleAction;
329 | }
330 |
331 | ///
332 | /// 设置Rotate动作
333 | ///
334 | public void SetRotateAction(TSpriteAction pRotateAction)
335 | {
336 | _rotateAction = pRotateAction;
337 | }
338 |
339 | ///
340 | /// 设置Color动作
341 | ///
342 | public void SetColorAction(TSpriteAction pColorAction)
343 | {
344 | _colorAction = pColorAction;
345 | }
346 |
347 | ///
348 | /// 设置Parameter动作
349 | ///
350 | public void SetParameterAction(TSpriteAction pParameterAction)
351 | {
352 | _parameterAction = pParameterAction;
353 | }
354 |
355 | #endregion
356 | }
357 | }
--------------------------------------------------------------------------------
/OSU player/OSU player/OsuFiles/BeatmapSet.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics.Eventing.Reader;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Security.Cryptography;
7 | using System.Windows.Forms;
8 | namespace OSUplayer.OsuFiles
9 | {
10 | ///
11 | /// OSU文件内属性
12 | ///
13 | public enum OSUfile
14 | {
15 | FileVersion,
16 | AudioFilename,
17 | AudioHash,
18 | AudioLeadIn,
19 | PreviewTime,
20 | Countdown,
21 | SampleSet,
22 | StackLeniency,
23 | Mode,
24 | LetterboxInBreaks,
25 | StoryFireInFront,
26 | EpilepsyWarning,
27 | CountdownOffset,
28 | WidescreenStoryboard,
29 | EditorBookmarks,
30 | EditorDistanceSpacing,
31 | UseSkinSprites,
32 | OverlayPosition,
33 | SkinPreference,
34 | SpecialStyle,
35 | CustomSamples,
36 | Title,
37 | TitleUnicode,
38 | Artist,
39 | ArtistUnicode,
40 | Creator,
41 | Version,
42 | Source,
43 | Tags,
44 | BeatmapID,
45 | BeatmapSetID,
46 | HPDrainRate,
47 | CircleSize,
48 | OverallDifficulty,
49 | ApproachRate,
50 | SliderMultiplier,
51 | SliderTickRate,
52 | OSUfilecount
53 | }
54 | ///
55 | /// HitObject的类别
56 | ///
57 | public enum ObjectFlag
58 | {
59 | Normal = 1,
60 | Slider = 2,
61 | NewCombo = 4,
62 | NormalNewCombo = 5,
63 | SliderNewCombo = 6,
64 | Spinner = 8,
65 | SpinnerNewCombo = 12,
66 | ColourHax = 112,
67 | Hold = 128,
68 | ManiaLong = 128
69 | }
70 | ///
71 | /// 打击音效,可以叠加
72 | ///
73 | public enum HitSound
74 | {
75 | Normal = 0,
76 | Whistle = 2,
77 | Finish = 4,
78 | Clap = 8
79 | }
80 | ///
81 | /// 打击音效组的前缀
82 | ///
83 | public enum TSample
84 | {
85 | None = 0,
86 | Normal = 1,
87 | Soft = 2,
88 | Drum = 3
89 | }
90 | ///
91 | /// 打击音效组
92 | ///
93 | public struct CSample
94 | {
95 | public int sample;
96 | public int sampleset;
97 | public CSample(int sample, int sampleset)
98 | {
99 | this.sampleset = sampleset;
100 | this.sample = sample;
101 | }
102 | public static bool operator ==(CSample a, CSample b)
103 | {
104 | return a.sample == b.sample && a.sampleset == b.sampleset;
105 | }
106 | public static bool operator !=(CSample a, CSample b)
107 | {
108 | return !(a == b);
109 | }
110 | public override int GetHashCode()
111 | {
112 | return base.GetHashCode();
113 | }
114 | public override bool Equals(object obj)
115 | {
116 | return (CSample)obj == this;
117 | }
118 | }
119 | public enum Modes
120 | {
121 | Osu = 0,
122 | Taiko = 1,
123 | CTB = 2,
124 | Mania = 3
125 | }
126 | public enum Mods
127 | {
128 | NF,
129 | EZ,
130 | NV,
131 | HD,
132 | HR,
133 | SD,
134 | DT,
135 | Relax,
136 | HT,
137 | NC,
138 | FL,
139 | Auto,
140 | SO,
141 | Autopilot,
142 | PF,
143 | Key4,
144 | Key5,
145 | Key6,
146 | Key7,
147 | Key8,
148 | Fadein,
149 | Random,
150 | Cinema,
151 | Target,
152 | LastMod
153 | }
154 | ///
155 | /// Timing Points
156 | ///
157 | public struct Timing
158 | {
159 | public int offset;
160 | public double bpm;
161 | public int meter;
162 | public CSample sample;
163 | public float volume;
164 | public int type;
165 | public int kiai;
166 | }
167 | public struct note
168 | {
169 | public int x;
170 | public int y;
171 | }
172 | ///
173 | /// Hitobjects
174 | ///
175 | public struct HitObject
176 | {
177 | public int x;
178 | public int y;
179 | public int starttime;
180 | public ObjectFlag type;
181 | public int allhitsound;
182 | public int EndTime;
183 | public CSample sample;
184 | public CSample A_sample;
185 | public float S_Volume;
186 | public char slidertype;
187 | public int repeatcount;
188 | public double length;
189 | public int[] Hitsounds;
190 | public CSample[] samples;
191 | }
192 | [Serializable]
193 | public class BeatmapSet
194 | {
195 | public string location;
196 | public string OsbPath;
197 | public int count; //number of diffs
198 | private string name;
199 | public int setid;
200 | [NonSerialized()]
201 | public bool Detailed = false;
202 | public Dictionary Diffs;
203 | public string tags;
204 | private static string Checksample(string pre, string mid, string end)
205 | {
206 | if (File.Exists($"{pre}{mid}{end}.wav"))
207 | {
208 | return $"{pre}{mid}{end}.wav";
209 | }
210 | if (File.Exists($"{pre}{mid}{end}.mp3"))
211 | {
212 | return $"{pre}{mid}{end}.mp3";
213 | }
214 | return $@"{Application.StartupPath}\Default\{mid}.wav";
215 | // return "";
216 | }
217 | ///
218 | /// 取需要播放的音效完整目录
219 | ///
220 | /// 需要处理的sample类型
221 | /// 需要处理的音效
222 | /// 当前需要播放音效的List string
223 | public IEnumerable Getsamplename(CSample sample, int soundtype)
224 | {
225 | var tmp = new List();
226 | if (sample.sample == 0) { return tmp; }
227 | if (sample.sampleset == 0)
228 | {
229 | string all = String.Format(@"{0}\Default\{1}", Application.StartupPath, Enum.GetName(typeof(TSample), sample.sample));
230 | if (soundtype % 2 == 1 || soundtype == 0)
231 | {
232 | tmp.Add(all + "-hitnormal.wav");
233 | }
234 | soundtype = soundtype >> 2;
235 | if (soundtype % 2 == 1)
236 | {
237 | tmp.Add(all + "-hitwhistle.wav");
238 | }
239 | soundtype = soundtype >> 2;
240 | if (soundtype % 2 == 1)
241 | {
242 | tmp.Add(all + "-hitfinish.wav");
243 | }
244 | soundtype = soundtype >> 2;
245 | if (soundtype % 2 == 1)
246 | {
247 | tmp.Add(all + "-hitclap.wav");
248 | }
249 | return tmp;
250 | }
251 | string last = "";
252 | last = sample.sampleset == 1 ? "" : sample.sampleset.ToString();
253 | //normal-sliderslide(loops)
254 | //normal-sliderwhistle(loops)
255 | //normal-slidertick
256 | //不考虑以上
257 | string first = location + "\\";
258 | if (soundtype % 2 == 1 || soundtype == 0)
259 | {
260 | tmp.Add(Checksample(first, Enum.GetName(typeof(TSample), sample.sample) + "-hitnormal", last));
261 | }
262 | soundtype = soundtype / 2;
263 | if (soundtype % 2 == 1)
264 | {
265 | tmp.Add(Checksample(first, Enum.GetName(typeof(TSample), sample.sample) + "-hitwhistle", last));
266 | }
267 | soundtype = soundtype / 2;
268 | if (soundtype % 2 == 1)
269 | {
270 | tmp.Add(Checksample(first, Enum.GetName(typeof(TSample), sample.sample) + "-hitfinish", last));
271 | }
272 | soundtype = soundtype / 2;
273 | if (soundtype % 2 == 1)
274 | {
275 | tmp.Add(Checksample(first, Enum.GetName(typeof(TSample), sample.sample) + "-hitclap", last));
276 | }
277 | return tmp;
278 | }
279 | public void Add(Beatmap tmpbm)
280 | {
281 | if (count == 0)
282 | {
283 | location = tmpbm.Location;
284 | name = String.Format("{0} - {1}", tmpbm.Artist, tmpbm.Title);
285 | setid = tmpbm.BeatmapsetID;
286 | tags = tmpbm.Tags;
287 | tags += " " + tmpbm.ArtistRomanized;
288 | tags += " " + tmpbm.TitleRomanized;
289 | tags += " " + tmpbm.Creator;
290 | tags += " " + tmpbm.Source;
291 | }
292 | count++;
293 | var bmHash = tmpbm.GetHash();
294 | if (!Diffs.ContainsKey(bmHash)) Diffs.Add(bmHash, tmpbm);
295 | else
296 | {
297 | Diffs[bmHash] = tmpbm;
298 | count--;
299 | }
300 | tags += " " + tmpbm.Version;
301 | }
302 | public BeatmapSet()
303 | {
304 | count = 0;
305 | Diffs = new Dictionary();
306 | }
307 | public void GetDetail()
308 | {
309 | var f = new DirectoryInfo(location);
310 | var osbfiles = f.GetFiles("*.osb");
311 | if (osbfiles.Length != 0)
312 | {
313 | OsbPath = osbfiles[0].FullName;
314 | }
315 | foreach (var bm in Diffs.Values)
316 | {
317 | bm.Setsb(OsbPath);
318 | }
319 | Detailed = true;
320 | }
321 | public bool Check()
322 | {
323 | return Directory.Exists(location);
324 | }
325 | private string Hash { get; set; }
326 | public string GetHash()
327 | {
328 | if (Hash != null) { return Hash; }
329 | var strHashData = "";
330 | using (var md5Hash = MD5.Create())
331 | {
332 | var md5String = string.Join("", Diffs.Keys.ToArray());
333 | var arrHashValue = md5Hash.ComputeHash(System.Text.Encoding.ASCII.GetBytes(md5String));
334 | strHashData = BitConverter.ToString(arrHashValue);
335 | strHashData = strHashData.Replace("-", "");
336 |
337 | }
338 | Hash = strHashData.ToLower();
339 | return Hash;
340 | }
341 |
342 | private List _difflist = new List();
343 |
344 | public List GetBeatmaps()
345 | {
346 | if (_difflist.Count == Diffs.Keys.Count) return _difflist;
347 | _difflist = Diffs.Values.ToList();
348 | _difflist.Sort();
349 | return _difflist;
350 | }
351 | public override string ToString()
352 | {
353 | return name;
354 | }
355 | public bool Contains(Beatmap tmpbm)
356 | {
357 | return location == tmpbm.Location;
358 | /* if (setid == -1) {
359 | if (name==tmpbm.ArtistRomanized + " - " + tmpbm.TitleRomanized){return true;}else{return false;}
360 | }
361 | if (tmpbm.beatmapsetId == setid) { return true; }
362 | return false;*/
363 | }
364 |
365 | public void SaveAudios(string toLocation)
366 | {
367 | foreach (var map in Diffs.Values.Distinct(new MapAudioComparer()))
368 | {
369 | map.SaveAudio(toLocation);
370 | }
371 | }
372 |
373 | public int ArtistCompare(BeatmapSet obj)
374 | {
375 | if (obj == null) return 1;
376 | if (obj.GetBeatmaps().Count == 0) return 1;
377 | if (_difflist.Count == 0) return -1;
378 | if (obj.GetBeatmaps()[0].ArtistRomanized == "") return 1;
379 | var comp = String.Compare(_difflist[0].ArtistRomanized, obj.GetBeatmaps()[0].ArtistRomanized,
380 | StringComparison.CurrentCultureIgnoreCase);
381 | if (comp == 0)
382 | {
383 | var tcomp = String.Compare(_difflist[0].TitleRomanized, obj.GetBeatmaps()[0].TitleRomanized,
384 | StringComparison.CurrentCultureIgnoreCase);
385 | return tcomp;
386 | }
387 | return comp;
388 | }
389 | public int TitleCompare(BeatmapSet obj)
390 | {
391 | if (obj == null) return 1;
392 | if (obj.GetBeatmaps().Count == 0) return 1;
393 | if (_difflist.Count == 0) return -1;
394 | if (obj.GetBeatmaps()[0].TitleRomanized == "") return 1;
395 | var comp = String.Compare(_difflist[0].TitleRomanized, obj.GetBeatmaps()[0].TitleRomanized,
396 | StringComparison.CurrentCultureIgnoreCase);
397 | if (comp == 0)
398 | {
399 | var acomp = String.Compare(_difflist[0].ArtistRomanized, obj.GetBeatmaps()[0].ArtistRomanized,
400 | StringComparison.CurrentCultureIgnoreCase);
401 | return acomp;
402 | }
403 | return comp;
404 | }
405 | }
406 | public class MapAudioComparer : IEqualityComparer
407 | {
408 | public bool Equals(Beatmap x, Beatmap y)
409 | {
410 | if (x == null)
411 | return y == null;
412 | return x.Audio == y.Audio;
413 | }
414 |
415 | public int GetHashCode(Beatmap obj)
416 | {
417 | return obj.Audio.GetHashCode();
418 | }
419 | }
420 | }
421 |
--------------------------------------------------------------------------------