public void applyNormalize(bool isApply)
 {
     if (isApply)
     {
         //dspNormalize.setParameter((int) FMOD.DSP_NORMALIZE.FADETIME, 0);
         //dspNormalize.setParameter((int)FMOD.DSP_NORMALIZE.THRESHHOLD, 0.3f);
         if (dspconnectiontemp == null)
         {
             //float gain = 0;
             //channel[PlayerController.MainChannel].getLowPassGain(ref gain);
             //Debug.WriteLine(gain);
             //Debug.WriteLine("normalize");
             dspNormalize.setParameter((int)FMOD.DSP_NORMALIZE.FADETIME, 0);
             dspNormalize.setParameter((int)FMOD.DSP_NORMALIZE.MAXAMP, 1.25f);
             //dspNormalize.setParameter((int)FMOD.DSP_NORMALIZE.THRESHHOLD, 0.1f);
             RESULT result = system.addDSP(dspNormalize, ref dspconnectiontemp);
             checkFMODError(result);
         }
         //RESULT result = system.addDSP(dspNormalize, ref dspconnectiontemp);
         //checkFMODError(result);
     }
     else
     {
         RESULT result = dspNormalize.remove();
         dspconnectiontemp = null;
         checkFMODError(result);
     }
 }
Beispiel #2
0
        public RESULT getInput(ref DSP input)
        {
            RESULT rESULT = RESULT.OK;
            IntPtr raw    = IntPtr.Zero;

            try
            {
                rESULT = DSPConnection.FMOD_DSPConnection_GetInput(dspconnectionraw, ref raw);
            }
            catch
            {
                rESULT = RESULT.ERR_INVALID_PARAM;
            }
            RESULT result;

            if (rESULT != RESULT.OK)
            {
                result = rESULT;
            }
            else
            {
                if (input == null)
                {
                    DSP dSP = new DSP();
                    dSP.setRaw(raw);
                    input = dSP;
                }
                else
                {
                    input.setRaw(raw);
                }
                result = rESULT;
            }
            return(result);
        }
Beispiel #3
0
        public RESULT addDSP(DSP dsp, ref DSPConnection dspconnection)
        {
            RESULT rESULT = RESULT.OK;
            IntPtr raw    = IntPtr.Zero;

            try
            {
                rESULT = Channel.FMOD_Channel_AddDSP(channelraw, dsp.getRaw(), ref raw);
            }
            catch
            {
                rESULT = RESULT.ERR_INVALID_PARAM;
            }
            RESULT result;

            if (rESULT != RESULT.OK)
            {
                result = rESULT;
            }
            else
            {
                if (dspconnection == null)
                {
                    DSPConnection dSPConnection = new DSPConnection();
                    dSPConnection.setRaw(raw);
                    dspconnection = dSPConnection;
                }
                else
                {
                    dspconnection.setRaw(raw);
                }
                result = rESULT;
            }
            return(result);
        }
Beispiel #4
0
        public RESULT addInput(DSP target, ref DSPConnection dspconnection)
        {
            RESULT rESULT = RESULT.OK;
            IntPtr raw    = IntPtr.Zero;

            try
            {
                rESULT = DSP.FMOD_DSP_AddInput(dspraw, target.getRaw(), ref raw);
            }
            catch
            {
                rESULT = RESULT.ERR_INVALID_PARAM;
            }
            RESULT result;

            if (rESULT != RESULT.OK)
            {
                result = rESULT;
            }
            else
            {
                if (dspconnection == null)
                {
                    DSPConnection dSPConnection = new DSPConnection();
                    dSPConnection.setRaw(raw);
                    dspconnection = dSPConnection;
                }
                else
                {
                    dspconnection.setRaw(raw);
                }
                result = rESULT;
            }
            return(result);
        }
Beispiel #5
0
        public RESULT addDSP(DSP dsp, ref DSPConnection connection)
        {
            RESULT        result           = RESULT.OK;
            IntPtr        dspconnectionraw = new IntPtr();
            DSPConnection dspconnectionnew = null;

            try
            {
                result = FMOD_Channel_AddDSP(channelraw, dsp.getRaw(), ref dspconnectionraw);
            }
            catch
            {
                result = RESULT.ERR_INVALID_PARAM;
            }
            if (result != RESULT.OK)
            {
                return(result);
            }

            if (connection == null)
            {
                dspconnectionnew = new DSPConnection();
                dspconnectionnew.setRaw(dspconnectionraw);
                connection = dspconnectionnew;
            }
            else
            {
                connection.setRaw(dspconnectionraw);
            }

            return(result);
        }
