private void Add_Click(object sender, RoutedEventArgs e)
        {
            try {
                if (Tabs.SelectedIndex == 1)
                {
                    // Import one layer
                    HitsoundLayer layer = HitsoundImporter.ImportStack(BeatmapPathBox.Text, XCoordBox.GetDouble(), YCoordBox.GetDouble());
                    layer.Name            = NameBox.Text;
                    layer.SampleSet       = (SampleSet)(SampleSetBox.SelectedIndex + 1);
                    layer.Hitsound        = (Hitsound)HitsoundBox.SelectedIndex;
                    layer.SampleArgs.Path = SamplePathBox.Text;

                    HitsoundLayers.Add(layer);
                }
                else if (Tabs.SelectedIndex == 2)
                {
                    // Import complete hitsounds
                    foreach (string path in BeatmapPathBox2.Text.Split('|'))
                    {
                        HitsoundLayers.AddRange(HitsoundImporter.ImportHitsounds(path, VolumesBox2.IsChecked.GetValueOrDefault(),
                                                                                 DetectDuplicateSamplesBox2.IsChecked.GetValueOrDefault(),
                                                                                 RemoveDuplicatesBox2.IsChecked.GetValueOrDefault(),
                                                                                 IncludeStoryboardBox2.IsChecked.GetValueOrDefault()));
                    }
                    HitsoundLayers.ForEach(o => o.Name = $"{NameBox2.Text}: {o.Name}");
                }
                else if (Tabs.SelectedIndex == 3)
                {
                    // Import MIDI
                    HitsoundLayers = HitsoundImporter.ImportMidi(BeatmapPathBox3.Text, OffsetBox3.GetDouble(0),
                                                                 InstrumentBox3.IsChecked.GetValueOrDefault(), KeysoundBox3.IsChecked.GetValueOrDefault(),
                                                                 LengthBox3.IsChecked.GetValueOrDefault(), LengthRoughnessBox3.GetDouble(2),
                                                                 VelocityBox3.IsChecked.GetValueOrDefault(), VelocityRoughnessBox3.GetDouble(10));
                    HitsoundLayers.ForEach(o => o.Name = $"{NameBox3.Text}: {o.Name}");
                }
                else if (Tabs.SelectedIndex == 4)
                {
                    // Import storyboarded samples
                    foreach (string path in BeatmapPathBox4.Text.Split('|'))
                    {
                        HitsoundLayers.AddRange(HitsoundImporter.ImportStoryboard(path, VolumesBox4.IsChecked.GetValueOrDefault(),
                                                                                  RemoveDuplicatesBox4.IsChecked.GetValueOrDefault()));
                    }
                    HitsoundLayers.ForEach(o => o.Name = $"{NameBox4.Text}: {o.Name}");
                }
                else
                {
                    // Import none
                    HitsoundLayer layer = new HitsoundLayer(NameBox0.Text, ImportType.None, (SampleSet)(SampleSetBox0.SelectedIndex + 1), (Hitsound)HitsoundBox0.SelectedIndex, SamplePathBox0.Text);
                    HitsoundLayers.Add(layer);
                }

                Close();
            }
            catch (Exception ex) {
                ex.Show();
            }
        }