Skip to content

Commit

Permalink
Merge remote-tracking branch 'base/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloWRC committed Nov 9, 2024
2 parents 766282a + 8045429 commit 0220b87
Show file tree
Hide file tree
Showing 19 changed files with 97 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/BugReport.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug 反馈
description: 在使用 ClassIsland 的过程中遇到了 Bug。
title: 在这里输入你的标题
title: 将此栏【替换】为你的标题
labels: ["Bug", "待查看"]
body:
- type: markdown
Expand Down Expand Up @@ -30,7 +30,7 @@ body:
value: |
### Bug 信息
描述您遇到的 Bug。您可以附上截图、录屏、堆栈跟踪、日志等材料,便于开发者追踪问题。**您可以阅读[此处的文档](https://docs.classisland.tech/app/reporting-issue/)来了解如何收集跟踪错误需要的信息。**
描述您遇到的 Bug。您可以附上截图、录屏、堆栈跟踪、日志等材料,便于开发者追踪问题。**您可以阅读[此处的文档](https://docs.classisland.tech/app/reporting-issue)来了解如何收集跟踪错误需要的信息。**
- type: textarea
id: excepted
attributes:
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/FeatureRequest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 功能请求
description: 提出一项新的功能。
title: 在这里输入你的标题
title: 将此栏【替换】为你的标题
labels: ["新功能", "待查看"]
body:
- type: markdown
Expand All @@ -22,9 +22,9 @@ body:
options:
- label: 我已将本应用更新到最新测试版 ![最新的版本号](https://img.shields.io/github/v/release/ClassIsland/ClassIsland?include_prereleases&style=flat-square&label=),并看过[最新提交](https://github.com/ClassIsland/ClassIsland/commits/dev/),确认我想要的功能还没有实现。
required: true
- label: 我已在 [Issues](https://github.com/ClassIsland/ClassIsland/issues?q=label%3A新功能) 和 [ClassIsland 文档](https://docs.classisland.tech/app/)中检索,确认我想要的功能未被提交过。
- label: 我已在 [Issues](https://github.com/ClassIsland/ClassIsland/issues?q=-label%3ABug) 和 [ClassIsland 文档](https://docs.classisland.tech/app/)中检索,确认我想要的功能未被提交过。
required: true
- label: 我认为我想要的功能是用户广泛需要的,插件不能替代的,且没有超出 ClassIsland 作为**灵动课表**的开发目标,而非添加与课表及教学辅助无关的内容。(您可以学习[编写插件](https://docs.classisland.tech/dev/plugins/create-project/)来实现特殊的需求)。
- label: 我认为我想要的功能是用户广泛需要的,插件不能替代的,且没有超出 ClassIsland 作为**灵动课表**的开发目标,而非添加与课表及教学辅助无关的内容。(您可以学习[编写插件](https://docs.classisland.tech/dev/plugins/create-project)来实现特殊的需求)。
required: true
- label: 我已知晓由于开发者时间精力有限,加上已经积压了大量的功能请求,我提交的功能请求可能需要比较久的时间才能实现。
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: ClassIsland 文档反馈
url: https://github.com/ClassIsland/classisland-docs/issues/new
url: https://github.com/ClassIsland/classisland-docs-next/issues/new
about: 反馈 ClassIsland 文档相关问题
- name: 讨论区
url: https://github.com/ClassIsland/ClassIsland/discussions/
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: List files
run: ls
Expand Down Expand Up @@ -62,6 +63,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: List files
run: ls
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vendors/EdgeTtsSharp"]
path = vendors/EdgeTtsSharp
url = [email protected]:ClassIsland/EdgeTtsSharp.git
1 change: 1 addition & 0 deletions .idea/.idea.ClassIsland/.idea/vcs.xml

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

8 changes: 7 additions & 1 deletion ClassIsland.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demos", "Demos", "{006EDE57-B272-4893-AABA-4F91D431BC0B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassIsland.IpcDemo", "Demos\ClassIsland.IpcDemo\ClassIsland.IpcDemo.csproj", "{B6721576-FBFF-4D60-B3CD-0ED70DBA78FC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassIsland.IpcDemo", "Demos\ClassIsland.IpcDemo\ClassIsland.IpcDemo.csproj", "{B6721576-FBFF-4D60-B3CD-0ED70DBA78FC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edge_tts_sharp", "vendors\EdgeTtsSharp\Edge_tts_sharp\Edge_tts_sharp.csproj", "{D490316C-8D92-41EF-AAF4-26E902E7FF4F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -87,6 +89,10 @@ Global
{B6721576-FBFF-4D60-B3CD-0ED70DBA78FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6721576-FBFF-4D60-B3CD-0ED70DBA78FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6721576-FBFF-4D60-B3CD-0ED70DBA78FC}.Release|Any CPU.Build.0 = Release|Any CPU
{D490316C-8D92-41EF-AAF4-26E902E7FF4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D490316C-8D92-41EF-AAF4-26E902E7FF4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D490316C-8D92-41EF-AAF4-26E902E7FF4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D490316C-8D92-41EF-AAF4-26E902E7FF4F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
15 changes: 15 additions & 0 deletions ClassIsland/Assets/Documents/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ ClassIsland 目前推出了【精简模式】,精简模式的 ClassIsland 裁

***

# 1.5.0.4

1.5 - Griseo

本版本包含了对 1.5 的一些 Bug 修复和改进。

## 新增功能和优化

- 【构建】为 Nuget 包启用源代码链接

### Bug 修复

- 【提醒/语音】修复 EdgeTTS 无法使用的问题 ([#489](https://github.com/ClassIsland/ClassIsland/issues/489))
- 【插件】修复插件无法加载依赖的问题


# 1.5.0.3

Expand Down
2 changes: 1 addition & 1 deletion ClassIsland/ClassIsland.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Downloader" Version="3.0.6" />
<PackageReference Include="Edge_tts_sharp" Version="1.0.4" />
<PackageReference Include="EPPlus" Version="7.0.8" />
<PackageReference Include="Google.Protobuf" Version="3.27.0-rc1" />
<PackageReference Include="Grpc.Net.Client" Version="2.62.0" />
Expand Down Expand Up @@ -79,6 +78,7 @@
<ItemGroup>
<ProjectReference Include="..\ClassIsland.Core\ClassIsland.Core.csproj" />
<ProjectReference Include="..\ClassIsland.Shared\ClassIsland.Shared.csproj" />
<ProjectReference Include="..\vendors\EdgeTtsSharp\Edge_tts_sharp\Edge_tts_sharp.csproj" />
</ItemGroup>
<ItemGroup>
<Page Update="Themes\LightTheme.xaml">
Expand Down
14 changes: 11 additions & 3 deletions ClassIsland/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,15 @@ private IntPtr ProcWnd(IntPtr hwnd, int msg, IntPtr param, IntPtr lParam, ref bo
if ((pos.flags & SET_WINDOW_POS_FLAGS.SWP_NOZORDER) == 0) // SWP_NOZORDER
{
Logger.LogTrace("Z order changed");
ReCheckTopmostState();
if (pos.hwndInsertAfter != NativeWindowHelper.HWND_TOPMOST)
{
ReCheckTopmostState();
}

if (pos.hwndInsertAfter != NativeWindowHelper.HWND_BOTTOM)
{
SetBottom();
}
}
}

Expand Down Expand Up @@ -734,8 +742,8 @@ private void SetBottom()
}
if (ViewModel.IsNotificationWindowExplicitShowed)
{
SetWindowPos(hWnd, default, 0, 0, 0, 0,
SET_WINDOW_POS_FLAGS.SWP_NOSIZE | SET_WINDOW_POS_FLAGS.SWP_NOMOVE | SET_WINDOW_POS_FLAGS.SWP_NOACTIVATE);
//SetWindowPos(hWnd, NativeWindowHelper.HWND_TOPMOST, 0, 0, 0, 0,
// SET_WINDOW_POS_FLAGS.SWP_NOSIZE | SET_WINDOW_POS_FLAGS.SWP_NOMOVE | SET_WINDOW_POS_FLAGS.SWP_NOACTIVATE);
return;
}
SetWindowPos(hWnd, NativeWindowHelper.HWND_BOTTOM, 0, 0, 0, 0,
Expand Down
12 changes: 12 additions & 0 deletions ClassIsland/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ public class Settings : ObservableRecipient, ILessonControlSettings, INotificati
private bool _isSwapMode = true;
private bool _showEchoCaveWhenSettingsPageLoading = false;
private int _settingsPagesCachePolicy = 0;
private string _notificationSpeechCustomSmgTokenSource = "";

public void NotifyPropertyChanged(string propertyName)
{
Expand Down Expand Up @@ -1340,6 +1341,17 @@ public double NotificationSoundVolume
}
}

public string NotificationSpeechCustomSmgTokenSource
{
get => _notificationSpeechCustomSmgTokenSource;
set
{
if (value == _notificationSpeechCustomSmgTokenSource) return;
_notificationSpeechCustomSmgTokenSource = value;
OnPropertyChanged();
}
}

#endregion

#region AppUpgrades
Expand Down
2 changes: 1 addition & 1 deletion ClassIsland/PluginLoadContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace ClassIsland;

class PluginLoadContext(string pluginPath) : AssemblyLoadContext
class PluginLoadContext(string pluginPath) : AssemblyLoadContext("ClassIsland.PluginLoadContext")
{
private readonly AssemblyDependencyResolver _resolver = new(pluginPath);

Expand Down
4 changes: 4 additions & 0 deletions ClassIsland/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"ClassIsland (禁用集控) Sentry dbg": {
"commandName": "Project",
"commandLineArgs": "-dm -esd"
},
"配置文件 1": {
"commandName": "Project",
"commandLineArgs": "-dm -epp E:\\Coding\\TestNuGetDep\\TestNuGetDep\\bin\\Debug\\net8.0-windows\\win-x64"
}
}
}
7 changes: 4 additions & 3 deletions ClassIsland/Services/PluginService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ public static void InitializePlugins(HostBuilderContext context, IServiceCollect

try
{
var loadContext = new PluginLoadContext(Path.GetFullPath(pluginDir));
var asm = loadContext.LoadFromAssemblyPath(
Path.GetFullPath(Path.Combine(pluginDir, manifest.EntranceAssembly)));
var fullPath = Path.GetFullPath(Path.Combine(pluginDir, manifest.EntranceAssembly));
var loadContext = new PluginLoadContext(fullPath);
var asm = loadContext.LoadFromAssemblyName(
new AssemblyName(Path.GetFileNameWithoutExtension(fullPath)));
var entrance = asm.ExportedTypes.FirstOrDefault(x =>
x.BaseType == typeof(PluginBase) ||
x.GetCustomAttributes().FirstOrDefault(a => a.GetType() == typeof(PluginEntrance)) != null);
Expand Down
8 changes: 6 additions & 2 deletions ClassIsland/Services/SpeechService/EdgeTtsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class EdgeTtsService : ISpeechService

private SettingsService SettingsService { get; } = App.GetService<SettingsService>();

private List<eVoice> Voices { get; } = Edge_tts.GetVoice();
private List<eVoice> Voices { get; } = EdgeTts.GetVoice();

private Queue<EdgeTtsPlayInfo> PlayingQueue { get; } = new();

Expand Down Expand Up @@ -81,7 +81,11 @@ public void EnqueueSpeechQueue(string text)
var completed = false;
var voice = Voices.Find(voice => voice.ShortName == SettingsService.Settings.EdgeTtsVoiceName);
var completeHandle = new CancellationTokenSource();
Edge_tts.Invoke(text, voice, 0, (Action<List<byte>>)(binary =>
var options = new PlayOption()
{
Text = text
};
EdgeTts.Invoke(options, voice, (Action<List<byte>>)(binary =>
{
if (completeHandle.IsCancellationRequested)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public string? NotificationSettingsSelectedProvider
}

public List<eVoice> EdgeVoices { get; } =
Edge_tts.GetVoice().FindAll(i => i.Locale.Contains("zh-CN"));
EdgeTts.GetVoice().FindAll(i => i.Locale.Contains("zh-CN"));

public string TestSpeechText { get; set; } = "风带来了故事的种子,时间使之发芽。";
}
18 changes: 18 additions & 0 deletions GeneratePackage.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,26 @@
<RepositoryUrl>https://github.com/ClassIsland/ClassIsland</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright (c) 2024 HelloWRC</Copyright>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup>
<DebugType>embedded</DebugType>
<DebugSymbols>true</DebugSymbols>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
</Project>
10 changes: 4 additions & 6 deletions tools/plugin/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ $classIslandRoot = "$([System.IO.Path]::GetDirectoryName($scriptPath))\..\..\Cla

function SetEnvironmentVariable {
param (
$Name,
$Value,
$Scope="User"
$Name, $Value
)
$out = "$Name = $Value"
Write-Host $out -ForegroundColor DarkGray
[Environment]::SetEnvironmentVariable($Name, $Value, $Scope)
[Environment]::SetEnvironmentVariable($Name, $Value, 1)
}

Set-Location $classIslandRoot
Expand All @@ -39,7 +37,7 @@ catch {

Write-Host "🔧 正在设置开发环境变量…" -ForegroundColor Cyan

SetEnvironmentVariable("ClassIsland_DebugBinaryFile", [System.IO.Path]::GetFullPath("${classIslandRoot}\bin\Debug\net8.0-windows\ClassIsland.exe"))
SetEnvironmentVariable("ClassIsland_DebugBinaryDirectory", [System.IO.Path]::GetFullPath("${classIslandRoot}/bin\Debug\net8.0-windows\"))
[Environment]::SetEnvironmentVariable("ClassIsland_DebugBinaryFile", [System.IO.Path]::GetFullPath("${classIslandRoot}\bin\Debug\net8.0-windows\ClassIsland.exe"), 1)
[Environment]::SetEnvironmentVariable("ClassIsland_DebugBinaryDirectory", [System.IO.Path]::GetFullPath("${classIslandRoot}/bin\Debug\net8.0-windows\"), 1)

Write-Host "构建完成" -ForegroundColor Green
1 change: 1 addition & 0 deletions vendors/EdgeTtsSharp
Submodule EdgeTtsSharp added at 4e9a7d

0 comments on commit 0220b87

Please sign in to comment.