Merge branch 'main' of github.com:cass-dlcm/godotVmcSharp

This commit is contained in:
Cassandra de la Cruz-Munoz 2023-09-24 12:29:26 -04:00
commit e420482962
27 changed files with 252 additions and 244 deletions

View File

@ -34,12 +34,12 @@ namespace godotVmcSharp
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "name", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "name", 's', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "value", 'f', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "value", 'f', m.Data[1].Type));
return;
}
var blendShape = (string)m.Data[0].Value;
@ -61,7 +61,7 @@ namespace godotVmcSharp
Value = (float)m.Data[1].Value;
return;
}
GD.Print($"Invalid argument for {addr}. BlendShape \"{blendShape}\" not in list.");
GD.Print($"Invalid argument for {Addr}. BlendShape \"{blendShape}\" not in list.");
}
public VmcExtBlendVal(string name, float value) : base(new OscAddress("VMC/Ext/Blend/Val"))
@ -84,7 +84,7 @@ namespace godotVmcSharp
Value = value;
return;
}
GD.Print($"Invalid argument for {addr}. BlendShape \"{name}\" not in list.");
GD.Print($"Invalid argument for {Addr}. BlendShape \"{name}\" not in list.");
}
private bool IsVrm0BlendShape(string name)
@ -134,7 +134,7 @@ namespace godotVmcSharp
}
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument> {
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument> {
new OscArgument(Name, 's'),
new OscArgument(Value, 'f')
});

View File

@ -30,47 +30,47 @@ namespace godotVmcSharp
{
if (m.Data.Count != 8)
{
GD.Print($"Invalid number of arguments for {addr}. Expected 8, received {m.Data.Count}.");
GD.Print($"Invalid number of arguments for {Addr}. Expected 8, received {m.Data.Count}.");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "name", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "name", 's', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.x", 'f', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.x", 'f', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.y", 'f', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.y", 'f', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.z", 'f', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.z", 'f', m.Data[3].Type));
return;
}
if (m.Data[4].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.x", 'f', m.Data[4].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.x", 'f', m.Data[4].Type));
return;
}
if (m.Data[5].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.y", 'f', m.Data[5].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.y", 'f', m.Data[5].Type));
return;
}
if (m.Data[6].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.z", 'f', m.Data[6].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.z", 'f', m.Data[6].Type));
return;
}
if (m.Data[7].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.w", 'f', m.Data[7].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.w", 'f', m.Data[7].Type));
return;
}
Name = (string)m.Data[0].Value;
@ -86,7 +86,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
var quat = Transform.Basis.GetRotationQuaternion();
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Name, 's'),
new OscArgument(Transform.Origin.X, 'f'),
new OscArgument(Transform.Origin.Y, 'f'),

View File

@ -37,42 +37,42 @@ namespace godotVmcSharp
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "name", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "name", 's', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.x", 'f', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.x", 'f', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.y", 'f', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.y", 'f', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.z", 'f', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.z", 'f', m.Data[3].Type));
return;
}
if (m.Data[4].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.x", 'f', m.Data[4].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.x", 'f', m.Data[4].Type));
return;
}
if (m.Data[5].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.y", 'f', m.Data[5].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.y", 'f', m.Data[5].Type));
return;
}
if (m.Data[6].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.z", 'f', m.Data[6].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.z", 'f', m.Data[6].Type));
return;
}
if (m.Data[7].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.w", 'f', m.Data[7].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.w", 'f', m.Data[7].Type));
return;
}
if (m.Data[8].Type != 'f')
@ -95,7 +95,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
var quat = Transform.Basis.GetRotationQuaternion();
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Name, 's'),
new OscArgument(Transform.Origin.X, 'f'),
new OscArgument(Transform.Origin.Y, 'f'),

View File

