Exemplo n.º 1
0
        private void HandleTransitionPins(IDiffSpread <string> sender)
        {
            //FLogger.Log(LogType.Debug, "Update Pins");

            //empty automata tree ? -> create a reset pin
            if (TransitionNames[0] == "")
            {
                TransitionNames[0] = "Init";
            }

            // CREATE INIT
            if (stateList.Count == 0)
            {
                stateList.Add(new State()
                {
                    ID     = "Init",
                    Name   = "Init",
                    Bounds = new Rectangle(new Point(0, 0), new Size(p.StateSize, p.StateSize))
                });
            }

            //delete pins which are not in the new list
            foreach (var name in FPins.Keys)
            {
                if (TransitionNames.IndexOf(name) == -1)
                {
                    FPins[name].Dispose();
                }
            }

            Dictionary <string, IIOContainer> newPins = new Dictionary <string, IIOContainer>();

            foreach (var name in TransitionNames)
            {
                if (!string.IsNullOrEmpty(name)) //ignore empty slices
                {
                    if (FPins.ContainsKey(name)) //pin already exists, copy to new dict
                    {
                        newPins.Add(name, FPins[name]);
                        FPins.Remove(name);
                    }
                    else if (!newPins.ContainsKey(name)) //just checking in case of duplicate names
                    {
                        var attr = new InputAttribute(name);
                        attr.IsBang = true;
                        var type      = typeof(IDiffSpread <bool>);
                        var container = FIOFactory.CreateIOContainer(type, attr);
                        newPins.Add(name, container);
                    }
                }
            }

            //FPins now only holds disposed IIOContainers, since we copied the reusable ones to newPins
            FPins = newPins;
        }
        private void JavascriptCallback(object sender, CfrV8HandlerExecuteEventArgs e)
        {
            if (e.Arguments.Length == 0)
            {
                return;
            }

            int index = FMethodIn.IndexOf(e.Name);

            if (index >= 0)
            {
                string[] arr = new string[e.Arguments.Length];
                for (int k = 0; k < e.Arguments.Length; k++)
                {
                    arr[k] = CfrV8ValueToString(e.Arguments[k]);
                }
                FResultOut[index] = string.Join(",", arr);
                method[index]     = true;
            }
        }
Exemplo n.º 3
0
        public void Evaluate(int SpreadMax)
        {
            SpreadMax = SpreadUtils.SpreadMax(Address, ReadWriteMode);

            if (DoSend.IndexOf(true) < 0 || SpreadMax == 0)
            {
                DataOut[0] = Stream.Null;
                return; // return when nothing to send
            }

            Out.Position = 0;
            Out.SetLength(0);

            byte lsb, msb;

            // I2C config up front
            Out.WriteByte(Command.SYSEX_START);
            Out.WriteByte(Command.I2C_CONFIG);
            FirmataUtils.GetBytesFromValue(I2CDelay[0], out msb, out lsb);
            Out.WriteByte(lsb); Out.WriteByte(msb);
            Out.WriteByte(Command.SYSEX_END);

            for (int i = 0; i < SpreadMax; i++)
            {
                if ((ReadWriteMode[i] != I2CMode.WRITE && DoSend[i] == false) ||
                    (ReadWriteMode[i] == I2CMode.WRITE && DataIn[i].Length == 0)
                    )
                {
                    continue;
                }

                // handle read continuously readings, keep track of requests
                if (ReadWriteMode[i] == I2CMode.READ_CONTINUOUSLY)
                {
                    if (ContinuouslyReadings.Contains(Address[i]))
                    {
                        continue;
                    }
                    else
                    {
                        ContinuouslyReadings.Add(Address[i]);
                    }
                }
                else if (ReadWriteMode[i] == I2CMode.STOP_READING && ContinuouslyReadings.Contains(Address[i]))
                {
                    ContinuouslyReadings.Remove(Address[i]);
                }

                // Write the request header
                Out.WriteByte(Firmata.Command.SYSEX_START);
                Out.WriteByte(Firmata.Command.I2C_REQUEST);

                // Write therequest address and mode
                Out.WriteByte((byte)(Address[i] & 0x7F)); // LSB

                byte mode = (byte)ReadWriteMode[i];
                // Handle 10-bit mode
                if (AddressMode[i].Index > 0)
                {
                    mode |= 0x20;                             // enable
                    mode |= (byte)((Address[i] >> 8) & 0x03); // add MSB of address
                }
                Out.WriteByte(mode);

                switch (ReadWriteMode[i])
                {
                case I2CMode.WRITE:
                    if (Register[i] > 0)
                    {
                        FirmataUtils.GetBytesFromValue(Math.Max(Register[i], 0), out msb, out lsb);
                        Out.WriteByte(lsb); Out.WriteByte(msb);
                    }
                    while (DataIn[i].Position < DataIn[i].Length)
                    {
                        FirmataUtils.GetBytesFromValue((int)DataIn[i].ReadByte(), out msb, out lsb);
                        Out.WriteByte(lsb); Out.WriteByte(msb);
                    }
                    break;

                case I2CMode.READ_ONCE:
                case I2CMode.READ_CONTINUOUSLY:
                    if (Register[i] > 0 || ReadWriteMode[i] == I2CMode.READ_CONTINUOUSLY)
                    {
                        FirmataUtils.GetBytesFromValue(Math.Max(Register[i], 0), out msb, out lsb);
                        Out.WriteByte(lsb); Out.WriteByte(msb);
                    }
                    FirmataUtils.GetBytesFromValue(BytesToRead[i], out msb, out lsb);
                    Out.WriteByte(lsb); Out.WriteByte(msb);
                    break;
                }

                // Close SysEx message
                Out.WriteByte(Firmata.Command.SYSEX_END);
            }

            DataOut[0] = Out;
        }
