public void SetData(SMidiOBSAction d, int i) { this.Text = "ItemEditor (" + i + ")"; //copy object Data = new SMidiOBSAction(); Data.InActions = new List <SMidiInput>(); if (d.InActions != null) { Data.InActions = d.InActions.ToList(); } Data.Index = d.Index; Data.Modifier = d.Modifier; Data.OutActions = new List <SMidiOutput>(); if (d.OutActions != null) { Data.OutActions = d.OutActions.ToList(); } Data.ObsMode = d.ObsMode; Data.Type = d.Type; Data.IsModifier = d.IsModifier; Index = i; RenderForm(); FormChanged(); SelectValues(); }
public void EditRow(int index, SMidiOBSAction d) { if (index >= 0 && index < midiActions.Count()) { midiActions[index] = d; renderData(); changed = true; } }
private bool selectData(int index) { if (index >= 0 && index < midiActions.Count()) { int realindex = getRealIndex(index); selected = midiActions[realindex]; selectedIndex = realindex; return(true); } return(false); }
public CFEditor_GridItem(int index, SMidiOBSAction a) { _index = index; ruletype = a.Type == EMidiOBSItemType.Modifier ? "Modifier" : "Item"; obsmode = ((EMidiObsMode)a.ObsMode).ToString(); if (a.Type == EMidiOBSItemType.Modifier) { modifier = "--"; } else { if (a.Modifier == -1) { modifier = "ANY"; } else if (a.Modifier == 0) { modifier = "None"; } else { modifier = "Modifier#" + a.Modifier.ToString(); } } action = a.Type.ToString(); connect = (a.Index + 1).ToString(); switch (a.Type) { case EMidiOBSItemType.AudioItem: connect += ". Audio item"; break; case EMidiOBSItemType.AudioVolume: connect += ". Audio slider"; break; case EMidiOBSItemType.ConnectionStatus: connect = "Connection status"; break; case EMidiOBSItemType.Mode: connect = "OBS Mode"; break; case EMidiOBSItemType.Pscene: connect += ". Preview Scene"; break; case EMidiOBSItemType.PsceneItem: connect += ". Preview Source"; break; case EMidiOBSItemType.Scene: connect += ". Scene"; break; case EMidiOBSItemType.SceneItem: connect += ". Source"; break; case EMidiOBSItemType.Record: connect = "Recording"; break; case EMidiOBSItemType.Stream: connect = "Streaming"; break; case EMidiOBSItemType.ReloadObsData: connect = "Reload OBS data"; break; case EMidiOBSItemType.Transition: connect += ". Transition"; break; case EMidiOBSItemType.None: connect = "None (dummy)"; break; } if (a.InActions != null) { input = "[" + a.InActions.Count().ToString() + "]"; for (int i = 0; i < a.InActions.Count(); i++) { input += " "; input += a.InActions[i].Type.ToString(); input += ":0x"; input += a.InActions[i].Action.Data1.ToString("X2"); input += a.InActions[i].Action.Data2.ToString("X2"); } } else { input = "--"; } if (a.OutActions != null) { output = "[" + a.OutActions.Count().ToString() + "]"; for (int i = 0; i < a.OutActions.Count(); i++) { output += " "; output += a.OutActions[i].Type.ToString(); output += ":0x"; output += a.OutActions[i].Action.Data1.ToString("X2"); output += a.OutActions[i].Action.Data2.ToString("X2"); } } else { output = "0"; } }