ERRCHECK() public method

public ERRCHECK ( FMOD result ) : void
result FMOD
return void
Example #1
0
 private void Update3DAttributes()
 {
     FMOD.Studio.System system = FMOD_StudioSystem.instance.System;
     if (system != null && system.isValid())
     {
         FMOD.Studio.ATTRIBUTES_3D attributes = UnityUtil.to3DAttributes(base.gameObject, this.cachedRigidBody);
         FMOD_Listener.ERRCHECK(system.setListenerAttributes(0, attributes));
     }
 }
Example #2
0
 public static void UnloadBank(string path)
 {
     foreach (KeyValuePair <string, Bank> current in FMOD_Listener.sLoadedBanks)
     {
         string a;
         FMOD_Listener.ERRCHECK(current.Value.getPath(out a));
         if (a == path)
         {
             UnityUtil.Log("Unloading " + current.Key);
             FMOD_Listener.ERRCHECK(current.Value.unload());
             FMOD_Listener.sLoadedBanks.Remove(current.Key);
             break;
         }
     }
 }
Example #3
0
 private void LoadPlugins()
 {
     FMOD.System system = null;
     FMOD_Listener.ERRCHECK(FMOD_StudioSystem.instance.System.getLowLevelSystem(out system));
     if (Application.platform == RuntimePlatform.IPhonePlayer && this.pluginPaths.Length != 0)
     {
         UnityUtil.LogError("DSP Plugins not currently supported on iOS, contact [email protected] for more information");
         return;
     }
     string[] array = this.pluginPaths;
     for (int i = 0; i < array.Length; i++)
     {
         string rawName = array[i];
         string text    = this.pluginPath + "/" + this.GetPluginFileName(rawName);
         UnityUtil.Log("Loading plugin: " + text);
         if (!File.Exists(text))
         {
             UnityUtil.LogWarning("plugin not found: " + text);
         }
         uint num;
         FMOD_Listener.ERRCHECK(system.loadPlugin(text, out num));
     }
 }
