using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Fusion_Control_Centre_UberMDX { public partial class DEBUG_SpeechForm : Form { List AllPossible = null; Fusion_Control_Centre_UberMDX.MainMDX MyMomma = null; public DEBUG_SpeechForm(Fusion_Control_Centre_UberMDX.MainMDX input_momma) { InitializeComponent(); input_momma.Debug_SpeechCommands_Hypothesized += new MainMDX.Debug_Delegate_DebugSpeechCommands(New_Speech_Command_Received_Hypo); input_momma.Debug_SpeechCommands_Recognized += new MainMDX.Debug_Delegate_DebugSpeechCommands(New_Speech_Command_Received_Reco); input_momma.Debug_Speech_CommandsRejected += new MainMDX.Debug_Delegate_DebugSpeechCommands(momma_Debug_Speech_Commands_Rejected); this.Shown += new EventHandler(DEBUG_SpeechForm_Shown); MyMomma = input_momma; } void DEBUG_SpeechForm_Shown(object sender, EventArgs e) { SetupNewAllPossible(MyMomma.DEBUG_AllPossibleSpeechStrings); } public void SetupNewAllPossible(List input_AllPossible) { AllPossible = input_AllPossible; LIST_POSSIBLE.Items.Clear(); LIST_POSSIBLE.Items.AddRange(AllPossible.ToArray()); } void momma_Debug_Speech_Commands_Rejected(string I_Heard_String) { try { TXT_REJECTED.Text = I_Heard_String + "\r\n" + TXT_REJECTED.Text; } catch (Exception e) { try { TXT_REJECTED.Clear(); } catch (Exception e2) { return; } } } private void New_Speech_Command_Received_Reco(string I_Heard_String) { try { TXT_RECO.Text = I_Heard_String + "\r\n" + TXT_RECO.Text; } catch (Exception e) { try { TXT_RECO.Clear(); } catch (Exception e2) { return; } } } private void New_Speech_Command_Received_Hypo(string I_Heard_String) { try { TXT_HYPO.Text = I_Heard_String + "\r\n" + TXT_HYPO.Text; } catch (Exception e) { try { TXT_HYPO.Clear(); } catch (Exception e2) { return; } } } private void BTN_ENABLE_Click(object sender, EventArgs e) { MyMomma.Speech_Start(); } private void BTN_DISABLE_Click(object sender, EventArgs e) { MyMomma.Speech_Stop(); } } }