public void OnMixerControllerChanged(AudioMixerController controller)
 {
   this.m_Controller = controller;
   if ((bool) ((UnityEngine.Object) this.m_Controller))
     this.m_Controller.ChangedExposedParameter += new ChangedExposedParameterHandler(this.RecreateListControl);
   this.RecreateListControl();
 }
 public AudioMixerItem(int id, int depth, TreeViewItem parent, string displayName, AudioMixerController mixer, string infoText)
   : base(id, depth, parent, displayName)
 {
   this.mixer = mixer;
   this.infoText = infoText;
   this.UpdateSuspendedString(true);
 }
 public static bool Slider(GUIContent label, ref float value, float displayScale, float displayExponent, string unit, float leftValue, float rightValue, AudioMixerController controller, AudioParameterPath path, params GUILayoutOption[] options)
 {
     EditorGUI.BeginChangeCheck();
     float fieldWidth = EditorGUIUtility.fieldWidth;
     string kFloatFieldFormatString = EditorGUI.kFloatFieldFormatString;
     bool flag = controller.ContainsExposedParameter(path.parameter);
     EditorGUIUtility.fieldWidth = 70f;
     EditorGUI.kFloatFieldFormatString = "F2";
     EditorGUI.s_UnitString = unit;
     GUIContent content = label;
     if (flag)
     {
         content = GUIContent.Temp(label.text + " ➔", label.tooltip);
     }
     float num2 = value * displayScale;
     num2 = EditorGUILayout.PowerSlider(content, num2, leftValue * displayScale, rightValue * displayScale, displayExponent, options);
     EditorGUI.s_UnitString = null;
     EditorGUI.kFloatFieldFormatString = kFloatFieldFormatString;
     EditorGUIUtility.fieldWidth = fieldWidth;
     if ((Event.current.type == EventType.ContextClick) && GUILayoutUtility.topLevel.GetLast().Contains(Event.current.mousePosition))
     {
         ParameterTransitionType type;
         Event.current.Use();
         GenericMenu menu = new GenericMenu();
         if (!flag)
         {
             if (<>f__mg$cache0 == null)
             {
			public EffectContext(AudioMixerController controller, AudioMixerGroupController group, int index, string name)
			{
				this.controller = controller;
				this.group = group;
				this.index = index;
				this.name = name;
			}
 private static string GetInfoText(AudioMixerController controller)
 {
     if (controller.outputAudioMixerGroup != null)
     {
         return string.Format("({0} of {1})", controller.outputAudioMixerGroup.name, controller.outputAudioMixerGroup.audioMixer.name);
     }
     return "(Audio Listener)";
 }
 internal static void Popup(AudioMixerController controller, GUIStyle style, params GUILayoutOption[] options)
 {
   GUIContent buttonContent = AudioMixerExposedParametersPopup.GetButtonContent(controller);
   Rect rect = GUILayoutUtility.GetRect(buttonContent, style, options);
   if (!EditorGUI.ButtonMouseDown(rect, buttonContent, FocusType.Passive, style))
     return;
   PopupWindow.Show(rect, (PopupWindowContent) new AudioMixerExposedParametersPopup(controller));
 }
		public AudioMixerGroupPopupContext(AudioMixerController controller, AudioMixerGroupController group)
		{
			this.controller = controller;
			this.groups = new AudioMixerGroupController[]
			{
				group
			};
		}
 public void OnMixerControllerChanged(AudioMixerController controller)
 {
   if (!((UnityEngine.Object) controller != (UnityEngine.Object) null))
     return;
   this.m_TreeView.SetSelection(new int[1]
   {
     controller.GetInstanceID()
   }, 1 != 0);
 }
 private static GUIContent GetButtonContent(AudioMixerController controller)
 {
   if (controller.numExposedParameters != AudioMixerExposedParametersPopup.m_LastNumExposedParams)
   {
     AudioMixerExposedParametersPopup.m_ButtonContent.text = string.Format("Exposed Parameters ({0})", (object) controller.numExposedParameters);
     AudioMixerExposedParametersPopup.m_LastNumExposedParams = controller.numExposedParameters;
   }
   return AudioMixerExposedParametersPopup.m_ButtonContent;
 }
 private static GUIContent GetButtonContent(AudioMixerController controller)
 {
     if (controller.numExposedParameters != m_LastNumExposedParams)
     {
         m_ButtonContent.text = string.Format("Exposed Parameters ({0})", controller.numExposedParameters);
         m_LastNumExposedParams = controller.numExposedParameters;
     }
     return m_ButtonContent;
 }
		public void OnMixerControllerChanged(AudioMixerController controller)
		{
			this.m_Controller = controller;
			if (this.m_Controller)
			{
				this.m_Controller.ChangedExposedParameter += new ChangedExposedParameterHandler(this.RecreateListControl);
			}
			this.RecreateListControl();
		}
		public void OnMixerControllerChanged(AudioMixerController controller)
		{
			if (controller != null)
			{
				this.m_TreeView.SetSelection(new int[]
				{
					controller.GetInstanceID()
				}, true);
			}
		}
		public static bool Slider(GUIContent label, ref float value, float displayScale, float displayExponent, string unit, float leftValue, float rightValue, AudioMixerController controller, AudioParameterPath path, params GUILayoutOption[] options)
		{
			EditorGUI.BeginChangeCheck();
			float fieldWidth = EditorGUIUtility.fieldWidth;
			string kFloatFieldFormatString = EditorGUI.kFloatFieldFormatString;
			bool flag = controller.ContainsExposedParameter(path.parameter);
			EditorGUIUtility.fieldWidth = 70f;
			EditorGUI.kFloatFieldFormatString = "F2";
			EditorGUI.s_UnitString = unit;
			GUIContent label2 = label;
			if (flag)
			{
				label2 = GUIContent.Temp(label.text + " ➔", label.tooltip);
			}
			float num = value * displayScale;
			num = EditorGUILayout.PowerSlider(label2, num, leftValue * displayScale, rightValue * displayScale, displayExponent, options);
			EditorGUI.s_UnitString = null;
			EditorGUI.kFloatFieldFormatString = kFloatFieldFormatString;
			EditorGUIUtility.fieldWidth = fieldWidth;
			if (Event.current.type == EventType.ContextClick && GUILayoutUtility.topLevel.GetLast().Contains(Event.current.mousePosition))
			{
				Event.current.Use();
				GenericMenu genericMenu = new GenericMenu();
				if (!flag)
				{
					genericMenu.AddItem(new GUIContent("Expose '" + path.ResolveStringPath(false) + "' to script"), false, new GenericMenu.MenuFunction2(AudioMixerEffectGUI.ExposePopupCallback), new AudioMixerEffectGUI.ExposedParamContext(controller, path));
				}
				else
				{
					genericMenu.AddItem(new GUIContent("Unexpose"), false, new GenericMenu.MenuFunction2(AudioMixerEffectGUI.UnexposePopupCallback), new AudioMixerEffectGUI.ExposedParamContext(controller, path));
				}
				ParameterTransitionType parameterTransitionType;
				bool transitionTypeOverride = controller.TargetSnapshot.GetTransitionTypeOverride(path.parameter, out parameterTransitionType);
				genericMenu.AddSeparator(string.Empty);
				genericMenu.AddItem(new GUIContent("Linear Snapshot Transition"), parameterTransitionType == ParameterTransitionType.Lerp, new GenericMenu.MenuFunction2(AudioMixerEffectGUI.ParameterTransitionOverrideCallback), new AudioMixerEffectGUI.ParameterTransitionOverrideContext(controller, path.parameter, ParameterTransitionType.Lerp));
				genericMenu.AddItem(new GUIContent("Smoothstep Snapshot Transition"), parameterTransitionType == ParameterTransitionType.Smoothstep, new GenericMenu.MenuFunction2(AudioMixerEffectGUI.ParameterTransitionOverrideCallback), new AudioMixerEffectGUI.ParameterTransitionOverrideContext(controller, path.parameter, ParameterTransitionType.Smoothstep));
				genericMenu.AddItem(new GUIContent("Squared Snapshot Transition"), parameterTransitionType == ParameterTransitionType.Squared, new GenericMenu.MenuFunction2(AudioMixerEffectGUI.ParameterTransitionOverrideCallback), new AudioMixerEffectGUI.ParameterTransitionOverrideContext(controller, path.parameter, ParameterTransitionType.Squared));
				genericMenu.AddItem(new GUIContent("SquareRoot Snapshot Transition"), parameterTransitionType == ParameterTransitionType.SquareRoot, new GenericMenu.MenuFunction2(AudioMixerEffectGUI.ParameterTransitionOverrideCallback), new AudioMixerEffectGUI.ParameterTransitionOverrideContext(controller, path.parameter, ParameterTransitionType.SquareRoot));
				genericMenu.AddItem(new GUIContent("BrickwallStart Snapshot Transition"), parameterTransitionType == ParameterTransitionType.BrickwallStart, new GenericMenu.MenuFunction2(AudioMixerEffectGUI.ParameterTransitionOverrideCallback), new AudioMixerEffectGUI.ParameterTransitionOverrideContext(controller, path.parameter, ParameterTransitionType.BrickwallStart));
				genericMenu.AddItem(new GUIContent("BrickwallEnd Snapshot Transition"), parameterTransitionType == ParameterTransitionType.BrickwallEnd, new GenericMenu.MenuFunction2(AudioMixerEffectGUI.ParameterTransitionOverrideCallback), new AudioMixerEffectGUI.ParameterTransitionOverrideContext(controller, path.parameter, ParameterTransitionType.BrickwallEnd));
				genericMenu.AddSeparator(string.Empty);
				genericMenu.ShowAsContext();
			}
			if (EditorGUI.EndChangeCheck())
			{
				value = num / displayScale;
				return true;
			}
			return false;
		}
			public ExposedParamContext(AudioMixerController controller, AudioParameterPath path)
			{
				this.controller = controller;
				this.path = path;
			}
 public float GetValueForMixLevel(AudioMixerController controller, AudioMixerSnapshotController snapshot);
 private TreeViewItem BuildSubTree(AudioMixerController controller)
 {
     AudioMixerGroupController masterGroup = controller.masterGroup;
     TreeViewItem item = new TreeViewItem(masterGroup.GetInstanceID(), 0, base.m_RootItem, masterGroup.name) {
         userData = masterGroup
     };
     this.AddChildrenRecursive(masterGroup, item);
     return item;
 }
		public void OnMixerControllerChanged(AudioMixerController controller)
		{
			if (this.m_Controller != controller)
			{
				this.m_TreeViewGUI.m_Controller = controller;
				this.m_Controller = controller;
				this.m_AudioGroupTreeDataSource.m_Controller = controller;
				if (controller != null)
				{
					this.ReloadTree();
					this.InitSelection(false);
					this.LoadExpandedState();
					this.m_AudioGroupTree.data.SetExpandedWithChildren(this.m_AudioGroupTree.data.root, true);
				}
			}
		}
Exemple #18
0
 extern private static void Internal_CreateAudioMixerController(AudioMixerController mono);
Exemple #19
0
 extern public float GetValueForVolume(AudioMixerController controller, AudioMixerSnapshotController snapshot);
 private AudioMixerExposedParametersPopup(AudioMixerController controller)
 {
     this.m_ExposedParametersView.OnMixerControllerChanged(controller);
 }
        public string GetDisplayString(Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap)
        {
            AudioMixerGroupController audioMixerGroupController = effectMap[this];

            if (audioMixerGroupController.GetInstanceID() != this.m_LastCachedGroupDisplayNameID || this.m_DisplayName == null)
            {
                this.m_DisplayName = audioMixerGroupController.GetDisplayString() + AudioMixerController.s_GroupEffectDisplaySeperator + AudioMixerController.FixNameForPopupMenu(this.effectName);
                this.m_LastCachedGroupDisplayNameID = audioMixerGroupController.GetInstanceID();
            }
            return(this.m_DisplayName);
        }
Exemple #22
0
 public extern float GetValueForSend(AudioMixerController controller, AudioMixerSnapshotController snapshot);
 public extern bool GetFloatBuffer(AudioMixerController controller, string name, out float[] data, int numsamples);
 public extern float GetCPUUsage(AudioMixerController controller);
 public extern void SetValueForParameter(AudioMixerController controller, AudioMixerSnapshotController snapshot, string parameterName, float value);
 private unsafe extern bool GetFloatBuffer_Internal(AudioMixerController controller, string name, float *buffer, int bufferLength);
Exemple #27
0
 public void SetValueForPitch(AudioMixerController controller, AudioMixerSnapshotController snapshot, float value);
			public ParameterTransitionOverrideRemoveContext(AudioMixerController controller, GUID parameter)
			{
				this.controller = controller;
				this.parameter = parameter;
			}
Exemple #29
0
 public extern void SetValueForSend(AudioMixerController controller, AudioMixerSnapshotController snapshot, float value);
Exemple #30
0
 public float GetValueForPitch(AudioMixerController controller, AudioMixerSnapshotController snapshot);
Exemple #31
0
 extern public void SetValueForVolume(AudioMixerController controller, AudioMixerSnapshotController snapshot, float value);
 public void OnMixerControllerChanged(AudioMixerController controller)
 {
   this.m_Controller = controller;
   this.RecreateListControl();
 }
 public override bool IsPluginEditableAndEnabled()
 {
     return(AudioMixerController.EditingTargetSnapshot() && !this.m_Effect.bypass);
 }
 public float GetValueForParameter(AudioMixerController controller, AudioMixerSnapshotController snapshot, string parameterName);
		public extern bool GetFloatBuffer(AudioMixerController controller, string name, out float[] data, int numsamples);
		private static string GetUniqueAudioMixerName(AudioMixerController controller)
		{
			return "AudioMixer_" + controller.GetInstanceID();
		}
		public extern float GetCPUUsage(AudioMixerController controller);
		private void OnMixersDroppedOnMixerCallback(List<AudioMixerController> draggedMixers, AudioMixerController droppedUponMixer)
		{
			int[] array = (
				from i in draggedMixers
				select i.GetInstanceID()).ToArray<int>();
			this.m_TreeView.SetSelection(array, true);
			Selection.instanceIDs = array;
			if (droppedUponMixer == null)
			{
				Undo.RecordObjects(draggedMixers.ToArray(), "Set output group for mixer" + ((draggedMixers.Count <= 1) ? string.Empty : "s"));
				foreach (AudioMixerController current in draggedMixers)
				{
					current.outputAudioMixerGroup = null;
				}
				this.ReloadTree();
			}
			else
			{
				this.m_DraggedMixers = draggedMixers;
				UnityEngine.Object obj = (draggedMixers.Count != 1) ? null : draggedMixers[0].outputAudioMixerGroup;
				ObjectSelector.get.Show(obj, typeof(AudioMixerGroup), null, false, new List<int>
				{
					droppedUponMixer.GetInstanceID()
				});
				ObjectSelector.get.objectSelectorID = 1212;
				ObjectSelector.get.title = "Select Output Audio Mixer Group";
				GUIUtility.ExitGUI();
			}
		}
 public AudioMixerSelection(AudioMixerController controller)
 {
   this.m_Controller = controller;
   this.ChannelStripSelection = new List<AudioMixerGroupController>();
   this.SyncToUnitySelection();
 }
 public TreeViewDataSourceForMixers(TreeView treeView, AudioMixerController ignoreController) : base(treeView)
 {
     base.showRootNode = false;
     base.rootIsCollapsable = false;
     this.ignoreThisController = ignoreController;
     base.alwaysAddFirstItemToSearchResult = true;
 }
 public static float DoInitialModule(AudioMixerGroupController group, AudioMixerController controller, List<AudioMixerGroupController> allGroups)
 {
   Rect rect = EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins, new GUILayoutOption[0]);
   float valueForPitch = group.GetValueForPitch(controller, controller.TargetSnapshot);
   if (AudioMixerEffectGUI.Slider(AudioMixerEffectView.Texts.pitch, ref valueForPitch, 100f, 1f, AudioMixerEffectView.Texts.percentage, 0.01f, 10f, controller, (AudioParameterPath) new AudioGroupParameterPath(group, group.GetGUIDForPitch())))
   {
     Undo.RecordObject((UnityEngine.Object) controller.TargetSnapshot, "Change Pitch");
     group.SetValueForPitch(controller, controller.TargetSnapshot, valueForPitch);
   }
   GUILayout.Space(5f);
   EditorGUILayout.EndVertical();
   AudioMixerDrawUtils.DrawSplitter();
   return rect.height;
 }
 private bool ShouldShowController(AudioMixerController controller, List<int> allowedInstanceIDs)
 {
     if (controller == null)
     {
         return false;
     }
     if ((allowedInstanceIDs != null) && (allowedInstanceIDs.Count > 0))
     {
         return allowedInstanceIDs.Contains(controller.GetInstanceID());
     }
     return true;
 }
 private static void ShowEffectContextMenu(AudioMixerGroupController group, AudioMixerEffectController effect, int effectIndex, AudioMixerController controller, Rect buttonRect)
 {
   // ISSUE: object of a compiler-generated type is created
   // ISSUE: variable of a compiler-generated type
   AudioMixerEffectView.\u003CShowEffectContextMenu\u003Ec__AnonStorey63 menuCAnonStorey63 = new AudioMixerEffectView.\u003CShowEffectContextMenu\u003Ec__AnonStorey63();
   // ISSUE: reference to a compiler-generated field
   menuCAnonStorey63.effect = effect;
   // ISSUE: reference to a compiler-generated field
   menuCAnonStorey63.controller = controller;
   // ISSUE: reference to a compiler-generated field
   menuCAnonStorey63.group = group;
   // ISSUE: reference to a compiler-generated field
   menuCAnonStorey63.effectIndex = effectIndex;
   GenericMenu pm = new GenericMenu();
   // ISSUE: reference to a compiler-generated field
   if (!menuCAnonStorey63.effect.IsReceive())
   {
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     if (!menuCAnonStorey63.effect.IsAttenuation() && !menuCAnonStorey63.effect.IsSend() && !menuCAnonStorey63.effect.IsDuckVolume())
     {
       // ISSUE: reference to a compiler-generated field
       // ISSUE: reference to a compiler-generated method
       pm.AddItem(new GUIContent("Allow Wet Mixing (causes higher memory usage)"), menuCAnonStorey63.effect.enableWetMix, new GenericMenu.MenuFunction(menuCAnonStorey63.\u003C\u003Em__AA));
       // ISSUE: reference to a compiler-generated field
       // ISSUE: reference to a compiler-generated method
       pm.AddItem(new GUIContent("Bypass"), menuCAnonStorey63.effect.bypass, new GenericMenu.MenuFunction(menuCAnonStorey63.\u003C\u003Em__AB));
       pm.AddSeparator(string.Empty);
     }
     // ISSUE: reference to a compiler-generated method
     pm.AddItem(new GUIContent("Copy effect settings to all snapshots"), false, new GenericMenu.MenuFunction(menuCAnonStorey63.\u003C\u003Em__AC));
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     if (!menuCAnonStorey63.effect.IsAttenuation() && !menuCAnonStorey63.effect.IsSend() && (!menuCAnonStorey63.effect.IsDuckVolume() && menuCAnonStorey63.effect.enableWetMix))
     {
       // ISSUE: reference to a compiler-generated method
       pm.AddItem(new GUIContent("Copy effect settings to all snapshots, including wet level"), false, new GenericMenu.MenuFunction(menuCAnonStorey63.\u003C\u003Em__AD));
     }
     pm.AddSeparator(string.Empty);
   }
   // ISSUE: reference to a compiler-generated field
   AudioMixerGroupController[] groups = new AudioMixerGroupController[1]{ menuCAnonStorey63.group };
   // ISSUE: reference to a compiler-generated field
   // ISSUE: reference to a compiler-generated field
   AudioMixerChannelStripView.AddEffectItemsToMenu(menuCAnonStorey63.controller, groups, menuCAnonStorey63.effectIndex, "Add effect before/", pm);
   // ISSUE: reference to a compiler-generated field
   // ISSUE: reference to a compiler-generated field
   AudioMixerChannelStripView.AddEffectItemsToMenu(menuCAnonStorey63.controller, groups, menuCAnonStorey63.effectIndex + 1, "Add effect after/", pm);
   // ISSUE: reference to a compiler-generated field
   if (!menuCAnonStorey63.effect.IsAttenuation())
   {
     pm.AddSeparator(string.Empty);
     // ISSUE: reference to a compiler-generated method
     pm.AddItem(new GUIContent("Remove this effect"), false, new GenericMenu.MenuFunction(menuCAnonStorey63.\u003C\u003Em__AE));
   }
   pm.DropDown(buttonRect);
 }
			public ParameterTransitionOverrideContext(AudioMixerController controller, GUID parameter, ParameterTransitionType type)
			{
				this.controller = controller;
				this.parameter = parameter;
				this.type = type;
			}
 public void HandleDragging(Rect totalRect, AudioMixerGroupController group, AudioMixerController controller)
 {
   if (!this.isDragging)
     return;
   Event current = Event.current;
   EventType typeForControl = current.GetTypeForControl(this.m_DragControlID);
   switch (typeForControl)
   {
     case EventType.MouseUp:
       current.Use();
       if (this.m_MovingSrcIndex == -1)
         break;
       if (this.m_MovingDstIndex != -1 && this.m_MovingEffectAllowed)
       {
         List<AudioMixerEffectController> list = ((IEnumerable<AudioMixerEffectController>) group.effects).ToList<AudioMixerEffectController>();
         if (AudioMixerController.MoveEffect(ref list, this.m_MovingSrcIndex, ref list, this.m_MovingDstIndex))
           group.effects = list.ToArray();
       }
       this.m_MovingSrcIndex = -1;
       this.m_MovingDstIndex = -1;
       controller.m_HighlightEffectIndex = -1;
       if (GUIUtility.hotControl == this.m_DragControlID)
         GUIUtility.hotControl = 0;
       EditorGUIUtility.SetWantsMouseJumping(0);
       AudioMixerUtility.RepaintAudioMixerAndInspectors();
       GUIUtility.ExitGUI();
       break;
     case EventType.MouseDrag:
       this.m_MovingPos = current.mousePosition.y;
       current.Use();
       break;
     default:
       if (typeForControl != EventType.Repaint || (double) this.m_DragHighlightPos <= 0.0)
         break;
       float width = totalRect.width;
       Color color1 = !this.m_MovingEffectAllowed ? this.kMoveColorLoDisallowed : this.kMoveColorLoAllowed;
       Color color2 = !this.m_MovingEffectAllowed ? this.kMoveColorHiDisallowed : this.kMoveColorHiAllowed;
       Color color3 = !this.m_MovingEffectAllowed ? this.kMoveColorBorderDisallowed : this.kMoveColorBorderAllowed;
       AudioMixerDrawUtils.DrawGradientRect(new Rect(this.m_MovingRect.x, this.m_DragHighlightPos - 15f, width, 15f), color1, color2);
       AudioMixerDrawUtils.DrawGradientRect(new Rect(this.m_MovingRect.x, this.m_DragHighlightPos, width, 15f), color2, color1);
       AudioMixerDrawUtils.DrawGradientRect(new Rect(this.m_MovingRect.x, this.m_DragHighlightPos - this.m_DragHighlightHeight / 2f, width, this.m_DragHighlightHeight), color3, color3);
       break;
   }
 }
Exemple #46
0
 private static extern void Internal_CreateAudioMixerController([Writable] AudioMixerController mono);
        public string GetDisplayString(Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap)
        {
            AudioMixerGroupController group = effectMap[this];

            if (group.GetInstanceID() != m_LastCachedGroupDisplayNameID || m_DisplayName == null)
            {
                // Cache display name to prevent string allocs every event
                m_DisplayName = group.GetDisplayString() + AudioMixerController.s_GroupEffectDisplaySeperator + AudioMixerController.FixNameForPopupMenu(effectName);
                m_LastCachedGroupDisplayNameID = group.GetInstanceID();
            }
            return(m_DisplayName);
        }