Example #4
0
    private void DrawEventList()
    {
        GUIStyle gUIStyle = new GUIStyle(GUI.skin.label);

        gUIStyle.alignment = TextAnchor.MiddleLeft;
        gUIStyle.fontSize  = 10;
        GUIStyle gUIStyle2 = new GUIStyle(gUIStyle);

        gUIStyle2.alignment = TextAnchor.MiddleRight;
        GUIStyle gUIStyle3 = new GUIStyle(gUIStyle);

        gUIStyle3.alignment = TextAnchor.MiddleRight;
        GUILayout.Space(25f);
        GUILayout.BeginVertical(GUI.skin.button, new GUILayoutOption[0]);
        if (FMOD_Listener.PathFilter.Length > 0)
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Path Filter:", gUIStyle, new GUILayoutOption[0]);
            GUILayout.Label(string.Join(" AND ", FMOD_Listener.PathFilter), gUIStyle3, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
        }
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUILayout.Label("Instances", gUIStyle, new GUILayoutOption[]
        {
            GUILayout.Width(50f)
        });
        GUILayout.Label("Streams", gUIStyle, new GUILayoutOption[]
        {
            GUILayout.Width(40f)
        });
        GUILayout.Label("Event Path", gUIStyle, new GUILayoutOption[0]);
        GUILayout.EndHorizontal();
        int num  = 0;
        int num2 = 0;

        foreach (FMOD_Listener.EventInfo current in this.eventInfoList)
        {
            if (current.instances.Count > 0)
            {
                List <FMOD_Listener.EventInstanceInfo> instances = current.instances;
                GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.Label(instances.Count.ToString(), gUIStyle2, new GUILayoutOption[]
                {
                    GUILayout.Width(50f)
                });
                GUILayout.Label(current.streamCount.ToString(), gUIStyle2, new GUILayoutOption[]
                {
                    GUILayout.Width(40f)
                });
                num  += instances.Count;
                num2 += current.streamCount;
                if (current.normalizedPositions != null)
                {
                    FMOD_Listener.MultiValueBox(current.path, current.normalizedPositions, gUIStyle, FMOD_Listener.ProgressValueStyle);
                }
                else
                {
                    GUILayout.Label(current.path, gUIStyle, new GUILayoutOption[0]);
                }
                GUILayout.EndHorizontal();
            }
        }
        GUILayout.Space(10f);
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUILayout.Label(num.ToString(), gUIStyle2, new GUILayoutOption[]
        {
            GUILayout.Width(50f)
        });
        GUILayout.Label(num2.ToString(), gUIStyle2, new GUILayoutOption[]
        {
            GUILayout.Width(40f)
        });
        GUILayout.Label("Totals", gUIStyle, new GUILayoutOption[0]);
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
        GUILayout.BeginArea(new Rect((float)(base.GetComponent <Camera>().pixelWidth - 155), 0f, 150f, 550f));
        BUFFER_USAGE bUFFER_USAGE;

        if (UnityUtil.ERRCHECK(FMOD_StudioSystem.instance.System.getBufferUsage(out bUFFER_USAGE)))
        {
            GUILayout.BeginVertical(GUI.skin.button, new GUILayoutOption[0]);
            GUILayout.Label("Command Buffer Usage", gUIStyle, new GUILayoutOption[0]);
            FMOD_Listener.NumberField("Current:", bUFFER_USAGE.studioCommandQueue.currentUsage, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Peak:", bUFFER_USAGE.studioCommandQueue.peakUsage, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Capacity:", bUFFER_USAGE.studioCommandQueue.capacity, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Stalls:", bUFFER_USAGE.studioCommandQueue.stallCount, gUIStyle, 50f, gUIStyle3, 50f);
            GUILayout.EndVertical();
        }
        int value  = 0;
        int value2 = 0;

        if (UnityUtil.ERRCHECK(Memory.GetStats(out value, out value2)))
        {
            GUILayout.BeginVertical(GUI.skin.button, new GUILayoutOption[0]);
            GUILayout.Label("Memory Usage", gUIStyle, new GUILayoutOption[0]);
            FMOD_Listener.NumberField("Current:", value, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Peak:", value2, gUIStyle, 50f, gUIStyle3, 50f);
            GUILayout.EndVertical();
        }
        CPU_USAGE cPU_USAGE;

        if (UnityUtil.ERRCHECK(FMOD_StudioSystem.instance.System.getCPUUsage(out cPU_USAGE)))
        {
            GUILayout.BeginVertical(GUI.skin.button, new GUILayoutOption[0]);
            GUILayout.Label("CPU Usage", gUIStyle, new GUILayoutOption[0]);
            GUILayout.Label("Current", gUIStyle, new GUILayoutOption[0]);
            FMOD_Listener.NumberField("DSP:", cPU_USAGE.dspUsage, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Stream:", cPU_USAGE.streamUsage, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Update:", cPU_USAGE.updateUsage, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Studio:", cPU_USAGE.studioUsage, gUIStyle, 50f, gUIStyle3, 50f);
            this.peakCPUUsage.dspUsage    = Math.Max(this.peakCPUUsage.dspUsage, cPU_USAGE.dspUsage);
            this.peakCPUUsage.streamUsage = Math.Max(this.peakCPUUsage.streamUsage, cPU_USAGE.streamUsage);
            this.peakCPUUsage.updateUsage = Math.Max(this.peakCPUUsage.updateUsage, cPU_USAGE.updateUsage);
            this.peakCPUUsage.studioUsage = Math.Max(this.peakCPUUsage.studioUsage, cPU_USAGE.studioUsage);
            GUILayout.Space(10f);
            GUILayout.Label("Peak", gUIStyle, new GUILayoutOption[0]);
            FMOD_Listener.NumberField("DSP:", this.peakCPUUsage.dspUsage, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Stream:", this.peakCPUUsage.streamUsage, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Update:", this.peakCPUUsage.updateUsage, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Studio:", this.peakCPUUsage.studioUsage, gUIStyle, 50f, gUIStyle3, 50f);
            GUILayout.EndVertical();
        }
        FMOD.System system = null;
        if (UnityUtil.ERRCHECK(FMOD_StudioSystem.instance.System.getLowLevelSystem(out system)))
        {
            int num3 = 0;
            int num4 = 0;
            for (int i = 0; i < 1024; i++)
            {
                Channel channel;
                if (UnityUtil.ERRCHECK(system.getChannel(i, out channel)))
                {
                    bool   flag   = false;
                    RESULT rESULT = channel.isPlaying(out flag);
                    if (rESULT != RESULT.ERR_INVALID_HANDLE)
                    {
                        FMOD_Listener.ERRCHECK(rESULT);
                    }
                    if (flag)
                    {
                        num3++;
                        bool flag2 = false;
                        UnityUtil.ERRCHECK(channel.isVirtual(out flag2));
                        if (!flag2)
                        {
                            num4++;
                        }
                    }
                }
            }
            GUILayout.BeginVertical(GUI.skin.button, new GUILayoutOption[0]);
            GUILayout.Label("Channels", gUIStyle, new GUILayoutOption[0]);
            FMOD_Listener.NumberField("Playing:", num3, gUIStyle, 50f, gUIStyle3, 50f);
            FMOD_Listener.NumberField("Real:", num4, gUIStyle, 50f, gUIStyle3, 50f);
            GUILayout.EndVertical();
        }
        GUILayout.BeginVertical(GUI.skin.button, new GUILayoutOption[0]);
        FMOD_Listener.NumberField("Streams:", num2, gUIStyle, 50f, gUIStyle3, 50f);
        GUILayout.EndVertical();
        GUILayout.EndArea();
    }