Beispiel #6
0
 public RESULT addInput(DSP target, out DSPConnection connection, DSPCONNECTION_TYPE type)
 {
     connection = null;
     IntPtr raw;
     RESULT result = DSP.FMOD5_DSP_AddInput(this.rawPtr, target.getRaw(), out raw, type);
     connection = new DSPConnection(raw);
     return result;
 }
Beispiel #7
0
        public RESULT addInput(DSP target, out DSPConnection connection, DSPCONNECTION_TYPE type)
        {
            connection = null;
            IntPtr raw;
            RESULT result = DSP.FMOD5_DSP_AddInput(this.rawPtr, target.getRaw(), out raw, type);

            connection = new DSPConnection(raw);
            return(result);
        }
        public RESULT addGroup(ChannelGroup group, bool propagatedspclock, out DSPConnection connection)
        {
            connection = null;
            IntPtr raw;
            RESULT result = ChannelGroup.FMOD5_ChannelGroup_AddGroup(base.getRaw(), group.getRaw(), propagatedspclock, out raw);

            connection = new DSPConnection(raw);
            return(result);
        }
Beispiel #9
0
        public RESULT getOutput(out DSP output)
        {
            output = null;
            IntPtr raw;
            RESULT result = DSPConnection.FMOD5_DSPConnection_GetOutput(this.rawPtr, out raw);

            output = new DSP(raw);
            return(result);
        }
Beispiel #10
0
 public RESULT getInput(int index, out DSP input, out DSPConnection inputconnection)
 {
     input = null;
     inputconnection = null;
     IntPtr raw;
     IntPtr raw2;
     RESULT result = DSP.FMOD5_DSP_GetInput(this.rawPtr, index, out raw, out raw2);
     input = new DSP(raw);
     inputconnection = new DSPConnection(raw2);
     return result;
 }
Beispiel #11
0
        public RESULT getOutput(int index, out DSP output, out DSPConnection outputconnection)
        {
            output           = null;
            outputconnection = null;
            IntPtr raw;
            IntPtr raw2;
            RESULT result = DSP.FMOD5_DSP_GetOutput(this.rawPtr, index, out raw, out raw2);

            output           = new DSP(raw);
            outputconnection = new DSPConnection(raw2);
            return(result);
        }
Beispiel #12
0
        public static EqualizerBand GetEqualizerBand(FMOD.System system, bool isActive, float centerValue, float bandwithValue, float gainValue)
        {
            FMOD.DSPConnection dspConnTemp = null;
            FMOD.DSP           dspParamEq  = null;

            if (isActive)
            {
                var result = system.createDSPByType(FMOD.DSP_TYPE.PARAMEQ, ref dspParamEq);
                if (!result.ERRCHECK())
                {
                    return(null);
                }

                result = system.addDSP(dspParamEq, ref dspConnTemp);
                if (!result.ERRCHECK())
                {
                    return(null);
                }

                result = dspParamEq.setParameter((int)FMOD.DSP_PARAMEQ.CENTER, centerValue);
                if (!result.ERRCHECK())
                {
                    return(null);
                }

                result = dspParamEq.setParameter((int)FMOD.DSP_PARAMEQ.BANDWIDTH, bandwithValue);
                if (!result.ERRCHECK())
                {
                    return(null);
                }

                result = dspParamEq.setParameter((int)FMOD.DSP_PARAMEQ.GAIN, gainValue);
                if (!result.ERRCHECK())
                {
                    return(null);
                }

                result = dspParamEq.setActive(true);
                if (!result.ERRCHECK())
                {
                    return(null);
                }
            }

            var band = new EqualizerBand(dspParamEq, centerValue, gainValue, isActive);

            return(band);
        }
Beispiel #13
0
        public RESULT getOutput(int index, ref DSP output, ref DSPConnection outputconnection)
        {
            RESULT rESULT = RESULT.OK;
            IntPtr raw    = IntPtr.Zero;
            IntPtr raw2   = IntPtr.Zero;

            try
            {
                rESULT = DSP.FMOD_DSP_GetOutput(dspraw, index, ref raw, ref raw2);
            }
            catch
            {
                rESULT = RESULT.ERR_INVALID_PARAM;
            }
            RESULT result;

            if (rESULT != RESULT.OK)
            {
                result = rESULT;
            }
            else
            {
                if (output == null)
                {
                    DSP dSP = new DSP();
                    dSP.setRaw(raw);
                    output = dSP;
                }
                else
                {
                    output.setRaw(raw);
                }
                if (outputconnection == null)
                {
                    DSPConnection dSPConnection = new DSPConnection();
                    dSPConnection.setRaw(raw2);
                    outputconnection = dSPConnection;
                }
                else
                {
                    outputconnection.setRaw(raw2);
                }
                result = rESULT;
            }
            return(result);
        }
