Chatterer.chatterer.paste_beepsource_values C# (CSharp) Method

paste_beepsource_values() private method

private paste_beepsource_values ( BeepSource source ) : void
source BeepSource
return void
        private void paste_beepsource_values(BeepSource source)
        {
            if (beepsource_clipboard.HasValue("precise")) source.precise = Boolean.Parse(beepsource_clipboard.GetValue("precise"));
            if (beepsource_clipboard.HasValue("precise_freq"))
            {
                source.precise_freq = Int32.Parse(beepsource_clipboard.GetValue("precise_freq"));
                source.precise_freq_slider = source.precise_freq;
            }
            if (beepsource_clipboard.HasValue("loose_freq"))
            {
                source.loose_freq = Int32.Parse(beepsource_clipboard.GetValue("loose_freq"));
                source.loose_freq_slider = source.loose_freq;
            }
            if (beepsource_clipboard.HasValue("volume")) source.audiosource.volume = Single.Parse(beepsource_clipboard.GetValue("volume"));
            if (beepsource_clipboard.HasValue("pitch")) source.audiosource.pitch = Single.Parse(beepsource_clipboard.GetValue("pitch"));
            if (beepsource_clipboard.HasValue("current_clip")) source.current_clip = beepsource_clipboard.GetValue("current_clip");
            if (beepsource_clipboard.HasValue("sel_filter")) source.sel_filter = Int32.Parse(beepsource_clipboard.GetValue("sel_filter"));
            if (beepsource_clipboard.HasValue("show_settings_window")) source.show_settings_window = Boolean.Parse(beepsource_clipboard.GetValue("show_settings_window"));
            if (beepsource_clipboard.HasValue("reverb_preset_index")) source.reverb_preset_index = Int32.Parse(beepsource_clipboard.GetValue("reverb_preset_index"));
            if (beepsource_clipboard.HasValue("settings_window_pos_x")) source.settings_window_pos.x = Single.Parse(beepsource_clipboard.GetValue("settings_window_pos_x"));
            if (beepsource_clipboard.HasValue("settings_window_pos_y")) source.settings_window_pos.y = Single.Parse(beepsource_clipboard.GetValue("settings_window_pos_y"));

            if (dict_probe_samples.Count > 0)
            {
                set_beep_clip(source);

                if (source.precise == false && source.loose_freq > 0) new_beep_loose_timer_limit(source);
            }

            foreach (ConfigNode filter in beepsource_clipboard.nodes)
            {
                if (filter.name == "CHORUS")
                {
                    if (filter.HasValue("enabled")) source.chorus_filter.enabled = Boolean.Parse(filter.GetValue("enabled"));
                    if (filter.HasValue("dry_mix")) source.chorus_filter.dryMix = Single.Parse(filter.GetValue("dry_mix"));
                    if (filter.HasValue("wet_mix_1")) source.chorus_filter.wetMix1 = Single.Parse(filter.GetValue("wet_mix_1"));
                    if (filter.HasValue("wet_mix_2")) source.chorus_filter.wetMix2 = Single.Parse(filter.GetValue("wet_mix_2"));
                    if (filter.HasValue("wet_mix_3")) source.chorus_filter.wetMix3 = Single.Parse(filter.GetValue("wet_mix_3"));
                }
                else if (filter.name == "DISTORTION")
                {
                    if (filter.HasValue("enabled")) source.distortion_filter.enabled = Boolean.Parse(filter.GetValue("enabled"));
                    if (filter.HasValue("distortion_level")) source.distortion_filter.distortionLevel = Single.Parse(filter.GetValue("distortion_level"));
                }
                else if (filter.name == "ECHO")
                {
                    if (filter.HasValue("enabled")) source.echo_filter.enabled = Boolean.Parse(filter.GetValue("enabled"));
                    if (filter.HasValue("delay")) source.echo_filter.delay = Single.Parse(filter.GetValue("delay"));
                    if (filter.HasValue("decay_ratio")) source.echo_filter.decayRatio = Single.Parse(filter.GetValue("decay_ratio"));
                    if (filter.HasValue("dry_mix")) source.echo_filter.dryMix = Single.Parse(filter.GetValue("dry_mix"));
                    if (filter.HasValue("wet_mix")) source.echo_filter.wetMix = Single.Parse(filter.GetValue("wet_mix"));
                }
                else if (filter.name == "HIGHPASS")
                {
                    if (filter.HasValue("enabled")) source.highpass_filter.enabled = Boolean.Parse(filter.GetValue("enabled"));
                    if (filter.HasValue("cutoff_freq")) source.highpass_filter.cutoffFrequency = Single.Parse(filter.GetValue("cutoff_freq"));
                    if (filter.HasValue("resonance_q")) source.highpass_filter.highpassResonaceQ = Single.Parse(filter.GetValue("resonance_q"));
                }
                else if (filter.name == "LOWPASS")
                {
                    if (filter.HasValue("enabled")) source.lowpass_filter.enabled = Boolean.Parse(filter.GetValue("enabled"));
                    if (filter.HasValue("cutoff_freq")) source.lowpass_filter.cutoffFrequency = Single.Parse(filter.GetValue("cutoff_freq"));
                    if (filter.HasValue("resonance_q")) source.lowpass_filter.lowpassResonaceQ = Single.Parse(filter.GetValue("resonance_q"));
                }
                else if (filter.name == "REVERB")
                {
                    if (filter.HasValue("enabled")) source.reverb_filter.enabled = Boolean.Parse(filter.GetValue("enabled"));
                    if (filter.HasValue("reverb_preset")) source.reverb_filter.reverbPreset = (AudioReverbPreset)Enum.Parse(typeof(AudioReverbPreset), filter.GetValue("reverb_preset"));
                    if (filter.HasValue("dry_level")) source.reverb_filter.dryLevel = Single.Parse(filter.GetValue("dry_level"));
                    if (filter.HasValue("room")) source.reverb_filter.room = Single.Parse(filter.GetValue("room"));
                    if (filter.HasValue("room_hf")) source.reverb_filter.roomHF = Single.Parse(filter.GetValue("room_hf"));
                    if (filter.HasValue("room_lf")) source.reverb_filter.roomLF = Single.Parse(filter.GetValue("room_lf"));
                    if (filter.HasValue("room_rolloff")) source.reverb_filter.roomRolloff = Single.Parse(filter.GetValue("room_rolloff"));
                    if (filter.HasValue("decay_time")) source.reverb_filter.decayTime = Single.Parse(filter.GetValue("decay_time"));
                    if (filter.HasValue("decay_hf_ratio")) source.reverb_filter.decayHFRatio = Single.Parse(filter.GetValue("decay_hf_ratio"));
                    if (filter.HasValue("reflections_level")) source.reverb_filter.reflectionsLevel = Single.Parse(filter.GetValue("reflections_level"));
                    if (filter.HasValue("reflections_delay")) source.reverb_filter.reflectionsDelay = Single.Parse(filter.GetValue("reflections_delay"));
                    if (filter.HasValue("reverb_level")) source.reverb_filter.reverbLevel = Single.Parse(filter.GetValue("reverb_level"));
                    if (filter.HasValue("reverb_delay")) source.reverb_filter.reverbDelay = Single.Parse(filter.GetValue("reverb_delay"));
                    if (filter.HasValue("diffusion")) source.reverb_filter.diffusion = Single.Parse(filter.GetValue("diffusion"));
                    if (filter.HasValue("density")) source.reverb_filter.density = Single.Parse(filter.GetValue("density"));
                    if (filter.HasValue("hf_reference")) source.reverb_filter.hfReference = Single.Parse(filter.GetValue("hf_reference"));
                    if (filter.HasValue("lf_reference")) source.reverb_filter.lFReference = Single.Parse(filter.GetValue("lf_reference"));
                }
            }
            if (debugging) Debug.Log("[CHATR] single beepsource values pasted from beepsource_clipboard");
        }
chatterer