private void EffectSlot(Rect effectRect, AudioMixerSnapshotController snapshot, AudioMixerEffectController effect, int effectIndex, ref int highlightEffectIndex, AudioMixerChannelStripView.ChannelStripParams p, ref Dictionary<AudioMixerEffectController, AudioMixerChannelStripView.PatchSlot> patchslots)
		{
			if (effect == null)
			{
				return;
			}
			Rect rect = effectRect;
			Event current = Event.current;
			if (current.type == EventType.Repaint && patchslots != null && (effect.IsSend() || MixerEffectDefinitions.EffectCanBeSidechainTarget(effect)))
			{
				AudioMixerChannelStripView.PatchSlot patchSlot = new AudioMixerChannelStripView.PatchSlot();
				patchSlot.group = p.group;
				patchSlot.x = rect.xMax - (rect.yMax - rect.yMin) * 0.5f;
				patchSlot.y = (rect.yMin + rect.yMax) * 0.5f;
				patchslots[effect] = patchSlot;
			}
			bool flag = !effect.DisallowsBypass();
			Rect position = rect;
			position.width = 10f;
			rect.xMin += 10f;
			if (flag && GUI.Button(position, this.bypassButtonContent, GUIStyle.none))
			{
				effect.bypass = !effect.bypass;
				this.m_Controller.UpdateBypass();
				InspectorWindow.RepaintAllInspectors();
			}
			this.m_IndexCounter++;
			float num = (!(effect != null)) ? AudioMixerController.kMinVolume : Mathf.Clamp(effect.GetValueForMixLevel(this.m_Controller, snapshot), AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect);
			bool flag2 = effect != null && ((effect.IsSend() && effect.sendTarget != null) || effect.enableWetMix);
			if (current.type == EventType.Repaint)
			{
				GUIStyle effectBarStyle = this.GetEffectBarStyle(effect);
				float num2 = (!flag2) ? 1f : ((num - AudioMixerController.kMinVolume) / (AudioMixerController.kMaxEffect - AudioMixerController.kMinVolume));
				bool flag3 = (!p.group.bypassEffects && (effect == null || !effect.bypass)) || (effect != null && effect.DisallowsBypass());
				Color color = (!(effect != null)) ? new Color(0f, 0f, 0f, 0.5f) : AudioMixerDrawUtils.GetEffectColor(effect);
				if (!flag3)
				{
					color = new Color(color.r * 0.5f, color.g * 0.5f, color.b * 0.5f);
				}
				if (flag3)
				{
					if (num2 < 1f)
					{
						float num3 = rect.width * num2;
						if (num3 < 4f)
						{
							num3 = Mathf.Max(num3, 2f);
							float num4 = 1f - num3 / 4f;
							Color color2 = GUI.color;
							if (!GUI.enabled)
							{
								GUI.color = new Color(1f, 1f, 1f, 0.5f);
							}
							GUI.DrawTextureWithTexCoords(new Rect(rect.x, rect.y, num3, rect.height), effectBarStyle.focused.background, new Rect(num4, 0f, 1f - num4, 1f));
							GUI.color = color2;
						}
						else
						{
							effectBarStyle.Draw(new Rect(rect.x, rect.y, num3, rect.height), false, false, false, true);
						}
						GUI.DrawTexture(new Rect(rect.x + num3, rect.y, rect.width - num3, rect.height), effectBarStyle.onFocused.background, ScaleMode.StretchToFill);
					}
					else
					{
						effectBarStyle.Draw(rect, !flag2, false, false, flag2);
					}
				}
				else
				{
					effectBarStyle.Draw(rect, false, false, false, false);
				}
				if (flag)
				{
					this.styles.circularToggle.Draw(new Rect(position.x + 2f, position.y + 5f, position.width - 2f, position.width - 2f), false, false, !effect.bypass, false);
				}
				if (effect.IsSend() && effect.sendTarget != null)
				{
					position.y -= 1f;
					GUI.Label(position, this.styles.sendString, EditorStyles.miniLabel);
				}
				EditorGUI.BeginDisabledGroup(!flag3);
				string effectSlotName = this.GetEffectSlotName(effect, flag2, snapshot, p);
				string effectSlotTooltip = this.GetEffectSlotTooltip(effect, rect, p);
				GUI.Label(new Rect(rect.x, rect.y, rect.width - 10f, rect.height), GUIContent.Temp(effectSlotName, effectSlotTooltip), this.styles.effectName);
				EditorGUI.EndDisabledGroup();
			}
			else
			{
				this.EffectSlotDragging(effectRect, snapshot, effect, flag2, num, effectIndex, ref highlightEffectIndex, p);
			}
		}
		private string GetEffectSlotName(AudioMixerEffectController effect, bool showLevel, AudioMixerSnapshotController snapshot, AudioMixerChannelStripView.ChannelStripParams p)
		{
			if (this.m_ChangingWetMixIndex == this.m_IndexCounter && showLevel)
			{
				return string.Format("{0:F1} dB", effect.GetValueForMixLevel(this.m_Controller, snapshot));
			}
			if (effect.IsSend() && effect.sendTarget != null)
			{
				return effect.GetSendTargetDisplayString(p.effectMap);
			}
			return effect.effectName;
		}
		private void RectSelection(AudioMixerChannelStripView.ChannelStripParams channelStripParams)
		{
			Event current = Event.current;
			if (current.type == EventType.MouseDown && current.button == 0 && GUIUtility.hotControl == 0)
			{
				if (!current.shift)
				{
					Selection.objects = new UnityEngine.Object[0];
					this.m_Controller.OnUnitySelectionChanged();
				}
				GUIUtility.hotControl = this.m_RectSelectionControlID;
				this.m_RectSelectionStartPos = current.mousePosition;
				this.m_RectSelectionRect = new Rect(this.m_RectSelectionStartPos.x, this.m_RectSelectionStartPos.y, 0f, 0f);
				Event.current.Use();
				InspectorWindow.RepaintAllInspectors();
			}
			if (current.type == EventType.MouseDrag)
			{
				if (this.IsRectSelectionActive())
				{
					this.m_RectSelectionRect.x = Mathf.Min(this.m_RectSelectionStartPos.x, current.mousePosition.x);
					this.m_RectSelectionRect.y = Mathf.Min(this.m_RectSelectionStartPos.y, current.mousePosition.y);
					this.m_RectSelectionRect.width = Mathf.Max(this.m_RectSelectionStartPos.x, current.mousePosition.x) - this.m_RectSelectionRect.x;
					this.m_RectSelectionRect.height = Mathf.Max(this.m_RectSelectionStartPos.y, current.mousePosition.y) - this.m_RectSelectionRect.y;
					Event.current.Use();
				}
				if (this.m_MovingSrcRect.y >= 0f)
				{
					Event.current.Use();
				}
			}
			if (this.IsRectSelectionActive() && current.GetTypeForControl(this.m_RectSelectionControlID) == EventType.MouseUp)
			{
				List<AudioMixerGroupController> list = (!current.shift) ? new List<AudioMixerGroupController>() : this.m_Controller.CachedSelection;
				foreach (AudioMixerGroupController current2 in channelStripParams.rectSelectionGroups)
				{
					if (!list.Contains(current2))
					{
						list.Add(current2);
					}
				}
				Selection.objects = list.ToArray();
				this.m_Controller.OnUnitySelectionChanged();
				GUIUtility.hotControl = 0;
				Event.current.Use();
			}
			if (current.type == EventType.Repaint && this.IsRectSelectionActive())
			{
				Color color = new Color(1f, 1f, 1f, 0.3f);
				AudioMixerDrawUtils.DrawGradientRectHorizontal(this.m_RectSelectionRect, color, color);
			}
		}
		public AudioMixerChannelStripView(AudioMixerChannelStripView.State state)
		{
			this.m_State = state;
		}
 private void RectSelection(AudioMixerChannelStripView.ChannelStripParams channelStripParams)
 {
   Event current1 = Event.current;
   if (current1.type == EventType.MouseDown && current1.button == 0 && GUIUtility.hotControl == 0)
   {
     if (!current1.shift)
     {
       Selection.objects = new UnityEngine.Object[0];
       this.m_Controller.OnUnitySelectionChanged();
     }
     GUIUtility.hotControl = this.m_RectSelectionControlID;
     this.m_RectSelectionStartPos = current1.mousePosition;
     this.m_RectSelectionRect = new Rect(this.m_RectSelectionStartPos.x, this.m_RectSelectionStartPos.y, 0.0f, 0.0f);
     Event.current.Use();
     InspectorWindow.RepaintAllInspectors();
   }
   if (current1.type == EventType.MouseDrag)
   {
     if (this.IsRectSelectionActive())
     {
       this.m_RectSelectionRect.x = Mathf.Min(this.m_RectSelectionStartPos.x, current1.mousePosition.x);
       this.m_RectSelectionRect.y = Mathf.Min(this.m_RectSelectionStartPos.y, current1.mousePosition.y);
       this.m_RectSelectionRect.width = Mathf.Max(this.m_RectSelectionStartPos.x, current1.mousePosition.x) - this.m_RectSelectionRect.x;
       this.m_RectSelectionRect.height = Mathf.Max(this.m_RectSelectionStartPos.y, current1.mousePosition.y) - this.m_RectSelectionRect.y;
       Event.current.Use();
     }
     if ((double) this.m_MovingSrcRect.y >= 0.0)
       Event.current.Use();
   }
   if (this.IsRectSelectionActive() && current1.GetTypeForControl(this.m_RectSelectionControlID) == EventType.MouseUp)
   {
     List<AudioMixerGroupController> mixerGroupControllerList = !current1.shift ? new List<AudioMixerGroupController>() : this.m_Controller.CachedSelection;
     using (List<AudioMixerGroupController>.Enumerator enumerator = channelStripParams.rectSelectionGroups.GetEnumerator())
     {
       while (enumerator.MoveNext())
       {
         AudioMixerGroupController current2 = enumerator.Current;
         if (!mixerGroupControllerList.Contains(current2))
           mixerGroupControllerList.Add(current2);
       }
     }
     Selection.objects = (UnityEngine.Object[]) mixerGroupControllerList.ToArray();
     this.m_Controller.OnUnitySelectionChanged();
     GUIUtility.hotControl = 0;
     Event.current.Use();
   }
   if (current1.type != EventType.Repaint || !this.IsRectSelectionActive())
     return;
   Color color = new Color(1f, 1f, 1f, 0.3f);
   AudioMixerDrawUtils.DrawGradientRectHorizontal(this.m_RectSelectionRect, color, color);
 }
		private float DoVUMeters(Rect vuRect, float attenuationMarkerHeight, AudioMixerChannelStripView.ChannelStripParams p)
		{
			float num = 1f;
			int num2 = p.numChannels;
			if (num2 == 0)
			{
				if (p.index >= 0 && p.index < this.m_LastNumChannels.Count)
				{
					num2 = this.m_LastNumChannels[p.index];
				}
			}
			else
			{
				while (p.index >= this.m_LastNumChannels.Count)
				{
					this.m_LastNumChannels.Add(0);
				}
				this.m_LastNumChannels[p.index] = num2;
			}
			if (num2 <= 2)
			{
				vuRect.x = vuRect.xMax - 25f;
				vuRect.width = 25f;
			}
			if (num2 == 0)
			{
				return vuRect.x;
			}
			float num3 = Mathf.Floor(attenuationMarkerHeight / 2f);
			vuRect.y += num3;
			vuRect.height -= 2f * num3;
			float num4 = Mathf.Round((vuRect.width - (float)num2 * num) / (float)num2);
			Rect r = new Rect(vuRect.xMax - num4, vuRect.y, num4, vuRect.height);
			for (int i = num2 - 1; i >= 0; i--)
			{
				if (i != num2 - 1)
				{
					r.x -= r.width + num;
				}
				float level = 1f - AudioMixerController.VolumeToScreenMapping(Mathf.Clamp(p.vuinfo_level[i], AudioMixerController.kMinVolume, AudioMixerController.GetMaxVolume()), 1f, true);
				float peak = 1f - AudioMixerController.VolumeToScreenMapping(Mathf.Clamp(p.vuinfo_peak[i], AudioMixerController.kMinVolume, AudioMixerController.GetMaxVolume()), 1f, true);
				this.VUMeter(p.group, r, level, peak);
			}
			AudioMixerDrawUtils.AddTooltipOverlay(vuRect, this.styles.vuMeterGUIContent.tooltip);
			return r.x;
		}
		private void DrawChannelStrip(AudioMixerChannelStripView.ChannelStripParams p, ref int highlightEffectIndex, ref Dictionary<AudioMixerEffectController, AudioMixerChannelStripView.PatchSlot> patchslots, bool showBusConnectionsOfSelection)
		{
			Event current = Event.current;
			bool flag = current.type == EventType.MouseDown && p.stripRect.Contains(current.mousePosition);
			bool selected = this.m_Controller.CachedSelection.Contains(p.group);
			if (this.IsRectSelectionActive() && AudioMixerChannelStripView.RectOverlaps(p.stripRect, this.m_RectSelectionRect))
			{
				p.rectSelectionGroups.Add(p.group);
				selected = true;
			}
			this.DrawBackgrounds(p, selected);
			GUIContent arg_9B_0 = this.headerGUIContent;
			string displayString = p.group.GetDisplayString();
			this.headerGUIContent.tooltip = displayString;
			arg_9B_0.text = displayString;
			GUI.Label(p.bgRects[p.kHeaderIndex], this.headerGUIContent, AudioMixerDrawUtils.styles.channelStripHeaderStyle);
			Rect rect = new RectOffset(-6, 0, 0, -4).Add(p.bgRects[p.kVUMeterFaderIndex]);
			float num = 1f;
			float num2 = 54f;
			float width = rect.width - num2 - num;
			Rect vuRect = new Rect(rect.x, rect.y, num2, rect.height);
			Rect rect2 = new Rect(vuRect.xMax + num, rect.y, width, rect.height);
			float width2 = 29f;
			Rect r = new Rect(rect2.x, rect2.y, width2, rect2.height);
			Rect rect3 = p.bgRects[p.kSoloMuteBypassIndex];
			GUIStyle channelStripAttenuationMarkerSquare = AudioMixerDrawUtils.styles.channelStripAttenuationMarkerSquare;
			EditorGUI.BeginDisabledGroup(!AudioMixerController.EditingTargetSnapshot());
			this.DoVUMeters(vuRect, channelStripAttenuationMarkerSquare.fixedHeight, p);
			this.DoAttenuationFader(r, p.group, this.m_Controller.CachedSelection, channelStripAttenuationMarkerSquare);
			this.DoTotaldB(p);
			this.DoEffectList(p, selected, ref highlightEffectIndex, ref patchslots, showBusConnectionsOfSelection);
			EditorGUI.EndDisabledGroup();
			this.DoSoloMuteBypassButtons(rect3, p.group, p.allGroups, this.m_Controller.CachedSelection, p.anySoloActive);
			if (flag)
			{
				this.GroupClicked(p.group, p, current.type == EventType.Used);
			}
			if (current.type == EventType.ContextClick && p.stripRect.Contains(current.mousePosition))
			{
				current.Use();
				this.OpenGroupContextMenu(p.group);
			}
		}
		private void GroupClicked(AudioMixerGroupController clickedGroup, AudioMixerChannelStripView.ChannelStripParams p, bool clickedControlInGroup)
		{
			List<int> list = new List<int>();
			foreach (AudioMixerGroupController current in p.shownGroups)
			{
				list.Add(current.GetInstanceID());
			}
			List<int> list2 = new List<int>();
			foreach (AudioMixerGroupController current2 in this.m_Controller.CachedSelection)
			{
				list2.Add(current2.GetInstanceID());
			}
			int lastClickedInstanceID = this.m_State.m_LastClickedInstanceID;
			bool allowMultiSelection = true;
			bool keepMultiSelection = Event.current.shift || clickedControlInGroup;
			bool useShiftAsActionKey = false;
			List<int> newSelection = InternalEditorUtility.GetNewSelection(clickedGroup.GetInstanceID(), list, list2, lastClickedInstanceID, keepMultiSelection, useShiftAsActionKey, allowMultiSelection);
			List<AudioMixerGroupController> list3 = (
				from x in p.allGroups
				where newSelection.Contains(x.GetInstanceID())
				select x).ToList<AudioMixerGroupController>();
			Selection.objects = list3.ToArray();
			this.m_Controller.OnUnitySelectionChanged();
			InspectorWindow.RepaintAllInspectors();
		}
 private void DrawBackgrounds(AudioMixerChannelStripView.ChannelStripParams p, bool selected)
 {
   if (Event.current.type == EventType.Repaint)
   {
     this.styles.channelStripBg.Draw(p.stripRect, false, false, selected, false);
     float num1 = 0.4666667f;
     float num2 = 0.227451f;
     Color color = !EditorGUIUtility.isProSkin ? new Color(num1, num1, num1) : new Color(num2, num2, num2);
     Rect bgRect = p.bgRects[p.kEffectStartIndex];
     --bgRect.y;
     bgRect.height = 1f;
     EditorGUI.DrawRect(bgRect, color);
   }
   Rect bgRect1 = p.bgRects[p.kVUMeterFaderIndex];
   bgRect1.height = !EditorGUIUtility.isProSkin ? 2f : 1f;
   bgRect1.y -= bgRect1.height;
   int userColorIndex = p.group.userColorIndex;
   if (userColorIndex == 0)
     return;
   EditorGUI.DrawRect(bgRect1, AudioMixerColorCodes.GetColor(userColorIndex));
 }
		private void DrawBackgrounds(AudioMixerChannelStripView.ChannelStripParams p, bool selected)
		{
			if (Event.current.type == EventType.Repaint)
			{
				this.styles.channelStripBg.Draw(p.stripRect, false, false, selected, false);
				float num = 0.466666669f;
				float num2 = 0.227450982f;
				Color color = (!EditorGUIUtility.isProSkin) ? new Color(num, num, num) : new Color(num2, num2, num2);
				Rect rect = p.bgRects[p.kEffectStartIndex];
				rect.y -= 1f;
				rect.height = 1f;
				EditorGUI.DrawRect(rect, color);
			}
			Rect rect2 = p.bgRects[p.kVUMeterFaderIndex];
			rect2.height = (float)((!EditorGUIUtility.isProSkin) ? 2 : 1);
			rect2.y -= rect2.height;
			int userColorIndex = p.group.userColorIndex;
			if (userColorIndex != 0)
			{
				EditorGUI.DrawRect(rect2, AudioMixerColorCodes.GetColor(userColorIndex));
			}
		}
 private void GroupClicked(AudioMixerGroupController clickedGroup, AudioMixerChannelStripView.ChannelStripParams p, bool clickedControlInGroup)
 {
   // ISSUE: object of a compiler-generated type is created
   // ISSUE: variable of a compiler-generated type
   AudioMixerChannelStripView.\u003CGroupClicked\u003Ec__AnonStorey60 clickedCAnonStorey60 = new AudioMixerChannelStripView.\u003CGroupClicked\u003Ec__AnonStorey60();
   List<int> allInstanceIDs = new List<int>();
   using (List<AudioMixerGroupController>.Enumerator enumerator = p.shownGroups.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       AudioMixerGroupController current = enumerator.Current;
       allInstanceIDs.Add(current.GetInstanceID());
     }
   }
   List<int> selectedInstanceIDs = new List<int>();
   using (List<AudioMixerGroupController>.Enumerator enumerator = this.m_Controller.CachedSelection.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       AudioMixerGroupController current = enumerator.Current;
       selectedInstanceIDs.Add(current.GetInstanceID());
     }
   }
   int clickedInstanceId = this.m_State.m_LastClickedInstanceID;
   bool allowMultiSelection = true;
   bool keepMultiSelection = Event.current.shift || clickedControlInGroup;
   bool useShiftAsActionKey = false;
   // ISSUE: reference to a compiler-generated field
   clickedCAnonStorey60.newSelection = InternalEditorUtility.GetNewSelection(clickedGroup.GetInstanceID(), allInstanceIDs, selectedInstanceIDs, clickedInstanceId, keepMultiSelection, useShiftAsActionKey, allowMultiSelection);
   // ISSUE: reference to a compiler-generated method
   Selection.objects = (UnityEngine.Object[]) p.allGroups.Where<AudioMixerGroupController>(new Func<AudioMixerGroupController, bool>(clickedCAnonStorey60.\u003C\u003Em__A4)).ToList<AudioMixerGroupController>().ToArray();
   this.m_Controller.OnUnitySelectionChanged();
   InspectorWindow.RepaintAllInspectors();
 }
 private void EffectSlotDragging(Rect r, AudioMixerSnapshotController snapshot, AudioMixerEffectController effect, bool showLevel, float level, int effectIndex, ref int highlightEffectIndex, AudioMixerChannelStripView.ChannelStripParams p)
 {
   Event current1 = Event.current;
   switch (current1.GetTypeForControl(this.m_EffectInteractionControlID))
   {
     case EventType.MouseDown:
       if (!r.Contains(current1.mousePosition) || current1.button != 0 || GUIUtility.hotControl != 0)
         break;
       GUIUtility.hotControl = this.m_EffectInteractionControlID;
       this.m_MouseDragStartX = current1.mousePosition.x;
       this.m_MouseDragStartValue = level;
       highlightEffectIndex = effectIndex;
       this.m_MovingEffectSrcIndex = -1;
       this.m_MovingEffectDstIndex = -1;
       this.m_WaitingForDragEvent = true;
       this.m_MovingSrcRect = r;
       this.m_MovingDstRect = r;
       this.m_MovingSrcGroup = p.group;
       this.m_MovingDstGroup = p.group;
       this.m_MovingEffectAllowed = true;
       this.SetFocus();
       Event.current.Use();
       EditorGUIUtility.SetWantsMouseJumping(1);
       InspectorWindow.RepaintAllInspectors();
       break;
     case EventType.MouseUp:
       if (GUIUtility.hotControl != this.m_EffectInteractionControlID || current1.button != 0 || !p.stripRect.Contains(current1.mousePosition))
         break;
       if (this.m_MovingEffectDstIndex != -1 && this.m_MovingEffectAllowed)
       {
         if (this.IsDuplicateKeyPressed() && this.CanDuplicateDraggedEffect())
         {
           AudioMixerEffectController effect1 = this.m_MovingSrcGroup.controller.CopyEffect(this.m_MovingSrcGroup.effects[this.m_MovingEffectSrcIndex]);
           List<AudioMixerEffectController> list = ((IEnumerable<AudioMixerEffectController>) this.m_MovingDstGroup.effects).ToList<AudioMixerEffectController>();
           if (AudioMixerController.InsertEffect(effect1, ref list, this.m_MovingEffectDstIndex))
             this.m_MovingDstGroup.effects = list.ToArray();
         }
         else if ((UnityEngine.Object) this.m_MovingSrcGroup == (UnityEngine.Object) this.m_MovingDstGroup)
         {
           List<AudioMixerEffectController> list = ((IEnumerable<AudioMixerEffectController>) this.m_MovingSrcGroup.effects).ToList<AudioMixerEffectController>();
           if (AudioMixerController.MoveEffect(ref list, this.m_MovingEffectSrcIndex, ref list, this.m_MovingEffectDstIndex))
             this.m_MovingSrcGroup.effects = list.ToArray();
         }
         else if (!this.m_MovingSrcGroup.effects[this.m_MovingEffectSrcIndex].IsAttenuation())
         {
           List<AudioMixerEffectController> list1 = ((IEnumerable<AudioMixerEffectController>) this.m_MovingSrcGroup.effects).ToList<AudioMixerEffectController>();
           List<AudioMixerEffectController> list2 = ((IEnumerable<AudioMixerEffectController>) this.m_MovingDstGroup.effects).ToList<AudioMixerEffectController>();
           if (AudioMixerController.MoveEffect(ref list1, this.m_MovingEffectSrcIndex, ref list2, this.m_MovingEffectDstIndex))
           {
             this.m_MovingSrcGroup.effects = list1.ToArray();
             this.m_MovingDstGroup.effects = list2.ToArray();
           }
         }
       }
       this.ClearEffectDragging(ref highlightEffectIndex);
       current1.Use();
       EditorGUIUtility.SetWantsMouseJumping(0);
       GUIUtility.ExitGUI();
       break;
     case EventType.MouseDrag:
       if (GUIUtility.hotControl != this.m_EffectInteractionControlID)
         break;
       if (this.HasFocus() && this.m_WaitingForDragEvent)
       {
         this.m_ChangingWetMixIndex = -1;
         if (effectIndex < p.group.effects.Length)
         {
           if ((double) Mathf.Abs(current1.delta.y) > (double) Mathf.Abs(current1.delta.x))
           {
             this.m_MovingEffectSrcIndex = effectIndex;
             this.ClearFocus();
           }
           else
             this.m_ChangingWetMixIndex = this.m_IndexCounter;
         }
         this.m_WaitingForDragEvent = false;
       }
       if (this.IsMovingEffect() && p.stripRect.Contains(current1.mousePosition))
       {
         float num1 = r.height * 0.5f;
         float num2 = effectIndex != 0 ? 0.0f : -num1;
         float num3 = effectIndex != p.group.effects.Length - 1 ? r.height : r.height + num1;
         float num4 = current1.mousePosition.y - r.y;
         if ((double) num4 >= (double) num2 && (double) num4 <= (double) num3 && effectIndex < p.group.effects.Length)
         {
           int targetIndex = (double) num4 >= (double) num1 ? effectIndex + 1 : effectIndex;
           if (targetIndex != this.m_MovingEffectDstIndex || (UnityEngine.Object) this.m_MovingDstGroup != (UnityEngine.Object) p.group)
           {
             this.m_MovingDstRect.x = r.x;
             this.m_MovingDstRect.width = r.width;
             this.m_MovingDstRect.y = (float) (((double) num4 >= (double) num1 ? (double) r.y + (double) r.height : (double) r.y) - 1.0);
             this.m_MovingEffectDstIndex = targetIndex;
             this.m_MovingDstGroup = p.group;
             this.m_MovingEffectAllowed = (!this.m_MovingSrcGroup.effects[this.m_MovingEffectSrcIndex].IsAttenuation() || !((UnityEngine.Object) this.m_MovingSrcGroup != (UnityEngine.Object) this.m_MovingDstGroup)) && !AudioMixerController.WillMovingEffectCauseFeedback(p.allGroups, this.m_MovingSrcGroup, this.m_MovingEffectSrcIndex, this.m_MovingDstGroup, targetIndex, (List<AudioMixerController.ConnectionNode>) null) && (!this.IsDuplicateKeyPressed() || this.CanDuplicateDraggedEffect());
           }
           current1.Use();
         }
       }
       if (!this.IsAdjustingWetMix() || !this.HasFocus() || !showLevel)
         break;
       this.m_WaitingForDragEvent = false;
       float num = Mathf.Clamp(AudioMixerChannelStripView.kEffectScaleMouseDrag * HandleUtility.niceMouseDelta + level, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect) - level;
       if ((double) num != 0.0)
       {
         Undo.RecordObject((UnityEngine.Object) this.m_Controller.TargetSnapshot, "Change effect level");
         if (effect.IsSend() && this.m_Controller.CachedSelection.Count > 1 && this.m_Controller.CachedSelection.Contains(p.group))
         {
           List<AudioMixerEffectController> effectControllerList = new List<AudioMixerEffectController>();
           using (List<AudioMixerGroupController>.Enumerator enumerator = this.m_Controller.CachedSelection.GetEnumerator())
           {
             while (enumerator.MoveNext())
             {
               foreach (AudioMixerEffectController effect1 in enumerator.Current.effects)
               {
                 if (effect1.effectName == effect.effectName && (UnityEngine.Object) effect1.sendTarget == (UnityEngine.Object) effect.sendTarget)
                   effectControllerList.Add(effect1);
               }
             }
           }
           using (List<AudioMixerEffectController>.Enumerator enumerator = effectControllerList.GetEnumerator())
           {
             while (enumerator.MoveNext())
             {
               AudioMixerEffectController current2 = enumerator.Current;
               if (!current2.IsSend() || (UnityEngine.Object) current2.sendTarget != (UnityEngine.Object) null)
                 current2.SetValueForMixLevel(this.m_Controller, snapshot, Mathf.Clamp(current2.GetValueForMixLevel(this.m_Controller, snapshot) + num, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect));
             }
           }
         }
         else if (!effect.IsSend() || (UnityEngine.Object) effect.sendTarget != (UnityEngine.Object) null)
           effect.SetValueForMixLevel(this.m_Controller, snapshot, Mathf.Clamp(level + num, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect));
         InspectorWindow.RepaintAllInspectors();
       }
       current1.Use();
       break;
   }
 }
 private void EffectSlot(Rect effectRect, AudioMixerSnapshotController snapshot, AudioMixerEffectController effect, int effectIndex, ref int highlightEffectIndex, AudioMixerChannelStripView.ChannelStripParams p, ref Dictionary<AudioMixerEffectController, AudioMixerChannelStripView.PatchSlot> patchslots)
 {
   if ((UnityEngine.Object) effect == (UnityEngine.Object) null)
     return;
   Rect rect = effectRect;
   Event current = Event.current;
   if (current.type == EventType.Repaint && patchslots != null && (effect.IsSend() || MixerEffectDefinitions.EffectCanBeSidechainTarget(effect)))
     patchslots[effect] = new AudioMixerChannelStripView.PatchSlot()
     {
       group = p.group,
       x = rect.xMax - (float) (((double) rect.yMax - (double) rect.yMin) * 0.5),
       y = (float) (((double) rect.yMin + (double) rect.yMax) * 0.5)
     };
   bool flag1 = !effect.DisallowsBypass();
   Rect position = rect;
   position.width = 10f;
   rect.xMin += 10f;
   if (flag1 && GUI.Button(position, this.bypassButtonContent, GUIStyle.none))
   {
     effect.bypass = !effect.bypass;
     this.m_Controller.UpdateBypass();
     InspectorWindow.RepaintAllInspectors();
   }
   ++this.m_IndexCounter;
   float level = !((UnityEngine.Object) effect != (UnityEngine.Object) null) ? AudioMixerController.kMinVolume : Mathf.Clamp(effect.GetValueForMixLevel(this.m_Controller, snapshot), AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect);
   bool flag2 = (UnityEngine.Object) effect != (UnityEngine.Object) null && (effect.IsSend() && (UnityEngine.Object) effect.sendTarget != (UnityEngine.Object) null || effect.enableWetMix);
   if (current.type == EventType.Repaint)
   {
     GUIStyle effectBarStyle = this.GetEffectBarStyle(effect);
     float num1 = !flag2 ? 1f : (float) (((double) level - (double) AudioMixerController.kMinVolume) / ((double) AudioMixerController.kMaxEffect - (double) AudioMixerController.kMinVolume));
     bool flag3 = !p.group.bypassEffects && ((UnityEngine.Object) effect == (UnityEngine.Object) null || !effect.bypass) || (UnityEngine.Object) effect != (UnityEngine.Object) null && effect.DisallowsBypass();
     Color color1 = !((UnityEngine.Object) effect != (UnityEngine.Object) null) ? new Color(0.0f, 0.0f, 0.0f, 0.5f) : AudioMixerDrawUtils.GetEffectColor(effect);
     if (!flag3)
       color1 = new Color(color1.r * 0.5f, color1.g * 0.5f, color1.b * 0.5f);
     if (flag3)
     {
       if ((double) num1 < 1.0)
       {
         float num2 = rect.width * num1;
         if ((double) num2 < 4.0)
         {
           num2 = Mathf.Max(num2, 2f);
           float x = (float) (1.0 - (double) num2 / 4.0);
           Color color2 = GUI.color;
           if (!GUI.enabled)
             GUI.color = new Color(1f, 1f, 1f, 0.5f);
           GUI.DrawTextureWithTexCoords(new Rect(rect.x, rect.y, num2, rect.height), (Texture) effectBarStyle.focused.background, new Rect(x, 0.0f, 1f - x, 1f));
           GUI.color = color2;
         }
         else
           effectBarStyle.Draw(new Rect(rect.x, rect.y, num2, rect.height), false, false, false, true);
         GUI.DrawTexture(new Rect(rect.x + num2, rect.y, rect.width - num2, rect.height), (Texture) effectBarStyle.onFocused.background, ScaleMode.StretchToFill);
       }
       else
         effectBarStyle.Draw(rect, !flag2, false, false, flag2);
     }
     else
       effectBarStyle.Draw(rect, false, false, false, false);
     if (flag1)
       this.styles.circularToggle.Draw(new Rect(position.x + 2f, position.y + 5f, position.width - 2f, position.width - 2f), false, false, !effect.bypass, false);
     if (effect.IsSend() && (UnityEngine.Object) effect.sendTarget != (UnityEngine.Object) null)
     {
       --position.y;
       GUI.Label(position, this.styles.sendString, EditorStyles.miniLabel);
     }
     EditorGUI.BeginDisabledGroup(!flag3);
     string effectSlotName = this.GetEffectSlotName(effect, flag2, snapshot, p);
     string effectSlotTooltip = this.GetEffectSlotTooltip(effect, rect, p);
     GUI.Label(new Rect(rect.x, rect.y, rect.width - 10f, rect.height), GUIContent.Temp(effectSlotName, effectSlotTooltip), this.styles.effectName);
     EditorGUI.EndDisabledGroup();
   }
   else
     this.EffectSlotDragging(effectRect, snapshot, effect, flag2, level, effectIndex, ref highlightEffectIndex, p);
 }
		private string GetEffectSlotTooltip(AudioMixerEffectController effect, Rect effectRect, AudioMixerChannelStripView.ChannelStripParams p)
		{
			if (!effectRect.Contains(Event.current.mousePosition))
			{
				return string.Empty;
			}
			if (effect.IsSend())
			{
				if (effect.sendTarget != null)
				{
					string sendTargetDisplayString = effect.GetSendTargetDisplayString(p.effectMap);
					return "Send to: " + sendTargetDisplayString;
				}
				return this.styles.emptySendSlotGUIContent.tooltip;
			}
			else
			{
				if (effect.IsReceive())
				{
					return this.styles.returnSlotGUIContent.tooltip;
				}
				if (effect.IsDuckVolume())
				{
					return this.styles.duckVolumeSlotGUIContent.tooltip;
				}
				if (effect.IsAttenuation())
				{
					return this.styles.attenuationSlotGUIContent.tooltip;
				}
				return this.styles.effectSlotGUIContent.tooltip;
			}
		}
		private void DoTotaldB(AudioMixerChannelStripView.ChannelStripParams p)
		{
			float num = 50f;
			this.styles.totalVULevel.padding.right = (int)((p.stripRect.width - num) * 0.5f);
			float num2 = Mathf.Max(p.vuinfo_level[8], -80f);
			Rect position = p.bgRects[p.kTotalVULevelIndex];
			GUI.Label(position, string.Format("{0:F1} dB", num2), this.styles.totalVULevel);
		}
		private void EffectSlotDragging(Rect r, AudioMixerSnapshotController snapshot, AudioMixerEffectController effect, bool showLevel, float level, int effectIndex, ref int highlightEffectIndex, AudioMixerChannelStripView.ChannelStripParams p)
		{
			Event current = Event.current;
			switch (current.GetTypeForControl(this.m_EffectInteractionControlID))
			{
			case EventType.MouseDown:
				if (r.Contains(current.mousePosition) && current.button == 0 && GUIUtility.hotControl == 0)
				{
					GUIUtility.hotControl = this.m_EffectInteractionControlID;
					this.m_MouseDragStartX = current.mousePosition.x;
					this.m_MouseDragStartValue = level;
					highlightEffectIndex = effectIndex;
					this.m_MovingEffectSrcIndex = -1;
					this.m_MovingEffectDstIndex = -1;
					this.m_WaitingForDragEvent = true;
					this.m_MovingSrcRect = r;
					this.m_MovingDstRect = r;
					this.m_MovingSrcGroup = p.group;
					this.m_MovingDstGroup = p.group;
					this.m_MovingEffectAllowed = true;
					this.SetFocus();
					Event.current.Use();
					EditorGUIUtility.SetWantsMouseJumping(1);
					InspectorWindow.RepaintAllInspectors();
				}
				break;
			case EventType.MouseUp:
				if (GUIUtility.hotControl == this.m_EffectInteractionControlID && current.button == 0 && p.stripRect.Contains(current.mousePosition))
				{
					if (this.m_MovingEffectDstIndex != -1 && this.m_MovingEffectAllowed)
					{
						if (this.IsDuplicateKeyPressed() && this.CanDuplicateDraggedEffect())
						{
							AudioMixerEffectController sourceEffect = this.m_MovingSrcGroup.effects[this.m_MovingEffectSrcIndex];
							AudioMixerEffectController effect2 = this.m_MovingSrcGroup.controller.CopyEffect(sourceEffect);
							List<AudioMixerEffectController> list = this.m_MovingDstGroup.effects.ToList<AudioMixerEffectController>();
							if (AudioMixerController.InsertEffect(effect2, ref list, this.m_MovingEffectDstIndex))
							{
								this.m_MovingDstGroup.effects = list.ToArray();
							}
						}
						else
						{
							if (this.m_MovingSrcGroup == this.m_MovingDstGroup)
							{
								List<AudioMixerEffectController> list2 = this.m_MovingSrcGroup.effects.ToList<AudioMixerEffectController>();
								if (AudioMixerController.MoveEffect(ref list2, this.m_MovingEffectSrcIndex, ref list2, this.m_MovingEffectDstIndex))
								{
									this.m_MovingSrcGroup.effects = list2.ToArray();
								}
							}
							else
							{
								if (!this.m_MovingSrcGroup.effects[this.m_MovingEffectSrcIndex].IsAttenuation())
								{
									List<AudioMixerEffectController> list3 = this.m_MovingSrcGroup.effects.ToList<AudioMixerEffectController>();
									List<AudioMixerEffectController> list4 = this.m_MovingDstGroup.effects.ToList<AudioMixerEffectController>();
									if (AudioMixerController.MoveEffect(ref list3, this.m_MovingEffectSrcIndex, ref list4, this.m_MovingEffectDstIndex))
									{
										this.m_MovingSrcGroup.effects = list3.ToArray();
										this.m_MovingDstGroup.effects = list4.ToArray();
									}
								}
							}
						}
					}
					this.ClearEffectDragging(ref highlightEffectIndex);
					current.Use();
					EditorGUIUtility.SetWantsMouseJumping(0);
					GUIUtility.ExitGUI();
				}
				break;
			case EventType.MouseDrag:
				if (GUIUtility.hotControl == this.m_EffectInteractionControlID)
				{
					if (this.HasFocus() && this.m_WaitingForDragEvent)
					{
						this.m_ChangingWetMixIndex = -1;
						if (effectIndex < p.group.effects.Length)
						{
							if (Mathf.Abs(current.delta.y) > Mathf.Abs(current.delta.x))
							{
								this.m_MovingEffectSrcIndex = effectIndex;
								this.ClearFocus();
							}
							else
							{
								this.m_ChangingWetMixIndex = this.m_IndexCounter;
							}
						}
						this.m_WaitingForDragEvent = false;
					}
					if (this.IsMovingEffect() && p.stripRect.Contains(current.mousePosition))
					{
						float num = r.height * 0.5f;
						float num2 = (effectIndex != 0) ? 0f : (-num);
						float num3 = (effectIndex != p.group.effects.Length - 1) ? r.height : (r.height + num);
						float num4 = current.mousePosition.y - r.y;
						if (num4 >= num2 && num4 <= num3 && effectIndex < p.group.effects.Length)
						{
							int num5 = (num4 >= num) ? (effectIndex + 1) : effectIndex;
							if (num5 != this.m_MovingEffectDstIndex || this.m_MovingDstGroup != p.group)
							{
								this.m_MovingDstRect.x = r.x;
								this.m_MovingDstRect.width = r.width;
								this.m_MovingDstRect.y = ((num4 >= num) ? (r.y + r.height) : r.y) - 1f;
								this.m_MovingEffectDstIndex = num5;
								this.m_MovingDstGroup = p.group;
								this.m_MovingEffectAllowed = ((!this.m_MovingSrcGroup.effects[this.m_MovingEffectSrcIndex].IsAttenuation() || !(this.m_MovingSrcGroup != this.m_MovingDstGroup)) && !AudioMixerController.WillMovingEffectCauseFeedback(p.allGroups, this.m_MovingSrcGroup, this.m_MovingEffectSrcIndex, this.m_MovingDstGroup, num5, null) && (!this.IsDuplicateKeyPressed() || this.CanDuplicateDraggedEffect()));
							}
							current.Use();
						}
					}
					if (this.IsAdjustingWetMix() && this.HasFocus() && showLevel)
					{
						this.m_WaitingForDragEvent = false;
						float value = AudioMixerChannelStripView.kEffectScaleMouseDrag * HandleUtility.niceMouseDelta + level;
						float num6 = Mathf.Clamp(value, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect) - level;
						if (num6 != 0f)
						{
							Undo.RecordObject(this.m_Controller.TargetSnapshot, "Change effect level");
							if (effect.IsSend() && this.m_Controller.CachedSelection.Count > 1 && this.m_Controller.CachedSelection.Contains(p.group))
							{
								List<AudioMixerEffectController> list5 = new List<AudioMixerEffectController>();
								foreach (AudioMixerGroupController current2 in this.m_Controller.CachedSelection)
								{
									AudioMixerEffectController[] effects = current2.effects;
									for (int i = 0; i < effects.Length; i++)
									{
										AudioMixerEffectController audioMixerEffectController = effects[i];
										if (audioMixerEffectController.effectName == effect.effectName && audioMixerEffectController.sendTarget == effect.sendTarget)
										{
											list5.Add(audioMixerEffectController);
										}
									}
								}
								foreach (AudioMixerEffectController current3 in list5)
								{
									if (!current3.IsSend() || current3.sendTarget != null)
									{
										current3.SetValueForMixLevel(this.m_Controller, snapshot, Mathf.Clamp(current3.GetValueForMixLevel(this.m_Controller, snapshot) + num6, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect));
									}
								}
							}
							else
							{
								if (!effect.IsSend() || effect.sendTarget != null)
								{
									effect.SetValueForMixLevel(this.m_Controller, snapshot, Mathf.Clamp(level + num6, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect));
								}
							}
							InspectorWindow.RepaintAllInspectors();
						}
						current.Use();
					}
				}
				break;
			}
		}
		private void DoEffectList(AudioMixerChannelStripView.ChannelStripParams p, bool selected, ref int highlightEffectIndex, ref Dictionary<AudioMixerEffectController, AudioMixerChannelStripView.PatchSlot> patchslots, bool showBusConnectionsOfSelection)
		{
			Event current = Event.current;
			for (int i = 0; i < p.maxEffects; i++)
			{
				Rect rect = p.bgRects[p.kEffectStartIndex + i];
				if (i < p.group.effects.Length)
				{
					AudioMixerEffectController effect = p.group.effects[i];
					if (p.visible)
					{
						if (current.type == EventType.ContextClick && rect.Contains(Event.current.mousePosition))
						{
							this.ClearFocus();
							this.DoEffectSlotInsertEffectPopup(rect, p.group, p.allGroups, i, ref p.effectMap);
							current.Use();
						}
						this.EffectSlot(rect, this.m_Controller.TargetSnapshot, effect, i, ref highlightEffectIndex, p, ref patchslots);
					}
				}
			}
			if (p.visible)
			{
				Rect rect2 = p.bgRects[p.bgRects.Count - 1];
				if (current.type == EventType.Repaint)
				{
					GUI.DrawTextureWithTexCoords(new Rect(rect2.x, rect2.y, rect2.width, rect2.height - 1f), this.styles.effectBar.hover.background, new Rect(0f, 0.5f, 0.1f, 0.1f));
					GUI.Label(rect2, this.addText, this.styles.effectName);
				}
				if (current.type == EventType.MouseDown && rect2.Contains(Event.current.mousePosition))
				{
					this.ClearFocus();
					int effectSlotIndex = p.group.effects.Length;
					this.DoEffectSlotInsertEffectPopup(rect2, p.group, p.allGroups, effectSlotIndex, ref p.effectMap);
					current.Use();
				}
			}
		}
