some breaking changes, mostly style stuff

This commit is contained in:
Cassandra de la Cruz-Munoz 2023-08-17 14:48:26 -04:00
parent 8923bd3f25
commit f3fac167e1
27 changed files with 510 additions and 524 deletions

View File

@ -18,17 +18,17 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtBlendVal : VmcMessage public class VmcExtBlendVal : VmcMessage
{ {
public string name { get; } public string Name { get; }
public float value { get; } public float Value { get; }
public VmcExtBlendVal(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtBlendVal(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 2) { if (m.Data.Count != 2)
{
GD.Print($"Invalid number of arguments for /VMC/Ext/Blend/Val. Expected 2, received {m.Data.Count}."); GD.Print($"Invalid number of arguments for /VMC/Ext/Blend/Val. Expected 2, received {m.Data.Count}.");
return; return;
} }
@ -43,65 +43,65 @@ namespace godotVmcSharp
return; return;
} }
var blendShape = (string)m.Data[0].Value; var blendShape = (string)m.Data[0].Value;
if (isVrm0BlendShape(blendShape)) if (IsVrm0BlendShape(blendShape))
{ {
name = blendShape; Name = blendShape;
value = (float)m.Data[1].Value; Value = (float)m.Data[1].Value;
return; return;
} }
if (isVrm1Expression(blendShape)) if (IsVrm1Expression(blendShape))
{ {
name = blendShape; Name = blendShape;
value = (float)m.Data[1].Value; Value = (float)m.Data[1].Value;
return; return;
} }
if (isArkitBlendShape(blendShape)) if (IsArkitBlendShape(blendShape))
{ {
name = blendShape; Name = blendShape;
value = (float)m.Data[1].Value; Value = (float)m.Data[1].Value;
return; 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 godotOscSharp.Address("VMC/Ext/Blend/Val")) public VmcExtBlendVal(string name, float value) : base(new OscAddress("VMC/Ext/Blend/Val"))
{ {
if (isVrm0BlendShape(_name)) if (IsVrm0BlendShape(name))
{ {
name = _name; Name = name;
value = _value; Value = value;
return; return;
} }
if (isVrm1Expression(_name)) if (IsVrm1Expression(name))
{ {
name = _name; Name = name;
value = _value; Value = value;
return; return;
} }
if (isArkitBlendShape(_name)) if (IsArkitBlendShape(name))
{ {
name = _name; Name = name;
value = _value; Value = value;
return; 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) private bool IsVrm0BlendShape(string name)
{ {
return name == "Joy" || name == "Angry" || name == "Sorrow" || name == "Fun" || return name == "Joy" || name == "Angry" || name == "Sorrow" || name == "Fun" ||
name == "A" || name == "I" || name == "U" || name == "E" || name == "O" || name == "A" || name == "I" || name == "U" || name == "E" || name == "O" ||
name == "Blink_L" || name == "Blink_R"; name == "Blink_L" || name == "Blink_R";
} }
private bool isVrm1Expression(string name) private bool IsVrm1Expression(string name)
{ {
return name == "happy" || name == "angry" || name == "sad" || name == "relaxed" || return name == "happy" || name == "angry" || name == "sad" || name == "relaxed" ||
name == "aa" || name == "ih" || name == "ou" || name == "ee" || name == "oh" || name == "aa" || name == "ih" || name == "ou" || name == "ee" || name == "oh" ||
name == "blinkLeft" || name == "blinkRight"; name == "blinkLeft" || name == "blinkRight";
} }
private bool isArkitBlendShape(string name) private bool IsArkitBlendShape(string name)
{ {
return name == "browInnerUp" || return name == "browInnerUp" ||
name == "browDownLeft" || name == "browDownRight" || name == "browDownLeft" || name == "browDownRight" ||
@ -132,9 +132,12 @@ namespace godotVmcSharp
name == "mouthStretchLeft" || name == "mouthStretchRight" || name == "mouthStretchLeft" || name == "mouthStretchRight" ||
name == "tongueOut"; name == "tongueOut";
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{new godotOscSharp.OscArgument(name, 's'), new godotOscSharp.OscArgument(value, 'f')}); return new OscMessage(addr, new System.Collections.Generic.List<OscArgument> {
new OscArgument(Name, 's'),
new OscArgument(Value, 'f')
});
} }
} }
} }

View File

@ -18,16 +18,15 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtBonePos : VmcMessage public class VmcExtBonePos : VmcMessage
{ {
public string name { get; } public string Name { get; }
public Godot.Transform3D transform { get; } public Transform3D Transform { get; }
public VmcExtBonePos(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtBonePos(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 8) if (m.Data.Count != 8)
{ {
@ -74,28 +73,28 @@ namespace godotVmcSharp
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; return;
} }
name = (string)m.Data[0].Value; Name = (string)m.Data[0].Value;
transform = new Godot.Transform3D(new Godot.Basis(new Godot.Quaternion((float)m.Data[4].Value, (float)m.Data[5].Value, (float)m.Data[6].Value, (float)m.Data[7].Value)), new Godot.Vector3((float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].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 VmcExtBonePos(string _name, Godot.Transform3D _transform) : base(new godotOscSharp.Address("/VMC/Ext/Bone/Pos")) public VmcExtBonePos(string name, Transform3D transform) : base(new OscAddress("/VMC/Ext/Bone/Pos"))
{ {
name = _name; Name = name;
transform = _transform; Transform = transform;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
var quat = transform.Basis.GetRotationQuaternion(); var quat = Transform.Basis.GetRotationQuaternion();
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(name, 's'), new OscArgument(Name, 's'),
new godotOscSharp.OscArgument(transform.Origin.X, 'f'), new OscArgument(Transform.Origin.X, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Y, 'f'), new OscArgument(Transform.Origin.Y, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Z, 'f'), new OscArgument(Transform.Origin.Z, 'f'),
new godotOscSharp.OscArgument(quat.X, 'f'), new OscArgument(quat.X, 'f'),
new godotOscSharp.OscArgument(quat.Y, 'f'), new OscArgument(quat.Y, 'f'),
new godotOscSharp.OscArgument(quat.Z, 'f'), new OscArgument(quat.Z, 'f'),
new godotOscSharp.OscArgument(quat.W, 'f'), new OscArgument(quat.W, 'f'),
}); });
} }
} }

View File

@ -17,6 +17,7 @@
*/ */
using Godot; using Godot;
using godotOscSharp;
namespace godotVmcSharp namespace godotVmcSharp
{ {
@ -27,7 +28,7 @@ namespace godotVmcSharp
public Transform3D Transform { get; } public Transform3D Transform { get; }
public float Fov { get; } public float Fov { get; }
public VmcExtCam(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtCam(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 9) if (m.Data.Count != 9)
{ {
@ -80,30 +81,30 @@ namespace godotVmcSharp
return; return;
} }
Name = (string)m.Data[0].Value; Name = (string)m.Data[0].Value;
Transform = new Godot.Transform3D(new Godot.Basis(new Godot.Quaternion((float)m.Data[4].Value, (float)m.Data[5].Value, (float)m.Data[6].Value, (float)m.Data[7].Value)), new Godot.Vector3((float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].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));
Fov = (float)m.Data[8].Value; Fov = (float)m.Data[8].Value;
} }
public VmcExtCam(string name, Transform3D transform, float fov) : base(new godotOscSharp.Address("/VMC/Ext/Cam")) public VmcExtCam(string name, Transform3D transform, float fov) : base(new OscAddress("/VMC/Ext/Cam"))
{ {
Name = name; Name = name;
Transform = transform; Transform = transform;
Fov = fov; Fov = fov;
} }
public new godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
var quat = Transform.Basis.GetRotationQuaternion(); var quat = Transform.Basis.GetRotationQuaternion();
return new godotOscSharp.OscMessage(addr, new System.Collections.Generic.List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(Name, 's'), new OscArgument(Name, 's'),
new godotOscSharp.OscArgument(Transform.Origin.X, 'f'), new OscArgument(Transform.Origin.X, 'f'),
new godotOscSharp.OscArgument(Transform.Origin.Y, 'f'), new OscArgument(Transform.Origin.Y, 'f'),
new godotOscSharp.OscArgument(Transform.Origin.Z, 'f'), new OscArgument(Transform.Origin.Z, 'f'),
new godotOscSharp.OscArgument(quat.X, 'f'), new OscArgument(quat.X, 'f'),
new godotOscSharp.OscArgument(quat.Y, 'f'), new OscArgument(quat.Y, 'f'),
new godotOscSharp.OscArgument(quat.Z, 'f'), new OscArgument(quat.Z, 'f'),
new godotOscSharp.OscArgument(quat.W, 'f'), new OscArgument(quat.W, 'f'),
new godotOscSharp.OscArgument(Fov, 'f') new OscArgument(Fov, 'f')
}); });
} }
} }

View File

@ -18,20 +18,19 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtCon : VmcMessage public class VmcExtCon : VmcMessage
{ {
public int active { get; } public int Active { get; }
public string name { get; } public string Name { get; }
public int isLeft { get; } public int IsLeft { get; }
public int isTouch { get; } public int IsTouch { get; }
public int isAxis { get; } public int IsAxis { get; }
public Godot.Vector3 axis { get; } public Vector3 Axis { get; }
public VmcExtCon(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtCon(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 8) if (m.Data.Count != 8)
{ {
@ -77,40 +76,40 @@ namespace godotVmcSharp
GD.Print($"Invalid value for \"active\" 'i' argument of /VMC/Ext/Con. Expected 0-2, received {(int)m.Data[0].Value}"); GD.Print($"Invalid value for \"active\" 'i' argument of /VMC/Ext/Con. Expected 0-2, received {(int)m.Data[0].Value}");
return; return;
} }
active = (int)m.Data[0].Value; Active = (int)m.Data[0].Value;
name = (string)m.Data[1].Value; Name = (string)m.Data[1].Value;
isLeft = (int)m.Data[2].Value; IsLeft = (int)m.Data[2].Value;
isTouch = (int)m.Data[3].Value; IsTouch = (int)m.Data[3].Value;
isAxis = (int)m.Data[4].Value; IsAxis = (int)m.Data[4].Value;
axis = new Godot.Vector3((float)m.Data[5].Value, (float)m.Data[6].Value, (float)m.Data[7].Value); Axis = new Vector3((float)m.Data[5].Value, (float)m.Data[6].Value, (float)m.Data[7].Value);
} }
public VmcExtCon(int _active, string _name, int _isLeft, int _isTouch, int _isAxis, Godot.Vector3 _axis): base(new godotOscSharp.Address("/VMC/Ext/Con")) public VmcExtCon(int active, string name, int isLeft, int isTouch, int isAxis, Vector3 axis) : base(new OscAddress("/VMC/Ext/Con"))
{ {
if (_active < 0 || _active > 2) 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; return;
} }
active = _active; Active = active;
name = _name; Name = name;
isLeft = _isLeft; IsLeft = isLeft;
isTouch = _isTouch; IsTouch = isTouch;
isAxis = _isAxis; IsAxis = isAxis;
axis = _axis; Axis = axis;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(active, 'i'), new OscArgument(Active, 'i'),
new godotOscSharp.OscArgument(name, 's'), new OscArgument(Name, 's'),
new godotOscSharp.OscArgument(isLeft, 'i'), new OscArgument(IsLeft, 'i'),
new godotOscSharp.OscArgument(isTouch, 'i'), new OscArgument(IsTouch, 'i'),
new godotOscSharp.OscArgument(isAxis, 'i'), new OscArgument(IsAxis, 'i'),
new godotOscSharp.OscArgument(axis.X, 'i'), new OscArgument(Axis.X, 'i'),
new godotOscSharp.OscArgument(axis.Y, 'i'), new OscArgument(Axis.Y, 'i'),
new godotOscSharp.OscArgument(axis.Z, 'i'), new OscArgument(Axis.Z, 'i'),
}); });
} }
} }

View File

@ -18,15 +18,14 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtConfig : VmcMessage public class VmcExtConfig : VmcMessage
{ {
public string path { get; } public string Path { get; }
public VmcExtConfig(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtConfig(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 1) if (m.Data.Count != 1)
{ {
@ -38,17 +37,17 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "path", 's', m.Data[0].Type)); GD.Print(InvalidArgumentType.GetErrorString(addr, "path", 's', m.Data[0].Type));
return; return;
} }
path = (string)m.Data[0].Value; Path = (string)m.Data[0].Value;
} }
public VmcExtConfig(string _path) : base(new godotOscSharp.Address("/VMC/Ext/Config")) public VmcExtConfig(string path) : base(new OscAddress("/VMC/Ext/Config"))
{ {
path = _path; Path = path;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{new godotOscSharp.OscArgument(path, 's')}); return new OscMessage(addr, new System.Collections.Generic.List<OscArgument> { new OscArgument(Path, 's') });
} }
} }
} }

View File

@ -18,16 +18,15 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtDevicePos : VmcMessage public class VmcExtDevicePos : VmcMessage
{ {
public string serial { get; } public string Serial { get; }
public Godot.Transform3D transform { get; } public Transform3D Transform { get; }
public VmcExtDevicePos(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtDevicePos(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 8) if (m.Data.Count != 8)
{ {
@ -74,28 +73,28 @@ namespace godotVmcSharp
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; return;
} }
serial = (string)m.Data[0].Value; Serial = (string)m.Data[0].Value;
transform = new Godot.Transform3D(new Godot.Basis(new Godot.Quaternion((float)m.Data[4].Value, (float)m.Data[5].Value, (float)m.Data[6].Value, (float)m.Data[7].Value)), new Godot.Vector3((float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].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(godotOscSharp.Address _addr, string _serial, Godot.Transform3D _transform) : base(_addr) public VmcExtDevicePos(OscAddress addr, string serial, Transform3D transform) : base(addr)
{ {
serial = _serial; Serial = serial;
transform = _transform; Transform = transform;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
var quat = transform.Basis.GetRotationQuaternion(); var quat = Transform.Basis.GetRotationQuaternion();
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(serial, 's'), new OscArgument(Serial, 's'),
new godotOscSharp.OscArgument(transform.Origin.X, 'f'), new OscArgument(Transform.Origin.X, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Y, 'f'), new OscArgument(Transform.Origin.Y, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Z, 'f'), new OscArgument(Transform.Origin.Z, 'f'),
new godotOscSharp.OscArgument(quat.X, 'f'), new OscArgument(quat.X, 'f'),
new godotOscSharp.OscArgument(quat.Y, 'f'), new OscArgument(quat.Y, 'f'),
new godotOscSharp.OscArgument(quat.Z, 'f'), new OscArgument(quat.Z, 'f'),
new godotOscSharp.OscArgument(quat.W, 'f') new OscArgument(quat.W, 'f')
}); });
} }
} }

View File

@ -18,16 +18,15 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtKey : VmcMessage public class VmcExtKey : VmcMessage
{ {
public int active { get; } public int Active { get; }
public string name { get; } public string Name { get; }
public int keycode { get; } public int Keycode { get; }
public VmcExtKey(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtKey(OscMessage m) : base(m.Address)
{ {
if (m.Data[0].Type != 'i') if (m.Data[0].Type != 'i')
{ {
@ -49,29 +48,29 @@ namespace godotVmcSharp
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; return;
} }
active = (int)m.Data[0].Value; Active = (int)m.Data[0].Value;
name = (string)m.Data[1].Value; Name = (string)m.Data[1].Value;
keycode = (int)m.Data[2].Value; Keycode = (int)m.Data[2].Value;
} }
public VmcExtKey(int _active, string _name, int _keycode) : base(new godotOscSharp.Address("/VMC/Ext/Key")) public VmcExtKey(int active, string name, int keycode) : base(new OscAddress("/VMC/Ext/Key"))
{ {
if (_active < 0 || _active > 1) 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; return;
} }
active = _active; Active = active;
name = _name; Name = name;
keycode = _keycode; Keycode = keycode;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(active, 'i'), new OscArgument(Active, 'i'),
new godotOscSharp.OscArgument(name, 's'), new OscArgument(Name, 's'),
new godotOscSharp.OscArgument(keycode, 'i') new OscArgument(Keycode, 'i')
}); });
} }
} }

View File

@ -24,11 +24,11 @@ namespace godotVmcSharp
{ {
public class VmcExtLight : VmcMessage public class VmcExtLight : VmcMessage
{ {
public string name { get; } public string Name { get; }
public Godot.Transform3D transform { get; } public Transform3D Transform { get; }
public Godot.Color color { get; } public Color Color { get; }
public VmcExtLight(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtLight(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 12) if (m.Data.Count != 12)
{ {
@ -95,34 +95,34 @@ namespace godotVmcSharp
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; return;
} }
name = (string)m.Data[0].Value; Name = (string)m.Data[0].Value;
transform = new Godot.Transform3D(new Godot.Basis(new Godot.Quaternion((float)m.Data[4].Value, (float)m.Data[5].Value, (float)m.Data[6].Value, (float)m.Data[7].Value)), new Godot.Vector3((float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].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));
color = new Godot.Color((float)m.Data[8].Value, (float)m.Data[9].Value, (float)m.Data[10].Value, (float)m.Data[11].Value); Color = new Color((float)m.Data[8].Value, (float)m.Data[9].Value, (float)m.Data[10].Value, (float)m.Data[11].Value);
} }
public VmcExtLight(string _name, Godot.Transform3D _transform, Godot.Color _color) : base(new godotOscSharp.Address("/VMC/Ext/Light")) public VmcExtLight(string name, Transform3D transform, Color color) : base(new OscAddress("/VMC/Ext/Light"))
{ {
name = _name; Name = name;
transform = _transform; Transform = transform;
color = _color; Color = color;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
var quat = transform.Basis.GetRotationQuaternion(); var quat = Transform.Basis.GetRotationQuaternion();
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new List<OscArgument>{
new godotOscSharp.OscArgument(name, 's'), new OscArgument(Name, 's'),
new godotOscSharp.OscArgument(transform.Origin.X, 'f'), new OscArgument(Transform.Origin.X, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Y, 'f'), new OscArgument(Transform.Origin.Y, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Z, 'f'), new OscArgument(Transform.Origin.Z, 'f'),
new godotOscSharp.OscArgument(quat.X, 'f'), new OscArgument(quat.X, 'f'),
new godotOscSharp.OscArgument(quat.Y, 'f'), new OscArgument(quat.Y, 'f'),
new godotOscSharp.OscArgument(quat.Z, 'f'), new OscArgument(quat.Z, 'f'),
new godotOscSharp.OscArgument(quat.W, 'f'), new OscArgument(quat.W, 'f'),
new godotOscSharp.OscArgument(color.R, 'f'), new OscArgument(Color.R, 'f'),
new godotOscSharp.OscArgument(color.G, 'f'), new OscArgument(Color.G, 'f'),
new godotOscSharp.OscArgument(color.B, 'f'), new OscArgument(Color.B, 'f'),
new godotOscSharp.OscArgument(color.A, 'f') new OscArgument(Color.A, 'f')
}); });
} }
} }

View File

@ -18,15 +18,14 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtMidiCcBit : VmcMessage public class VmcExtMidiCcBit : VmcMessage
{ {
public int knob { get; } public int Knob { get; }
public int active { get; } public int Active { get; }
public VmcExtMidiCcBit(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtMidiCcBit(OscMessage m) : base(m.Address)
{ {
if (m.Data[0].Type != 'i') if (m.Data[0].Type != 'i')
{ {
@ -43,26 +42,26 @@ namespace godotVmcSharp
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; return;
} }
knob = (int)m.Data[0].Value; Knob = (int)m.Data[0].Value;
active = (int)m.Data[1].Value; Active = (int)m.Data[1].Value;
} }
public VmcExtMidiCcBit(int _knob, int _active) : base(new godotOscSharp.Address("/VMC/Ext/Midi/CC/Bit")) public VmcExtMidiCcBit(int knob, int active) : base(new OscAddress("/VMC/Ext/Midi/CC/Bit"))
{ {
if (_active < 0 || _active > 1) 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; return;
} }
knob = _knob; Knob = knob;
active = _active; Active = active;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(knob, 'i'), new OscArgument(Knob, 'i'),
new godotOscSharp.OscArgument(active, 'i') new OscArgument(Active, 'i')
}); });
} }
} }

View File

@ -18,15 +18,14 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtMidiCcVal : VmcMessage public class VmcExtMidiCcVal : VmcMessage
{ {
public int knob { get; } public int Knob { get; }
public float value { get; } public float Value { get; }
public VmcExtMidiCcVal(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtMidiCcVal(OscMessage m) : base(m.Address)
{ {
if (m.Data[0].Type != 'i') if (m.Data[0].Type != 'i')
{ {
@ -38,21 +37,21 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "value", 'f', m.Data[1].Type)); GD.Print(InvalidArgumentType.GetErrorString(addr, "value", 'f', m.Data[1].Type));
return; return;
} }
knob = (int)m.Data[0].Value; Knob = (int)m.Data[0].Value;
value = (int)m.Data[1].Value; Value = (int)m.Data[1].Value;
} }
public VmcExtMidiCcVal(int _knob, float _value) : base(new godotOscSharp.Address("/VMC/Ext/Midi/CC/Val")) public VmcExtMidiCcVal(int knob, float value) : base(new OscAddress("/VMC/Ext/Midi/CC/Val"))
{ {
knob = _knob; Knob = knob;
value = _value; Value = value;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(knob, 'i'), new OscArgument(Knob, 'i'),
new godotOscSharp.OscArgument(value, 'f') new OscArgument(Value, 'f')
}); });
} }
} }

View File

@ -18,18 +18,17 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtMidiNote : VmcMessage public class VmcExtMidiNote : VmcMessage
{ {
public int active { get; } public int Active { get; }
public int channel { get; } public int Channel { get; }
public int note { get; } public int Note { get; }
public float velocity { get; } public float Velocity { get; }
public VmcExtMidiNote(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtMidiNote(OscMessage m) : base(m.Address)
{ {
if (m.Data[0].Type != 'i') if (m.Data[0].Type != 'i')
{ {
@ -56,32 +55,32 @@ namespace godotVmcSharp
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; return;
} }
active = (int)m.Data[0].Value; Active = (int)m.Data[0].Value;
channel = (int)m.Data[1].Value; Channel = (int)m.Data[1].Value;
note = (int)m.Data[2].Value; Note = (int)m.Data[2].Value;
velocity = (int)m.Data[3].Value; Velocity = (int)m.Data[3].Value;
} }
public VmcExtMidiNote(int _active, int _channel, int _note, float _velocity) : base(new godotOscSharp.Address("/VMC/Ext/Midi/Note")) public VmcExtMidiNote(int active, int channel, int note, float velocity) : base(new OscAddress("/VMC/Ext/Midi/Note"))
{ {
if (_active < 0 || _active > 1) 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; return;
} }
active = _active; Active = active;
channel = _channel; Channel = channel;
note = _note; Note = note;
velocity = _velocity; Velocity = velocity;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(active, 'i'), new OscArgument(Active, 'i'),
new godotOscSharp.OscArgument(channel, 'i'), new OscArgument(Channel, 'i'),
new godotOscSharp.OscArgument(note, 'i'), new OscArgument(Note, 'i'),
new godotOscSharp.OscArgument(velocity, 'f') new OscArgument(Velocity, 'f')
}); });
} }
} }

View File

@ -24,169 +24,191 @@ namespace godotVmcSharp
{ {
public class VmcExtOk : VmcMessage public class VmcExtOk : VmcMessage
{ {
public int loaded { get; private set; } public int Loaded { get; }
public int? calibrationState { get; private set; } public int? CalibrationState { get; }
public int? calibrationMode { get; private set; } public int? CalibrationMode { get; }
public int? trackingStatus { get; private set; } public int? TrackingStatus { get; }
public VmcExtOk(int _loaded) : base(new godotOscSharp.Address("/VMC/Ext/OK")) public VmcExtOk(int loaded) : base(new OscAddress("/VMC/Ext/OK"))
{ {
if (_loaded < 0 || _loaded > 1) if (loaded < 0 || loaded > 1)
{ {
GD.Print($"Invalid value for loaded status. Expected 0 or 1, received {_loaded}."); GD.Print($"Invalid value for loaded status. Expected 0 or 1, received {loaded}.");
return; return;
} }
loaded = _loaded; Loaded = loaded;
} }
public VmcExtOk(int _loaded, int _calibrationState, int _calibrationMode) : base(new godotOscSharp.Address("/VMC/Ext/OK")) public VmcExtOk(int loaded, int calibrationState, int calibrationMode) : base(new OscAddress("/VMC/Ext/OK"))
{ {
if (_loaded < 0 || _loaded > 1) if (loaded < 0 || loaded > 1)
{ {
GD.Print($"Invalid value for loaded status. Expected 0 or 1, received {_loaded}."); GD.Print($"Invalid value for loaded status. Expected 0 or 1, received {loaded}.");
return; return;
} }
if (_calibrationState < 0 || _calibrationState > 3) if (calibrationState < 0 || calibrationState > 3)
{ {
GD.Print($"Invalid value for calibration state. Expected 0-3, received {_calibrationState}"); GD.Print($"Invalid value for calibration state. Expected 0-3, received {calibrationState}");
return; return;
} }
if (_calibrationMode < 0 || _calibrationMode > 2) if (calibrationMode < 0 || calibrationMode > 2)
{ {
GD.Print($"Invalid value for calibration mode. Expected 0-2, received {_calibrationMode}"); GD.Print($"Invalid value for calibration mode. Expected 0-2, received {calibrationMode}");
return; return;
} }
loaded = _loaded; Loaded = loaded;
calibrationState = _calibrationState; CalibrationState = calibrationState;
calibrationMode = _calibrationMode; CalibrationMode = calibrationMode;
} }
public VmcExtOk(int _loaded, int _calibrationState, int _calibrationMode, int _trackingStatus) : base(new godotOscSharp.Address("/VMC/Ext/OK")) public VmcExtOk(int loaded, int calibrationState, int calibrationMode, int trackingStatus) : base(new OscAddress("/VMC/Ext/OK"))
{ {
if (_loaded < 0 || _loaded > 1) if (loaded < 0 || loaded > 1)
{ {
GD.Print($"Invalid value for loaded status. Expected 0 or 1, received {_loaded}."); GD.Print($"Invalid value for loaded status. Expected 0 or 1, received {loaded}.");
return; return;
} }
if (_calibrationState < 0 || _calibrationState > 3) if (calibrationState < 0 || calibrationState > 3)
{ {
GD.Print($"Invalid value for calibration state. Expected 0-3, received {_calibrationState}"); GD.Print($"Invalid value for calibration state. Expected 0-3, received {calibrationState}");
return; return;
} }
if (_calibrationMode < 0 || _calibrationMode > 2) if (calibrationMode < 0 || calibrationMode > 2)
{ {
GD.Print($"Invalid value for calibration mode. Expected 0-2, received {_calibrationMode}"); GD.Print($"Invalid value for calibration mode. Expected 0-2, received {calibrationMode}");
return; return;
} }
if (_trackingStatus < 0 || _trackingStatus > 1) if (trackingStatus < 0 || trackingStatus > 1)
{ {
GD.Print($"Invalid value for tracking status. Expected 0-1, received {_trackingStatus}"); GD.Print($"Invalid value for tracking status. Expected 0-1, received {trackingStatus}");
return; return;
} }
loaded = _loaded; Loaded = loaded;
calibrationState = _calibrationState; CalibrationState = calibrationState;
calibrationMode = _calibrationMode; CalibrationMode = calibrationMode;
trackingStatus = _trackingStatus; TrackingStatus = trackingStatus;
} }
public VmcExtOk(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtOk(OscMessage m) : base(m.Address)
{ {
switch (m.Data.Count) switch (m.Data.Count)
{ {
case 1: case 1:
OkParam0(m.Data[0]); if (!OkParam0(m.Data[0]))
{
return;
}
Loaded = (int)m.Data[0].Value;
break; break;
case 3: case 3:
OkParam1And2(m.Data[0], m.Data[1], m.Data[2]); if (!OkParam1And2(m.Data[0], m.Data[1], m.Data[2]))
{
return;
}
Loaded = (int)m.Data[0].Value;
CalibrationState = (int)m.Data[1].Value;
CalibrationMode = (int)m.Data[2].Value;
break; break;
case 4: case 4:
OkParam3(m.Data[0], m.Data[1], m.Data[2], m.Data[3]); if (!OkParam3(m.Data[0], m.Data[1], m.Data[2], m.Data[3]))
{
return;
}
Loaded = (int)m.Data[0].Value;
CalibrationState = (int)m.Data[1].Value;
CalibrationMode = (int)m.Data[2].Value;
TrackingStatus = (int)m.Data[3].Value;
break; break;
default: default:
GD.Print($"Invalid number of arguments for /VMC/Ext/OK message. Expected 1, 3, or 4 but received {m.Data.Count}"); GD.Print($"Invalid number of arguments for /VMC/Ext/OK message. Expected 1, 3, or 4 but received {m.Data.Count}");
break; return;
} }
} }
private void OkParam0(godotOscSharp.OscArgument arg) private bool OkParam0(OscArgument arg)
{ {
if (arg.Type != 'i') if (arg.Type != 'i')
{ {
GD.Print($"Invalid argument type for /VMC/Ext/OK message. Expected int in argument 0, received {arg.Type}"); GD.Print($"Invalid argument type for /VMC/Ext/OK message. Expected int in argument 0, received {arg.Type}");
return; return false;
} }
if ((int)arg.Value < 0 && (int)arg.Value > 1) if ((int)arg.Value < 0 && (int)arg.Value > 1)
{ {
GD.Print($"Invalid value for loaded status. Expected 0-1, received {(int)arg.Value}"); GD.Print($"Invalid value for loaded status. Expected 0-1, received {(int)arg.Value}");
return; return false;
} }
loaded = (int)arg.Value; return true;
} }
private void OkParam1And2(godotOscSharp.OscArgument arg0, godotOscSharp.OscArgument arg1, godotOscSharp.OscArgument arg2) private bool OkParam1And2(OscArgument arg0, OscArgument arg1, OscArgument arg2)
{ {
OkParam0(arg0); if (!OkParam0(arg0))
{
return false;
}
if (arg1.Type != 'i') if (arg1.Type != 'i')
{ {
GD.Print($"Invalid argument type for /VMC/Ext/OK message. Expected int in argument 1, received {arg1.Type}"); GD.Print($"Invalid argument type for /VMC/Ext/OK message. Expected int in argument 1, received {arg1.Type}");
return; return false;
} }
if (arg2.Type != 'i') if (arg2.Type != 'i')
{ {
GD.Print($"Invalid argument type for /VMC/Ext/OK message. Expected int in argument 2, received {arg2.Type}"); GD.Print($"Invalid argument type for /VMC/Ext/OK message. Expected int in argument 2, received {arg2.Type}");
return; return false;
} }
if ((int)arg1.Value < 0 && (int)arg1.Value > 3) if ((int)arg1.Value < 0 && (int)arg1.Value > 3)
{ {
GD.Print($"Invalid value for calibration state. Expected 0-3, received {(int)arg1.Value}"); GD.Print($"Invalid value for calibration state. Expected 0-3, received {(int)arg1.Value}");
return; return false;
} }
if ((int)arg2.Value < 0 && (int)arg2.Value > 2) if ((int)arg2.Value < 0 && (int)arg2.Value > 2)
{ {
GD.Print($"Invalid value for calibration mode. Expected 0-2, received {(int)arg2.Value}"); GD.Print($"Invalid value for calibration mode. Expected 0-2, received {(int)arg2.Value}");
return; return false;
} }
calibrationState = (int)arg1.Value; return true;
calibrationMode = (int)arg2.Value;
} }
private void OkParam3(godotOscSharp.OscArgument arg0, godotOscSharp.OscArgument arg1, godotOscSharp.OscArgument arg2, godotOscSharp.OscArgument arg) private bool OkParam3(OscArgument arg0, OscArgument arg1, OscArgument arg2, OscArgument arg)
{ {
OkParam1And2(arg0, arg1, arg2); if (!OkParam1And2(arg0, arg1, arg2))
{
return false;
}
if (arg.Type != 'i') if (arg.Type != 'i')
{ {
GD.Print($"Invalid argument type for /VMC/Ext/OK message. Expected int in argument 3, received {arg.Type}"); GD.Print($"Invalid argument type for /VMC/Ext/OK message. Expected int in argument 3, received {arg.Type}");
return; return false;
} }
if ((int)arg.Value < 0 && (int)arg.Value > 1) if ((int)arg.Value < 0 && (int)arg.Value > 1)
{ {
GD.Print($"Invalid value for tracking status. Expected 0-1, received {(int)arg.Value}"); GD.Print($"Invalid value for tracking status. Expected 0-1, received {(int)arg.Value}");
return; return false;
} }
trackingStatus = (int)arg.Value; return true;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
if (calibrationState == null) if (CalibrationState == null)
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new List<OscArgument>{
new godotOscSharp.OscArgument(loaded, 'i') new OscArgument(Loaded, 'i')
}); });
} }
if (trackingStatus == null) if (TrackingStatus == null)
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new List<OscArgument>{
new godotOscSharp.OscArgument(loaded, 'i'), new OscArgument(Loaded, 'i'),
new godotOscSharp.OscArgument(calibrationState, 'i'), new OscArgument(CalibrationState, 'i'),
new godotOscSharp.OscArgument(calibrationMode, 'i') new OscArgument(CalibrationMode, 'i')
}); });
} }
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new List<OscArgument>{
new godotOscSharp.OscArgument(loaded, 'i'), new OscArgument(Loaded, 'i'),
new godotOscSharp.OscArgument(calibrationState, 'i'), new OscArgument(CalibrationState, 'i'),
new godotOscSharp.OscArgument(calibrationMode, 'i'), new OscArgument(CalibrationMode, 'i'),
new godotOscSharp.OscArgument(trackingStatus, 'i') new OscArgument(TrackingStatus, 'i')
}); });
} }
} }

View File

@ -18,7 +18,6 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
@ -26,7 +25,7 @@ namespace godotVmcSharp
{ {
public string option { get; } public string option { get; }
public VmcExtOpt(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtOpt(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 1) if (m.Data.Count != 1)
{ {
@ -41,14 +40,14 @@ namespace godotVmcSharp
option = (string)m.Data[0].Value; option = (string)m.Data[0].Value;
} }
public VmcExtOpt(string _option) : base(new godotOscSharp.Address("/VMC/Ext/Opt")) public VmcExtOpt(string _option) : base(new OscAddress("/VMC/Ext/Opt"))
{ {
option = _option; option = _option;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{new godotOscSharp.OscArgument(option, 's')}); return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(option, 's')});
} }
} }
} }

View File

