Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements and New Features #443

Merged
merged 2 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/@MasterVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v10.4.6
v10.4.8
1 change: 1 addition & 0 deletions source/ACT.Hojoring.Common/GetActionIcon.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 必要な物
# Google Chrome
# https://www.nuget.org/packages/HtmlAgilityPack/
# https://www.nuget.org/packages/Selenium.WebDriver
# https://www.nuget.org/packages/Selenium.WebDriver.ChromeDriver
Expand Down
4 changes: 2 additions & 2 deletions source/ACT.Hojoring.Common/Version.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;

[assembly: AssemblyVersion("10.4.0.6")]
[assembly: AssemblyFileVersion("10.4.0.6")]
[assembly: AssemblyVersion("10.4.0.8")]
[assembly: AssemblyFileVersion("10.4.0.8")]
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ private void TryCompile()
{
lock (this)
{
if ((DateTime.UtcNow - this.lastQueueTimestamp).TotalMilliseconds <= CompileHandlerInterval)
// ゾーンチェンジが発生していない場合はインターバルをもうける
if (!this.isQueueZoneChange)
{
return;
if ((DateTime.UtcNow - this.lastQueueTimestamp).TotalMilliseconds <= CompileHandlerInterval)
{
return;
}
}

this.lastQueueTimestamp = DateTime.MaxValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
Expand Down Expand Up @@ -120,6 +121,8 @@ public void LoadCurrentTimeline()
{
lock (this)
{
var sw = Stopwatch.StartNew();
this.AppLogger.Trace("LoadCurrentTimeline start"); LogManager.Flush();
WPFHelper.Invoke(() =>
{
TimelineNoticeOverlay.CloseNotice();
Expand All @@ -132,18 +135,22 @@ public void LoadCurrentTimeline()
var toReloads = timelines.Where(x =>
x.IsGlobalZone ||
x.IsReference);
/*
foreach (var tl in toReloads)
{
tl.Reload();
WPFHelper.DelayTask();
}

*/
// すでにコントローラがロードされていたらアンロードする
foreach (var tl in timelines)
{
tl.Controller.Unload();
tl.IsActive = false;
WPFHelper.DelayTask();
if (tl.Controller.Status != TimelineStatus.Unloaded)
{
tl.Controller.Unload();
tl.IsActive = false;
WPFHelper.DelayTask();
}
}

// 現在のゾーンで有効なタイムラインを取得する
Expand Down Expand Up @@ -180,6 +187,7 @@ public void LoadCurrentTimeline()

// ゾーングローバルオブジェクトを初期化する
TimelineScriptGlobalModel.Instance.DynamicObject.ClearZoneGlobal();
this.AppLogger.Trace("LoadCurrentTimeline end " + sw.Elapsed.TotalMilliseconds.ToString() + "ms"); LogManager.Flush();
}
}

Expand Down
21 changes: 20 additions & 1 deletion source/ACT.TTSYukkuri/ACT.TTSYukkuri.Core/PluginCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ private void SpeakTTS(
/// コマンドの発行から5.5秒後に「こんにちは」という
/// </example>
private static readonly Regex WaitCommandRegex = new Regex(
@"/wait\s+(?<due>[\d\.]+)[,\s]+(?<tts>.+)$",
@"/wait\s+(?<due>[\d\.]+)(?<operator>[+-]|)(?<offset>\d|)[,\s]+(?<tts>.+)$",
RegexOptions.Compiled);

private void SpeakTTS(
Expand All @@ -356,6 +356,8 @@ private void SpeakTTS(
}

var delayAsText = match.Groups["due"].Value;
var operatorAsText = match.Groups["operator"].Value;
var offsetAsText = match.Groups["offset"].Value;
var message = match.Groups["tts"].Value?.Trim();

if (!double.TryParse(delayAsText, out double delay))
Expand All @@ -370,6 +372,23 @@ private void SpeakTTS(
return;
}

// 必要ならdurationに対して簡易な足し算と引き算を行う
if (operatorAsText != string.Empty && offsetAsText != string.Empty)
{
double offset;
if (double.TryParse(offsetAsText, out offset))
{
if (operatorAsText == "+")
{
delay += offset;
}
else if (operatorAsText == "-")
{
delay -= offset;
}
}
}

// ディレイをかけて読上げる
SpeechController.Default.SpeakWithDelay(
message,
Expand Down