Ejemplo n.º 18
0
		private void Init()
		{
			if (this.m_Initialized)
			{
				return;
			}
			if (this.m_LayoutStripsOnTop == null)
			{
				this.m_LayoutStripsOnTop = new AudioMixerWindow.Layout();
			}
			if (this.m_LayoutStripsOnTop.m_VerticalSplitter == null || this.m_LayoutStripsOnTop.m_VerticalSplitter.realSizes.Length != 2)
			{
				this.m_LayoutStripsOnTop.m_VerticalSplitter = new SplitterState(new int[]
				{
					65,
					35
				}, new int[]
				{
					85,
					105
				}, null);
			}
			if (this.m_LayoutStripsOnTop.m_HorizontalSplitter == null || this.m_LayoutStripsOnTop.m_HorizontalSplitter.realSizes.Length != 4)
			{
				this.m_LayoutStripsOnTop.m_HorizontalSplitter = new SplitterState(new int[]
				{
					60,
					60,
					60,
					60
				}, new int[]
				{
					85,
					85,
					85,
					85
				}, null);
			}
			if (this.m_LayoutStripsOnRight == null)
			{
				this.m_LayoutStripsOnRight = new AudioMixerWindow.Layout();
			}
			if (this.m_LayoutStripsOnRight.m_HorizontalSplitter == null || this.m_LayoutStripsOnRight.m_HorizontalSplitter.realSizes.Length != 2)
			{
				this.m_LayoutStripsOnRight.m_HorizontalSplitter = new SplitterState(new int[]
				{
					30,
					70
				}, new int[]
				{
					160,
					160
				}, null);
			}
			if (this.m_LayoutStripsOnRight.m_VerticalSplitter == null || this.m_LayoutStripsOnRight.m_VerticalSplitter.realSizes.Length != 4)
			{
				this.m_LayoutStripsOnRight.m_VerticalSplitter = new SplitterState(new int[]
				{
					60,
					60,
					60,
					60
				}, new int[]
				{
					100,
					85,
					85,
					85
				}, null);
			}
			if (this.m_AudioGroupTreeState == null)
			{
				this.m_AudioGroupTreeState = new TreeViewState();
			}
			this.m_GroupTree = new AudioMixerGroupTreeView(this, this.m_AudioGroupTreeState);
			if (this.m_MixersTreeState == null)
			{
				this.m_MixersTreeState = new TreeViewState();
			}
			this.m_MixersTree = new AudioMixersTreeView(this, this.m_MixersTreeState, new Func<List<AudioMixerController>>(this.GetAllControllers));
			if (this.m_ViewsState == null)
			{
				this.m_ViewsState = new ReorderableListWithRenameAndScrollView.State();
			}
			this.m_GroupViews = new AudioMixerGroupViewList(this.m_ViewsState);
			if (this.m_SnapshotState == null)
			{
				this.m_SnapshotState = new ReorderableListWithRenameAndScrollView.State();
			}
			this.m_SnapshotListView = new AudioMixerSnapshotListView(this.m_SnapshotState);
			if (this.m_ChannelStripViewState == null)
			{
				this.m_ChannelStripViewState = new AudioMixerChannelStripView.State();
			}
			this.m_ChannelStripView = new AudioMixerChannelStripView(this.m_ChannelStripViewState);
			this.OnMixerControllerChanged();
			this.m_Initialized = true;
		}
 private void DoTotaldB(AudioMixerChannelStripView.ChannelStripParams p)
 {
   float num1 = 50f;
   this.styles.totalVULevel.padding.right = (int) (((double) p.stripRect.width - (double) num1) * 0.5);
   float num2 = Mathf.Max(p.vuinfo_level[8], -80f);
   GUI.Label(p.bgRects[p.kTotalVULevelIndex], string.Format("{0:F1} dB", (object) num2), this.styles.totalVULevel);
 }