Skip to content

Commit

Permalink
3.0-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
Kxnrl committed Nov 14, 2024
1 parent 5067d25 commit 455e533
Show file tree
Hide file tree
Showing 18 changed files with 1,104 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,6 @@ ASALocalRun/

# MFractors (Xamarin productivity tool) working folder
.mfractor/


.publish/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "submodule/discord-rpc-csharp"]
path = submodule/discord-rpc-csharp
url = https://github.com/Lachee/discord-rpc-csharp
16 changes: 14 additions & 2 deletions NetEaseMusic-DiscordRPC.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2042
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEaseMusic-DiscordRPC", "NetEaseMusic-DiscordRPC\NetEaseMusic-DiscordRPC.csproj", "{8A5639C6-8083-4623-9234-D87878036C4E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vanessa", "Vanessa\Vanessa.csproj", "{5B2859C2-BCDE-46C2-A113-13E48AB0A7B0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscordRPC", "submodule\discord-rpc-csharp\DiscordRPC\DiscordRPC.csproj", "{D3E3FE4A-F603-493B-8AE0-A402A91C914F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +19,14 @@ Global
{8A5639C6-8083-4623-9234-D87878036C4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A5639C6-8083-4623-9234-D87878036C4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A5639C6-8083-4623-9234-D87878036C4E}.Release|Any CPU.Build.0 = Release|Any CPU
{5B2859C2-BCDE-46C2-A113-13E48AB0A7B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B2859C2-BCDE-46C2-A113-13E48AB0A7B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B2859C2-BCDE-46C2-A113-13E48AB0A7B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B2859C2-BCDE-46C2-A113-13E48AB0A7B0}.Release|Any CPU.Build.0 = Release|Any CPU
{D3E3FE4A-F603-493B-8AE0-A402A91C914F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3E3FE4A-F603-493B-8AE0-A402A91C914F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3E3FE4A-F603-493B-8AE0-A402A91C914F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3E3FE4A-F603-493B-8AE0-A402A91C914F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
73 changes: 73 additions & 0 deletions Vanessa/AppResource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions Vanessa/AppResource.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
28 changes: 28 additions & 0 deletions Vanessa/Configurations.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.IO;
using System.Text;

namespace Kxnrl.Vanessa;

internal class Configurations
{
public bool IsFirstLoad { get; private set; }

private readonly string _path;

public Configurations()
{
var dir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Vanessa");
Directory.CreateDirectory(dir);

_path = Path.Combine(dir, "config.json");

IsFirstLoad = File.Exists(_path);

File.WriteAllText(_path, "{}", Encoding.UTF8);
}

public void Save()
{
}
}
6 changes: 6 additions & 0 deletions Vanessa/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Kxnrl.Vanessa;

internal static class Constants
{
public static Configurations GlobalConfig = new ();
}
20 changes: 20 additions & 0 deletions Vanessa/Models/PlayerInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;

namespace Kxnrl.Vanessa.Models;

internal readonly record struct PlayerInfo
{
public required string Identity { get; init; }
public required string Title { get; init; }
public required string Artists { get; init; }
public required string Album { get; init; }
public required string Cover { get; init; }
public required double Schedule { get; init; }
public required double Duration { get; init; }
public required string Url { get; init; }

public required bool Pause { get; init; }

public override int GetHashCode()
=> HashCode.Combine(Identity, Pause);
}
10 changes: 10 additions & 0 deletions Vanessa/MusicPlayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Kxnrl.Vanessa.Models;

namespace Kxnrl.Vanessa;

internal interface IMusicPlayer
{
bool Validate(int pid);

PlayerInfo? GetPlayerInfo();
}
Loading

0 comments on commit 455e533

Please sign in to comment.