Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 14
0
 public RESULT getType(out DSPCONNECTION_TYPE type)
 {
     return(DSPConnection.FMOD5_DSPConnection_GetType(this.rawPtr, out type));
 }
Exemplo n.º 15
0
 public RESULT getMix(out float volume)
 {
     return(DSPConnection.FMOD5_DSPConnection_GetMix(this.rawPtr, out volume));
 }
Exemplo n.º 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));
 }
Exemplo n.º 17
0
 public RESULT addInput(DSP target, out DSPConnection connection, DSPCONNECTION_TYPE type)
 {
     return(FMOD5_DSP_AddInput(handle, target.handle, out connection.handle, type));
 }
Exemplo n.º 18
0
 public RESULT setMix(float volume)
 {
     return(DSPConnection.FMOD5_DSPConnection_SetMix(this.rawPtr, volume));
 }
Exemplo n.º 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;

        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 23
0
 public RESULT getUserData(ref IntPtr userdata)
 {
     return(DSPConnection.FMOD_DSPConnection_GetUserData(dspconnectionraw, ref userdata));
 }
Exemplo n.º 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;
        }
Exemplo n.º 25
0
 public RESULT disconnectFrom(DSP target, DSPConnection connection)
 {
     return(DSP.FMOD5_DSP_DisconnectFrom(this.rawPtr, target.getRaw(), connection.getRaw()));
 }
Exemplo n.º 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));
 }
Exemplo n.º 27
0
 public RESULT disconnectFrom(DSP target, DSPConnection connection)
 {
     return(FMOD5_DSP_DisconnectFrom(handle, target.handle, connection.handle));
 }
Exemplo n.º 28
0
 public RESULT setUserData(IntPtr userdata)
 {
     return(DSPConnection.FMOD5_DSPConnection_SetUserData(this.rawPtr, userdata));
 }
Exemplo n.º 29
0
 public RESULT getLevels(SPEAKER speaker, float[] levels, int numlevels)
 {
     return(DSPConnection.FMOD_DSPConnection_GetLevels(dspconnectionraw, speaker, levels, numlevels));
 }
Exemplo n.º 30
0
 public RESULT getUserData(out IntPtr userdata)
 {
     return(DSPConnection.FMOD5_DSPConnection_GetUserData(this.rawPtr, out userdata));
 }
Exemplo n.º 31
0
 public RESULT setUserData(IntPtr userdata)
 {
     return(DSPConnection.FMOD_DSPConnection_SetUserData(dspconnectionraw, userdata));
 }
Exemplo n.º 32
0
 public RESULT disconnectFrom            (DSP target, DSPConnection connection)
 {
     return FMOD5_DSP_DisconnectFrom(rawPtr, target.getRaw(), connection.getRaw());
 }
Exemplo n.º 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;
        }
Exemplo n.º 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));
 }
Exemplo n.º 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;
        }
Exemplo n.º 37
0
 public RESULT setMix(float volume)
 {
     return(DSPConnection.FMOD_DSPConnection_SetMix(dspconnectionraw, volume));
 }
Exemplo n.º 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;
        }
Exemplo n.º 39
0
 public RESULT getMix(ref float volume)
 {
     return(DSPConnection.FMOD_DSPConnection_GetMix(dspconnectionraw, ref volume));
 }