Esempio n. 1
0
 /// <summary>
 /// Fires when the form closes.
 /// If the user pressed the back button, the next form will be loaded.
 /// If the user closed the form in some other way, the app will temrinate.
 /// </summary>
 /// <param name="sender">Automatically generated by Visual Studio.</param>
 /// <param name="e">Automatically generated by Visual Studio.</param>
 private void AudioPlayer_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (appClosing)
     {
         UserManagement.WriteSettings();
         DirectoryManagement.WritePaths();
         Application.Exit();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// When the save button is clicked, saves the changes to the settings and closes the window.
 /// </summary>
 /// <param name="sender">Automatically generated by Visual Studio.</param>
 /// <param name="e">Automatically generated by Visual Studio.</param>
 private void SaveButton_Click(object sender, EventArgs e)
 {
     DirectoryManagement.AudioFolder            = audioFolderTextBox.Text;
     DirectoryManagement.RecordingFolder        = recordingFolderTextBox.Text;
     DirectoryManagement.ScoreboardReportFolder = reportFolderTextBox.Text;
     DirectoryManagement.HTKFolder = HTKFolderTextBox.Text;
     DirectoryManagement.WritePaths();
     Close();
 }
Esempio n. 3
0
 /// <summary>
 /// Fires when the form closes.
 /// If the user pressed the back button, the next form will be loaded.
 /// If the user closed the form in some other way, the app will temrinate.
 /// </summary>
 /// <param name="sender">Automatically generated by Visual Studio.</param>
 /// <param name="e">Automatically generated by Visual Studio.</param>
 private void MPAiSoundMainMenu_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (appClosing)
     {
         UserManagement.WriteSettings();
         DirectoryManagement.WritePaths();
         Application.Exit();
     }
 }
Esempio n. 4
0
 /// <summary>
 /// When the save button is clicked, saves the changes to the settings and closes the window.
 /// </summary>
 /// <param name="sender">Automatically generated by Visual Studio.</param>
 /// <param name="e">Automatically generated by Visual Studio.</param>
 private void SaveButton_Click(object sender, EventArgs e)
 {
     DirectoryManagement.VideoFolder            = videoFolderTextBox.Text;
     DirectoryManagement.ScoreboardReportFolder = reportFolderTextBox.Text;
     DirectoryManagement.FormantFolder          = formantFolderTextBox.Text;
     DirectoryManagement.RecordingFolder        = recordingFolderTextBox.Text;
     DirectoryManagement.WritePaths();
     Close();
 }
Esempio n. 5
0
        /// <summary>
        /// Fires when the form closes.
        /// If the user pressed the back button, the next form will be loaded.
        /// If the user closed the form in some other way, the app will temrinate.
        /// </summary>
        /// <param name="sender">Automatically generated by Visual Studio.</param>
        /// <param name="e">Automatically generated by Visual Studio.</param>
        private void SpeechRecognitionTest_FormClosing(object sender, FormClosingEventArgs e)
        {
            StopPlay(); // The audio player runs threads in the background. To prevent them running after the form closes, call stop on close.

            if (appClosing)
            {
                UserManagement.WriteSettings();
                DirectoryManagement.WritePaths();
                Application.Exit();
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Saves any changes made when the form is closed.
        /// </summary>
        /// <param name="sender">Automatically generated by Visual Studio.</param>
        /// <param name="e">Automatically generated by Visual Studio.</param>
        private void LoginScreen_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!(PlotController.getCurrentPlotProcess() == null))
            {
                //Kills any persistent Processes.
                try
                {
                    //PlotController.getCurrentPlotProcess().Kill();
                    //PlotController.getCurrentPlotProcess().WaitForExit();
                    //PlotController.getCurrentPlotProcess().Dispose();
                }
                catch (Exception exp) {
                    Console.WriteLine(exp.StackTrace);
                }
            }

            foreach (var process in Process.GetProcessesByName("MPAiVowelRunner"))
            {
                if (process == null)
                {
                    process.Kill();
                    process.WaitForExit();
                    process.Dispose();
                }
            }
            foreach (var process in Process.GetProcessesByName("MPAiPlotRunner"))
            {
                if (process == null)
                {
                    process.Kill();
                    process.WaitForExit();
                    process.Dispose();
                }
            }

            UserManagement.WriteSettings();
            DirectoryManagement.WritePaths();
        }
Esempio n. 7
0
 /// <summary>
 /// Saves any changes made when the form is closed.
 /// </summary>
 /// <param name="sender">Automatically generated by Visual Studio.</param>
 /// <param name="e">Automatically generated by Visual Studio.</param>
 private void LoginScreen_FormClosing(object sender, FormClosingEventArgs e)
 {
     UserManagement.WriteSettings();
     DirectoryManagement.WritePaths();
 }