@ -39,37 +39,37 @@ namespace godotVmcSharp
}
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "active", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "active", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "name", 's', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "name", 's', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "IsLeft", 'i', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "IsLeft", 'i', m.Data[2].Type));
}
if (m.Data[3].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "IsTouch", 'i', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "IsTouch", 'i', m.Data[3].Type));
}
if (m.Data[4].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "IsAxis", 'i', m.Data[4].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "IsAxis", 'i', m.Data[4].Type));
}
if (m.Data[5].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "Axis.x", 'f', m.Data[5].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "Axis.x", 'f', m.Data[5].Type));
}
if (m.Data[6].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "Axis.y", 'f', m.Data[6].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "Axis.y", 'f', m.Data[6].Type));
}
if (m.Data[7].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "Axis.z", 'f', m.Data[7].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "Axis.z", 'f', m.Data[7].Type));
}
if ((int)m.Data[0].Value < 0 || (int)m.Data[0].Value > 2)
{
@ -88,7 +88,7 @@ namespace godotVmcSharp
{
if (active < 0 || active > 2)
{
GD.Print($"Invalid value for \"active\" 'i' argument of {addr}. Expected 0-2, received {active}");
GD.Print($"Invalid value for \"active\" 'i' argument of {Addr}. Expected 0-2, received {active}");
return;
}
Active = active;
@ -101,7 +101,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Active, 'i'),
new OscArgument(Name, 's'),
new OscArgument(IsLeft, 'i'),

View File

@ -29,12 +29,12 @@ namespace godotVmcSharp
{
if (m.Data.Count != 1)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 1, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 1, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "path", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "path", 's', m.Data[0].Type));
return;
}
Path = (string)m.Data[0].Value;
@ -47,7 +47,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument> { new OscArgument(Path, 's') });
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument> { new OscArgument(Path, 's') });
}
}
}

View File

@ -30,54 +30,54 @@ namespace godotVmcSharp
{
if (m.Data.Count != 8)
{
GD.Print($"Invalid number of arguments for {base.addr}. Expected 8, received {m.Data.Count}.");
GD.Print($"Invalid number of arguments for {base.Addr}. Expected 8, received {m.Data.Count}.");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "serial", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "serial", 's', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.x", 'f', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.x", 'f', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.y", 'f', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.y", 'f', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.z", 'f', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.z", 'f', m.Data[3].Type));
return;
}
if (m.Data[4].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.x", 'f', m.Data[4].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.x", 'f', m.Data[4].Type));
return;
}
if (m.Data[5].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.y", 'f', m.Data[5].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.y", 'f', m.Data[5].Type));
return;
}
if (m.Data[6].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.z", 'f', m.Data[6].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.z", 'f', m.Data[6].Type));
return;
}
if (m.Data[7].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.w", 'f', m.Data[7].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.w", 'f', m.Data[7].Type));
return;
}
Serial = (string)m.Data[0].Value;
Transform = new Transform3D(new Basis(new Quaternion((float)m.Data[4].Value, (float)m.Data[5].Value, (float)m.Data[6].Value, (float)m.Data[7].Value)), new Vector3((float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].Value));
}
public VmcExtDevicePos(OscAddress addr, string serial, Transform3D transform) : base(addr)
public VmcExtDevicePos(OscAddress Addr, string serial, Transform3D transform) : base(Addr)
{
Serial = serial;
Transform = transform;
@ -86,7 +86,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
var quat = Transform.Basis.GetRotationQuaternion();
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Serial, 's'),
new OscArgument(Transform.Origin.X, 'f'),
new OscArgument(Transform.Origin.Y, 'f'),

View File

@ -30,22 +30,22 @@ namespace godotVmcSharp
{
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "active", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "active", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "name", 's', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "name", 's', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "keycode", 'i', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "keycode", 'i', m.Data[2].Type));
return;
}
if ((int)m.Data[0].Value < 0 || (int)m.Data[0].Value > 1)
{
GD.Print($"Invalid value for \"active\" 'i' argument of {addr}. Expected 0 or 1, received {(int)m.Data[0].Value}");
GD.Print($"Invalid value for \"active\" 'i' argument of {Addr}. Expected 0 or 1, received {(int)m.Data[0].Value}");
return;
}
Active = (int)m.Data[0].Value;
@ -57,7 +57,7 @@ namespace godotVmcSharp
{
if (active < 0 || active > 1)
{
GD.Print($"Invalid value for \"active\" 'i' argument of {addr}. Expected 0 or 1, received {active}");
GD.Print($"Invalid value for \"active\" 'i' argument of {Addr}. Expected 0 or 1, received {active}");
return;
}
Active = active;
@ -67,7 +67,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Active, 'i'),
new OscArgument(Name, 's'),
new OscArgument(Keycode, 'i')

View File

