-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Eimaen/master
Plugin system prototype
- Loading branch information
Showing
198 changed files
with
892 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using DevBase.Format.Structure; | ||
using DevBase.Generics; | ||
using OpenLyricsClient.Shared.Plugin; | ||
using OpenLyricsClient.Shared.Structure.Artwork; | ||
using OpenLyricsClient.Shared.Structure.Lyrics; | ||
using OpenLyricsClient.Shared.Structure.Song; | ||
|
||
namespace OpenLyricsClient.Plugin | ||
{ | ||
public class ExamplePlugin : IPlugin | ||
{ | ||
public PluginScope Scope => PluginScope.LyricsCollector; | ||
|
||
public Task<Artwork?> CollectArtwork(SongResponseObject songResponseObject) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public async Task<LyricData?> CollectLyrics(SongResponseObject songResponseObject) | ||
{ | ||
AList<LyricElement> lyrics = new AList<LyricElement>(); | ||
lyrics.Add(new LyricElement(533, "Here's my line")); | ||
lyrics.Add(new LyricElement(536, "Here's another")); | ||
lyrics.Add(new LyricElement(573, "Here's my line")); | ||
lyrics.Add(new LyricElement(83, "Here's another")); | ||
lyrics.Add(new LyricElement(5563, "Here's my line")); | ||
lyrics.Add(new LyricElement(333, "Here's another")); | ||
lyrics.Add(new LyricElement(43, "Here's another")); | ||
lyrics.Add(new LyricElement(5323, "Here's another")); | ||
lyrics.Add(new LyricElement(6333, "Here's another")); | ||
lyrics.Add(new LyricElement(7453, "Here's another")); | ||
lyrics.Add(new LyricElement(84583, "Here's another")); | ||
lyrics.Add(new LyricElement(45743, "Here's another")); | ||
return await LyricData.ConvertToData(lyrics, songResponseObject.SongRequestObject.Song.SongMetadata, "Plugin"); | ||
} | ||
|
||
public Task<SongResponseObject?> CollectSong(SongRequestObject songRequestObject) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public int GetCollectedArtworkQuality() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public int GetCollectedLyricsQuality() | ||
{ | ||
return 1337; | ||
} | ||
|
||
public int GetCollectedSongQuality() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<LyricData> ProcessLyrics(SongResponseObject songResponse, LyricData lyrics) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\OpenLyricsClient.Shared\OpenLyricsClient.Shared.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" Version="0.10.19" /> | ||
<PackageReference Include="Avalonia.X11" Version="0.10.19" /> | ||
<PackageReference Include="DevBase" Version="1.1.1" /> | ||
<PackageReference Include="DevBase.Api" Version="1.1.5" /> | ||
<PackageReference Include="DevBase.Avalonia" Version="1.0.1" /> | ||
<PackageReference Include="DevBase.Format" Version="1.2.1" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||
<PackageReference Include="SpotifyAPI.Web" Version="7.0.0" /> | ||
<PackageReference Include="Squalr.Engine" Version="2.3.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="XWindowManager"> | ||
<HintPath>..\Libraries\XWindowManager.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using OpenLyricsClient.Shared.Structure.Lyrics; | ||
using OpenLyricsClient.Shared.Structure.Song; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace OpenLyricsClient.Shared.Plugin | ||
{ | ||
public interface IPlugin | ||
{ | ||
PluginScope Scope { get; } | ||
Task<LyricData> ProcessLyrics(SongResponseObject songResponse, LyricData lyrics); | ||
Task<LyricData?> CollectLyrics(SongResponseObject songResponseObject); | ||
int GetCollectedLyricsQuality(); | ||
Task<SongResponseObject?> CollectSong(SongRequestObject songRequestObject); | ||
int GetCollectedSongQuality(); | ||
Task<Structure.Artwork.Artwork?> CollectArtwork(SongResponseObject songResponseObject); | ||
int GetCollectedArtworkQuality(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
|
||
namespace OpenLyricsClient.Shared.Plugin | ||
{ | ||
[Flags] | ||
public enum PluginScope | ||
{ | ||
Dummy = 1, | ||
LyricsPostprocess = 2, | ||
LyricsViewRendering = 4, | ||
LyricsCollector = 8, | ||
SongCollector = 16, | ||
ArtworkCollector = 32 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nd/Structure/Artwork/ArtworkReturnCode.cs → ...ed/Structure/Artwork/ArtworkReturnCode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace OpenLyricsClient.Shared.Structure.Enum; | ||
|
||
public enum DataOrigin | ||
{ | ||
SPOTIFY, TIDAL | ||
} |
2 changes: 1 addition & 1 deletion
2
...d/Structure/Enum/EnumLyricsDisplayMode.cs → ...d/Structure/Enum/EnumLyricsDisplayMode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nt/Backend/Structure/Enum/EnumPlayback.cs → ...ent.Shared/Structure/Enum/EnumPlayback.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ckend/Structure/Enum/EnumRegisterTypes.cs → ...hared/Structure/Enum/EnumRegisterTypes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ent/Backend/Structure/Json/JsonArtwork.cs → ...ient.Shared/Structure/Json/JsonArtwork.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/Backend/Structure/Json/JsonCacheData.cs → ...nt.Shared/Structure/Json/JsonCacheData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...t/Backend/Structure/Json/JsonLyricData.cs → ...nt.Shared/Structure/Json/JsonLyricData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ackend/Structure/Json/JsonSongMetadata.cs → ...Shared/Structure/Json/JsonSongMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...t/Backend/Structure/Json/JsonSongState.cs → ...nt.Shared/Structure/Json/JsonSongState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...on/Musixmatch/Json/MusixMatchAryGenres.cs → ...on/Musixmatch/Json/MusixMatchAryGenres.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...usixmatch/Json/MusixMatchFetchResponse.cs → ...usixmatch/Json/MusixMatchFetchResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ch/Json/MusixMatchFetchResponseMessage.cs → ...ch/Json/MusixMatchFetchResponseMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...son/MusixMatchFetchResponseMessageBody.cs → ...son/MusixMatchFetchResponseMessageBody.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/MusixMatchFetchResponseMessageHeader.cs → ...n/MusixMatchFetchResponseMessageHeader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../Json/Musixmatch/Json/MusixMatchLyrics.cs → .../Json/Musixmatch/Json/MusixMatchLyrics.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/Musixmatch/Json/MusixMatchMacroCalls.cs → ...n/Musixmatch/Json/MusixMatchMacroCalls.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ixmatch/Json/MusixMatchMatcherTrackGet.cs → ...ixmatch/Json/MusixMatchMatcherTrackGet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../Json/MusixMatchMatcherTrackGetMessage.cs → .../Json/MusixMatchMatcherTrackGetMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/MusixMatchMatcherTrackGetMessageBody.cs → ...n/MusixMatchMatcherTrackGetMessageBody.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...MusixMatchMatcherTrackGetMessageHeader.cs → ...MusixMatchMatcherTrackGetMessageHeader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...re/Json/Musixmatch/Json/MusixMatchMeta.cs → ...re/Json/Musixmatch/Json/MusixMatchMeta.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/Musixmatch/Json/MusixMatchMusicGenre.cs → ...n/Musixmatch/Json/MusixMatchMusicGenre.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...sixmatch/Json/MusixMatchMusicGenreList.cs → ...sixmatch/Json/MusixMatchMusicGenreList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Json/Musixmatch/Json/MusixMatchSnippet.cs → ...Json/Musixmatch/Json/MusixMatchSnippet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...son/Musixmatch/Json/MusixMatchSubtitle.cs → ...son/Musixmatch/Json/MusixMatchSubtitle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Musixmatch/Json/MusixMatchSubtitleList.cs → ...Musixmatch/Json/MusixMatchSubtitleList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/Json/Musixmatch/Json/MusixMatchTrack.cs → ...e/Json/Musixmatch/Json/MusixMatchTrack.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...sixmatch/Json/MusixMatchTrackLyricsGet.cs → ...sixmatch/Json/MusixMatchTrackLyricsGet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.