public void DrawShortcut(ResolumeOscShortcut shortcut) { DrawType(shortcut); using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(m_InputPathContent, m_LeftColumnWidth); EditorGUILayout.LabelField(shortcut.Input.Path, EditorStyles.miniLabel); } DrawUniqueId(shortcut); if (shortcut.SubTargets == null || shortcut.SubTargets.Length == 0) { EditorGUILayout.EndFoldoutHeaderGroup(); return; } if (m_ShowSubTargets) { DrawSubTargetsIfAny(shortcut.SubTargets); } EditorGUILayout.EndFoldoutHeaderGroup(); }
static void AddShortcutComponentIfAbsent <T>(GameObject go, ResolumeOscShortcut shortcut, List <T> components) where T : OscEventHandler { go.GetComponents(components); var found = false; foreach (var c in components) { if (c.Shortcut.Input.Path != shortcut.Input.Path) { continue; } c.Shortcut = shortcut; found = true; break; } if (!found) { go.SetActive(false); var component = go.AddComponent <T>(); component.Shortcut = shortcut; go.SetActive(true); } }
public static bool IsTimeEvent(this ResolumeOscShortcut shortcut) { const string tempoController = "tempocontroller"; var inputPath = shortcut.Input.Path; return(inputPath.Contains(tempoController)); }
public static bool IsLayerEvent(this ResolumeOscShortcut shortcut, bool excludeDashboard = true) { var inputPath = shortcut.Input.Path; var dashboardOk = !excludeDashboard || !inputPath.Contains("dashboard"); return(inputPath.IndexOf(compLayers, StringComparison.CurrentCulture) == 0 && dashboardOk); }
public static bool IsCompositionDashboardEvent(this ResolumeOscShortcut shortcut) { const string compDashboard = "composition/dashboard"; var inputPath = shortcut.Input.Path; return(inputPath.Contains(compDashboard)); }
public static bool IsCompositionLayerDashboardEvent(this ResolumeOscShortcut shortcut) { var inputPath = shortcut.Input.Path; return(inputPath.IndexOf(compLayers, StringComparison.CurrentCulture) == 0 && inputPath.Contains("dashboard")); }
public static bool IsApplicationUiEvent(this ResolumeOscShortcut shortcut) { const string applicationUI = "application/ui"; var inputPath = shortcut.Input.Path; return(inputPath.Contains(applicationUI)); }
public static string PrefixFromShortcut(ResolumeOscShortcut shortcut) { var inPath = shortcut.Input.Path; var lastSplit = inPath.LastIndexOf('/'); return(inPath.Substring(0, lastSplit)); }
void DrawType(ResolumeOscShortcut shortcut) { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(m_TypeContent, m_LeftColumnWidth); EditorGUILayout.LabelField(shortcut.TypeName, EditorStyles.miniLabel); } }
public static bool IsClipTransportEvent(this ResolumeOscShortcut shortcut) { var notCuepoint = !shortcut.Input.Path.Contains(k_Cuepoints); var containsTrans = shortcut.Input.Path.Contains("/transport"); var isOnLayers = shortcut.Input.Path.Contains("/layers"); return(notCuepoint && containsTrans && isOnLayers); }
public static bool IsLayerEffectEvent(this ResolumeOscShortcut shortcut) { var inputPath = shortcut.Input.Path; var dashboardOk = !inputPath.Contains("dashboard"); var hasEffects = inputPath.Contains("/effects/") || inputPath.Contains("/effect/"); var hasLayer = inputPath.Contains("/layers/"); return(dashboardOk && hasEffects && hasLayer); }
void HandleEndElementByName() { switch (m_Reader.Name) { case k_ShortCut: m_Shortcuts.Add(m_CurrentShortcut); m_CurrentShortcut = null; break; } }
void DrawUniqueId(ResolumeOscShortcut shortcut) { if (m_ShowUniqueIds) { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(m_IdContent, m_LeftColumnWidth); EditorGUILayout.LabelField(shortcut.UniqueId.ToString(), EditorStyles.miniLabel); } } }
public static bool IsCompositionEvent(this ResolumeOscShortcut shortcut, bool excludeDashboard = true) { var inputPath = shortcut.Input.Path; if (inputPath.Contains("/composition/layers")) { return(false); } var dashboardOk = !excludeDashboard || !inputPath.Contains("dashboard"); return(inputPath.IndexOf("/composition", StringComparison.CurrentCulture) == 0 && dashboardOk); }
static void AssignToVectorFieldList(ResolumeOscShortcut shortcut) { var inPath = shortcut.Input.Path; if (inPath.EndsWith("x")) { k_XShortcuts.Add(shortcut); } else if (inPath.EndsWith("y")) { k_YShortcuts.Add(shortcut); } else if (inPath.EndsWith("z")) { k_ZShortcuts.Add(shortcut); } }
void ComponentForShortcut(GameObject go, ResolumeOscShortcut shortcut) { if (shortcut.TypeName == typeof(int).Name) { AddShortcutComponentIfAbsent(go, shortcut, k_IntHandlerComponents); } else if (shortcut.TypeName == typeof(float).Name) { AddShortcutComponentIfAbsent(go, shortcut, k_FloatHandlerComponents); } else if (shortcut.TypeName == typeof(bool).Name) { AddShortcutComponentIfAbsent(go, shortcut, k_BoolHandlerComponents); } else if (shortcut.TypeName == typeof(string).Name) { AddShortcutComponentIfAbsent(go, shortcut, k_StringHandlerComponents); } }
GameObject ObjectForShortcut(ResolumeOscShortcut shortcut) { if (shortcut.IsTimeEvent()) { return(TempoController); } if (shortcut.IsClipTransportEvent()) { return(ClipTransport); } if (shortcut.IsCueEvent()) { return(ClipCuepoints); } if (shortcut.IsLayerEffectEvent()) { return(CompositionLayerEffects); } if (shortcut.IsLayerEvent()) { return(CompositionLayer); } if (shortcut.IsCompositionDashboardEvent()) { return(CompositionDashboard); } if (shortcut.IsCompositionLayerDashboardEvent()) { return(CompositionLayerDashboard); } if (shortcut.IsCompositionEvent()) { return(Composition); } if (shortcut.IsApplicationUiEvent()) { return(ApplicationUI); } return(null); }
void HandleNodeByName() { switch (m_Reader.Name) { case k_VersionInfoNodeName: m_Version = ParseVersion(); break; case k_ShortCut: m_CurrentShortcut = NewShortcut(); break; case k_ShortCutPath: ParseShortcutPath(); break; case k_SubTargetNodeName: // on initial parsing, we don't group sub-targets that we find in multiple Shortcut nodes m_CurrentShortcut.SubTargets = new[] { ParseSubTarget() }; break; } }
public static bool IsCueEvent(this ResolumeOscShortcut shortcut) { return(shortcut.Input.Path.Contains(k_Cuepoints)); }
static bool PrefixFoundInList(string prefix, List <ResolumeOscShortcut> shortcuts, ref ResolumeOscShortcut colorRef) { foreach (var shortcut in shortcuts) { if (shortcut.Input.Path.StartsWith(prefix)) { colorRef = shortcut; return(true); } } return(false); }