using Radegast.Netcom;\r
using Radegast.Core;\r
using OpenMetaverse;\r
+using OpenMetaverse.StructuredData;\r
\r
namespace Radegast\r
{\r
private RadegastNetcom netcom { get { return instance.Netcom; } }\r
private GridClient client { get { return instance.Client; } }\r
private TabsConsole tabConsole;\r
-\r
+ private OSDMap config;\r
public VoiceGateway gateway;\r
public VoiceSession session;\r
\r
\r
this.instance.MainForm.Load += new EventHandler(MainForm_Load);\r
\r
- chkVoiceEnable.Checked = instance.GlobalSettings["Voice.enabled"].AsBoolean();\r
+ config = instance.GlobalSettings["voice"] as OSDMap;\r
+ if (config == null)\r
+ {\r
+ config = new OSDMap();\r
+ config["enabled"] = new OSDBoolean(false);\r
+ instance.GlobalSettings["voice"] = config;\r
+ instance.GlobalSettings.Save();\r
+ }\r
+\r
+ chkVoiceEnable.Checked = config["enabled"].AsBoolean();\r
if (chkVoiceEnable.Checked)\r
Start();\r
}\r
\r
foreach (string name in available)\r
micDevice.Items.Add(name);\r
- micDevice.SelectedItem = instance.GlobalSettings["Voice.capture.device"].AsString();\r
+ micDevice.SelectedItem = config["capture.device"].AsString();\r
}\r
\r
void LoadSpkrDevices(List<string> available)\r
{\r
foreach (string name in available)\r
spkrDevice.Items.Add(name);\r
- spkrDevice.SelectedItem = instance.GlobalSettings["Voice.playback.device"].AsString();\r
+ spkrDevice.SelectedItem = config["playback.device"].AsString();\r
}\r
\r
private void spkrDevice_SelectedIndexChanged(object sender, EventArgs e)\r
{\r
gateway.PlaybackDevice = (string)spkrDevice.SelectedItem;\r
- instance.GlobalSettings["Voice.playback.device"] =\r
- OpenMetaverse.StructuredData.OSD.FromString((string)spkrDevice.SelectedItem);\r
+ config["playback.device"] = new OSDString((string)spkrDevice.SelectedItem);\r
+ instance.GlobalSettings.Save();\r
}\r
\r
private void micDevice_SelectedIndexChanged(object sender, EventArgs e)\r
{\r
gateway.CaptureDevice = (string)micDevice.SelectedItem;\r
- instance.GlobalSettings["Voice.capture.device"] =\r
- OpenMetaverse.StructuredData.OSD.FromString((string)micDevice.SelectedItem);\r
+ config["capture.device"] = new OSDString((string)micDevice.SelectedItem);\r
+ instance.GlobalSettings.Save();\r
}\r
\r
private void micLevel_ValueChanged(object sender, EventArgs e)\r
{\r
this.BeginInvoke(new MethodInvoker(delegate()\r
{\r
- instance.GlobalSettings["Voice.enabled"] =\r
- OpenMetaverse.StructuredData.OSD.FromBoolean(chkVoiceEnable.Checked);\r
+ config["enabled"] = new OSDBoolean( chkVoiceEnable.Checked );\r
+ instance.GlobalSettings.Save();\r
\r
if (chkVoiceEnable.Checked)\r
{\r