Skip to content

Commit f0bd7cc

Browse files
Update 0.1.7.17
1 parent 68df1be commit f0bd7cc

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

TwitchBot/Classes/Extentions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ public static void TrueTTS(string Text, string Voice = "")
188188
{
189189
return;
190190
}*/
191+
Player.Open(new Uri("./TwitchBot-TrueTTS.wav", UriKind.Relative));
191192
Player.Open(new Uri(path, UriKind.Absolute));
192193
Player.Volume = MySave.Current.Nums[4] / 100d;
193194
Player.Play();
@@ -201,6 +202,12 @@ public static void TrueTTS(string Text, string Voice = "")
201202
if (File.Exists(path)) File.Delete(path);
202203
TrueTTSReady = false;
203204
}
205+
public static void ClearTrueTTSFiles()
206+
{
207+
string path = Path.GetTempPath() + "/TwitchBot-TrueTTS.wav";
208+
if (File.Exists(path)) File.Delete(path);
209+
TrueTTSReady = false;
210+
}
204211
public static void CopyStream(Stream input, Stream output)
205212
{
206213
byte[] buffer = new byte[8 * 1024];

TwitchBot/Classes/OBSConnections.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public OBSWebSock()
2929
}
3030
}
3131

32+
//Controll
3233
public static void SetSourceEnabled(string Source, bool Enabled)
3334
{
3435
SendPackage("SetSceneItemProperties", new Dictionary<string, string>() {
@@ -50,6 +51,13 @@ public static void SetSourcePosition(string Source, string x, string y)
5051
{"position","{\"x\":"+x+",\"y\":"+y+"}"}
5152
});
5253
}
54+
public static void SetSourceScale(string Source, string x, string y)
55+
{
56+
SendPackage("SetSceneItemProperties", new Dictionary<string, string>() {
57+
{"item",Source},
58+
{"scale","{\"x\":"+x+",\"y\":"+y+"}"}
59+
});
60+
}
5361
public static void SetScene(string Scene)
5462
{
5563
SendPackage("SetCurrentScene", new Dictionary<string, string>() {
@@ -68,14 +76,14 @@ public static void SendTransition()
6876
SendPackage("TransitionToProgram", new Dictionary<string, string>());
6977
}
7078

79+
//Tech Met
7180
public static void ReAuth()
7281
{
7382
if (WSock == null || !WSock.IsAlive)
7483
return;
7584
MSGID++;
7685
WSock.Send(@"{""request-type"":""GetAuthRequired"",""message-id"":""-2""}");
7786
}
78-
7987
private static void SendPackage(string Type,Dictionary<string,string> parames)
8088
{
8189
if (!WSock.IsAlive)
@@ -92,6 +100,8 @@ private static void SendPackage(string Type,Dictionary<string,string> parames)
92100
MSGID++;
93101
WSock.Send(@"{""request-type"":"""+ Type + @"""," + parameters + @"""message-id"":""" + MSGID + @"""}");
94102
}
103+
104+
//WebSocket Methods
95105
private void WSock_OnOpen(object sender, EventArgs e)
96106
{
97107
MSGID++;

TwitchBot/Classes/ScriptLanguage.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,13 @@ public static int RunCommand(string command, int index = 0, string[] script = nu
229229
OBSWebSock.SetSourcePosition(rc[0].Trim(), rc[1].Trim(), rc[2].Trim());
230230
}
231231
break;
232+
case "Scale":
233+
{
234+
string[] rc = Regex.Replace(command, "^OBS Source Scale ", "").Trim().Split('.');
235+
if (rc.Length >= 3)
236+
OBSWebSock.SetSourceScale(rc[0].Trim(), rc[1].Trim(), rc[2].Trim());
237+
}
238+
break;
232239
}
233240
break;
234241
case "Audio":
@@ -247,6 +254,11 @@ public static int RunCommand(string command, int index = 0, string[] script = nu
247254
OBSWebSock.SetScene(Regex.Replace(command, "^OBS Scene ", "").Trim());
248255
}
249256
break;
257+
case "Transition":
258+
{
259+
OBSWebSock.SendTransition();
260+
}
261+
break;
250262
}
251263
break;
252264
case "Send":

TwitchBot/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,7 @@ private void AcSwitch(WinHotKey Key)
15261526
Extentions.SpeechSynth.SpeakAsyncCancelAll();
15271527
SpeechTask?.Abort();
15281528
Extentions.SpeechSynth.Rate = TTSrate;
1529+
Extentions.ClearTrueTTSFiles();
15291530
}
15301531

15311532
WinHotKey SwitcherKey;

TwitchBot/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
// Можно задать все значения или принять номера сборки и редакции по умолчанию
5252
// используя "*", как показано ниже:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("0.1.7.16")]
55-
[assembly: AssemblyFileVersion("0.1.7.16")]
54+
[assembly: AssemblyVersion("0.1.7.17")]
55+
[assembly: AssemblyFileVersion("0.1.7.17")]
5656
[assembly: Guid("ec4767b2-eb5d-4740-b605-c9145b8fb711")]
5757
[assembly: NeutralResourcesLanguage("ru")]

0 commit comments

Comments
 (0)