Skip to content

Commit

Permalink
Merge pull request #443 from wbonbon/master
Browse files Browse the repository at this point in the history
Improvements and New Features
  • Loading branch information
wbonbon authored Dec 29, 2024
2 parents d3bd3bb + 88039a3 commit 195074a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
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
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

0 comments on commit 195074a

Please sign in to comment.