Modifs OSC
This commit is contained in:
parent
cd540eca4e
commit
dc2f54bcd2
3 changed files with 17 additions and 19 deletions
|
|
@ -43,7 +43,7 @@ namespace DMX2
|
||||||
Fin
|
Fin
|
||||||
}
|
}
|
||||||
|
|
||||||
const int timeout = 200;
|
const int timeout = 1000;
|
||||||
|
|
||||||
// tampons Entrée/Sortie
|
// tampons Entrée/Sortie
|
||||||
public byte[] inputbuffer = new byte[532];
|
public byte[] inputbuffer = new byte[532];
|
||||||
|
|
|
||||||
|
|
@ -316,11 +316,14 @@ namespace DMX2
|
||||||
try {
|
try {
|
||||||
while (running) {
|
while (running) {
|
||||||
recv = udpCli.Receive (ref remep);
|
recv = udpCli.Receive (ref remep);
|
||||||
Console.WriteLine(remep);
|
//Console.WriteLine(remep);
|
||||||
OSCMessage msg = new OSCMessage(recv);
|
OSCMessage msg = new OSCMessage(recv);
|
||||||
Console.WriteLine(msg.Address);
|
#if DEBUG
|
||||||
|
Console.Write(msg.Address);
|
||||||
|
Console.Write(" ");
|
||||||
foreach(var arg in msg.Args)
|
foreach(var arg in msg.Args)
|
||||||
Console.WriteLine(arg.GetString());
|
Console.WriteLine(arg.GetString());
|
||||||
|
#endif
|
||||||
try{
|
try{
|
||||||
ProcessMessage(msg,remep);
|
ProcessMessage(msg,remep);
|
||||||
}catch{}
|
}catch{}
|
||||||
|
|
@ -502,7 +505,7 @@ namespace DMX2
|
||||||
break;
|
break;
|
||||||
case "off":
|
case "off":
|
||||||
if(!int.TryParse(toks[3],out dimId))return;
|
if(!int.TryParse(toks[3],out dimId))return;
|
||||||
//if( msg.Args[0].GetInt() !=0)
|
if( msg.Args[0].GetInt() !=0)
|
||||||
if(univ.AllumageForce.Contains(dimId))
|
if(univ.AllumageForce.Contains(dimId))
|
||||||
univ.AllumageForce.Remove(dimId);
|
univ.AllumageForce.Remove(dimId);
|
||||||
break;
|
break;
|
||||||
|
|
@ -540,13 +543,13 @@ namespace DMX2
|
||||||
int cirId;
|
int cirId;
|
||||||
if (!int.TryParse (toks [2], out cirId))
|
if (!int.TryParse (toks [2], out cirId))
|
||||||
return;
|
return;
|
||||||
//if (msg.Args [0].GetInt () != 0) {
|
if (msg.Args [0].GetInt () != 0) {
|
||||||
if (cirId > 0 && cirId <= Conduite.Courante.Circuits.Count) {
|
if (cirId > 0 && cirId <= Conduite.Courante.Circuits.Count) {
|
||||||
Circuit c = Conduite.Courante.Circuits [cirId - 1];
|
Circuit c = Conduite.Courante.Circuits [cirId - 1];
|
||||||
if (Conduite.Courante.CircuitTelecomande.Contains (c))
|
if (Conduite.Courante.CircuitTelecomande.Contains (c))
|
||||||
Conduite.Courante.CircuitTelecomande.Remove (c);
|
Conduite.Courante.CircuitTelecomande.Remove (c);
|
||||||
}
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "alloff":
|
case "alloff":
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ control.modeFunc = function(p1){
|
||||||
|
|
||||||
if( control.regMode == "UNI")
|
if( control.regMode == "UNI")
|
||||||
lblMode.setValue("Mode : Univers n°"+control.regUniv);
|
lblMode.setValue("Mode : Univers n°"+control.regUniv);
|
||||||
|
control.reglValChange(reglval.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
control.reglValChange = function(val){
|
control.reglValChange = function(val){
|
||||||
|
|
@ -87,12 +87,7 @@ control.reglValChange = function(val){
|
||||||
|
|
||||||
control.btnRegl = function(id,val)
|
control.btnRegl = function(id,val)
|
||||||
{
|
{
|
||||||
//if(val==0)return;
|
|
||||||
/*for(var i = 0;i<control.regPageCount;i++){
|
|
||||||
if(i!=id && mulButton.children[i].value !=0)
|
|
||||||
mulButton.children[i].setValue(0);
|
|
||||||
}*/
|
|
||||||
// reglval.setValue(0);
|
|
||||||
id = id + control.regPageCount *control.regPage +1;
|
id = id + control.regPageCount *control.regPage +1;
|
||||||
if(val==0) onoff= "/off/";
|
if(val==0) onoff= "/off/";
|
||||||
else onoff="/on/";
|
else onoff="/on/";
|
||||||
|
|
@ -100,12 +95,12 @@ control.btnRegl = function(id,val)
|
||||||
if( control.regMode == "UNI")
|
if( control.regMode == "UNI")
|
||||||
{
|
{
|
||||||
var addr = "/universe/"+ control.regUniv + onoff + (id-1);
|
var addr = "/universe/"+ control.regUniv + onoff + (id-1);
|
||||||
oscManager.sendOSC([addr,"f",val]);
|
oscManager.sendOSC([addr,"f",1]);
|
||||||
}
|
}
|
||||||
if( control.regMode == "CIR")
|
if( control.regMode == "CIR")
|
||||||
{
|
{
|
||||||
var addr = "/circuitTel" + onoff + (id);
|
var addr = "/circuitTel" + onoff + (id);
|
||||||
oscManager.sendOSC([addr,"f",val]);
|
oscManager.sendOSC([addr,"f",1]);
|
||||||
}
|
}
|
||||||
control.reglmem[id]=val;
|
control.reglmem[id]=val;
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +142,7 @@ oscManager.delegate = {
|
||||||
lblGoBack.setValue("Precedent : "+args[0]);
|
lblGoBack.setValue("Precedent : "+args[0]);
|
||||||
break;
|
break;
|
||||||
case "/masterseq/time":
|
case "/masterseq/time":
|
||||||
lblTime.setValue("T : "+args[0]);
|
lblTime.setValue("T : "+args[0].toFixed(1));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
oscManager.processOSC(oscAddress, typetags, args);
|
oscManager.processOSC(oscAddress, typetags, args);
|
||||||
|
|
@ -313,13 +308,13 @@ pages = [
|
||||||
"bounds": [.4,.3,.59,.58],
|
"bounds": [.4,.3,.59,.58],
|
||||||
"rows" : 4, "columns" : 8,
|
"rows" : 4, "columns" : 8,
|
||||||
"shouldLabel":"true",
|
"shouldLabel":"true",
|
||||||
"ontouchstart": "control.btnRegl(this.childID, this.value)",
|
"onvaluechange": "control.btnRegl(this.childID, this.value)",
|
||||||
"stroke":"#FFFFFF", "color":"#8888FF"
|
"stroke":"#FFFFFF", "color":"#8888FF"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "btnMulPlus", "type": "Button",
|
"name": "btnMulPlus", "type": "Button",
|
||||||
"bounds": [.325,.3,.05,.1],
|
"bounds": [.325,.78,.05,.1],
|
||||||
"mode": "momentary",
|
"mode": "momentary",
|
||||||
"ontouchstart":"control.pageUp()",
|
"ontouchstart":"control.pageUp()",
|
||||||
"label":"+"
|
"label":"+"
|
||||||
|
|
@ -327,7 +322,7 @@ pages = [
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "btnMulMoins", "type": "Button",
|
"name": "btnMulMoins", "type": "Button",
|
||||||
"bounds": [.325,.78,.05,.1],
|
"bounds": [.325,.3,.05,.1],
|
||||||
"mode": "momentary",
|
"mode": "momentary",
|
||||||
"label":"-",
|
"label":"-",
|
||||||
"ontouchstart":"control.pageDown()"
|
"ontouchstart":"control.pageDown()"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue