From 675252d310f2bf65c719eda6270bc87120d280fa Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Tue, 15 Aug 2023 15:36:55 -0400 Subject: [PATCH] add license notices to files --- OscAddress.cs | 18 ++++++++++++++++++ OscArgument.cs | 18 ++++++++++++++++++ OscBundle.cs | 18 ++++++++++++++++++ OscMessage.cs | 18 ++++++++++++++++++ OscReceiver.cs | 35 ++++++++++++++++++----------------- OscSender.cs | 18 ++++++++++++++++++ 6 files changed, 108 insertions(+), 17 deletions(-) diff --git a/OscAddress.cs b/OscAddress.cs index 375242f..81952ab 100644 --- a/OscAddress.cs +++ b/OscAddress.cs @@ -1,3 +1,21 @@ +/* + godotOscSharp + Copyright (C) 2023 Cassandra de la Cruz-Munoz + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ + using System; using System.Text.RegularExpressions; diff --git a/OscArgument.cs b/OscArgument.cs index 41f2db2..5a94bde 100644 --- a/OscArgument.cs +++ b/OscArgument.cs @@ -1,3 +1,21 @@ +/* + godotOscSharp + Copyright (C) 2023 Cassandra de la Cruz-Munoz + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ + using System; namespace godotOscSharp diff --git a/OscBundle.cs b/OscBundle.cs index c6964d4..9fc702a 100644 --- a/OscBundle.cs +++ b/OscBundle.cs @@ -1,3 +1,21 @@ +/* + godotOscSharp + Copyright (C) 2023 Cassandra de la Cruz-Munoz + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ + using System; using System.Collections.Generic; using System.Linq; diff --git a/OscMessage.cs b/OscMessage.cs index 1c90c1e..2b896fb 100644 --- a/OscMessage.cs +++ b/OscMessage.cs @@ -1,3 +1,21 @@ +/* + godotOscSharp + Copyright (C) 2023 Cassandra de la Cruz-Munoz + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ + using System; using System.Collections.Generic; using System.Linq; diff --git a/OscReceiver.cs b/OscReceiver.cs index b10e2a8..e7bc79f 100644 --- a/OscReceiver.cs +++ b/OscReceiver.cs @@ -1,3 +1,21 @@ +/* + godotOscSharp + Copyright (C) 2023 Cassandra de la Cruz-Munoz + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ + using Godot; using System; using System.Net; @@ -21,31 +39,21 @@ namespace godotOscSharp // The constructor that takes a port number public OscReceiver(int port) { - // Create a UDP client with the given port udpClient = new UdpClient(port); - - // Create a thread for listening to incoming messages listenThread = new Thread(new ThreadStart(Listen)); - - // Set the running flag to true running = true; - - // Start the thread listenThread.Start(); } // A method that listens to incoming messages private void Listen() { - // While the receiver is running while (running) { try { - // Receive data from any source IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); byte[] data = udpClient.Receive(ref remoteEndPoint); - // Parse the data to an OSC message if (data[0] == 0x2f) { OscMessage message = OscMessage.Parse(data); @@ -53,7 +61,6 @@ namespace godotOscSharp } else { - // GD.Print(string.Join(", ", data)); OscBundle bundle = OscBundle.Parse(data); foreach (var message in bundle.Messages) { @@ -63,7 +70,6 @@ namespace godotOscSharp } catch (Exception e) { - // If an exception occurs, invoke the error received event with the exception message ErrorReceived?.Invoke(this, new OscErrorReceivedEventArgs(e.Message)); } } @@ -72,13 +78,8 @@ namespace godotOscSharp // A method that disposes the receiver and releases resources public void Dispose() { - // Set the running flag to false running = false; - - // Close the UDP client udpClient.Close(); - - // Join the thread listenThread.Join(); } diff --git a/OscSender.cs b/OscSender.cs index 1f0bcf9..78639f0 100644 --- a/OscSender.cs +++ b/OscSender.cs @@ -1,3 +1,21 @@ +/* + godotOscSharp + Copyright (C) 2023 Cassandra de la Cruz-Munoz + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ + using System; using System.Net; using System.Net.Sockets;