You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to be able to extend the class OscClient in order to create additional OscClient.Send() method signatures. For example, I often need to send the following type of OSC message:
For some time now, I have used a forked version of OscJack, but it seems that if there was a way for me to extend the OscClient class (currently sealed), that would be the best (I rely several different method signatures for OscClient.Send()
Or maybe there's another approach beside the fork?
The text was updated successfully, but these errors were encountered:
Is there some reason the signature isn't handled dynamically? Such as:
public void Send(string address, params object[] data)
{
if (data == null)
{
Send(address);
return;
}
_encoder.Clear();
_encoder.Append(address);
string format = ",";
foreach (object o in data)
{
if (o is string) format += "s";
else if (o is int) format += "i";
else if (o is float) format += "f";
}
_encoder.Append(format);
foreach (object o in data)
{
if (o is string) _encoder.Append((string)o);
else if (o is int) _encoder.Append((int)o);
else if (o is float) _encoder.Append((float)o);
}
_socket.Send(_encoder.Buffer, _encoder.Length, SocketFlags.None);
}
It would be great to be able to extend the class
OscClient
in order to create additionalOscClient.Send()
method signatures. For example, I often need to send the following type of OSC message:public void Send(string address, string str, float data1, float data2, float data3)
For some time now, I have used a forked version of
OscJack
, but it seems that if there was a way for me to extend the OscClient class (currently sealed), that would be the best (I rely several different method signatures forOscClient.Send()
Or maybe there's another approach beside the fork?
The text was updated successfully, but these errors were encountered: