From c1825dad147ac30e8c53190ceb66280dd796e88e Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Thu, 17 Aug 2023 09:39:28 -0400 Subject: [PATCH] add ToMessage() to VmcExtRcv --- VmcMessages/VmcExtRcv.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/VmcMessages/VmcExtRcv.cs b/VmcMessages/VmcExtRcv.cs index de5fb03..15c00c3 100644 --- a/VmcMessages/VmcExtRcv.cs +++ b/VmcMessages/VmcExtRcv.cs @@ -18,6 +18,7 @@ using Godot; using godotOscSharp; +using System.Collections.Generic; namespace godotVmcSharp { @@ -100,5 +101,21 @@ namespace godotVmcSharp port = _port; ipAddress = _ipAddress; } + + public godotOscSharp.OscMessage ToMessage() + { + if (ipAddress == null) + { + return new godotOscSharp.OscMessage(addr, new List{ + new godotOscSharp.OscArgument(enable, 'i'), + new godotOscSharp.OscArgument(port, 'i'), + }); + } + return new godotOscSharp.OscMessage(addr, new List{ + new godotOscSharp.OscArgument(enable, 'i'), + new godotOscSharp.OscArgument(port, 'i'), + new godotOscSharp.OscArgument(ipAddress, 's'), + }); + } } } \ No newline at end of file