@ -32,67 +32,67 @@ namespace godotVmcSharp
{
if (m.Data.Count != 12)
{
GD.Print($"Invalid number of arguments for {base.addr}. Expected 12, received {m.Data.Count}.");
GD.Print($"Invalid number of arguments for {base.Addr}. Expected 12, received {m.Data.Count}.");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "name", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "name", 's', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.x", 'f', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.x", 'f', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.y", 'f', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.y", 'f', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.z", 'f', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.z", 'f', m.Data[3].Type));
return;
}
if (m.Data[4].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.x", 'f', m.Data[4].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.x", 'f', m.Data[4].Type));
return;
}
if (m.Data[5].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.y", 'f', m.Data[5].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.y", 'f', m.Data[5].Type));
return;
}
if (m.Data[6].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.z", 'f', m.Data[6].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.z", 'f', m.Data[6].Type));
return;
}
if (m.Data[7].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.w", 'f', m.Data[7].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.w", 'f', m.Data[7].Type));
return;
}
if (m.Data[8].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "color.red", 'f', m.Data[8].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "color.red", 'f', m.Data[8].Type));
return;
}
if (m.Data[9].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "color.blue", 'f', m.Data[9].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "color.blue", 'f', m.Data[9].Type));
return;
}
if (m.Data[10].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "color.green", 'f', m.Data[10].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "color.green", 'f', m.Data[10].Type));
return;
}
if (m.Data[11].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "color.alpha", 'f', m.Data[11].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "color.alpha", 'f', m.Data[11].Type));
return;
}
Name = (string)m.Data[0].Value;
@ -110,7 +110,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
var quat = Transform.Basis.GetRotationQuaternion();
return new OscMessage(addr, new List<OscArgument>{
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Name, 's'),
new OscArgument(Transform.Origin.X, 'f'),
new OscArgument(Transform.Origin.Y, 'f'),

View File

@ -29,17 +29,17 @@ namespace godotVmcSharp
{
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "knob", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "knob", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "active", 'i', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "active", 'i', m.Data[1].Type));
return;
}
if ((int)m.Data[1].Value < 0 || (int)m.Data[1].Value > 1)
{
GD.Print($"Invalid value for \"active\" argument of {addr}. Expected 0 or 1, received {(int)m.Data[1].Value}.");
GD.Print($"Invalid value for \"active\" argument of {Addr}. Expected 0 or 1, received {(int)m.Data[1].Value}.");
return;
}
Knob = (int)m.Data[0].Value;
@ -50,7 +50,7 @@ namespace godotVmcSharp
{
if (active < 0 || active > 1)
{
GD.Print($"Invalid value for \"active\" argument of {addr}. Expected 0 or 1, received {active}.");
GD.Print($"Invalid value for \"active\" argument of {Addr}. Expected 0 or 1, received {active}.");
return;
}
Knob = knob;
@ -59,7 +59,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Knob, 'i'),
new OscArgument(Active, 'i')
});

View File

@ -29,12 +29,12 @@ namespace godotVmcSharp
{
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "knob", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "knob", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "value", 'f', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "value", 'f', m.Data[1].Type));
return;
}
Knob = (int)m.Data[0].Value;
@ -49,7 +49,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Knob, 'i'),
new OscArgument(Value, 'f')
});

View File

@ -32,27 +32,27 @@ namespace godotVmcSharp
{
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "active", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "active", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "channel", 'i', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "channel", 'i', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "note", 'i', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "note", 'i', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "velocity", 'f', m.Data[4].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "velocity", 'f', m.Data[4].Type));
return;
}
if ((int)m.Data[0].Value < 0 || (int)m.Data[0].Value > 1)
{
GD.Print($"Invalid value for \"active\" 'i' argument of {addr}. Expected 0 or 1, received {(int)m.Data[0].Value}");
GD.Print($"Invalid value for \"active\" 'i' argument of {Addr}. Expected 0 or 1, received {(int)m.Data[0].Value}");
return;
}
Active = (int)m.Data[0].Value;
@ -65,7 +65,7 @@ namespace godotVmcSharp
{
if (active < 0 || active > 1)
{
GD.Print($"Invalid value for \"active\" 'i' argument of {addr}. Expected 0 or 1, received {Active}.");
GD.Print($"Invalid value for \"active\" 'i' argument of {Addr}. Expected 0 or 1, received {Active}.");
return;
}
Active = active;
@ -76,7 +76,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Active, 'i'),
new OscArgument(Channel, 'i'),
new OscArgument(Note, 'i'),

View File

