public void UpdateSelectedSongOption(SongOption newOption) { if (selectedSongOption != null && selectedSongOption != newOption) { selectedSongOption.UnSelectOption(); } selectedSongOption = newOption; }
public void Build(SongOption songOption) { Task.Run(() => { BildSong(songOption); IsFinished = true; builder = null; Console.WriteLine("Finished build: " + ID); }); }
public int Build(SongOption songOption) { AllowCORS(); lastID++; BuilderTask task = new BuilderTask() { ID = lastID, FilePath = FilePath }; task.Build(songOption); taskList.Add(task); return(task.ID); }
private void BildSong(SongOption songOption) { //Generate the melody AutogenratedSong song = new AutogenratedSong(songOption); song.Generate(); //Create wave file builder and register event for progressbar builder = new WaveFileBuilder(); //Dependency Injection (Setter Injection) song.SetBuilder(builder); //Generate the wave file song.Build(Path.Combine(FilePath, ID.ToString() + ".wav")); }
private void populateSongOptions() { foreach (var songPath in Directory.GetDirectories(songsPath)) { string songName = findSongName(songPath); string songId = findSongId(songPath); string thumbnailPath = Directory.GetFiles(songPath, "*.jpg")[0]; SongOption newOption = Instantiate(songOption_p); newOption.Title = songName; newOption.SetImage(thumbnailPath); newOption.transform.SetParent(songOptionsParent); newOption.SongId = songId; newOption.GetComponent <RectTransform>().localScale = Vector3.one; activeSongOptions.Add(newOption); } }