Beispiel #14
0
 public RESULT getType(out DSPCONNECTION_TYPE type)
 {
     return(DSPConnection.FMOD5_DSPConnection_GetType(this.rawPtr, out type));
 }
Beispiel #15
0
 public RESULT getMix(out float volume)
 {
     return(DSPConnection.FMOD5_DSPConnection_GetMix(this.rawPtr, out volume));
 }
Beispiel #16
0
 public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop)
 {
     return(DSPConnection.FMOD5_DSPConnection_GetMixMatrix(this.rawPtr, matrix, out outchannels, out inchannels, inchannel_hop));
 }
Beispiel #17
0
 public RESULT addInput(DSP target, out DSPConnection connection, DSPCONNECTION_TYPE type)
 {
     return(FMOD5_DSP_AddInput(handle, target.handle, out connection.handle, type));
 }
Beispiel #18
0
 public RESULT setMix(float volume)
 {
     return(DSPConnection.FMOD5_DSPConnection_SetMix(this.rawPtr, volume));
 }
Beispiel #19
0
        // Nested channel groups.
        public RESULT addGroup               (ChannelGroup group, bool propagatedspclock, out DSPConnection connection)
        {
            connection = null;

            IntPtr connectionRaw;
            RESULT result = FMOD5_ChannelGroup_AddGroup(getRaw(), group.getRaw(), propagatedspclock, out connectionRaw);
            connection = new DSPConnection(connectionRaw);

            return result;

        }
Beispiel #20
0
        // Connection / disconnection / input and output enumeration.
        public RESULT addInput(DSP target, out DSPConnection connection)
        {
            connection = null;

            IntPtr dspconnectionraw;
            RESULT result = FMOD_DSP_AddInput(rawPtr, target.getRaw(), out dspconnectionraw);
            connection = new DSPConnection(dspconnectionraw);

            return result;
        }
Beispiel #21
0
        public RESULT getOutput(int index, ref DSP output, ref DSPConnection outputconnection)
        {
            RESULT result      = RESULT.OK;
            IntPtr dsprawnew   = new IntPtr();
            DSP    dspnew      = null;
            IntPtr dspconnectionraw = new IntPtr();
            DSPConnection dspconnectionnew = null;

            try
            {
                result = FMOD_DSP_GetOutput(dspraw, index, ref dsprawnew, ref dspconnectionraw);
            }
            catch
            {
                result = RESULT.ERR_INVALID_PARAM;
            }
            if (result != RESULT.OK)
            {
                return result;
            }

            if (output == null)
            {
                dspnew = new DSP();
                dspnew.setRaw(dsprawnew);
                output = dspnew;
            }
            else
            {
                output.setRaw(dsprawnew);
            }

            if (outputconnection == null)
            {
                dspconnectionnew = new DSPConnection();
                dspconnectionnew.setRaw(dspconnectionraw);
                outputconnection = dspconnectionnew;
            }
            else
            {
                outputconnection.setRaw(dspconnectionraw);
            }

            return result;
        }
Beispiel #22
0
        public RESULT addDSP                 (DSP dsp, CHANNELCONTROL_DSP_INDEX index, ref DSPConnection connection)
        {
            RESULT result = RESULT.OK;
            IntPtr dspconnectionraw = new IntPtr();
            DSPConnection dspconnectionnew = null;

            try
            {
                result = FMOD_ChannelGroup_AddDSP(channelgroupraw, index, dsp.getRaw(), ref dspconnectionraw);
            }
            catch
            {
                result = RESULT.ERR_INVALID_PARAM;
            }
            if (result != RESULT.OK)
            {
                return result;
            }

            if (connection == null)
            {
                dspconnectionnew = new DSPConnection();
                dspconnectionnew.setRaw(dspconnectionraw);
                connection = dspconnectionnew;
            }
            else
            {
                connection.setRaw(dspconnectionraw);
            }

            return result;
        }
Beispiel #23
0
 public RESULT getUserData(ref IntPtr userdata)
 {
     return(DSPConnection.FMOD_DSPConnection_GetUserData(dspconnectionraw, ref userdata));
 }
Beispiel #24
0
        public RESULT getOutput                 (int index, out DSP output, out DSPConnection outputconnection)
        {
            output = null;
            outputconnection = null;

            IntPtr dspoutputraw;
            IntPtr dspconnectionraw;
            RESULT result = FMOD_DSP_GetOutput(rawPtr, index, out dspoutputraw, out dspconnectionraw);
            output = new DSP(dspoutputraw);
            outputconnection = new DSPConnection(dspconnectionraw);

            return result;
        }
Beispiel #25
0
 public RESULT disconnectFrom(DSP target, DSPConnection connection)
 {
     return(DSP.FMOD5_DSP_DisconnectFrom(this.rawPtr, target.getRaw(), connection.getRaw()));
 }