@ -192,19 +192,19 @@ namespace godotVmcSharp
{
if (CalibrationState == null)
{
return new OscMessage(addr, new List<OscArgument>{
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Loaded, 'i')
});
}
if (TrackingStatus == null)
{
return new OscMessage(addr, new List<OscArgument>{
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Loaded, 'i'),
new OscArgument(CalibrationState, 'i'),
new OscArgument(CalibrationMode, 'i')
});
}
return new OscMessage(addr, new List<OscArgument>{
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Loaded, 'i'),
new OscArgument(CalibrationState, 'i'),
new OscArgument(CalibrationMode, 'i'),

View File

@ -29,12 +29,12 @@ namespace godotVmcSharp
{
if (m.Data.Count != 1)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 1, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 1, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "option", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "option", 's', m.Data[0].Type));
return;
}
option = (string)m.Data[0].Value;
@ -47,7 +47,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(option, 's')});
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(option, 's')});
}
}
}

View File

@ -32,27 +32,27 @@ namespace godotVmcSharp
{
if (m.Data.Count > 3 || m.Data.Count < 2)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 2 or 3, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 2 or 3, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "enable", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "enable", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "port", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "port", 'i', m.Data[0].Type));
return;
}
if ((int)m.Data[0].Value < 0 || (int)m.Data[0].Value > 1)
{
GD.Print($"Invalid value for \"enable\" argument of {addr}. Expected 0 or 1, received {(int)m.Data[0].Value}.");
GD.Print($"Invalid value for \"enable\" argument of {Addr}. Expected 0 or 1, received {(int)m.Data[0].Value}.");
return;
}
if ((int)m.Data[1].Value < 0 || (int)m.Data[1].Value > 65535)
{
GD.Print($"Invalid value for \"port\" argument of {addr}. Expected 0-65535, received {(int)m.Data[1].Value}.");
GD.Print($"Invalid value for \"port\" argument of {Addr}. Expected 0-65535, received {(int)m.Data[1].Value}.");
return;
}
Enable = (int)m.Data[0].Value;
@ -64,7 +64,7 @@ namespace godotVmcSharp
}
if (m.Data[2].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "IpAddress", 's', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "IpAddress", 's', m.Data[2].Type));
return;
}
IpAddress = (string)m.Data[2].Value;
@ -74,12 +74,12 @@ namespace godotVmcSharp
{
if (enable < 0 || enable > 1)
{
GD.Print($"Invalid value for \"enable\" argument of {addr}. Expected 0 or 1, received {enable}.");
GD.Print($"Invalid value for \"enable\" argument of {Addr}. Expected 0 or 1, received {enable}.");
return;
}
if (port < 0 || port > 65535)
{
GD.Print($"Invalid value for \"port\" argument of {addr}. Expected 0-65535, received {port}.");
GD.Print($"Invalid value for \"port\" argument of {Addr}. Expected 0-65535, received {port}.");
return;
}
Enable = enable;
@ -91,12 +91,12 @@ namespace godotVmcSharp
{
if (enable < 0 || enable > 1)
{
GD.Print($"Invalid value for \"enable\" argument of {addr}. Expected 0 or 1, received {enable}.");
GD.Print($"Invalid value for \"enable\" argument of {Addr}. Expected 0 or 1, received {enable}.");
return;
}
if (port < 0 || port > 65535)
{
GD.Print($"Invalid value for \"port\" argument of {addr}. Expected 0-65535, received {port}.");
GD.Print($"Invalid value for \"port\" argument of {Addr}. Expected 0-65535, received {port}.");
return;
}
Enable = enable;
@ -108,12 +108,12 @@ namespace godotVmcSharp
{
if (IpAddress == "")
{
return new OscMessage(addr, new List<OscArgument>{
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Enable, 'i'),
new OscArgument(Port, 'i'),
});
}
return new OscMessage(addr, new List<OscArgument>{
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Enable, 'i'),
new OscArgument(Port, 'i'),
new OscArgument(IpAddress, 's'),

View File

@ -30,17 +30,17 @@ namespace godotVmcSharp
{
if (m.Data.Count != 2)
{
GD.Print($"Invalid number of arguments for {addr} message. Expected 2 but received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr} message. Expected 2 but received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "service", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "service", 's', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "json", 's', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "json", 's', m.Data[1].Type));
return;
}
Service = (string)m.Data[0].Value;
@ -55,7 +55,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Service, 's'),
new OscArgument(Json, 's')
});

View File

@ -54,7 +54,7 @@ namespace godotVmcSharp
Offset = new Vector3((float)m.Data[11].Value, (float)m.Data[12].Value, (float)m.Data[13].Value);
break;
default:
GD.Print($"Invalid number of arguments for {addr}. Expected 8 or 14, received {m.Data.Count}.");
GD.Print($"Invalid number of arguments for {Addr}. Expected 8 or 14, received {m.Data.Count}.");
return;
}
}
@ -77,42 +77,42 @@ namespace godotVmcSharp
{
if (data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "name", 's', data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "name", 's', data[0].Type));
return false;
}
if (data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.x", 'f', data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.x", 'f', data[1].Type));
return false;
}
if (data[2].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.y", 'f', data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.y", 'f', data[2].Type));
return false;
}
if (data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.z", 'f', data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.z", 'f', data[3].Type));
return false;
}
if (data[4].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.x", 'f', data[4].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.x", 'f', data[4].Type));
return false;
}
if (data[5].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.y", 'f', data[5].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.y", 'f', data[5].Type));
return false;
}
if (data[6].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.z", 'f', data[6].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.z", 'f', data[6].Type));
return false;
}
if (data[7].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.w", 'f', data[7].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "q.w", 'f', data[7].Type));
return false;
}
return true;
@ -126,32 +126,32 @@ namespace godotVmcSharp
}
if (data[8].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "s.x", 'f', data[8].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "s.x", 'f', data[8].Type));
return false;
}
if (data[9].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "s.y", 'f', data[9].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "s.y", 'f', data[9].Type));
return false;
}
if (data[10].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "s.z", 'f', data[10].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "s.z", 'f', data[10].Type));
return false;
}
if (data[11].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "o.x", 'f', data[11].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "o.x", 'f', data[11].Type));
return false;
}
if (data[12].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "o.y", 'f', data[12].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "o.y", 'f', data[12].Type));
return false;
}
if (data[13].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "o.z", 'f', data[13].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "o.z", 'f', data[13].Type));
return false;
}
return true;
@ -162,7 +162,7 @@ namespace godotVmcSharp
var quat = Transform.Basis.GetRotationQuaternion();
if (!Scale.HasValue)
{
return new OscMessage(addr, new List<OscArgument>{
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Name, 's'),
new OscArgument(Transform.Origin.X, 'f'),
new OscArgument(Transform.Origin.Y, 'f'),
@ -173,7 +173,7 @@ namespace godotVmcSharp
new OscArgument(quat.W, 'f'),
});
}
return new OscMessage(addr, new List<OscArgument>{
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Name, 's'),
new OscArgument(Transform.Origin.X, 'f'),
new OscArgument(Transform.Origin.Y, 'f'),

View File

@ -29,12 +29,12 @@ namespace godotVmcSharp
{
if (m.Data.Count != 1)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 1, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 1, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "mode", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "mode", 'i', m.Data[0].Type));
return;
}
if ((int)m.Data[0].Value < 0 || (int)m.Data[0].Value > 2)
@ -57,7 +57,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Mode, 'i')});
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Mode, 'i')});
}
}
}

