mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-07 00:13:49 +00:00
Start cleaning up QParser
This commit is contained in:
@@ -36,9 +36,12 @@ namespace qController
|
||||
//one method for messages received whether from TCP or UDP (SAME MSG FORMAT)
|
||||
private void OnMessageReceived(object source, MessageEventArgs args)
|
||||
{
|
||||
Console.WriteLine("QCLIENT MESSAGE RECEIVED: "+args.Message.Address);
|
||||
//try to find a better filtering process
|
||||
if (!args.Message.Address.Contains("update"))
|
||||
qParser.ParseMessage(args.Message);
|
||||
else if (args.Message.Address.Contains("playbackPosition") || args.Message.Address.Contains("cue_id") || args.Message.Address.Contains("cueList"))
|
||||
qParser.ParseMessage(args.Message);
|
||||
else
|
||||
ProcessUpdate(args.Message);
|
||||
}
|
||||
@@ -106,24 +109,7 @@ namespace qController
|
||||
public void ProcessUpdate(OscMessage msg)
|
||||
{
|
||||
Console.WriteLine("PROCESS UPDATE : " + msg.Address);
|
||||
if (msg.Address.Contains("disconnect"))
|
||||
{
|
||||
qParser.ParseMessage(msg);
|
||||
}
|
||||
else if (msg.Address.Contains("cue_id"))
|
||||
{
|
||||
var updateID = msg.Address.Split('/').Last();
|
||||
//UpdateSpecificCue(updateID);
|
||||
}
|
||||
else if (msg.Address.Contains("playbackPosition"))
|
||||
{
|
||||
if (msg.Arguments.Count > 0)
|
||||
{
|
||||
qParser.ParseMessage(msg);
|
||||
//UpdateSelectedCue();
|
||||
}
|
||||
}
|
||||
else if (msg.Address.Contains("workspace"))
|
||||
if (msg.Address.Contains("workspace"))
|
||||
{
|
||||
UpdateWorkspace("not yet implemented");
|
||||
}
|
||||
|
||||
@@ -113,8 +113,7 @@ namespace qController
|
||||
ParseQInfo(msg);
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Unknown message type");
|
||||
Console.WriteLine(msg.Address);
|
||||
Console.WriteLine("QParser/Unknown message type: " + msg.Address);
|
||||
foreach (var item in msg.Arguments)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace SharpOSC
|
||||
//Console.WriteLine( "Thread " + num + ": Bytes read: " + bytesRead + " - " + Encoding.ASCII.GetString(buffer));
|
||||
} while (netStream.DataAvailable);
|
||||
|
||||
Console.WriteLine("Raw TCP In: " + System.Text.Encoding.ASCII.GetString(responseData.ToArray()));
|
||||
//Console.WriteLine("Raw TCP In: " + System.Text.Encoding.ASCII.GetString(responseData.ToArray()));
|
||||
response = (OscMessage)OscPacket.GetPacket(responseData.Skip(1).ToArray());
|
||||
}
|
||||
} catch(Exception e)
|
||||
@@ -101,7 +101,7 @@ namespace SharpOSC
|
||||
public void SendAndReceive(OscPacket packet)
|
||||
{
|
||||
OscMessage msg = (OscMessage)packet;
|
||||
Console.WriteLine("TCP Message Sent: " + msg.Address);
|
||||
//Console.WriteLine("TCP Message Sent: " + msg.Address);
|
||||
byte[] data = packet.GetBytes();
|
||||
SendAndReceive(data);
|
||||
}
|
||||
|
||||
Executable → Regular
+2
-2
@@ -100,7 +100,7 @@ namespace SharpOSC
|
||||
Console.WriteLine(e.ToString());
|
||||
// If there is an error reading the packet, null is sent to the callback
|
||||
}
|
||||
Console.WriteLine("Raw UDP In: " + System.Text.Encoding.ASCII.GetString(bytes));
|
||||
//Console.WriteLine("Raw UDP In: " + System.Text.Encoding.ASCII.GetString(bytes));
|
||||
OscPacketCallback(packet);
|
||||
}
|
||||
else
|
||||
@@ -151,7 +151,7 @@ namespace SharpOSC
|
||||
{
|
||||
byte[] bytes = queue.Dequeue();
|
||||
var packet = OscPacket.GetPacket(bytes);
|
||||
Console.WriteLine("Raw UDP In: " + System.Text.Encoding.ASCII.GetString(bytes));
|
||||
//Console.WriteLine("Raw UDP In: " + System.Text.Encoding.ASCII.GetString(bytes));
|
||||
return packet;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user