Exemplo n.º 4
0
#pragma warning restore

        public override void Evaluate(int SpreadMax)
        {
            if (FInput.IsAnyInvalid())
            {
                SpreadMax = 0;
                FOutput.FlushNil();
                FSuccess.FlushBool(false);
                FMatch.FlushNil();

                return;
            }
            else
            {
                SpreadMax = FInput.SliceCount;
            }

            var update = false;

            if (FTopic.IsChanged || FExtendedMode.IsChanged || FUseFields.IsChanged || Parser == null)
            {
                if (Parser == null)
                {
                    Parser = new Dictionary <string, IEnumerable <FormularFieldDescriptor> >();
                }
                else
                {
                    Parser.Clear();
                }

                for (int i = 0; i < FTopic.SliceCount; i++)
                {
                    var fields = (
                        from f in FUseFields[i]
                        select Formular[f.Name]
                        ).ToList();
                    Parser[FTopic[i]] = fields;
                }
                update = true;
            }

            if (!update && !FInput.IsChanged)
            {
                return;
            }

            FSuccess.SliceCount = SpreadMax;
            FOutput.SliceCount  = 0;
            FMatch.SliceCount   = 0;

            for (int i = 0; i < SpreadMax; i++)
            {
                var stream = FInput[i];
                stream.Position = 0;

                var address = OSCExtensions.PeekAddress(stream);
                stream.Position = 0;

                var isMatch = (
                    from a in FTopic
                    where address == a
                    select true
                    ).Any();

                Message message = isMatch? OSCExtensions.FromOSC(stream, Parser, FExtendedMode[0]) : null;

                if (message != null)
                {
                    FOutput.Add(message);
                    FSuccess[i] = true;
                    FMatch.Add(FTopic.IndexOf(address));
                }
                else
                {
                    FSuccess[i] = false;
                }
            }
            FOutput.Flush();
            FSuccess.Flush();
            FMatch.Flush();
        }