View File

@ -29,12 +29,12 @@ namespace godotVmcSharp
{
if (m.Data.Count != 1)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 1, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 1, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "path", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "path", 's', m.Data[0].Type));
return;
}
Path = (string)m.Data[0].Value;
@ -47,7 +47,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Path, 's')});
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Path, 's')});
}
}
}

View File

@ -30,27 +30,27 @@ namespace godotVmcSharp
{
if (m.Data.Count != 4)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 4, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 4, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "enable", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "enable", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.x", 'f', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.x", 'f', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.y", 'f', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.y", 'f', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.z", 'f', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "p.z", 'f', m.Data[3].Type));
return;
}
Enable = (int)m.Data[0].Value;
@ -65,7 +65,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Enable, 'i'),
new OscArgument(Position.X, 'f'),
new OscArgument(Position.Y, 'f'),

View File

@ -34,37 +34,37 @@ namespace godotVmcSharp
{
if (m.Data.Count != 6)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 6, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 6, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "status", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "status", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "root", 'i', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "root", 'i', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "bone", 'i', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "bone", 'i', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "blendShape", 'i', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "blendShape", 'i', m.Data[3].Type));
return;
}
if (m.Data[4].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "camera", 'i', m.Data[4].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "camera", 'i', m.Data[4].Type));
return;
}
if (m.Data[5].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "devices", 'i', m.Data[5].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "devices", 'i', m.Data[5].Type));
return;
}
Status = (int)m.Data[0].Value;
@ -87,7 +87,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Status, 'i'),
new OscArgument(Root, 'i'),
new OscArgument(Bone, 'i'),

View File

