Beispiel #1
0
        static void Main(string[] args)
        {
#if !DEBUG
            try
            {
#endif
            Directory.SetCurrentDirectory(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName));

            MIDIAudio.Init();

            var s = new Settings();
            s.InitSoundfontListner();
            if (s.EnableUpdates)
            {
                if (File.Exists(KivaUpdates.DefaultUpdatePackagePath))
                {
                    try
                    {
                        using (var z = File.OpenRead(KivaUpdates.DefaultUpdatePackagePath))
                            using (ZipArchive archive = new ZipArchive(z))
                            { }
                        UpdateReady = true;
                        if (!KivaUpdates.IsAnotherKivaRunning())
                        {
                            if (args.Length == 0)
                            {
                                Process.Start(KivaUpdates.InstallerPath, "update -Reopen");
                            }
                            else
                            {
                                Process.Start(KivaUpdates.InstallerPath, "update -Reopen -ReopenArg \"" + args[0] + "\"");
                            }
                        }
                    }
                    catch (Exception e) { TryDownloadUpdatePackage(s.VersionName); }
                }
                else
                {
                    TryDownloadUpdatePackage(s.VersionName);
                }
            }

            var window = new MainWindow(s);
            if (args.Length != 0)
            {
                window.LoadMidi(args[0]);
            }
            window.ShowDialog();
#if !DEBUG
        }

        catch (Exception e)
        {
            string msg = e.Message + "\n" + e.Data + "\n";
            msg += e.StackTrace;
            MessageBox.Show(msg, "Kiva has crashed!");
        }
#endif
        }
Beispiel #2
0
 public AudioBufferStream(MIDIAudio source)
 {
     audioSource = source;
 }