modif OSC
This commit is contained in:
parent
e20683f718
commit
ed53f248c2
3 changed files with 188 additions and 8 deletions
|
|
@ -54,6 +54,7 @@
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
<Package>gstreamer-sharp-0.10</Package>
|
<Package>gstreamer-sharp-0.10</Package>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Web" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="gtk-gui\gui.stetic">
|
<EmbeddedResource Include="gtk-gui\gui.stetic">
|
||||||
|
|
@ -116,6 +117,9 @@
|
||||||
<EmbeddedResource Include="html\css\theme\images\ui-bg_glass_65_ffffff_1x400.png">
|
<EmbeddedResource Include="html\css\theme\images\ui-bg_glass_65_ffffff_1x400.png">
|
||||||
<LogicalName>css.theme.images.ui-bg_glass_65_ffffff_1x400.png</LogicalName>
|
<LogicalName>css.theme.images.ui-bg_glass_65_ffffff_1x400.png</LogicalName>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="html\if.js">
|
||||||
|
<LogicalName>if.js</LogicalName>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="gtk-gui\generated.cs" />
|
<Compile Include="gtk-gui\generated.cs" />
|
||||||
|
|
|
||||||
|
|
@ -217,32 +217,161 @@ namespace DMX2
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// /master
|
/// /master <X---
|
||||||
/// /masterseq/
|
/// /masterseq/
|
||||||
/// go
|
/// go
|
||||||
/// goback
|
/// goback
|
||||||
/// goto
|
/// next <X---
|
||||||
|
/// goto
|
||||||
///
|
///
|
||||||
/// /seq/X/
|
/// /seq/X/
|
||||||
/// go
|
/// go
|
||||||
/// goback
|
/// goback
|
||||||
/// goto
|
/// goto
|
||||||
/// master
|
/// master <X---
|
||||||
/// circuit
|
/// circuit/X <X---
|
||||||
///
|
///
|
||||||
/// /universe/X/
|
/// /universe/X/
|
||||||
/// D/on
|
/// on/D
|
||||||
/// reset
|
/// off
|
||||||
///
|
/// onval
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
void ProcessMessage (OSCMessage msg)
|
void ProcessMessage (OSCMessage msg)
|
||||||
{
|
{
|
||||||
|
if(Conduite.Courante == null) return;
|
||||||
|
string[] toks = msg.Address.Split (new char[]{'/'},StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
int arg;
|
||||||
|
switch (toks [0]) {
|
||||||
|
case "master":
|
||||||
|
arg = msg.Args[0].GetInt();
|
||||||
|
if(arg>=0 && arg<=100)
|
||||||
|
Conduite.Courante.Master = arg;
|
||||||
|
break;
|
||||||
|
case "masterseq":
|
||||||
|
switch(toks[1]){
|
||||||
|
case "go":
|
||||||
|
if( msg.Args[0].GetInt() !=0)
|
||||||
|
Conduite.Courante.SequenceurMaitre.EffetSuivant();
|
||||||
|
break;
|
||||||
|
case "goback":
|
||||||
|
if( msg.Args[0].GetInt() !=0)
|
||||||
|
Conduite.Courante.SequenceurMaitre.EffetPrecedent();
|
||||||
|
break;
|
||||||
|
case "next":
|
||||||
|
arg = msg.Args[0].GetInt();
|
||||||
|
Conduite.Courante.SequenceurMaitre.IndexLigneaSuivre = arg;
|
||||||
|
break;
|
||||||
|
case "goto":
|
||||||
|
arg = msg.Args[0].GetInt();
|
||||||
|
Conduite.Courante.SequenceurMaitre.IndexLigneaSuivre = arg;
|
||||||
|
Conduite.Courante.SequenceurMaitre.EffetSuivant();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "seq":
|
||||||
|
ProcessMessageSeq(msg,toks);
|
||||||
|
break;
|
||||||
|
case "universe":
|
||||||
|
ProcessMessageUniv(msg,toks);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessMessageSeq (OSCMessage msg, string[] toks)
|
||||||
|
{
|
||||||
|
int seqId;
|
||||||
|
Sequenceur seq = null;
|
||||||
|
if (int.TryParse (toks [1], out seqId)) {
|
||||||
|
if (seqId < 0 || seqId > Conduite.Courante.Sequenceurs.Count)
|
||||||
|
return;
|
||||||
|
seq = Conduite.Courante.Sequenceurs [seqId-1];
|
||||||
|
}
|
||||||
|
if (seq is SequenceurLineaire) {
|
||||||
|
SequenceurLineaire seql = seq as SequenceurLineaire;
|
||||||
|
switch(toks[2]){
|
||||||
|
case "go":
|
||||||
|
if( msg.Args[0].GetInt() !=0)
|
||||||
|
seql.IndexEffetCourrant++;
|
||||||
|
break;
|
||||||
|
case "goback":
|
||||||
|
if( msg.Args[0].GetInt() !=0)
|
||||||
|
seql.IndexEffetCourrant--;
|
||||||
|
break;
|
||||||
|
case "goto":
|
||||||
|
int arg = msg.Args[0].GetInt();
|
||||||
|
seql.IndexEffetCourrant = arg;
|
||||||
|
break;
|
||||||
|
case "master":
|
||||||
|
arg = msg.Args[0].GetInt();
|
||||||
|
if(arg>=0 && arg<=100)
|
||||||
|
seql.Master = arg;
|
||||||
|
break;
|
||||||
|
case "circuit":
|
||||||
|
int cirId;
|
||||||
|
arg = msg.Args[0].GetInt();
|
||||||
|
arg = Math.Max(0,arg);
|
||||||
|
arg = Math.Min(255,arg);
|
||||||
|
if(!int.TryParse(toks[3],out cirId)) return;
|
||||||
|
Circuit c = Conduite.Courante.GetCircuitByID (cirId);
|
||||||
|
if(seql.Circuits.Contains(c))
|
||||||
|
seql.ChangeValeur(c,arg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (seq is SequenceurMacro) {
|
||||||
|
SequenceurMacro seqm = seq as SequenceurMacro;
|
||||||
|
switch(toks[2]){
|
||||||
|
case "go":
|
||||||
|
if( msg.Args[0].GetInt() !=0)
|
||||||
|
seqm.LigneSuivante();
|
||||||
|
break;
|
||||||
|
case "goto":
|
||||||
|
int arg = msg.Args[0].GetInt();
|
||||||
|
seqm.IndexLigneaSuivre = arg;
|
||||||
|
seqm.LigneSuivante();
|
||||||
|
break;
|
||||||
|
case "next":
|
||||||
|
arg = msg.Args[0].GetInt();
|
||||||
|
seqm.IndexLigneaSuivre = arg;
|
||||||
|
break;
|
||||||
|
case "master":
|
||||||
|
arg = msg.Args[0].GetInt();
|
||||||
|
if(arg>=0 && arg<=100)
|
||||||
|
seqm.Master = arg;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcessMessageUniv (OSCMessage msg, string[] toks)
|
||||||
|
{
|
||||||
|
int univId;
|
||||||
|
if (!int.TryParse (toks [1], out univId))
|
||||||
|
return;
|
||||||
|
if (univId > 0 || univId >= Conduite.Courante.Patches.Count)
|
||||||
|
return;
|
||||||
|
UniversDMX univ = Conduite.Courante.Patches [univId];
|
||||||
|
|
||||||
|
switch (toks [2]) {
|
||||||
|
case "on":
|
||||||
|
int dimId;
|
||||||
|
if(!int.TryParse(toks[3],out dimId))return;
|
||||||
|
if( msg.Args[0].GetInt() !=0)
|
||||||
|
univ.AllumageForce = dimId;
|
||||||
|
break;
|
||||||
|
case "off":
|
||||||
|
univ.AllumageForce = -1;
|
||||||
|
break;
|
||||||
|
case "onval":
|
||||||
|
int val = msg.Args[0].GetInt();
|
||||||
|
if(val>=0 && val<=255)
|
||||||
|
univ.AllumageForceVal = val;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region IDisposable implementation
|
#region IDisposable implementation
|
||||||
|
|
||||||
|
|
|
||||||
47
DMX-2.0/html/if.js
Normal file
47
DMX-2.0/html/if.js
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
loadedInterfaceName = "Loupiottes";
|
||||||
|
|
||||||
|
interfaceOrientation = "landscape";
|
||||||
|
|
||||||
|
pages = [[
|
||||||
|
{
|
||||||
|
"name": "refresh",
|
||||||
|
"type": "Button",
|
||||||
|
"bounds": [.6, .9, .2, .1],
|
||||||
|
"startingValue": 0,
|
||||||
|
"isLocal": true,
|
||||||
|
"mode": "contact",
|
||||||
|
"ontouchstart": "interfaceManager.refreshInterface()",
|
||||||
|
"stroke": "#aaa",
|
||||||
|
"label": "refrsh",
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name":"master",
|
||||||
|
"type":"Slider",
|
||||||
|
"bounds": [.05, .1, .1, .8],
|
||||||
|
"isVertical" : true,
|
||||||
|
"address" : "/master",
|
||||||
|
"min":0,"max":101,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name":"masters1",
|
||||||
|
"type":"Slider",
|
||||||
|
"bounds": [.20, .1, .1, .8],
|
||||||
|
"isVertical" : true,
|
||||||
|
"address" : "/seq/1/master",
|
||||||
|
"min":0,"max":101,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name":"ml1",
|
||||||
|
"type":"MultiSlider",
|
||||||
|
"bounds": [.30, .1, .5, .8],
|
||||||
|
"isVertical" : true,
|
||||||
|
"address" : "/seq/1/circuit",
|
||||||
|
"min":0,"max":256,
|
||||||
|
"numberOfSliders" : 10,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
];
|
||||||
Loading…
Reference in a new issue