diff --git a/qController.Standard/Classes/Communication/QUpdater.cs b/qController.Standard/Classes/Communication/QUpdater.cs index 3cda96a..7a59035 100644 --- a/qController.Standard/Classes/Communication/QUpdater.cs +++ b/qController.Standard/Classes/Communication/QUpdater.cs @@ -1,4 +1,5 @@ using System; +using System.Threading; using Xamarin.Forms; using SharpOSC; namespace qController @@ -7,20 +8,25 @@ namespace qController { private bool active = true; private QController qController; + private Thread updateThread; public QUpdater(QController controller) { qController = controller; + updateThread = new Thread(new ThreadStart(UpdateLoop)); } public void Start(){ + updateThread.Start(); + } + + public void UpdateLoop() + { active = true; Device.StartTimer(TimeSpan.FromSeconds(0.01), () => { - //qController.sendCommandUDP("/selectedCues"); UpdateSelected(); UpdateLevels(); return active; }); - } public void UpdateSelected() @@ -35,6 +41,7 @@ namespace qController public void Kill(){ active = false; + updateThread.Abort(); } } }