mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-13 19:33:52 +00:00
Begin implementing "/update" responses from QLab
This commit is contained in:
@@ -32,7 +32,6 @@ namespace SharpOSC
|
||||
char[] types = new char[0];
|
||||
List<object> arguments = new List<object>();
|
||||
List<object> mainArray = arguments; // used as a reference when we are parsing arrays to get the main array back
|
||||
|
||||
// Get address
|
||||
address = getAddress(msg, index);
|
||||
index += msg.FirstIndexAfter(address.Length, x => x == ',');
|
||||
@@ -147,7 +146,7 @@ namespace SharpOSC
|
||||
|
||||
case ('['):
|
||||
if (arguments != mainArray)
|
||||
throw new Exception("SharopOSC does not support nested arrays");
|
||||
throw new Exception("SharpOSC does not support nested arrays");
|
||||
arguments = new List<object>(); // make arguments point to a new object array
|
||||
break;
|
||||
|
||||
@@ -247,6 +246,12 @@ namespace SharpOSC
|
||||
}
|
||||
}
|
||||
|
||||
if (types == null)
|
||||
{
|
||||
byte[] term = { 0 };
|
||||
types = Encoding.ASCII.GetChars(term);
|
||||
}
|
||||
|
||||
if (i >= msg.Length && types == null)
|
||||
throw new Exception("No null terminator after type string");
|
||||
|
||||
@@ -480,6 +485,5 @@ namespace SharpOSC
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace SharpOSC
|
||||
|
||||
string _address;
|
||||
TcpClient client;
|
||||
Thread receivingThread;
|
||||
|
||||
byte END = 0xc0;
|
||||
byte ESC = 0xdb;
|
||||
@@ -81,7 +80,7 @@ namespace SharpOSC
|
||||
}
|
||||
} catch(Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
//Console.WriteLine(e.ToString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
@@ -103,10 +102,6 @@ namespace SharpOSC
|
||||
OnMessageReceived(response);
|
||||
return response;
|
||||
}
|
||||
public void StartReceiving()
|
||||
{
|
||||
receivingThread.Start();
|
||||
}
|
||||
|
||||
public void Send(OscPacket packet)
|
||||
{
|
||||
@@ -145,7 +140,6 @@ namespace SharpOSC
|
||||
public void Close()
|
||||
{
|
||||
client.GetStream().Close();
|
||||
receivingThread.Abort();
|
||||
client.Close();
|
||||
}
|
||||
|
||||
|
||||
@@ -97,10 +97,10 @@ namespace SharpOSC
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// If there is an error reading the packet, null is sent to the callback
|
||||
}
|
||||
|
||||
OscPacketCallback(packet);
|
||||
Console.WriteLine(e.ToString());
|
||||
// If there is an error reading the packet, null is sent to the callback
|
||||
}
|
||||
OscPacketCallback(packet);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user