@ -30,12 +30,12 @@ namespace godotVmcSharp
{
if (m.Data.Count != 1)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 1, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 1, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "response", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "response", 's', m.Data[0].Type));
return;
}
Response = (string)m.Data[0].Value;
@ -48,7 +48,7 @@ namespace godotVmcSharp
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Response, 's')});
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Response, 's')});
}
}
}

View File

@ -23,31 +23,31 @@ namespace godotVmcSharp
{
public class VmcExtSetShortcut : VmcMessage
{
public string shortcut { get; }
public string Shortcut { get; }
public VmcExtSetShortcut(OscMessage m) : base(m.Address)
{
if (m.Data.Count != 1)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 1, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 1, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "shortcut", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "shortcut", 's', m.Data[0].Type));
return;
}
shortcut = (string)m.Data[0].Value;
Shortcut = (string)m.Data[0].Value;
}
public VmcExtSetShortcut(string _shortcut) : base(new OscAddress("/VMC/Ext/Set/Shortcut"))
public VmcExtSetShortcut(string shortcut) : base(new OscAddress("/VMC/Ext/Set/Shortcut"))
{
shortcut = _shortcut;
Shortcut = shortcut;
}
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(shortcut, 's')});
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Shortcut, 's')});
}
}
}

View File

@ -24,50 +24,50 @@ namespace godotVmcSharp
{
public class VmcExtSettingColor : VmcMessage
{
public Godot.Color color { get; }
public Color Color { get; }
public VmcExtSettingColor(godotOscSharp.OscMessage m) : base(m.Address)
public VmcExtSettingColor(OscMessage m) : base(m.Address)
{
if (m.Data.Count != 4)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 4, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 4, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "r", 'f', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "r", 'f', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "g", 'f', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "g", 'f', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "b", 'f', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "b", 'f', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "a", 'f', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "a", 'f', m.Data[3].Type));
return;
}
color = new Godot.Color((float)m.Data[0].Value, (float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].Value);
Color = new Godot.Color((float)m.Data[0].Value, (float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].Value);
}
public VmcExtSettingColor(Godot.Color _color) : base(new godotOscSharp.OscAddress("/VMC/Ext/Setting/Color"))
public VmcExtSettingColor(Color color) : base(new OscAddress("/VMC/Ext/Setting/Color"))
{
color = _color;
Color = color;
}
public godotOscSharp.OscMessage ToMessage()
public OscMessage ToMessage()
{
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(color.R, 'f'),
new godotOscSharp.OscArgument(color.G, 'f'),
new godotOscSharp.OscArgument(color.B, 'f'),
new godotOscSharp.OscArgument(color.A, 'f')
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Color.R, 'f'),
new OscArgument(Color.G, 'f'),
new OscArgument(Color.B, 'f'),
new OscArgument(Color.A, 'f')
});
}
}

View File

