/// <summary> /// Respond to change in selected voice. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void voiceList_SelectedIndexChanged(object sender, EventArgs e) { if (voiceList.SelectedItem == null) { return; } voiceName = (string)voiceList.SelectedItem; voice = library[voiceName]; if (voice.Male) { gender.Text = "M"; } else { gender.Text = "F"; } // Reset the modifiers. rateModification = 0; pitchModification = 0; rateSelector.SelectedIndex = rateModification + 1; pitchSelector.SelectedIndex = pitchModification + 1; Demonstrate(); }
public VoiceAssignment(PluginControl pc, string name, UUID id) { control = pc; avatarName = name; avatarId = id; InitializeComponent(); control.talker.SayMore("Assign a voice for " + avatarName, BeepType.Open); // Inhibit demonstrations until constructore is done. doDemo = false; // Populate the fixed fields avName.Text = avatarName; library = control.talker.voices.voiceLibrary; foreach (string vname in library.Keys) { AvailableVoice v = library[vname]; voiceList.Items.Add(v.Name); } // Set the current name, if any. voiceList.ClearSelected(); voiceName = null; AssignedVoice av = null; // First check the assigned voices. av = control.talker.voices.VoiceFor(id, false); // A voice has been assigned, so indicate that. if (av != null) { voiceName = av.root.Name; voice = library[voiceName]; rateSelector.SelectedIndex = av.rateModification + 1; pitchSelector.SelectedIndex = av.pitchModification + 1; SelectByName(voiceName); } doDemo = true; Radegast.GUI.GuiHelpers.ApplyGuiFixes(this); }