コード例 #1
0
        private static async Task CreateLists(int mapCount, int playlistSize, IEnumerable <string> idList, CatType catType)
        {
            IEnumerable <Task> tasks = Enumerable.Range(0, (int)Math.Ceiling(mapCount / (double)playlistSize))
                                       .Select(i => CreateBeatMapPlaylist(mapCount, playlistSize, idList, catType, i));

            await Task.WhenAll(tasks);

            ProcessedBeatmapNotifier.SendNotification($"Playlist size: {playlistSize}, Category: {catType}, finished");
        }
        public async void CreatePlaylistOnClick()
        {
            LoadLoggingScene();

            ProcessedBeatmapNotifier.SendNotification("Beatmap processing started...");
            await PlaylistCreator.CreateAllLists(this.beatmapCount, this.playlistSize, this.catType);

            ProcessedBeatmapNotifier.SendNotification("All beatmaps processed.");
            BeatmapLog.SaveLog();
            ProcessedBeatmapNotifier.SendNotification("You can view all new beatmaps in the log.");
        }
コード例 #3
0
        public async void OnClick()
        {
            LoadLoggingScene();

            ProcessedBeatmapNotifier.SendNotification("Calculating max beatmap count...");

            ProcessedBeatmapNotifier.SendNotification("Beatmap processing started...");
            await CreateAllPlaylistCreators(CurrentBeatmapCount.CurrentMapCount);

            ProcessedBeatmapNotifier.SendNotification("All beatmaps processed.");
            BeatmapLog.SaveLog();
            ProcessedBeatmapNotifier.SendNotification("You can view all new beatmaps in the log.");
        }
コード例 #4
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="BeatMapPlaylist" /> class.
        /// </summary>
        /// <param name="image"> The data of the jpg to be saved. </param>
        /// <param name="songs"> All Song id's. </param>
        /// <param name="fileNumber"> The playlist number. </param>
        /// <param name="playlistSize"> The amount of maps per file. </param>
        /// <param name="catType"> The category type. </param>
        public BeatMapPlaylist(byte[] image, IEnumerable <HashBase> songs, int fileNumber, int playlistSize, CatType catType)
        {
            this.playlistTitle  = $"{catType} Part{fileNumber}";
            this.image          = Base64ImagePrefix + Convert.ToBase64String(image);
            this.songs          = songs;
            this.playlistAuthor = "Rubiksmaster02";

            string path = $"Playlists/BeatmapSize{playlistSize}/{catType}/";

            Directory.CreateDirectory(path);

            path += $"{catType} part{fileNumber}";

            if (Options.Default.UseOutputImage)
            {
                File.WriteAllBytes(path + ".jpg", image);
            }

            File.WriteAllText(path + ".bplist", JsonConvert.SerializeObject(this, Formatting.Indented));

            ProcessedBeatmapNotifier.SendNotification(
                $"Playlist size: {playlistSize}, Category: {catType}, File number: {fileNumber}, has been processed.");
        }