@ -18,105 +18,104 @@
using Godot;
using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp
{
public class VmcExtSettingWin : VmcMessage
{
public int isTopMost { get; }
public int isTransparent { get; }
public int windowClickThrough { get; }
public int hideBorder { get; }
public int IsTopMost { get; }
public int IsTransparent { get; }
public int WindowClickThrough { get; }
public int HideBorder { get; }
public VmcExtSettingWin(godotOscSharp.OscMessage m) : base(m.Address)
public VmcExtSettingWin(OscMessage m) : base(m.Address)
{
if (m.Data.Count != 4)
{
GD.Print($"Invalid number of arguments for {addr}. Expecting 4, received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr}. Expecting 4, received {m.Data.Count}");
return;
}
if (m.Data[0].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "isTopMost", 'i', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "isTopMost", 'i', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "isTransparent", 'i', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "isTransparent", 'i', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "windowClickThrough", 'i', m.Data[2].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "windowClickThrough", 'i', m.Data[2].Type));
return;
}
if (m.Data[3].Type != 'i')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "hideBorder", 'i', m.Data[3].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "hideBorder", 'i', m.Data[3].Type));
return;
}
if ((int)m.Data[0].Value < 0 || (int)m.Data[0].Value > 1)
{
GD.Print($"Invalid value for \"isTopMost\" 'i' argument of {addr}. Expected 0 or 1, received {(int)m.Data[0].Value}");
GD.Print($"Invalid value for \"isTopMost\" 'i' argument of {Addr}. Expected 0 or 1, received {(int)m.Data[0].Value}");
return;
}
if ((int)m.Data[1].Value < 0 || (int)m.Data[1].Value > 1)
{
GD.Print($"Invalid value for \"isTransparent\" 'i' argument of {addr}. Expected 0 or 1, received {(int)m.Data[1].Value}");
GD.Print($"Invalid value for \"isTransparent\" 'i' argument of {Addr}. Expected 0 or 1, received {(int)m.Data[1].Value}");
return;
}
if ((int)m.Data[2].Value < 0 || (int)m.Data[2].Value > 1)
{
GD.Print($"Invalid value for \"windowClickThrough\" 'i' argument of {addr}. Expected 0 or 1, received {(int)m.Data[2].Value}");
GD.Print($"Invalid value for \"windowClickThrough\" 'i' argument of {Addr}. Expected 0 or 1, received {(int)m.Data[2].Value}");
return;
}
if ((int)m.Data[3].Value < 0 || (int)m.Data[3].Value > 1)
{
GD.Print($"Invalid value for \"hideBorder\" 'i' argument of {addr}. Expected 0 or 1, received {(int)m.Data[3].Value}");
GD.Print($"Invalid value for \"hideBorder\" 'i' argument of {Addr}. Expected 0 or 1, received {(int)m.Data[3].Value}");
return;
}
isTopMost = (int)m.Data[0].Value;
isTransparent = (int)m.Data[1].Value;
windowClickThrough = (int)m.Data[2].Value;
hideBorder = (int)m.Data[3].Value;
IsTopMost = (int)m.Data[0].Value;
IsTransparent = (int)m.Data[1].Value;
WindowClickThrough = (int)m.Data[2].Value;
HideBorder = (int)m.Data[3].Value;
}
public VmcExtSettingWin(int _isTopMost, int _isTransparent, int _windowClickThrough, int _hideBorder) : base(new godotOscSharp.OscAddress("/VMC/Ext/Setting/Win"))
public VmcExtSettingWin(int isTopMost, int isTransparent, int windowClickThrough, int hideBorder) : base(new OscAddress("/VMC/Ext/Setting/Win"))
{
if (_isTopMost < 0 || _isTopMost > 1)
if (isTopMost < 0 || isTopMost > 1)
{
GD.Print($"Invalid value for \"isTopMost\" 'i' argument of {addr}. Expected 0 or 1, received {_isTopMost}");
GD.Print($"Invalid value for \"isTopMost\" 'i' argument of {Addr}. Expected 0 or 1, received {isTopMost}");
return;
}
if (_isTransparent < 0 || _isTransparent > 1)
if (isTransparent < 0 || isTransparent > 1)
{
GD.Print($"Invalid value for \"isTransparent\" 'i' argument of {addr}. Expected 0 or 1, received {_isTransparent}");
GD.Print($"Invalid value for \"isTransparent\" 'i' argument of {Addr}. Expected 0 or 1, received {isTransparent}");
return;
}
if (_windowClickThrough < 0 || _windowClickThrough > 1)
if (windowClickThrough < 0 || windowClickThrough > 1)
{
GD.Print($"Invalid value for \"windowClickThrough\" 'i' argument of {addr}. Expected 0 or 1, received {_windowClickThrough}");
GD.Print($"Invalid value for \"windowClickThrough\" 'i' argument of {Addr}. Expected 0 or 1, received {windowClickThrough}");
return;
}
if (_hideBorder < 0 || _hideBorder > 1)
if (hideBorder < 0 || hideBorder > 1)
{
GD.Print($"Invalid value for \"hideBorder\" 'i' argument of {addr}. Expected 0 or 1, received {_hideBorder}");
GD.Print($"Invalid value for \"hideBorder\" 'i' argument of {Addr}. Expected 0 or 1, received {hideBorder}");
return;
}
isTopMost = _isTopMost;
isTransparent = _isTransparent;
windowClickThrough = _windowClickThrough;
hideBorder = _hideBorder;
IsTopMost = isTopMost;
IsTransparent = isTransparent;
WindowClickThrough = windowClickThrough;
HideBorder = hideBorder;
}
public godotOscSharp.OscMessage ToMessage()
public new OscMessage ToMessage()
{
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(isTopMost, 'i'),
new godotOscSharp.OscArgument(isTransparent, 'i'),
new godotOscSharp.OscArgument(windowClickThrough, 'i'),
new godotOscSharp.OscArgument(hideBorder, 'i')
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(IsTopMost, 'i'),
new OscArgument(IsTransparent, 'i'),
new OscArgument(WindowClickThrough, 'i'),
new OscArgument(HideBorder, 'i')
});
}
}

