mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-06 16:03:48 +00:00
Cleanup
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
//Currently unused would like to reimplement eventually
|
||||
//Currently being done in qConnectionPage.xaml.cs Scan() method
|
||||
//TODO: Implement this along with a way of getting active Instances and # of workspaces for an instance
|
||||
using Serilog;
|
||||
using System.Collections.Generic;
|
||||
using Zeroconf;
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
//Class used for receiving workspace update messages (UDP)
|
||||
using SharpOSC;
|
||||
using System.Threading;
|
||||
using Serilog;
|
||||
|
||||
namespace qController.Communication
|
||||
{
|
||||
public class QReceiver
|
||||
{
|
||||
public delegate void UpdateMessageReceivedHandler(object source, MessageEventArgs args);
|
||||
public event UpdateMessageReceivedHandler UpdateMessageReceived;
|
||||
|
||||
static Thread thread;
|
||||
static UDPListener udpListener;
|
||||
static int Port;
|
||||
public QReceiver(int port)
|
||||
{
|
||||
Port = port;
|
||||
udpListener = new UDPListener(port);
|
||||
thread = new Thread(new ThreadStart(ListenLoop));
|
||||
thread.Start();
|
||||
|
||||
}
|
||||
|
||||
public void ListenLoop()
|
||||
{
|
||||
/*
|
||||
HandleOscPacket callback = delegate (OscPacket packet)
|
||||
{
|
||||
var messageReceived = (OscMessage)packet;
|
||||
if (messageReceived != null)
|
||||
OnUpdateMessageReceived(messageReceived);
|
||||
else
|
||||
Log.Debug("Message came back null");
|
||||
};
|
||||
|
||||
udpListener = new UDPListener(Port, callback);
|
||||
*/
|
||||
while (true)
|
||||
{
|
||||
OscMessage messageReceived = null;
|
||||
while(messageReceived == null)
|
||||
{
|
||||
messageReceived = (OscMessage)udpListener.Receive();
|
||||
Thread.Sleep(1);
|
||||
}
|
||||
OnUpdateMessageReceived(messageReceived);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Close(){
|
||||
|
||||
thread.Abort();
|
||||
udpListener.Close();
|
||||
}
|
||||
|
||||
protected virtual void OnUpdateMessageReceived(OscMessage msg)
|
||||
{
|
||||
if (UpdateMessageReceived != null)
|
||||
UpdateMessageReceived(this, new MessageEventArgs() { Message = msg });
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
namespace qController.QItems
|
||||
using qController.QItems;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class NoQCueSelected : QCue
|
||||
{
|
||||
Reference in New Issue
Block a user