Skip to content

Commit bb68a44

Browse files
committed
Theater time sync
1 parent 9b9e394 commit bb68a44

File tree

4 files changed

+162
-98
lines changed

4 files changed

+162
-98
lines changed

modularDollyCam/Camera.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Diagnostics;
22
using System.Numerics;
33
using System.Runtime.CompilerServices;
4+
using System.Security.Cryptography.X509Certificates;
45
using System.Text;
56

67
namespace modularDollyCam
@@ -24,6 +25,8 @@ public partial class MainForm : Form
2425
private Vector3 targetPosition;
2526

2627
private string mapHeader;
28+
private string theaterTime;
29+
public float startSync;
2730

2831
private void SetupDataGridView()
2932
{
@@ -77,6 +80,15 @@ public async Task MoveCamera()
7780
{
7881
int.TryParse(StartDelayTextbox.Text, out int delaySeconds);
7982

83+
if (timesyncCheckbox.Checked == true)
84+
{
85+
while (true)
86+
{
87+
float time = memory.ReadFloat(theaterTime);
88+
if (time >= startSync) break;
89+
}
90+
}
91+
8092
if (delaySeconds > 0)
8193
{
8294
await Task.Delay(delaySeconds * 1000);
@@ -225,5 +237,19 @@ public async Task getPlayerList()
225237
trackListCombo.Items.Add(result);
226238
}
227239
}
240+
241+
public async Task getCurrentTime()
242+
{
243+
while (true)
244+
{
245+
float time = memory.ReadFloat(theaterTime);
246+
TimeSpan timeSpan = TimeSpan.FromSeconds(time);
247+
string formattedTime = timeSpan.ToString(@"hh\:mm\:ss\:fff");
248+
249+
CurrentTimeTextbox.Text = formattedTime;
250+
251+
await Task.Delay(1);
252+
}
253+
}
228254
}
229255
}

0 commit comments

Comments
 (0)