View File

@ -23,7 +23,7 @@ namespace godotVmcSharp
{
public class VmcExtT : VmcMessage
{
public float time { get; }
public float Time { get; }
public VmcExtT(godotOscSharp.OscMessage m) : base(m.Address)
{
if (m.Data.Count != 1)
@ -36,12 +36,19 @@ namespace godotVmcSharp
InvalidArgumentType.GetErrorString(m.Address.ToString(), "time", 'f', m.Data[0].Type);
return;
}
time = (float)m.Data[0].Value;
Time = (float)m.Data[0].Value;
}
public VmcExtT(float _time) : base(new godotOscSharp.OscAddress("/VMC/Ext/T"))
public VmcExtT(float time) : base(new godotOscSharp.OscAddress("/VMC/Ext/T"))
{
time = _time;
Time = time;
}
public new OscMessage ToMessage()
{
return new OscMessage(Addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Time, 'f')
});
}
}
}

View File

@ -24,80 +24,82 @@ namespace godotVmcSharp
{
public class VmcExtVrm : VmcMessage
{
public string path { get; }
public string title { get; }
public string? hash { get; }
public string Path { get; }
public string Title { get; }
public string Hash { get; }
public VmcExtVrm(godotOscSharp.OscMessage m) : base(m.Address)
public VmcExtVrm(OscMessage m) : base(m.Address)
{
switch (m.Data.Count)
{
case 2:
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "path", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "path", 's', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "title", 's', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "title", 's', m.Data[1].Type));
return;
}
path = (string)m.Data[0].Value;
title = (string)m.Data[1].Value;
Path = (string)m.Data[0].Value;
Title = (string)m.Data[1].Value;
Hash = "";
break;
case 3:
if (m.Data[0].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "path", 's', m.Data[0].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "path", 's', m.Data[0].Type));
return;
}
if (m.Data[1].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "title", 's', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "title", 's', m.Data[1].Type));
return;
}
if (m.Data[2].Type != 's')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "hash", 's', m.Data[1].Type));
GD.Print(InvalidArgumentType.GetErrorString(Addr, "hash", 's', m.Data[1].Type));
return;
}
path = (string)m.Data[0].Value;
title = (string)m.Data[1].Value;
hash = (string)m.Data[2].Value;
Path = (string)m.Data[0].Value;
Title = (string)m.Data[1].Value;
Hash = (string)m.Data[2].Value;
break;
default:
GD.Print($"Invalid number of arguments for {addr} message. Expected 2 or 3 but received {m.Data.Count}");
GD.Print($"Invalid number of arguments for {Addr} message. Expected 2 or 3 but received {m.Data.Count}");
return;
}
}
public VmcExtVrm(string _path, string _title) : base(new godotOscSharp.OscAddress("/VMC/Ext/VRM"))
public VmcExtVrm(string path, string title) : base(new OscAddress("/VMC/Ext/VRM"))
{
path = _path;
title = _title;
Path = path;
Title = title;
Hash = "";
}
public VmcExtVrm(string _path, string _title, string _hash) : base(new godotOscSharp.OscAddress("/VMC/Ext/VRM"))
public VmcExtVrm(string path, string title, string hash) : base(new OscAddress("/VMC/Ext/VRM"))
{
path = _path;
title = _title;
hash = _hash;
Path = path;
Title = title;
Hash = hash;
}
public godotOscSharp.OscMessage ToMessage()
public new OscMessage ToMessage()
{
if (hash == null)
if (Hash == null)
{
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(path, 's'),
new godotOscSharp.OscArgument(title, 's')
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Path, 's'),
new OscArgument(Title, 's')
});
}
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(path, 's'),
new godotOscSharp.OscArgument(title, 's'),
new godotOscSharp.OscArgument(hash, 's')
return new OscMessage(Addr, new List<OscArgument>{
new OscArgument(Path, 's'),
new OscArgument(Title, 's'),
new OscArgument(Hash, 's')
});
}
}

View File

@ -22,16 +22,16 @@ namespace godotVmcSharp
{
public class VmcMessage
{
public godotOscSharp.OscAddress addr { get; }
public godotOscSharp.OscAddress Addr { get; }
public VmcMessage(godotOscSharp.OscAddress address)
{
addr = address;
Addr = address;
}
public godotOscSharp.OscMessage ToMessage()
{
return new godotOscSharp.OscMessage(addr);
return new godotOscSharp.OscMessage(Addr);
}
}
}