Ejemplo n.º 1
0
        private void Hyperlink_Click_2(object sender, RoutedEventArgs e)
        {
            System.Diagnostics.Process.Start("C:\\Program Files (x86)\\Audacity\\audacity.exe", myrecorder.FilePath);
            var x1 = new SpecialMessageBox();

            x1.ShowMessage(this, "Edit in Audacity", "Launching Audacity...", "Export back as a WAV once you've finished.");
        }
Ejemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Storyboard animation;

            if (recordButton.IsChecked == false)
            {
                {
                    animation = this.FindResource("animateBackgroundReturn") as Storyboard;
                    this.BeginStoryboard(animation);
                }

                myrecorder.Stop();

                //((App)Application.Current).overlayWnd.Hide();
                this.Visibility = Visibility.Hidden;

                try
                {
                    var p = new PostWindow();
                    p.ShowDialog();

                    myrecorder.Reset();

                    var x = new System.Windows.Shell.TaskbarItemInfo();
                    x.ProgressState      = System.Windows.Shell.TaskbarItemProgressState.Normal;
                    this.TaskbarItemInfo = x;

                    this.Visibility = Visibility.Visible;
                    ((App)Application.Current).overlayWnd.Show();
                } catch (Exception ex)
                {
                    CrashHelpMe.CreateCrashReport(ex);

                    {
                        try
                        {
                            if (System.IO.File.Exists(myrecorder.FilePath))
                            {
                                var emergency_wav = System.IO.Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop), myrecorder.FileName + ".wav");
                                System.IO.File.Copy(myrecorder.FilePath, emergency_wav);

                                var x1 = new SpecialMessageBox();
                                x1.ShowMessage(this, "Unexpected error", "Due to an error, the MP3 may not have been saved.", String.Format("The app ran into a problem. As a precaution, the recording WAV file has been copied to your Desktop. You can continue editing the WAV file in Audacity, etc. from there.\n{0}", ex.Message));

                                System.Diagnostics.Process.Start("explorer.exe", "/select,\"" + emergency_wav + "\"");
                            }
                            else
                            {
                                var x1 = new SpecialMessageBox();
                                x1.ShowMessage(this, "Unexpected error", "Due to an error, the recording seems to have failed.", String.Format("The app ran into a problem. The WAV file may have failed to record.\n{0}", ex.Message));
                                System.Diagnostics.Process.Start("explorer.exe", "/select,\"" + ((App)Application.Current).Options.TempLocation + "\"");
                            }
                        }
                        catch (Exception ex2)
                        {
                            var x1 = new SpecialMessageBox();
                            x1.ShowMessage(this, "Unexpected error", "Due to an error, the MP3 may not have been saved.", String.Format("The app ran into a problem:\n{0}", ex2.Message));

                            System.Diagnostics.Process.Start("explorer.exe", "/select,\"" + myrecorder.FilePath + "\"");
                        }
                    }
                    Close();
                }
            }
            else
            {
                {
                    animation = this.FindResource("animateBackground") as Storyboard;
                    this.BeginStoryboard(animation);
                }

                {
                    Dispatcher.Invoke(DispatcherPriority.Normal, (Action) delegate() {
                        OverlayWindow ow = ((App)Application.Current).overlayWnd;
                        ow.animateBlink.Stop();
                    });
                }

                myrecorder.Record();

                var x = new System.Windows.Shell.TaskbarItemInfo();
                x.ProgressState      = System.Windows.Shell.TaskbarItemProgressState.Error;
                x.ProgressValue      = 1;
                this.TaskbarItemInfo = x;

                if (((App)Application.Current).Options.AutoMinimise)
                {
                    this.WindowState = WindowState.Minimized;
                }
            }

            updateUI();
        }