diff --git a/DMX-2.0/SequenceurMacro.cs b/DMX-2.0/SequenceurMacro.cs index 4b13ff2..9240eba 100644 --- a/DMX-2.0/SequenceurMacro.cs +++ b/DMX-2.0/SequenceurMacro.cs @@ -658,7 +658,7 @@ namespace DMX2 var cmd = regexCommand2.Match(commands[i]); if(cmd.Success){ int ef = int.Parse(cmd.Groups["effet"].Value); - if (ef-1>index) { + if (ef>index) { ef++; commands[i] = ef.ToString() + cmd.Groups["params"].Value; } diff --git a/DMX-2.0/SequenceurMidi.cs b/DMX-2.0/SequenceurMidi.cs index 683960e..f36b102 100644 --- a/DMX-2.0/SequenceurMidi.cs +++ b/DMX-2.0/SequenceurMidi.cs @@ -566,7 +566,7 @@ namespace DMX2 var cmd = regexCommand2.Match(commands[i]); if(cmd.Success){ int ef = int.Parse(cmd.Groups["effet"].Value); - if (ef-1>index) { + if (ef>index) { ef++; commands[i] = ef.ToString() + cmd.Groups["params"].Value; } diff --git a/DMX-2.0/SequenceurOSC.cs b/DMX-2.0/SequenceurOSC.cs index c781214..766d0ad 100644 --- a/DMX-2.0/SequenceurOSC.cs +++ b/DMX-2.0/SequenceurOSC.cs @@ -309,6 +309,7 @@ namespace DMX2 string[] data = enCours.Commande.Split(' '); OSCMessage message = new OSCMessage(data[0]); + if (data.Length < 2) return; for (int i = 1; i < data.Length; i++) { if (int.TryParse(data[i], out int di)) @@ -320,7 +321,14 @@ namespace DMX2 var buff = message.Encode(); - udpClient.Send(buff, buff.Length); + try + { + udpClient.Send(buff, buff.Length); + } + catch (SocketException) + { + + } } @@ -479,7 +487,7 @@ namespace DMX2 var cmd = regexCommand2.Match(commands[i]); if(cmd.Success){ int ef = int.Parse(cmd.Groups["effet"].Value); - if (ef-1>index) { + if (ef>index) { ef++; commands[i] = ef.ToString() + cmd.Groups["params"].Value; }