Пример #1
0
 public static void WriteDelesteBeatmap([NotNull] TextWriter writer, [NotNull] Score score, Difficulty difficulty,
                                        [NotNull] string title, [NotNull] string composer, [NotNull] string lyricist, [NotNull] string bg,
                                        [NotNull] string song, int level, MusicColor color, int bgmVolume, int seVolume)
 {
     WriteBeatmapHeader(writer, difficulty, title, composer, lyricist, bg, song, level, color, bgmVolume, seVolume);
     WriteEntries(score, writer);
 }
Пример #2
0
            private static void WriteBeatmapHeader([NotNull] TextWriter writer, Difficulty difficulty,
                                                   [NotNull] string title, [NotNull] string composer, [NotNull] string lyricist, [NotNull] string bg,
                                                   [NotNull] string song, int level, MusicColor color, int bgmVolume, int seVolume)
            {
                writer.WriteLine("#utf8");
                writer.WriteLine("#Title {0}", title);
                writer.WriteLine("#Lyricist {0}", lyricist);
                writer.WriteLine("#Composer {0}", composer);
                writer.WriteLine("#Background {0}", bg);
                writer.WriteLine("#Song {0}", song);
                writer.WriteLine("#Lyrics lyrics.lyr");
                // Using the 240/0 preset as discussed at 2016-10-09. May be updated when a new version of Deleste Viewer is released.
                //writer.WriteLine("#BPM {0:F2}", score.Project.Settings.GlobalBpm);
                //writer.WriteLine("#Offset {0}", (int)Math.Round(score.Project.Settings.StartTimeOffset * 1000));
                writer.WriteLine("#BPM 240");
                // Force offset 0. -40 seems to be a garbage value.
                writer.WriteLine("#Offset 0");

                string s;

                switch (difficulty)
                {
                case Difficulty.Debut:
                case Difficulty.Regular:
                case Difficulty.Pro:
                case Difficulty.Master:
                    s = difficulty.ToString();
                    break;

                case Difficulty.MasterPlus:
                    s = "Master+";
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                writer.WriteLine("#Difficulty {0}", s);

                writer.WriteLine("#Level {0}", level);
                writer.WriteLine("#BGMVolume {0}", bgmVolume);
                writer.WriteLine("#SEVolume {0}", seVolume);

                switch (color)
                {
                case MusicColor.Multicolor:
                    s = "All";
                    break;

                case MusicColor.Cute:
                case MusicColor.Cool:
                case MusicColor.Passion:
                    s = color.ToString();
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(color), color, null);
                }
                writer.WriteLine("#Attribute {0}", s);

                // Use the undocumented "Convert" format for CSV-converted beatmaps.
                writer.WriteLine("#Format Convert");
                writer.WriteLine();
            }