Beispiel #26
0
 public RESULT getOutput(int index, out DSP output, out DSPConnection outputconnection)
 {
     return(FMOD5_DSP_GetOutput(handle, index, out output.handle, out outputconnection.handle));
 }
Beispiel #27
0
 public RESULT disconnectFrom(DSP target, DSPConnection connection)
 {
     return(FMOD5_DSP_DisconnectFrom(handle, target.handle, connection.handle));
 }
Beispiel #28
0
 public RESULT setUserData(IntPtr userdata)
 {
     return(DSPConnection.FMOD5_DSPConnection_SetUserData(this.rawPtr, userdata));
 }
Beispiel #29
0
 public RESULT getLevels(SPEAKER speaker, float[] levels, int numlevels)
 {
     return(DSPConnection.FMOD_DSPConnection_GetLevels(dspconnectionraw, speaker, levels, numlevels));
 }
Beispiel #30
0
 public RESULT getUserData(out IntPtr userdata)
 {
     return(DSPConnection.FMOD5_DSPConnection_GetUserData(this.rawPtr, out userdata));
 }
Beispiel #31
0
 public RESULT setUserData(IntPtr userdata)
 {
     return(DSPConnection.FMOD_DSPConnection_SetUserData(dspconnectionraw, userdata));
 }
Beispiel #32
0
 public RESULT disconnectFrom            (DSP target, DSPConnection connection)
 {
     return FMOD5_DSP_DisconnectFrom(rawPtr, target.getRaw(), connection.getRaw());
 }
Beispiel #33
0
        public RESULT addDSP(DSP dsp, int index, out DSPConnection connection)
        {
            connection = null;

            IntPtr dspconnectionraw;
            RESULT result = FMOD_ChannelGroup_AddDSP(rawPtr, index, dsp.getRaw(), out dspconnectionraw);
            connection = new DSPConnection(dspconnectionraw);

            return result;
        }
Beispiel #34
0
        public RESULT getInput                  (int index, out DSP input, out DSPConnection inputconnection)
        {
            input = null;
            inputconnection = null;

            IntPtr dspinputraw;
            IntPtr dspconnectionraw;
            RESULT result = FMOD_DSP_GetInput(rawPtr, index, out dspinputraw, out dspconnectionraw);
            input = new DSP(dspinputraw);
            inputconnection = new DSPConnection(dspconnectionraw);

            return result;
        }
 public RESULT addGroup(ChannelGroup group, bool propagatedspclock, out DSPConnection connection)
 {
     return(FMOD5_ChannelGroup_AddGroup(handle, group.handle, propagatedspclock, out connection.handle));
 }
Beispiel #36
0
        public RESULT addInput(DSP target, ref DSPConnection connection)
        {
            RESULT result = RESULT.OK;
            IntPtr dspconnectionraw = new IntPtr();
            DSPConnection dspconnectionnew = null;

            try
            {
                result = FMOD_DSP_AddInput(dspraw, target.getRaw(), ref dspconnectionraw);
            }
            catch
            {
                result = RESULT.ERR_INVALID_PARAM;
            }
            if (result != RESULT.OK)
            {
                return result;
            }

            if (connection == null)
            {
                dspconnectionnew = new DSPConnection();
                dspconnectionnew.setRaw(dspconnectionraw);
                connection = dspconnectionnew;
            }
            else
            {
                connection.setRaw(dspconnectionraw);
            }

            return result;
        }
Beispiel #37
0
 public RESULT setMix(float volume)
 {
     return(DSPConnection.FMOD_DSPConnection_SetMix(dspconnectionraw, volume));
 }
Beispiel #38
0
        public RESULT addDSP(DSP dsp, ref DSPConnection connection)
        {
            RESULT result = RESULT.OK;
            IntPtr dspconnectionraw = new IntPtr();
            DSPConnection dspconnectionnew = null;

            try
            {
                result = FMOD_System_AddDSP(systemraw, dsp.getRaw(), ref dspconnectionraw);
            }
            catch
            {
                result = RESULT.ERR_INVALID_PARAM;
            }
            if (result != RESULT.OK)
            {
                return result;
            }

            if (connection == null)
            {
                dspconnectionnew = new DSPConnection();
                dspconnectionnew.setRaw(dspconnectionraw);
                connection = dspconnectionnew;
            }
            else
            {
                connection.setRaw(dspconnectionraw);
            }

            return result;
        }
Beispiel #39
0
 public RESULT getMix(ref float volume)
 {
     return(DSPConnection.FMOD_DSPConnection_GetMix(dspconnectionraw, ref volume));
 }