Exemplo n.º 1
0
 private void load_settings(ConfigNode node, BeepSource source)
 {
     if (node.HasValue("precise"))
     {
         source.precise = Boolean.Parse(node.GetValue("precise"));
     }
     if (node.HasValue("precise_freq"))
     {
         source.precise_freq        = Int32.Parse(node.GetValue("precise_freq"));
         source.precise_freq_slider = source.precise_freq;
     }
     if (node.HasValue("loose_freq"))
     {
         source.loose_freq        = Int32.Parse(node.GetValue("loose_freq"));
         source.loose_freq_slider = source.loose_freq;
     }
     if (node.HasValue("volume"))
     {
         source.audiosource.volume = Single.Parse(node.GetValue("volume"));
     }
     if (node.HasValue("pitch"))
     {
         source.audiosource.pitch = Single.Parse(node.GetValue("pitch"));
     }
     if (node.HasValue("current_clip"))
     {
         source.current_clip = node.GetValue("current_clip");
     }
     if (node.HasValue("randomizeBeep"))
     {
         source.randomizeBeep = Boolean.Parse(node.GetValue("randomizeBeep"));
     }
     if (node.HasValue("sel_filter"))
     {
         source.sel_filter = Int32.Parse(node.GetValue("sel_filter"));
     }
     if (node.HasValue("show_settings_window"))
     {
         source.show_settings_window = Boolean.Parse(node.GetValue("show_settings_window"));
     }
     if (node.HasValue("reverb_preset_index"))
     {
         source.reverb_preset_index = Int32.Parse(node.GetValue("reverb_preset_index"));
     }
     if (node.HasValue("settings_window_pos_x"))
     {
         source.settings_window_pos.x = Single.Parse(node.GetValue("settings_window_pos_x"));
     }
     if (node.HasValue("settings_window_pos_y"))
     {
         source.settings_window_pos.y = Single.Parse(node.GetValue("settings_window_pos_y"));
     }
 }
Exemplo n.º 2
0
 private void save_settings(ConfigNode node, BeepSource source)
 {
     node.AddValue("precise", source.precise);
     node.AddValue("precise_freq", source.precise_freq);
     node.AddValue("loose_freq", source.loose_freq);
     node.AddValue("volume", source.audiosource.volume);
     node.AddValue("pitch", source.audiosource.pitch);
     node.AddValue("current_clip", source.current_clip);
     node.AddValue("randomizeBeep", source.randomizeBeep);
     node.AddValue("sel_filter", source.sel_filter);
     node.AddValue("show_settings_window", source.show_settings_window);
     node.AddValue("show_settings_window", source.show_settings_window);
     node.AddValue("reverb_preset_index", source.reverb_preset_index);
     node.AddValue("settings_window_pos_x", source.settings_window_pos.x);
     node.AddValue("settings_window_pos_y", source.settings_window_pos.y);
 }