@ -24,11 +24,11 @@ namespace godotVmcSharp
{ {
public class VmcExtRcv : VmcMessage public class VmcExtRcv : VmcMessage
{ {
public int enable { get; } public int Enable { get; }
public int port { get; } public int Port { get; }
public string? ipAddress { get; } public string IpAddress { get; }
public VmcExtRcv(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtRcv(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count > 3 || m.Data.Count < 2) if (m.Data.Count > 3 || m.Data.Count < 2)
{ {
@ -55,10 +55,11 @@ namespace godotVmcSharp
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; return;
} }
enable = (int)m.Data[0].Value; Enable = (int)m.Data[0].Value;
port = (int)m.Data[1].Value; Port = (int)m.Data[1].Value;
if (m.Data.Count != 3) if (m.Data.Count != 3)
{ {
IpAddress = "";
return; return;
} }
if (m.Data[2].Type != 's') if (m.Data[2].Type != 's')
@ -66,55 +67,56 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "IpAddress", 's', m.Data[2].Type)); GD.Print(InvalidArgumentType.GetErrorString(addr, "IpAddress", 's', m.Data[2].Type));
return; return;
} }
ipAddress = (string)m.Data[2].Value; IpAddress = (string)m.Data[2].Value;
} }
public VmcExtRcv(int _enable, int _port) : base(new godotOscSharp.Address("/VMC/Ext/Rcv")) public VmcExtRcv(int enable, int port) : base(new OscAddress("/VMC/Ext/Rcv"))
{ {
if (_enable < 0 || _enable > 1) 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; return;
} }
if (_port < 0 || _port > 65535) 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; return;
} }
enable = _enable; Enable = enable;
port = _port; Port = port;
IpAddress = "";
} }
public VmcExtRcv(int _enable, int _port, string _ipAddress) : base(new godotOscSharp.Address("/VMC/Ext/Rcv")) public VmcExtRcv(int enable, int port, string ipAddress) : base(new OscAddress("/VMC/Ext/Rcv"))
{ {
if (_enable < 0 || _enable > 1) 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; return;
} }
if (_port < 0 || _port > 65535) 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; return;
} }
enable = _enable; Enable = enable;
port = _port; Port = port;
ipAddress = _ipAddress; IpAddress = ipAddress;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
if (ipAddress == null) if (IpAddress == "")
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new List<OscArgument>{
new godotOscSharp.OscArgument(enable, 'i'), new OscArgument(Enable, 'i'),
new godotOscSharp.OscArgument(port, 'i'), new OscArgument(Port, 'i'),
}); });
} }
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new List<OscArgument>{
new godotOscSharp.OscArgument(enable, 'i'), new OscArgument(Enable, 'i'),
new godotOscSharp.OscArgument(port, 'i'), new OscArgument(Port, 'i'),
new godotOscSharp.OscArgument(ipAddress, 's'), new OscArgument(IpAddress, 's'),
}); });
} }
} }

View File

@ -18,16 +18,15 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtRemote : VmcMessage public class VmcExtRemote : VmcMessage
{ {
public string service { get; } public string Service { get; }
public string json { get; } public string Json { get; }
public VmcExtRemote(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtRemote(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 2) if (m.Data.Count != 2)
{ {
@ -44,21 +43,21 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "json", 's', m.Data[1].Type)); GD.Print(InvalidArgumentType.GetErrorString(addr, "json", 's', m.Data[1].Type));
return; return;
} }
service = (string)m.Data[0].Value; Service = (string)m.Data[0].Value;
json = (string)m.Data[1].Value; Json = (string)m.Data[1].Value;
} }
public VmcExtRemote(string _service, string _json) : base(new godotOscSharp.Address("/VMC/Ext/Remote")) public VmcExtRemote(string service, string json) : base(new OscAddress("/VMC/Ext/Remote"))
{ {
service = _service; Service = service;
json = _json; Json = json;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(service, 's'), new OscArgument(Service, 's'),
new godotOscSharp.OscArgument(json, 's') new OscArgument(Json, 's')
}); });
} }
} }

View File

@ -19,202 +19,175 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtRootPos : VmcMessage public class VmcExtRootPos : VmcMessage
{ {
public string name { get; private set; } public string Name { get; }
public Godot.Transform3D transform { get; private set;} public Transform3D Transform { get; }
public Godot.Vector3? scale { get; private set; } public Vector3? Scale { get; }
public Godot.Vector3? offset { get; private set; } public Vector3? Offset { get; }
public VmcExtRootPos(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtRootPos(OscMessage m) : base(m.Address)
{ {
switch (m.Data.Count) switch (m.Data.Count)
{ {
case 8: case 8:
Transform8(m.Data); if (!Transform8(m.Data))
{
return;
}
Name = (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));
break; break;
case 14: case 14:
Transform14(m.Data); if (!Transform14(m.Data))
{
return;
}
Name = (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));
Scale = new Vector3((float)m.Data[8].Value, (float)m.Data[9].Value, (float)m.Data[10].Value);
Offset = new Vector3((float)m.Data[11].Value, (float)m.Data[12].Value, (float)m.Data[13].Value);
break; break;
default: default:
GD.Print($"Invalid number of arguments for {base.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}.");
break; return;
} }
} }
public VmcExtRootPos(string _name, Godot.Transform3D _transform) : base(new godotOscSharp.Address("/VMC/Ext/Root/Pos")) public VmcExtRootPos(string name, Transform3D transform) : base(new OscAddress("/VMC/Ext/Root/Pos"))
{ {
name = _name; Name = name;
transform = _transform; Transform = transform;
} }
public VmcExtRootPos(string _name, Godot.Transform3D _transform, Godot.Vector3 _scale, Godot.Vector3 _offset) : base(new godotOscSharp.Address("/VMC/Ext/Root/Pos")) public VmcExtRootPos(string name, Transform3D transform, Vector3 scale, Vector3 offset) : base(new OscAddress("/VMC/Ext/Root/Pos"))
{ {
name = _name; Name = name;
transform = _transform; Transform = transform;
scale = _scale; Scale = scale;
offset = _offset; Offset = offset;
} }
private void Transform8(List<godotOscSharp.OscArgument> data) private bool Transform8(List<OscArgument> data)
{ {
if (data[0].Type != 's') 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; return false;
} }
if (data[1].Type != 'f') 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; return false;
} }
if (data[2].Type != 'f') 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; return false;
} }
if (data[3].Type != 'f') 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; return false;
} }
if (data[4].Type != 'f') 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; return false;
} }
if (data[5].Type != 'f') 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; return false;
} }
if (data[6].Type != 'f') 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; return false;
} }
if (data[7].Type != 'f') 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; return false;
} }
name = (string)data[0].Value; return true;
transform = new Godot.Transform3D(new Godot.Basis(new Godot.Quaternion((float)data[4].Value, (float)data[5].Value, (float)data[6].Value, (float)data[7].Value)), new Godot.Vector3((float)data[1].Value, (float)data[2].Value, (float)data[3].Value));
} }
private void Transform14(List<godotOscSharp.OscArgument> data) private bool Transform14(List<OscArgument> data)
{ {
if (data[0].Type != 's') if (!Transform8(data))
{ {
GD.Print(InvalidArgumentType.GetErrorString(addr, "name", 's', data[0].Type)); return false;
return;
}
if (data[1].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.x", 'f', data[1].Type));
return;
}
if (data[2].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.y", 'f', data[2].Type));
return;
}
if (data[3].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "p.z", 'f', data[3].Type));
return;
}
if (data[4].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.x", 'f', data[4].Type));
return;
}
if (data[5].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.y", 'f', data[5].Type));
return;
}
if (data[6].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.z", 'f', data[6].Type));
return;
}
if (data[7].Type != 'f')
{
GD.Print(InvalidArgumentType.GetErrorString(addr, "q.w", 'f', data[7].Type));
return;
} }
if (data[8].Type != 'f') 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; return false;
} }
if (data[9].Type != 'f') 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; return false;
} }
if (data[10].Type != 'f') 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; return false;
} }
if (data[11].Type != 'f') 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; return false;
} }
if (data[12].Type != 'f') 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; return false;
} }
if (data[13].Type != 'f') 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; return false;
} }
name = (string)data[0].Value; return true;
transform = new Godot.Transform3D(new Godot.Basis(new Godot.Quaternion((float)data[4].Value, (float)data[5].Value, (float)data[6].Value, (float)data[7].Value)), new Godot.Vector3((float)data[1].Value, (float)data[2].Value, (float)data[3].Value));
scale = new Godot.Vector3((float)data[8].Value, (float)data[9].Value, (float)data[10].Value);
offset = new Godot.Vector3((float)data[11].Value, (float)data[12].Value, (float)data[13].Value);
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
var quat = transform.Basis.GetRotationQuaternion(); var quat = Transform.Basis.GetRotationQuaternion();
if (!scale.HasValue) if (!Scale.HasValue)
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new List<OscArgument>{
new godotOscSharp.OscArgument(name, 's'), new OscArgument(Name, 's'),
new godotOscSharp.OscArgument(transform.Origin.X, 'f'), new OscArgument(Transform.Origin.X, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Y, 'f'), new OscArgument(Transform.Origin.Y, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Z, 'f'), new OscArgument(Transform.Origin.Z, 'f'),
new godotOscSharp.OscArgument(quat.X, 'f'), new OscArgument(quat.X, 'f'),
new godotOscSharp.OscArgument(quat.Y, 'f'), new OscArgument(quat.Y, 'f'),
new godotOscSharp.OscArgument(quat.Z, 'f'), new OscArgument(quat.Z, 'f'),
new godotOscSharp.OscArgument(quat.W, 'f'), new OscArgument(quat.W, 'f'),
}); });
} }
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new List<OscArgument>{
new godotOscSharp.OscArgument(name, 's'), new OscArgument(Name, 's'),
new godotOscSharp.OscArgument(transform.Origin.X, 'f'), new OscArgument(Transform.Origin.X, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Y, 'f'), new OscArgument(Transform.Origin.Y, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Z, 'f'), new OscArgument(Transform.Origin.Z, 'f'),
new godotOscSharp.OscArgument(quat.X, 'f'), new OscArgument(quat.X, 'f'),
new godotOscSharp.OscArgument(quat.Y, 'f'), new OscArgument(quat.Y, 'f'),
new godotOscSharp.OscArgument(quat.Z, 'f'), new OscArgument(quat.Z, 'f'),
new godotOscSharp.OscArgument(quat.W, 'f'), new OscArgument(quat.W, 'f'),
new godotOscSharp.OscArgument(scale.Value.X, 'f'), new OscArgument(Scale.Value.X, 'f'),
new godotOscSharp.OscArgument(scale.Value.Y, 'f'), new OscArgument(Scale.Value.Y, 'f'),
new godotOscSharp.OscArgument(scale.Value.Z, 'f'), new OscArgument(Scale.Value.Z, 'f'),
new godotOscSharp.OscArgument(offset.Value.X, 'f'), new OscArgument(Offset.Value.X, 'f'),
new godotOscSharp.OscArgument(offset.Value.Y, 'f'), new OscArgument(Offset.Value.Y, 'f'),
new godotOscSharp.OscArgument(offset.Value.Z, 'f'), new OscArgument(Offset.Value.Z, 'f'),
}); });
} }
} }

