Ejemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        private void HandleGetStartedButtonClick(object sender, EventArgs e)
        {
            _buttonGetStarted.Enabled = false;
            ExternalProcess.CleanUpAllProcesses();
            string newAnnotationFile = null;

            if (_radioButtonManual.Checked)
            {
                Settings.Default.DefaultSegmentationMethod = 0;
                newAnnotationFile = ManualSegmenterDlg.ShowDialog(_file, this, -1);
            }
            else if (_radioButtonCarefulSpeech.Checked)
            {
                Settings.Default.DefaultSegmentationMethod = 1;
                newAnnotationFile = (!AudioUtils.GetCanRecordAudio()) ? null :
                                    _file.RecordAnnotations(FindForm(), AudioRecordingType.Careful);
            }
            else if (_radioButtonElan.Checked)
            {
                var caption = LocalizationManager.GetString(
                    "DialogBoxes.Transcription.CreateAnnotationFileDlg.LoadSegmentFileDlgCaption", "Select Segment File");

                var filetype = LocalizationManager.GetString(
                    "DialogBoxes.Transcription.CreateAnnotationFileDlg.ElanFileTypeString",
                    "ELAN File (*.eaf)|*.eaf");

                newAnnotationFile = GetAudacityOrElanFile(caption, filetype);
                Settings.Default.DefaultSegmentationMethod = 2;
            }
            else if (_radioButtonAudacity.Checked)
            {
                var caption = LocalizationManager.GetString(
                    "DialogBoxes.Transcription.CreateAnnotationFileDlg.AudacityLabelOpenFileDlg.Caption",
                    "Select Audacity Label File");

                var filetype = LocalizationManager.GetString(
                    "DialogBoxes.Transcription.CreateAnnotationFileDlg.AudacityLabelOpenFileDlg.FileTypeString",
                    "Audacity Label File (*.txt)|*.txt");

                newAnnotationFile = GetAudacityOrElanFile(caption, filetype);
                Settings.Default.DefaultSegmentationMethod = 3;
            }
            else if (_radioButtonAutoSegmenter.Checked)
            {
                var segmenter = new AutoSegmenter(_file, _project);
                newAnnotationFile = segmenter.Run();
                Settings.Default.DefaultSegmentationMethod = 4;
            }

            if (newAnnotationFile != null && ComponentFileListRefreshAction != null)
            {
                ComponentFileListRefreshAction(newAnnotationFile, null);
            }

            _buttonGetStarted.Enabled = true;
        }
Ejemplo n.º 2
0
        /// ------------------------------------------------------------------------------------
        private static void SetUpErrorHandling()
        {
            Application.ApplicationExit += (sender, args) => ExternalProcess.CleanUpAllProcesses();
            Application.ThreadException += (sender, args) => ExternalProcess.CleanUpAllProcesses();
            AppDomain.CurrentDomain.UnhandledException += (sender, args) => ExternalProcess.CleanUpAllProcesses();

            ErrorReport.EmailAddress = "*****@*****.**";
            ErrorReport.AddStandardProperties();
            ExceptionHandler.Init();
            ExceptionHandler.AddDelegate((w, e) => Analytics.ReportException(e.Exception));
        }