Exemplo n.º 5
0
        //called each frame by vvvv
        public void Evaluate(int SpreadMax)
        {
            FCurrentPos.SliceCount          = SpreadMax;
            FLength.SliceCount              = SpreadMax;
            FStreamDataLengthOut.SliceCount = SpreadMax;

            bool ChangedSpreadSize = FPreviousSpreadMax == SpreadMax ? false : true;

            //tells the Irrklang engine which System Audio Output to use
            #region Output devices

            if (FDeviceenum.IsChanged)
            {
                try
                {
                    int id = FDeviceSelect[FDeviceenum[0]];
                    FEngine.StopAllSounds();
                    FEngine       = new ISoundEngine(SoundOutputDriver.AutoDetect, SoundEngineOptionFlag.DefaultOptions, FDevice.getDeviceID(id));
                    FDriverUse[0] = FEngine.Name;
                    FMultiT[0]    = FEngine.IsMultiThreaded;

                    //HACK: Does not init plugins in the construcotr??
                    string PluginPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
                    FEngine.LoadPlugins(Path.GetDirectoryName(PluginPath));
                }
                catch (Exception ex)
                {
                    FLogger.Log(LogType.Error, ex.Message);
                }
            }

            #endregion output devices

            //Sets the MainVoume of the Engine
            #region MainVolume

            if (FMainVolume.IsChanged)
            {
                FEngine.SoundVolume = (float)FMainVolume[0];
            }


            #endregion MainVolume

            //Handles the Reading and Deleting of the Files
            //and Creating the ISoundSource Onject
            #region File IO

            if (ChangedSpreadSize || FFile.IsChanged || FDeviceenum.IsChanged || FPlayMode.IsChanged || FStreamMode.IsChanged || FStreamThreashold.IsChanged)
            {
                FEngine.StopAllSounds();
                FEngine.RemoveAllSoundSources();
                FSoundsources.Clear();
                FSounds.Clear();

                for (int i = 0; i < SpreadMax; i++)
                {
                    ISoundSource Source;
                    int          Index = FFile.IndexOf(FFile[i]);
                    if (Index < i)
                    {
                        Source = FEngine.AddSoundSourceAlias(FSoundsources[Index], FFile[i] + i.ToString());
                    }
                    else
                    {
                        Source = FEngine.AddSoundSourceFromFile(FFile[i]);
                    }

                    string EnumState = Enum.GetName(typeof(StreamMode), FStreamMode[i]);
                    switch (EnumState)
                    {
                    case "AutoDetect":
                        Source.StreamMode = StreamMode.AutoDetect;
                        break;

                    case "NoStreaming":
                        Source.StreamMode = StreamMode.NoStreaming;
                        Source.ForcedStreamingThreshold = 0;
                        break;

                    case "Streaming":
                        Source.StreamMode = StreamMode.Streaming;
                        Source.ForcedStreamingThreshold = FStreamThreashold[i];
                        break;

                    default:
                        FLogger.Log(LogType.Message, "No Streammode set");
                        break;
                    }

                    FSoundsources.Add(Source);
                }
            }

            #endregion File IO


            #region Finished Sounds

            Monitor.Enter(thisLock);
            try
            {
                List <ISound> Temp = new List <ISound>(FFinishedSounds);
                FFinishedSounds.Clear();
                foreach (ISound Sound in Temp)
                {
                    foreach (KeyValuePair <int, List <ISound> > Pair in FSounds)
                    {
                        if (Pair.Value.Contains(Sound))
                        {
                            Pair.Value.Remove(Sound);
                        }
                    }
                }
            }
            finally
            {
                Monitor.Exit(thisLock);
            }


            #endregion Finshed Sounds


            for (int i = 0; i < SpreadMax; i++)
            {
                #region PlayBack

                List <ISound> SoundsPerSlice;
                FSounds.TryGetValue(i, out SoundsPerSlice);

                if (SoundsPerSlice == null)
                {
                    SoundsPerSlice = new List <ISound>();
                    FSounds.Add(i, SoundsPerSlice);
                }


                if (FPlay[i] == true)
                {
                    try
                    {
                        FStreamDataLengthOut[i] = FSoundsources[i].SampleData.Length;
                    }catch
                    {
                        FStreamDataLengthOut[i] = -1;
                    }
                    try
                    {
                        if (FPlayMode[i] == "2D")
                        {
                            ISound Sound = FEngine.Play2D(FSoundsources[i], FLoop[i], true, true);
                            Sound.Volume        = FVolume[i];
                            Sound.Pan           = FPan[i];
                            Sound.PlaybackSpeed = FPlaybackSpeed[i];
                            Sound.Paused        = FPause[i];
                            Sound.setSoundStopEventReceiver(this);
                            SoundsPerSlice.Add(Sound);
                        }
                        else
                        {
                            ISound Sound = FEngine.Play3D(FSoundsources[i], (float)FSoundPosition[i].x, (float)FSoundPosition[i].y, (float)FSoundPosition[i].z, FLoop[i], true, true);
                            Sound.Volume        = FVolume[i];
                            Sound.PlaybackSpeed = FPlaybackSpeed[i];
                            Sound.MaxDistance   = FMaxDist[i];
                            Sound.MinDistance   = FMinDist[i];
                            Vector3D          Vector    = FSoundVelocity[i];
                            IrrKlang.Vector3D IrrVector = new IrrKlang.Vector3D((float)Vector.x, (float)Vector.y, (float)Vector.z);
                            Sound.Velocity = IrrVector;
                            Sound.Paused   = FPause[i];
                            Sound.setSoundStopEventReceiver(this);
                            SoundsPerSlice.Add(Sound);
                        }
                    }catch (NullReferenceException ex)
                    {
                        FLogger.Log(LogType.Error, "File not found in Irrklang");
                        FLogger.Log(LogType.Error, ex.Message);
                    }
                }

                if (FVolume.IsChanged || FPlay.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        Sound.Volume = FVolume[i];
                    }
                }


                if (FStop[i] == true)
                {
                    if (SoundsPerSlice.Count > 0)
                    {
                        SoundsPerSlice[SoundsPerSlice.Count - 1].Stop();
                        SoundsPerSlice.RemoveAt(SoundsPerSlice.Count - 1);
                    }
                }


                if (FLoop.IsChanged)
                {
                    if (FLoop[i] == true)
                    {
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.Looped = true;
                        }
                    }
                    else
                    {
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.Looped = false;
                        }
                    }
                }


                if (FPause.IsChanged)
                {
                    if (FPause[i])
                    {
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.Paused = true;
                        }
                    }
                    else
                    {
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.Paused = false;
                        }
                    }
                }

                if (FPlaybackSpeed.IsChanged || FPlay.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        Sound.PlaybackSpeed = FPlaybackSpeed[i];
                    }
                }



                if (FSeek[i] == true)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        Sound.PlayPosition = (uint)(((UInt32)FSeekPos[i]));
                    }
                }



                if (FPan.IsChanged || FPlay.IsChanged)
                {
                    if (FPlayMode[i].Name == "2D")
                    {
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.Pan = FPan[i];
                        }
                    }
                }


                if (FSoundPosition.IsChanged)
                {
                    if (FPlayMode[i].Name == "3D")
                    {
                        Vector3D          Vector    = FSoundPosition[i];
                        IrrKlang.Vector3D IrrVector = new IrrKlang.Vector3D((float)Vector.x, (float)Vector.y, (float)Vector.z);
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.Position = IrrVector;
                        }
                    }
                }

                if (FSoundVelocity.IsChanged || FPlay.IsChanged)
                {
                    if (FPlayMode[i].Name == "3D")
                    {
                        Vector3D          Vector    = FSoundVelocity[i];
                        IrrKlang.Vector3D IrrVector = new IrrKlang.Vector3D((float)Vector.x, (float)Vector.y, (float)Vector.z);
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.Velocity = IrrVector;
                        }
                    }
                }


                if (FMinDist.IsChanged || FPlay.IsChanged)
                {
                    if (FPlayMode[i].Name == "3D")
                    {
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.MinDistance = FMinDist[i];
                        }
                    }
                }

                if (FMaxDist.IsChanged || FPlay.IsChanged)
                {
                    if (FPlayMode[i].Name == "3D")
                    {
                        foreach (ISound Sound in SoundsPerSlice)
                        {
                            Sound.MaxDistance = FMinDist[i];
                        }
                    }
                }

                #endregion Playback


                #region Node Output

                //Set the OutputPin values
                FCurrentPos[i].SliceCount = SoundsPerSlice.Count;
                FLength[i] = FSoundsources[i].PlayLength;
                int Counter = 0;
                foreach (ISound Sound in SoundsPerSlice)
                {
                    if (!Sound.Finished)
                    {
                        FCurrentPos[i][Counter] = (double)(Sound.PlayPosition);
                    }
                    else
                    {
                        FCurrentPos[i][Counter] = 0;
                    }
                    Counter++;
                }


                #endregion NodeOutput


                #region Effekts



                //Sets the Chorus Effekt of a ISound Object
                #region Chorus

                if (FPlay.IsChanged || FEnableChorus.IsChanged || FChorusDelay.IsChanged || FChorusFrequency.IsChanged || FChoruspDepth.IsChanged || FChoruspFeedback.IsChanged || FChorusPhase.IsChanged || FChoruspWetDryMix.IsChanged || FChorusSinusWaveForm.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;

                        if (FEnableChorus[i])
                        {
                            Fx.EnableChorusSoundEffect(FChoruspWetDryMix[i], FChoruspDepth[i], FChoruspFeedback[i], FChorusFrequency[i], FChorusSinusWaveForm[i], FChorusDelay[i], FChorusPhase[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableChorusSoundEffect();
                        }
                    }
                }

                #endregion Chorus

                //Sets the Compresser Effekt of a ISound Object
                #region Compressor

                if (FPlay.IsChanged || FEnableComp.IsChanged || FCompAttack.IsChanged || FCompGain.IsChanged || FCompPredelay.IsChanged || FCompRatio.IsChanged || FCompRelease.IsChanged || FCompThreshold.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;

                        if (FEnableComp[i])
                        {
                            Fx.EnableCompressorSoundEffect(FCompGain[i], FCompAttack[i], FCompRelease[i], FCompThreshold[i], FCompRatio[i], FCompPredelay[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableCompressorSoundEffect();
                        }
                    }
                }

                #endregion Compressor

                //Sets the Distortion Effekt of a ISound Object
                #region Disortion

                if (FPlay.IsChanged || FEnableDistortion.IsChanged || FDistortionGain.IsChanged || FDistortionBandwidth.IsChanged || FDistortionEdge.IsChanged || FDistortionEQCenterFrequenz.IsChanged || FDistortionLowpassCutoff.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;

                        if (FEnableDistortion[i])
                        {
                            Fx.EnableDistortionSoundEffect(FDistortionGain[i], FDistortionEdge[i], FDistortionEQCenterFrequenz[i], FDistortionBandwidth[i], FDistortionLowpassCutoff[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableDistortionSoundEffect();
                        }
                    }
                }

                #endregion Distortion

                //Sets the Echo Effekt of a ISound Object
                #region Echo

                if (FPlay.IsChanged || FEnableEcho.IsChanged || FEchoFeedback.IsChanged || FEchoLeftDelay.IsChanged || FEchoPanDelay.IsChanged || FEchoRightDelay.IsChanged || FEchoWetDryMix.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;

                        if (FEnableEcho[i])
                        {
                            Fx.EnableEchoSoundEffect(FEchoWetDryMix[i], FEchoFeedback[i], FEchoLeftDelay[i], FEchoRightDelay[i], FEchoPanDelay[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableEchoSoundEffect();
                        }
                    }
                }

                #endregion Echo

                //Sets the Flanger Effekt of a ISound Object
                #region Flanger

                if (FPlay.IsChanged || FEnableFlanger.IsChanged || FFlangerDelay.IsChanged || FFlangerDepth.IsChanged || FFlangerFeedback.IsChanged || FFlangerFrequency.IsChanged || FFlangerPhase.IsChanged || FFlangerTriangleWaveForm.IsChanged || FFlangerWetDryMix.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;

                        if (FEnableFlanger[i])
                        {
                            Fx.EnableFlangerSoundEffect(FFlangerWetDryMix[i], FFlangerDepth[i], FFlangerFeedback[i], FFlangerFrequency[i], FFlangerTriangleWaveForm[i], FFlangerDelay[i], FFlangerPhase[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableFlangerSoundEffect();
                        }
                    }
                }

                #endregion Flanger

                //Sets the Gargle Effekt of a ISound Object
                #region Gargle

                if (FPlay.IsChanged || FEnableGargle.IsChanged || FGargleRateHz.IsChanged || FGargleSinusWaveForm.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;
                        if (FEnableGargle[i])
                        {
                            Fx.EnableGargleSoundEffect(FGargleRateHz[i], FGargleSinusWaveForm[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableGargleSoundEffect();
                        }
                    }
                }

                #endregion Gargle

                //Sets the I3Dl2 Reverb Effekt of a ISound Object
                #region I3Dl2 Reverb

                if (FPlay.IsChanged || FEnableI3DL2.IsChanged || FI3DL2DecayHFRatio.IsChanged || FI3DL2DecayTime.IsChanged || FI3DL2Density.IsChanged || FI3DL2Diffusion.IsChanged || FI3DL2HfReference.IsChanged || FI3DL2ReflectionDelay.IsChanged || FI3DL2Reflections.IsChanged || FI3DL2Reverb.IsChanged || FI3DL2ReverbDelay.IsChanged || FI3DL2Room.IsChanged || FI3DL2RoomHF.IsChanged || FI3DL2RoomRollOffFactor.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;

                        if (FEnableI3DL2[i])
                        {
                            Fx.EnableI3DL2ReverbSoundEffect(FI3DL2Room[i], FI3DL2RoomHF[i], FI3DL2RoomRollOffFactor[i], FI3DL2DecayTime[i], FI3DL2DecayHFRatio[i], FI3DL2Reflections[i], FI3DL2ReflectionDelay[i], FI3DL2Reverb[i], FI3DL2ReverbDelay[i], FI3DL2Diffusion[i], FI3DL2Density[i], FI3DL2HfReference[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableI3DL2ReverbSoundEffect();
                        }
                    }
                }

                #endregion I3Dl2 Reverb

                //Sets the Param EQ Effekt of a ISound Objec
                #region Param EQ

                if (FPlay.IsChanged || FEnableEq.IsChanged || FEqBandwidth.IsChanged || FEqCenter.IsChanged || FEqGain.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;
                        if (FEnableEq[i])
                        {
                            Fx.EnableParamEqSoundEffect(FEqCenter[i], FEqBandwidth[i], FEqGain[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableParamEqSoundEffect();
                        }
                    }
                }

                #endregion param EQ

                //Sets the Wave Effekt of a ISound Object
                #region Wave Reverb

                if (FPlay.IsChanged || FEnableWaveReverb.IsChanged || FWaveReverbFreq.IsChanged || FWaveReverbInGain.IsChanged || FWaveReverbMix.IsChanged || FWaveReverbTime.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;

                        if (FEnableWaveReverb[i])
                        {
                            Fx.EnableWavesReverbSoundEffect(FWaveReverbInGain[i], FWaveReverbMix[i], FWaveReverbTime[i], FWaveReverbFreq[i]);
                        }
                        else if (Fx != null)
                        {
                            Fx.DisableWavesReverbSoundEffect();
                        }
                    }
                }

                #endregion Wave Reverb

                //Disables all Effekts
                #region Disable All Effekts

                if (FDisableAllEffekt.IsChanged)
                {
                    foreach (ISound Sound in SoundsPerSlice)
                    {
                        ISoundEffectControl Fx = Sound.SoundEffectControl;
                        if (FDisableAllEffekt[i])
                        {
                            Fx.DisableAllEffects();
                        }
                    }
                }

                #endregion Disabel All Effects

                #endregion Effekts
            }

            //stops or paused all SoundSource which are playedback with the Irrklangengine
            #region Stop / Pause All

            if (FStopAll.IsChanged)
            {
                if (FStopAll[0])
                {
                    FEngine.StopAllSounds();
                }
            }

            if (FPauseAll.IsChanged)
            {
                if (FPause[0])
                {
                    FEngine.SetAllSoundsPaused(true);
                }
                else
                {
                    FEngine.SetAllSoundsPaused(false);
                }
            }

            #endregion Stop / Pause All

            //set the Listener Position of the Engine
            #region View Listener

            if (FViewDir.IsChanged || FViewPos.IsChanged || FViewUpVector.IsChanged || FViewVelocity.IsChanged)
            {
                IrrKlang.Vector3D ViewDir      = new IrrKlang.Vector3D((float)FViewDir[0].x, (float)FViewDir[0].y, (float)FViewDir[0].z);
                IrrKlang.Vector3D ViewPos      = new IrrKlang.Vector3D((float)FViewPos[0].x, (float)FViewPos[0].y, (float)FViewPos[0].z);
                IrrKlang.Vector3D ViewVelocity = new IrrKlang.Vector3D((float)FViewVelocity[0].x, (float)FViewVelocity[0].y, (float)FViewVelocity[0].z);
                IrrKlang.Vector3D ViewUp       = new IrrKlang.Vector3D((float)FViewUpVector[0].x, (float)FViewUpVector[0].y, (float)FViewUpVector[0].z);
                FEngine.SetListenerPosition(ViewDir, ViewPos, ViewVelocity, ViewUp);
            }

            #endregion View Listener

            //sets the RollOff effekt of the Engine
            #region RollOff

            if (FRollOff.IsChanged)
            {
                FEngine.SetRolloffFactor(FRollOff[0]);
            }

            #endregion RollOFF

            //sets the DopllerEffekt of the Engine
            #region DopplerEffekt

            if (FDoplerFactor.IsChanged || FDoplerDistanceFactor.IsChanged)
            {
                FEngine.SetDopplerEffectParameters(FDoplerFactor[0], FDoplerDistanceFactor[0]);
            }

            #endregion DopplerEffekt

            FPreviousSpreadMax = SpreadMax;
        }