View File

@ -18,15 +18,14 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtSetCalibExec : VmcMessage public class VmcExtSetCalibExec : VmcMessage
{ {
public int mode { get; } public int Mode { get; }
public VmcExtSetCalibExec(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtSetCalibExec(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 1) if (m.Data.Count != 1)
{ {
@ -43,22 +42,22 @@ namespace godotVmcSharp
GD.Print($"Invalid value for argument \"mode\" of \"/VMC/Ext/Set/Calib/Exec\". Expected in range 0-2, received {(int)m.Data[0].Value}"); GD.Print($"Invalid value for argument \"mode\" of \"/VMC/Ext/Set/Calib/Exec\". Expected in range 0-2, received {(int)m.Data[0].Value}");
return; return;
} }
mode = (int)m.Data[0].Value; Mode = (int)m.Data[0].Value;
} }
public VmcExtSetCalibExec(int _mode) : base(new godotOscSharp.Address("/VMC/Ext/Set/Calib/Exec")) public VmcExtSetCalibExec(int mode) : base(new OscAddress("/VMC/Ext/Set/Calib/Exec"))
{ {
if (_mode < 0 || _mode > 2) if (mode < 0 || mode > 2)
{ {
GD.Print($"Invalid value for argument \"mode\" of \"/VMC/Ext/Set/Calib/Exec\". Expected in range 0-2, received {_mode}"); GD.Print($"Invalid value for argument \"mode\" of \"/VMC/Ext/Set/Calib/Exec\". Expected in range 0-2, received {mode}");
return; return;
} }
mode = _mode; Mode = mode;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{new godotOscSharp.OscArgument(mode, 'i')}); return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Mode, 'i')});
} }
} }
} }

View File

@ -18,15 +18,14 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtSetConfig : VmcMessage public class VmcExtSetConfig : VmcMessage
{ {
public string path { get; } public string Path { get; }
public VmcExtSetConfig(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtSetConfig(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 1) if (m.Data.Count != 1)
{ {
@ -38,17 +37,17 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "path", 's', m.Data[0].Type)); GD.Print(InvalidArgumentType.GetErrorString(addr, "path", 's', m.Data[0].Type));
return; return;
} }
path = (string)m.Data[0].Value; Path = (string)m.Data[0].Value;
} }
public VmcExtSetConfig(string _path) : base(new godotOscSharp.Address("/VMC/Ext/Set/Config")) public VmcExtSetConfig(string path) : base(new OscAddress("/VMC/Ext/Set/Config"))
{ {
path = _path; Path = path;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{new godotOscSharp.OscArgument(path, 's')}); return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Path, 's')});
} }
} }
} }

View File

@ -18,16 +18,15 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtSetEye : VmcMessage public class VmcExtSetEye : VmcMessage
{ {
public int enable { get; } public int Enable { get; }
public Godot.Vector3 position { get; } public Vector3 Position { get; }
public VmcExtSetEye(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtSetEye(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 4) if (m.Data.Count != 4)
{ {
@ -54,23 +53,23 @@ namespace godotVmcSharp
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; return;
} }
enable = (int)m.Data[0].Value; Enable = (int)m.Data[0].Value;
position = new Godot.Vector3((float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].Value); Position = new Vector3((float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].Value);
} }
public VmcExtSetEye(int _enable, Godot.Vector3 _position) : base(new godotOscSharp.Address("/VMC/Ext/Set/Eye")) public VmcExtSetEye(int enable, Vector3 position) : base(new OscAddress("/VMC/Ext/Set/Eye"))
{ {
enable = _enable; Enable = enable;
position = _position; Position = position;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(enable, 'i'), new OscArgument(Enable, 'i'),
new godotOscSharp.OscArgument(position.X, 'f'), new OscArgument(Position.X, 'f'),
new godotOscSharp.OscArgument(position.Y, 'f'), new OscArgument(Position.Y, 'f'),
new godotOscSharp.OscArgument(position.Z, 'f'), new OscArgument(Position.Z, 'f'),
}); });
} }
} }

