diff --git a/qController.Standard/Classes/Communication/QController.cs b/qController.Standard/Classes/Communication/QController.cs index 42c065b..7987901 100644 --- a/qController.Standard/Classes/Communication/QController.cs +++ b/qController.Standard/Classes/Communication/QController.cs @@ -21,7 +21,6 @@ namespace qController.Communication { this.port = port; this.ipAddress = address; - qClient = new QClient(ipAddress, port); qUpdater = new QUpdater(this); @@ -75,8 +74,6 @@ namespace qController.Communication public void Kill(){ Log.Debug("QCONTROLLER - Killing"); - if (qUpdater != null) - qUpdater.Kill(); if (qClient != null) qClient.Close(); } diff --git a/qController.Standard/Classes/Communication/QUpdater.cs b/qController.Standard/Classes/Communication/QUpdater.cs index 4dbfb86..d79880b 100644 --- a/qController.Standard/Classes/Communication/QUpdater.cs +++ b/qController.Standard/Classes/Communication/QUpdater.cs @@ -1,24 +1,15 @@ //Class used for updating local "copy" of workspace info, cue-lists, cues, etc. -using System; -using System.Threading; -using Serilog; -using Xamarin.Forms; using Serilog; namespace qController.Communication { public class QUpdater { - - private bool active = true; - private bool started = false; - private QController qController; - private Thread updateThread; + private QController qController; public QUpdater(QController controller) { qController = controller; - updateThread = new Thread(new ThreadStart(UpdateLoop)); qController.qClient.qParser.CueInfoUpdated += OnCueUpdateReceived; qController.qClient.qParser.WorkspaceUpdated += OnWorkspaceUpdated; qController.qClient.qParser.PlaybackPositionUpdated += OnPlaybackPositionUpdated; @@ -40,33 +31,6 @@ namespace qController.Communication private void OnWorkspaceLoadError(object source, WorkspaceEventArgs args) { Log.Debug("QUPDATER - Loading cuelists has failed for some reason retrying"); - //qController.qClient.sendArgsUDP("/workspace/" + args.UpdatedWorkspace.workspace_id + "/connect"); - //qController.qClient.sendArgsUDP("/workspace/" + args.UpdatedWorkspace.workspace_id + "/updates", 1); - //qController.qClient.sendTCP("/workspace/" + args.UpdatedWorkspace.workspace_id + "/cueLists"); - - } - - public void Start(){ - Log.Debug("QUPDATER - Start() method called"); - try - { - //updateThread.Start(); - Log.Debug("QUPDATER - updateThread started"); - } - catch (ThreadStateException tSe) - { - Log.Debug("QUPDATER - updateThread already started"); - } - } - - //Attempt at a "keep alive" message - public void UpdateLoop() - { - active = true; - Device.StartTimer(TimeSpan.FromSeconds(5.0), () => { - SendThump(); - return active; - }); } public void OnCueUpdateReceived(object source, CueEventArgs args) @@ -101,16 +65,5 @@ namespace qController.Communication Log.Debug("QUPDATER - Update Specific Cue Called because of Playback Position Updated"); qController.qClient.UpdateSpecificCue(qController.qWorkspace.workspace_id,args.PlaybackPosition); } - - public void SendThump() - { - - qController.qClient.sendTCP("/workspace/" + qController.qWorkspace.workspace_id + "/thump"); - } - - public void Kill(){ - active = false; - updateThread.Abort(); - } } } diff --git a/qController.Standard/Pages/ControlPage.xaml.cs b/qController.Standard/Pages/ControlPage.xaml.cs index 5214531..f3878f0 100644 --- a/qController.Standard/Pages/ControlPage.xaml.cs +++ b/qController.Standard/Pages/ControlPage.xaml.cs @@ -61,7 +61,6 @@ namespace qController Log.Debug($"CONTROLPAGE - Connection Status Changed: {args.WorkspaceId} : {args.Status}"); if (args.Status.Equals("ok")) { - qController.qUpdater.Start(); Device.BeginInvokeOnMainThread(() => { FinishUI(); });