Skip to content

Commit b4cd9a5

Browse files
added async method to fix lag I hope
1 parent 851bad0 commit b4cd9a5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ColorlightPlugin.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public class ColorlightPlugin
2020

2121
StatusForm _form;
2222

23+
bool _outputing = false;
24+
2325
public IList<LivePacketDevice> _allDevices;
2426
public int _panelWidth = 0;
2527
public int _panelHeight = 0;
@@ -176,8 +178,12 @@ public void FireEvent(string type, string parameters)
176178
/// <summary>
177179
/// This Outputs the PixelBuffer data to the panel.
178180
/// </summary>
179-
void OutputToPanel(PixelBuffer buffer)
181+
async Task OutputToPanel(PixelBuffer buffer)
180182
{
183+
if (_outputing)
184+
return;
185+
186+
_outputing = true;
181187
try
182188
{
183189
if (_intSelectOutput == -1)
@@ -219,6 +225,7 @@ void OutputToPanel(PixelBuffer buffer)
219225
{
220226
OnSendError(ex.Message);
221227
}
228+
_outputing = false;
222229
}
223230

224231
/// <summary>

0 commit comments

Comments
 (0)