View File

@ -18,20 +18,19 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtSetPeriod : VmcMessage public class VmcExtSetPeriod : VmcMessage
{ {
public int status { get; } public int Status { get; }
public int root { get; } public int Root { get; }
public int bone { get; } public int Bone { get; }
public int blendShape { get; } public int BlendShape { get; }
public int camera { get; } public int Camera { get; }
public int devices { get; } public int Devices { get; }
public VmcExtSetPeriod(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtSetPeriod(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 6) if (m.Data.Count != 6)
{ {
@ -68,33 +67,33 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "devices", 'i', m.Data[5].Type)); GD.Print(InvalidArgumentType.GetErrorString(addr, "devices", 'i', m.Data[5].Type));
return; return;
} }
status = (int)m.Data[0].Value; Status = (int)m.Data[0].Value;
root = (int)m.Data[1].Value; Root = (int)m.Data[1].Value;
bone = (int)m.Data[2].Value; Bone = (int)m.Data[2].Value;
blendShape = (int)m.Data[3].Value; BlendShape = (int)m.Data[3].Value;
camera = (int)m.Data[4].Value; Camera = (int)m.Data[4].Value;
devices = (int)m.Data[5].Value; Devices = (int)m.Data[5].Value;
} }
public VmcExtSetPeriod(int _status, int _root, int _bone, int _blendShape, int _camera, int _devices) : base(new godotOscSharp.Address("/VMC/Ext/Set/Period")) public VmcExtSetPeriod(int status, int root, int bone, int blendShape, int camera, int devices) : base(new OscAddress("/VMC/Ext/Set/Period"))
{ {
status = _status; Status = status;
root = _root; Root = root;
bone = _bone; Bone = bone;
blendShape = _blendShape; BlendShape = blendShape;
camera = _camera; Camera = camera;
devices = _devices; Devices = devices;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{ return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new godotOscSharp.OscArgument(status, 'i'), new OscArgument(Status, 'i'),
new godotOscSharp.OscArgument(root, 'i'), new OscArgument(Root, 'i'),
new godotOscSharp.OscArgument(bone, 'i'), new OscArgument(Bone, 'i'),
new godotOscSharp.OscArgument(blendShape, 'i'), new OscArgument(BlendShape, 'i'),
new godotOscSharp.OscArgument(camera, 'i'), new OscArgument(Camera, 'i'),
new godotOscSharp.OscArgument(devices, 'i'), new OscArgument(Devices, 'i'),
}); });
} }
} }

View File

@ -18,15 +18,15 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
public class VmcExtSetRes : VmcMessage public class VmcExtSetRes : VmcMessage
{ {
public string response { get; } public string Response { get; }
public VmcExtSetRes(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtSetRes(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 1) if (m.Data.Count != 1)
{ {
@ -38,17 +38,17 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "response", 's', m.Data[0].Type)); GD.Print(InvalidArgumentType.GetErrorString(addr, "response", 's', m.Data[0].Type));
return; return;
} }
response = (string)m.Data[0].Value; Response = (string)m.Data[0].Value;
} }
public VmcExtSetRes(string _response) : base(new godotOscSharp.Address("/VMC/Ext/Set/Res")) public VmcExtSetRes(string response) : base(new OscAddress("/VMC/Ext/Set/Res"))
{ {
response = _response; Response = response;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{new godotOscSharp.OscArgument(response, 's')}); return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Response, 's')});
} }
} }
} }

View File

@ -18,7 +18,6 @@
using Godot; using Godot;
using godotOscSharp; using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp namespace godotVmcSharp
{ {
@ -26,7 +25,7 @@ namespace godotVmcSharp
{ {
public string shortcut { get; } public string shortcut { get; }
public VmcExtSetShortcut(godotOscSharp.OscMessage m) : base(m.Address) public VmcExtSetShortcut(OscMessage m) : base(m.Address)
{ {
if (m.Data.Count != 1) if (m.Data.Count != 1)
{ {
@ -41,14 +40,14 @@ namespace godotVmcSharp
shortcut = (string)m.Data[0].Value; shortcut = (string)m.Data[0].Value;
} }
public VmcExtSetShortcut(string _shortcut) : base(new godotOscSharp.Address("/VMC/Ext/Set/Shortcut")) public VmcExtSetShortcut(string _shortcut) : base(new OscAddress("/VMC/Ext/Set/Shortcut"))
{ {
shortcut = _shortcut; shortcut = _shortcut;
} }
public godotOscSharp.OscMessage ToMessage() public new OscMessage ToMessage()
{ {
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{new godotOscSharp.OscArgument(shortcut, 's')}); return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(shortcut, 's')});
} }
} }
} }

View File

@ -56,7 +56,7 @@ namespace godotVmcSharp
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.Address("/VMC/Ext/Setting/Color")) public VmcExtSettingColor(Godot.Color _color) : base(new godotOscSharp.OscAddress("/VMC/Ext/Setting/Color"))
{ {
color = _color; color = _color;
} }

View File

@ -82,7 +82,7 @@ namespace godotVmcSharp
hideBorder = (int)m.Data[3].Value; hideBorder = (int)m.Data[3].Value;
} }
public VmcExtSettingWin(int _isTopMost, int _isTransparent, int _windowClickThrough, int _hideBorder) : base(new godotOscSharp.Address("/VMC/Ext/Setting/Win")) public VmcExtSettingWin(int _isTopMost, int _isTransparent, int _windowClickThrough, int _hideBorder) : base(new godotOscSharp.OscAddress("/VMC/Ext/Setting/Win"))
{ {
if (_isTopMost < 0 || _isTopMost > 1) if (_isTopMost < 0 || _isTopMost > 1)
{ {

View File

@ -39,7 +39,7 @@ namespace godotVmcSharp
time = (float)m.Data[0].Value; time = (float)m.Data[0].Value;
} }
public VmcExtT(float _time) : base(new godotOscSharp.Address("/VMC/Ext/T")) public VmcExtT(float _time) : base(new godotOscSharp.OscAddress("/VMC/Ext/T"))
{ {
time = _time; time = _time;
} }

View File

@ -72,13 +72,13 @@ namespace godotVmcSharp
} }
} }
public VmcExtVrm(string _path, string _title) : base(new godotOscSharp.Address("/VMC/Ext/VRM")) public VmcExtVrm(string _path, string _title) : base(new godotOscSharp.OscAddress("/VMC/Ext/VRM"))
{ {
path = _path; path = _path;
title = _title; title = _title;
} }
public VmcExtVrm(string _path, string _title, string _hash) : base(new godotOscSharp.Address("/VMC/Ext/VRM")) public VmcExtVrm(string _path, string _title, string _hash) : base(new godotOscSharp.OscAddress("/VMC/Ext/VRM"))
{ {
path = _path; path = _path;
title = _title; title = _title;

View File

@ -22,9 +22,9 @@ namespace godotVmcSharp
{ {
public class VmcMessage public class VmcMessage
{ {
public godotOscSharp.Address addr { get; } public godotOscSharp.OscAddress addr { get; }
public VmcMessage(godotOscSharp.Address address) public VmcMessage(godotOscSharp.OscAddress address)
{ {
addr = address; addr = address;
} }