public override void LoadContent() { // Adjust for testing. LevelType levelType = MyGame.Manager.ConfigManager.GlobalConfigData.LevelType; if (LevelType.Test == levelType) { // Load level configuration data. Byte levelNo = Constants.TEST_LEVEL_NUM - 1; MyGame.Manager.LevelManager.LoadLevelConfigData(levelType, levelNo); LevelConfigData levelConfigData = MyGame.Manager.LevelManager.LevelConfigData; levelType = (LevelType)Enum.Parse(typeof(LevelType), levelConfigData.LevelType, true); levelNo = Convert.ToByte(levelConfigData.LevelNo); MyGame.Manager.LevelManager.SetLevelType(levelType); MyGame.Manager.LevelManager.SetLevelNo(levelNo); LevelType = MyGame.Manager.LevelManager.LevelType; LevelIndex = MyGame.Manager.LevelManager.LevelIndex; } else { LevelType = MyGame.Manager.LevelManager.LevelType; LevelIndex = MyGame.Manager.LevelManager.LevelIndex; MyGame.Manager.LevelManager.LoadLevelConfigData(LevelType, LevelIndex); } LevelConfigData = MyGame.Manager.LevelManager.LevelConfigData; // Resets all relevant score level info, MyGame.Manager.ScoreManager.ResetLevel(); // Bullets. MyGame.Manager.BulletManager.Reset(LevelConfigData.BulletMaxim, LevelConfigData.BulletFrame, LevelConfigData.BulletShoot); // Enemies. MyGame.Manager.EnemyManager.Reset(LevelType, LevelConfigData); // Explosions. MyGame.Manager.ExplosionManager.Reset(LevelConfigData.EnemySpawn, LevelConfigData.ExplodeDelay); // Sprites. MyGame.Manager.SpriteManager.Reset(LevelType, MyGame.Manager.LevelManager.LevelNo); levelName = MyGame.Manager.LevelManager.LevelName; levelValu = MyGame.Manager.LevelManager.LevelValu; base.LoadContent(); // Must set this after base load content. enemyTotalText = EnemyTotal.ToString().PadLeft(3, '0'); MyGame.Manager.RenderManager.SetGridDelay(LevelConfigData.GridDelay); MyGame.Manager.StateManager.SetKillSpace(Vector2.Zero); MyGame.Manager.EnemyManager.SpawnAllEnemies(); MyGame.Manager.SpriteManager.LargeTarget.SetHomeSpot(); MyGame.Manager.SoundManager.StopMusic(); SongType songType = MyGame.Manager.SoundManager.GetGameMusic(LevelIndex); MyGame.Manager.SoundManager.PlayGameMusic(songType); }
public static bool BackgroundEnqueue(SongType songtype, string Link, string RequestedBy, string title) { try { IWaveSource source = songtype == SongType.MP3 ? (IWaveSource) new Mp3MediafoundationDecoder(Link) : new AacDecoder(Link); var lenght = source.GetLength().TotalMinutes; if ((source.GetLength().TotalMinutes < Config.MaximumBackgroundInMin || Config.MaximumBackgroundInMin == 0) || Config.Admin == RequestedBy) { ConsoleSender.SendCommand($"{title} was added to the queue", ConsoleSender.Command.Chat); BackGroundQueue.PlayList.Enqueue(new Song(title, source, new User { Name = RequestedBy, Tag = 0 })); return(true); } else { Thread.Sleep(800); ConsoleSender.SendCommand("UwU sowwy butt its nyot possibwe to pway this swong", ConsoleSender.Command.Chat); ConsoleSender.SendCommand($"I can't handwe things that awe longer than {Instance.Config.MaximumBackgroundInMin} minyutes (inches) OwO", ConsoleSender.Command.Chat); return(true); } } catch (Exception e) { Console.WriteLine(e); return(false); } }
public void SwitchSongs(SongType song) { m_Songs[(int)m_SongSelection].enabled = false; m_Songs[(int)song].enabled = true; m_SongSelection = song; PlaySong(); }
public void LoadContent() { // Fonts. String fontsRoot = String.Format("{0}/{1}/", contentRoot, FONTS_DIRECTORY); Assets.EmulogicFont = contentFactory.LoadFont(fontsRoot + "Emulogic"); // Sounds. if (MyGame.Manager.ConfigManager.GlobalConfigData.LoadAudio) { String soundsRoot = String.Format("{0}/{1}/", contentRoot, SOUND_DIRECTORY); Assets.SongDictionary = new Dictionary <SongType, Song>(); for (SongType key = SongType.BossMusic1; key <= SongType.GameTitle; ++key) { String assetName = String.Format("{0}{1}", soundsRoot, key); Song value = contentFactory.LoadSong(assetName); Assets.SongDictionary.Add(key, value); } Assets.SoundEffectDictionary = new Dictionary <SoundEffectType, SoundEffectInstance>(); for (SoundEffectType key = SoundEffectType.Aaargh; key <= SoundEffectType.Wrong; ++key) { String assetName = String.Format("{0}{1}", soundsRoot, key); SoundEffectInstance value = contentFactory.LoadSoundEffectInstance(assetName); Assets.SoundEffectDictionary.Add(key, value); } } // Textures. Assets.SpriteSheet01Texture = contentFactory.LoadTexture(texturesRoot + "spritesheet01-1024"); Assets.SpriteSheet02Texture = contentFactory.LoadTexture(texturesRoot + "spritesheet02-1024"); }
public ActionResult Index(string filter, EntryType searchType = EntryType.Undefined, bool allowRedirect = true, string tag = null, string sort = null, int? artistId = null, ArtistType? artistType = null, DiscType? discType = null, SongType? songType = null, bool? onlyWithPVs = null ) { filter = !string.IsNullOrEmpty(filter) ? filter.Trim() : string.Empty; if (allowRedirect && !string.IsNullOrEmpty(filter)) { var redirectResult = TryRedirect(filter, searchType); if (redirectResult != null) return redirectResult; } ViewBag.Query = filter; ViewBag.SearchType = searchType != EntryType.Undefined ? searchType.ToString() : "Anything"; ViewBag.Tag = tag; ViewBag.Sort = sort; ViewBag.ArtistId = artistId; ViewBag.ArtistType = artistType; ViewBag.DiscType = discType; ViewBag.SongType = songType; ViewBag.OnlyWithPVs = onlyWithPVs; SetSearchEntryType(searchType); return View(); }
/// <summary> /// 获取所有歌曲类型 /// </summary> /// <returns></returns> public List <SongType> GetAllSongType() { List <SongType> types = new List <SongType>(); try { sql = "select id,songType from tb_songTypes"; DataSet ds = DatabaseHelper.GetDataSet(sql); if (ds != null) { DataTable dt = ds.Tables[0]; if (dt != null && dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { SongType t = new SongType(); t.id = Convert.ToInt32(r["id"]); t.songType = r["songType"].ToString(); types.Add(t); } } } } catch (Exception ex) { throw; } return(types); }
public SongQueryParams() { Common = new CommonSearchParams(); IgnoredIds = new int[] {}; Paging = new PagingProperties(0, 30, true); SongTypes = new SongType[] {}; }
public Song(string link) { string tmpLink = link; if (Regex.IsMatch(link, "soundcloud", RegexOptions.IgnoreCase)) { type = SongType.SOUNDCLOUD; songName = "Song from Soundcloud"; } else if (Regex.IsMatch(link, @"^(https?\:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$", RegexOptions.IgnoreCase)) { type = SongType.YOUTUBE_LINK; Thread sn = new Thread(new ThreadStart(delegate() { songName = Utils.getTitleFromYouTube(link); OnPropertyChanged(SongName); })); sn.Start(); } else { type = SongType.INVALID; } Link = tmpLink; }
public SongQueryParams() { ArtistParticipationStatus = ArtistAlbumParticipationStatus.Everything; Common = new CommonSearchParams(); IgnoredIds = new int[] {}; Paging = new PagingProperties(0, 30, true); SongTypes = new SongType[] {}; }
void Start() { //dummy audio source mCurrentSongType = SongType.INGAME; mCurrentBGSong = gameObject.AddComponent <AudioSource>(); FadeBGSoundTo(SongType.MAINMENU); }
public void ChangeSong(SongType type, int id, float fade = 0) { _nextType = type; _nextId = id; _elapsedFade = 0; _fade = fade; }
/// <summary> /// Tests if a particular tag is redundant for a song and should be skipped from automatic mapping. /// </summary> public bool TagIsRedundantForSong(SongType songType, int tagId, IEntryTypeTagRepository specialTags) { if (tagId == specialTags.SongTypeTagId(songType)) { return(true); } return(false); }
public PlaylistItem(string title, string cid, string songId, SongType songType, string songTitle, int duration, string author) : this() { Title = title; SongId = songId; SongType = songType; SongTitle = songTitle; Duration = duration; Author = author; Cid = cid; }
public SearchRouteParams Songs( int? artistId = null, SongType? songType = null, object sort = null, string tag = null) { return new SearchRouteParams(EntryType.Song) { artistId = artistId, songType = songType, sort = sort, tag = tag, }; }
/// <param name="query">Query search string. Can be null or empty, in which case no filtering by name is done.</param> /// <param name="songTypes">Allowed song types. Can be null or empy, in which case no filtering by song type is done.</param> /// <param name="start">0-based order number of the first item to be returned.</param> /// <param name="maxResults">Maximum number of results to be returned.</param> /// <param name="draftsOnly">Whether to return only entries with a draft status.</param> /// <param name="getTotalCount">Whether to return the total number of entries matching the criteria.</param> /// <param name="nameMatchMode">Mode for name maching. Ignored when query string is null or empty.</param> /// <param name="sortRule">Sort rule for results.</param> /// <param name="onlyByName">Whether to search items only by name, and not for example NicoId. Ignored when query string is null or empty.</param> /// <param name="moveExactToTop">Whether to move exact match to the top of search results.</param> /// <param name="ignoredIds">List of entries to be ignored. Can be null in which case no filtering is done.</param> public SongQueryParams(string query, SongType[] songTypes, int start, int maxResults, bool draftsOnly, bool getTotalCount, NameMatchMode nameMatchMode, SongSortRule sortRule, bool onlyByName, bool moveExactToTop, int[] ignoredIds) { Common = new CommonSearchParams(query, draftsOnly, nameMatchMode, onlyByName, moveExactToTop); Paging = new PagingProperties(start, maxResults, getTotalCount); SongTypes = songTypes; SortRule = sortRule; IgnoredIds = ignoredIds; TimeFilter = TimeSpan.Zero; OnlyWithPVs = false; }
public void PlayBackgroundSong(SongType song) { switch (song) { case SongType.TitleScreen: audioSource.clip = titleScreenSong; break; case SongType.Game: audioSource.clip = gameSong; break; case SongType.End: audioSource.clip = endSong; break; } audioSource.Play(); }
public void SongStop(SongType songType, int songNumber) { switch (songType) { case SongType.Dance: danceLoops[songNumber - 1].volume = 0; break; case SongType.Hiphop: hiphopLoops[songNumber - 1].volume = 0; break; } }
public void TrackActive(SongType songType, int songNumber, bool active) { switch (songType) { case SongType.Dance: danceActive[songNumber - 1] = active; break; case SongType.Hiphop: hiphopActive[songNumber - 1] = active; break; } }
/// <summary> /// Tests if a particular tag is redundant for a song and should be skipped from automatic mapping. /// </summary> public bool TagIsRedundantForSong(SongType songType, int tagId, ISpecialTags specialTags) { if (songType == SongType.Cover && tagId == specialTags.Cover) { return(true); } if (songType == SongType.Remix && tagId == specialTags.Remix) { return(true); } return(false); }
private void RunParseTitle(string nicoTitle, string expectedTitle = null, SongType? expectedSongType = null, params string[] artists) { var result = CallParseTitle(nicoTitle); if (expectedTitle != null) Assert.AreEqual(expectedTitle, result.Title, "title"); if (expectedSongType.HasValue) Assert.AreEqual(expectedSongType.Value, result.SongType, "song type"); if (artists != null) AssertArtists(result, artists); }
public MusicPlayer(Game game) { this.songs = new Dictionary <SongType, Song> { { SongType.upbeat1, game.Content.Load <Song>("res/music/cwby1") }, { SongType.upbeat2, game.Content.Load <Song>("res/music/cwby2") }, { SongType.upbeat3, game.Content.Load <Song>("res/music/cwby4") }, }; this.currentSong = (SongType)(-1); MediaPlayer.IsRepeating = true; MediaPlayer.Volume = 0.75f; }
public static ContentFocus GetContentFocus(SongType songType) { switch (songType) { case SongType.DramaPV: case SongType.MusicPV: return(ContentFocus.Video); case SongType.Illustration: return(ContentFocus.Illustration); default: return(ContentFocus.Music); } }
public override void LoadContent() { const UInt16 gapDelay = 660; // good guess deltaY = startY - titleY; deltaY = gapDelay / deltaY; moverPosition = startPosition; //coolMusic = MyGame.Manager.ConfigManager.GlobalConfigData.CoolMusic; coolMusic = MyGame.Manager.StateManager.CoolMusic; SongType song = coolMusic ? SongType.CoolMusic : SongType.GameTitle; MyGame.Manager.SoundManager.PlayMusic(song, false); index = 0; base.LoadContent(); }
public void PlayMusic(SongType key, Boolean isRepeating) { if (null == Assets.SongDictionary) { return; } Song song = Assets.SongDictionary[key]; if (null == song) { return; } SetVolume(); soundFactory.PlayMusic(song, isRepeating); }
private AudioClip getAudioClip(SongType songType) { switch (songType) { case SongType.Regular: return(Resources.Load <AudioClip>("Songs/general_" + Random.Range(1, 3))); case SongType.Chill: return(Resources.Load <AudioClip>("Songs/chill_" + Random.Range(1, 3))); case SongType.Pump: return(Resources.Load <AudioClip>("Songs/pump_" + Random.Range(1, 3))); default: throw new ArgumentOutOfRangeException(nameof(songType), songType, null); } }
public Index(PartialFindResult<SongWithAlbumAndPVsContract> result, string filter, NameMatchMode nameMatchMode, SongType songType, string timeFilter, bool onlyWithPVs, SongSortRule sortRule, SongViewMode viewMode, bool draftsOnly, int page, int pageSize, IndexRouteParams routeParams) { ArtistId = routeParams.artistId ?? 0; DraftsOnly = draftsOnly; Songs = new StaticPagedList<SongWithAlbumAndPVsContract>(result.Items, page, pageSize, result.TotalCount); Filter = filter; NameMatchMode = nameMatchMode; SongType = songType; Since = timeFilter; OnlyWithPVs = onlyWithPVs; Sort = sortRule; ViewMode = viewMode; RouteParams = routeParams; }
public Index(PartialFindResult <SongWithAlbumAndPVsContract> result, string filter, NameMatchMode nameMatchMode, SongType songType, string timeFilter, bool onlyWithPVs, SongSortRule sortRule, SongViewMode viewMode, bool draftsOnly, int page, int pageSize, IndexRouteParams routeParams) { ArtistId = routeParams.artistId ?? 0; DraftsOnly = draftsOnly; Songs = new StaticPagedList <SongWithAlbumAndPVsContract>(result.Items, page, pageSize, result.TotalCount); Filter = filter; NameMatchMode = nameMatchMode; SongType = songType; Since = timeFilter; OnlyWithPVs = onlyWithPVs; Sort = sortRule; ViewMode = viewMode; RouteParams = routeParams; }
public override void LoadContent() { base.LoadContent(); MyGame.Manager.RenderManager.SetGridDelay(LevelConfigData.GridDelay); MyGame.Manager.ScoreManager.ResetTimer(); // Resume screen cannot die not matter what! Invincibile = true; NextScreen = CurrScreen; timer = 0; flag = true; MyGame.Manager.SoundManager.StopMusic(); SongType songType = MyGame.Manager.SoundManager.GetGameMusic(LevelIndex); MyGame.Manager.SoundManager.PlayGameMusic(songType); }
public void LoadScene(int songIndexUncategorized, SongType songType) { Debug.Log("Scene loaded with index: " + songIndexUncategorized.ToString()); switch (songType) { case SongType.Dance: //Debug.Log("Setting Dance index"); songIndex = songIndexUncategorized - 1; break; case SongType.Hiphop: songIndex = songIndexUncategorized + 3; break; } //Debug.Log("Does this ever get here?"); activeSong = songObjects[songIndex]; currentSongType = songType; }
/** * @brief Updates the @link Song::SongType type of Song@endlink that the Song is. */ private void UpdateSongType() { if (mNumDrumNotes > 0 && mNumMusicalNotes > 0) { mType = SongType.CombinedMelodyAndPercussion; } else if (mNumMusicalNotes > 0) { mType = SongType.Melody; } else if (mNumDrumNotes > 0) { mType = SongType.DrumLoop; } else { mType = SongType.Empty; } }
public bool NextSong() { //Checks if the next song is the tutorial (last index). If so, returns false, otherwise, puts the next song in memory and returns true Debug.Log("Loading Next song"); if (songIndex == 7) { Debug.Log("Last Song. Go to Main Menu"); return(false); } else { songIndex++; activeSong = songObjects[songIndex]; if (songIndex == 4) { currentSongType = SongType.Hiphop; } return(true); } }
public void Update(Minijam32 game) { if (!isMuted && PlayerDataManager.isDead) { isMuted = true; MediaPlayer.Stop(); SoundPlayer.PlaySound(SoundPlayer.Type.GameOverLick); } if (game.screenPool.screenState == ScreenPool.ScreenState.Playing) { SongType shouldBePlaying = (SongType)(((game.levelData.currentLevelId - 1) % 3)); if (shouldBePlaying != this.currentSong) { this.currentSong = shouldBePlaying; MediaPlayer.Play(this.songs[this.currentSong]); } } }
public void FadeBGSoundTo(SongType inSongType) { if (mCurrentSongType != inSongType) { mCurrentSongType = inSongType; AudioClip nextSong = BGSounds[0]; if (inSongType == SongType.INGAME) { nextSong = BGSounds[1]; } mNextBGSong = gameObject.AddComponent <AudioSource>(); mNextBGSong.clip = nextSong; mNextBGSong.loop = true; mNextBGSong.volume = 0.0f; mNextBGSong.mute = !toggleMusic; mNextBGSong.Play(); StartCoroutine(FadeAudioSources()); } }
public PartialFindResult <SongForApiContract> GetList( string query = "", SongType songTypes = SongType.Unspecified, string tag = null, int?artistId = null, ArtistAlbumParticipationStatus artistParticipationStatus = ArtistAlbumParticipationStatus.Everything, bool childVoicebanks = false, bool onlyWithPvs = false, int?since = null, [FromUri] ContentLanguageSelections?lyrics = null, int?userCollectionId = null, EntryStatus?status = null, int start = 0, int maxResults = defaultMax, bool getTotalCount = false, SongSortRule sort = SongSortRule.Name, NameMatchMode nameMatchMode = NameMatchMode.Exact, SongOptionalFields fields = SongOptionalFields.None, ContentLanguagePreference lang = ContentLanguagePreference.Default) { query = FindHelpers.GetMatchModeAndQueryForSearch(query, ref nameMatchMode); var types = songTypes != SongType.Unspecified ? new[] { songTypes } : new SongType[0]; var param = new SongQueryParams(query, types, start, Math.Min(maxResults, absoluteMax), false, getTotalCount, nameMatchMode, sort, false, false, null) { Tag = tag, OnlyWithPVs = onlyWithPvs, ArtistId = artistId ?? 0, ArtistParticipationStatus = artistParticipationStatus, ChildVoicebanks = childVoicebanks, TimeFilter = since.HasValue ? TimeSpan.FromHours(since.Value) : TimeSpan.Zero, LyricsLanguages = lyrics != null?lyrics.Value.ToIndividualSelections().ToArray() : null, UserCollectionId = userCollectionId ?? 0 }; param.Common.EntryStatus = status; var artists = service.Find(s => new SongForApiContract(s, null, lang, fields), param); return(artists); }
internal static async Task Add(ulong User, Queue <string> Args) { var Types = new SongType[SearchTypes.Length]; SearchTypes.CopyTo(Types, 0); var Words = Args.ToArray(); if (Words.Length > 2 && Words[Words.Length - 2] == "from") { var Source = Words[Words.Length - 1]; foreach (var Type in Types) { if (Type.ToString() == Source) { Types = new[] { Type }; Array.Resize(ref Words, Words.Length - 2); break; } } } var Text = string.Join(" ", Words); Logger.Log("Adding music (voice): " + Text); var Music = await SongRequest.Search(Text, Types, true); if (Music.Count != 0) { var Playing = Streamer.Queue.IsPlaying; var Place = Streamer.Queue.Enqueue(Music[0]); Logger.Log($"Added {Music[0].Title} at {Place}"); if (Playing) { Formatting.Update($"Added {Music[0].Title} at {Place}"); } } }
public Song(string link) { string tmpLink = link; if (Regex.IsMatch(link, "soundcloud", RegexOptions.IgnoreCase)) { type = SongType.SOUNDCLOUD; songName = "Song from Soundcloud"; } else if (Regex.IsMatch(link, @"^(https?\:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$", RegexOptions.IgnoreCase)) { type = SongType.YOUTUBE_LINK; Thread sn = new Thread(new ThreadStart(delegate () { songName = Utils.getTitleFromYouTube(link); OnPropertyChanged(SongName); })); sn.Start(); } else { type = SongType.INVALID; } Link = tmpLink; }
public PartialFindResult<SongForApiContract> GetList( string query = "", SongType songTypes = SongType.Unspecified, string tag = null, int? artistId = null, ArtistAlbumParticipationStatus artistParticipationStatus = ArtistAlbumParticipationStatus.Everything, bool childVoicebanks = false, bool onlyWithPvs = false, int? since = null, [FromUri] ContentLanguageSelections? lyrics = null, int? userCollectionId = null, EntryStatus? status = null, int start = 0, int maxResults = defaultMax, bool getTotalCount = false, SongSortRule sort = SongSortRule.Name, NameMatchMode nameMatchMode = NameMatchMode.Exact, SongOptionalFields fields = SongOptionalFields.None, ContentLanguagePreference lang = ContentLanguagePreference.Default) { query = FindHelpers.GetMatchModeAndQueryForSearch(query, ref nameMatchMode); var types = songTypes != SongType.Unspecified ? new[] { songTypes } : new SongType[0]; var param = new SongQueryParams(query, types, start, Math.Min(maxResults, absoluteMax), false, getTotalCount, nameMatchMode, sort, false, false, null) { Tag = tag, OnlyWithPVs = onlyWithPvs, ArtistId = artistId ?? 0, ArtistParticipationStatus = artistParticipationStatus, ChildVoicebanks = childVoicebanks, TimeFilter = since.HasValue ? TimeSpan.FromHours(since.Value) : TimeSpan.Zero, LyricsLanguages = lyrics != null ? lyrics.Value.ToIndividualSelections().ToArray() : null, UserCollectionId = userCollectionId ?? 0 }; param.Common.EntryStatus = status; var artists = service.Find(s => new SongForApiContract(s, null, lang, fields), param); return artists; }
void RandomSongType(SongType type) { switch (type) { case SongType.LOW: PlaySong(Random.Range(0, 3)); break; case SongType.MIDDLE: PlaySong(Random.Range(4, 7)); break; case SongType.HIGH: PlaySong(Random.Range(8, 9)); break; default: break; } }
public NicoTitleParseResult(string title, Artist[] artistNames, SongType songType) { ArtistNames = artistNames; Title = title; SongType = songType; }
public static bool IsAnimation(SongType songType) { return (songType == SongType.DramaPV || songType == SongType.MusicPV); }