public override int GetHashCode() { unchecked { var hashCode = TrackId; hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Artist != null ? Artist.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AlbumArtist != null ? AlbumArtist.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Composer != null ? Composer.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Album != null ? Album.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Genre != null ? Genre.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Kind != null ? Kind.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Size.GetHashCode(); hashCode = (hashCode * 397) ^ (PlayingTime != null ? PlayingTime.GetHashCode() : 0); hashCode = (hashCode * 397) ^ TrackNumber.GetHashCode(); hashCode = (hashCode * 397) ^ Year.GetHashCode(); hashCode = (hashCode * 397) ^ DateModified.GetHashCode(); hashCode = (hashCode * 397) ^ DateAdded.GetHashCode(); hashCode = (hashCode * 397) ^ BitRate.GetHashCode(); hashCode = (hashCode * 397) ^ SampleRate.GetHashCode(); hashCode = (hashCode * 397) ^ PlayCount.GetHashCode(); hashCode = (hashCode * 397) ^ PlayDate.GetHashCode(); hashCode = (hashCode * 397) ^ PartOfCompilation.GetHashCode(); return(hashCode); } }
public ActionResult _Playcount(string ID) { IndexViewModel invm = new IndexViewModel(); PlayCount pc = new PlayCount(); var id = Convert.ToInt32(ID); var Song = db.TrackLists.FirstOrDefault(x => x.ID == id); if (db.PlayCounts.Any(x => x.TrackListID == id)) { PlayCount existingPlayCount = db.PlayCounts.FirstOrDefault(x => x.TrackListID == id); existingPlayCount.SongPlayCount = existingPlayCount.SongPlayCount + 1; db.SaveChanges(); } else { pc.TrackListID = id; pc.SongPlayCount = 1; db.PlayCounts.Add(pc); db.SaveChanges(); } // var song = db. return(Json(new { success = true })); }
/// <summary> /// 使用一定的格式构造一个字符串 /// </summary> /// <param name="format"></param> /// <param name="formatProvider"></param> /// <returns></returns> public string ToString(string format, IFormatProvider formatProvider) { var b = new StringBuilder(format); b.Replace("username", UserName); b.Replace("userid", UserId.ToString()); b.Replace("mode", _mode.ToString()); b.Replace("pp", Pp.ToString(CultureInfo.InvariantCulture)); b.Replace("globalrank", GlobalRank.ToString()); b.Replace("countryrank", CountryRank.ToString()); b.Replace("cssh", SshCount.ToString()); b.Replace("csh", ShCount.ToString()); b.Replace("css", SsCount.ToString()); b.Replace("cs", SCount.ToString()); b.Replace("ca", ACount.ToString()); b.Replace("acc", $"{Accuracy:f2}%"); b.Replace("rankedscore", RankedScore.ToString(CultureInfo.InvariantCulture)); b.Replace("totalscore", TotalScore.ToString(CultureInfo.InvariantCulture)); b.Replace("playcount", PlayCount.ToString()); b.Replace("level", Level.ToString(CultureInfo.InvariantCulture)); b.Replace("countrycn", GetCountryInCn(Country)); b.Replace("country", Country); b.Replace("joindate", JoinDate.ToString("yyyy/MM/dd HH:mm:ss")); return(b.ToString()); }
public void switchScene() { // キーボードでシーン切り替え PlayCount playCount = GameObject.Find("Screen/PlayCount").GetComponent <PlayCount>(); playCount.increasePlayNum(); GameObject.Find("SoundBox").GetComponent <SoundController>().SoundSE(); GameObject.Find("FadeSystem").GetComponent <Fade>().LoadLevel(nextSceneName, 1f); }
public void SceneTrans() // シーン切り替え プレイ回数を1つ増やす { PlayCount playCount = GameObject.Find("Screen/PlayCount").GetComponent <PlayCount>(); sceneTransFlag = true; playCount.increasePlayNum(); GameObject.Find("SoundBox").GetComponent <SoundController>().SoundSE(); GameObject.Find("FadeSystem").GetComponent <Fade>().LoadLevel("Main", 1f); }
public override int GetHashCode() { var hash = Rater.GetHashCode(); hash ^= RawRating.GetHashCode(); hash ^= PlayCount.GetHashCode(); hash ^= Dance?.Name.GetHashCode() ?? 0; return(hash); }
public void TimeSet() { PlayCount playCount = new PlayCount(); if (GameData.sTime == 0) { GameData.sTime = int.Parse(playCount.FixTimeStr(System.DateTime.Now.Month) + playCount.FixTimeStr(System.DateTime.Now.Day) + playCount.FixTimeStr(System.DateTime.Now.Hour) + playCount.FixTimeStr(System.DateTime.Now.Minute) + playCount.FixTimeStr(System.DateTime.Now.Second)); } }
/// <summary> /// Returns a string field /// </summary> /// <param name="name">Name of field</param> /// <returns></returns> public string this[string name] { get { switch (name.ToLower()) { case "title": return(Title); case "artist": return(Artist); case "album": return(Album); case "genre": return(Genre); case "rating": return(RatingString); case "length": return(LengthString); case "play count": return(PlayCount.ToString()); case "date added": return(DateAdded.ToShortTimeString()); case "last played": return(LastPlayed.ToShortDateString()); case "track number": return(TrackNumber.ToString()); case "disc number": return(DiscNumber.ToString()); default: return(null); } } }
protected override void Render(HtmlTextWriter output) { StringBuilder sb = new StringBuilder("<OBJECT ID='" + this.ClientID + "' name='" + this.ClientID + "' " + "CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'" + "VIEWASTEXT" + "height=" + Height + " " + "width=" + Width + ">"); //Render properties as object parameters sb.Append("<PARAM name='URL' value='" + FileName + "'>"); sb.Append("<PARAM name='mute' value='" + Mute.ToString() + "'>"); sb.Append("<PARAM name='AutoStart' value='" + Autostart.ToString() + "'>"); sb.Append("<PARAM name='balance' value='" + Balance + "'>"); sb.Append("<PARAM name='enabled' value='" + Enabled.ToString() + "'>"); sb.Append("<PARAM name='fullScreen' value='" + Fullscreen.ToString() + "'>"); sb.Append("<PARAM name='playCount' value='" + PlayCount.ToString() + "'>"); if (Volume >= 0) { sb.Append("<PARAM name='volume' value='" + Volume + "'>"); } sb.Append("<PARAM name='rate' value='" + Rate + "'>"); sb.Append("<PARAM name='StretchToFit' value='" + StretchToFit.ToString() + "'>"); sb.Append("<PARAM name='enabledContextMenu' value='" + EnableContextMenu.ToString() + "'>"); //output ending object tag sb.Append("</OBJECT>"); //flush everything to the output stream output.Write(sb.ToString()); }
public string WriteMsg() { UserData = ""; UserData += SerialNumber.ToString("X").PadLeft(4, '0'); UserData += SendTime.ToString("yyMMddHHmmss").PadLeft(12, '0'); if (PlayCount < 1) { PlayCount = 1; } if (PlayCount > 255) { PlayCount = 255; } UserData += PlayCount.ToString("X").PadLeft(2, '0'); if (PlayRole < 1) { PlayRole = 1; } if (PlayRole > 15) { PlayRole = 15; } if (PlaySpeed < 1) { PlaySpeed = 1; } if (PlaySpeed > 15) { PlaySpeed = 15; } UserData += PlaySpeed.ToString("X") + PlayRole.ToString("X"); if (PlayContext.Length > 400) { PlayContext = PlayContext.Substring(0, 400); } UserData += HexStringUtility.StrToHexString(PlayContext.Trim()); UserDataBytes = HexStringUtility.HexStringToByteArray(UserData); return(WriteMsgBase()); }
/// <summary> /// Initializes a new instance of the <see cref="FrameContainer"/> class. /// </summary> internal FrameContainer() { _frameBinder = new FrameBinder(this); _unknownFrames = new List <UnknownFrame>(); _id3v24SingleOccurrenceFrames = new Dictionary <string, IFrame>(); _id3v24MultipleOccurrenceFrames = new Dictionary <string, IBindingList>(); _id3v23SingleOccurrenceFrames = new Dictionary <string, IFrame>(); _id3v23MultipleOccurrenceFrames = new Dictionary <string, IBindingList>(); _id3v22SingleOccurrenceFrames = new Dictionary <string, IFrame>(); _id3v22MultipleOccurrenceFrames = new Dictionary <string, IBindingList>(); _id3v24FrameAliases = new Dictionary <string, string>(); _id3v23FrameAliases = new Dictionary <string, string>(); // Binding lists m_AttachedPictureList = new AttachedPictureBindingList(); m_UserDefinedUrlList = new UserDefinedUrlBindingList(); m_CommentsList = new CommentsBindingList(); m_iTunesCommentsList = new CommentsBindingList(); m_CommercialInfoUrlList = new UrlBindingList("WCOM", "WCOM", "WCM"); m_ArtistUrlList = new UrlBindingList("WOAR", "WOAR", "WAR"); m_UserDefinedTextList = new UserDefinedTextBindingList(); m_RelativeVolumeAdjustmentList = new RelativeVolumeAdjustmentBindingList(); m_UnsynchronizedLyricsList = new UnsynchronizedLyricsBindingList(); m_GeneralEncapsulatedObjectList = new GeneralEncapsulatedObjectBindingList(); m_UniqueFileIdentifierList = new UniqueFileIdentifierBindingList(); m_PrivateFrameList = new PrivateFrameBindingList(); m_PopularimeterList = new PopularimeterBindingList(); m_TermsOfUseList = new TermsOfUseBindingList(); m_LinkedInformationList = new LinkedInformationBindingList(); m_CommercialInfoList = new CommercialBindingList(); m_EncryptionMethodList = new EncryptionMethodBindingList(); m_GroupIdentificationList = new GroupIdentificationBindingList(); m_SignatureList = new SignatureBindingList(); m_AudioEncryptionList = new AudioEncryptionBindingList(); m_EncryptedMetaFrameList = new EncryptedMetaFrameBindingList(); m_SynchronizedLyricsList = new SynchronizedTextBindingList(); m_EqualizationList = new EqualizationListBindingList(); m_AudioTextList = new AudioTextBindingList(); // Add binding lists to multiple occurence frames dictionary AddMultipleOccurrenceFrame("APIC", "APIC", "PIC", m_AttachedPictureList); AddMultipleOccurrenceFrame("WXXX", "WXXX", "WXX", m_UserDefinedUrlList); AddMultipleOccurrenceFrame("COMM", "COMM", "COM", m_CommentsList); AddMultipleOccurrenceFrame(null, null, null, m_iTunesCommentsList); AddMultipleOccurrenceFrame("WCOM", "WCOM", "WCM", m_CommercialInfoUrlList); //"CommercialInfoUrl", new MethodInvoker(ValidateCommercialInfoUrl)); // TODO AddMultipleOccurrenceFrame("WOAR", "WOAR", "WAR", m_ArtistUrlList); AddMultipleOccurrenceFrame("TXXX", "TXXX", "TXX", m_UserDefinedTextList); AddMultipleOccurrenceFrame("RVA2", "RVAD", "RVA", m_RelativeVolumeAdjustmentList); AddMultipleOccurrenceFrame("USLT", "USLT", "ULT", m_UnsynchronizedLyricsList); AddMultipleOccurrenceFrame("GEOB", "GEOB", "GEO", m_GeneralEncapsulatedObjectList); AddMultipleOccurrenceFrame("UFID", "UFID", "UFI", m_UniqueFileIdentifierList); AddMultipleOccurrenceFrame("PRIV", "PRIV", null, m_PrivateFrameList); AddMultipleOccurrenceFrame("POPM", "POPM", "POP", m_PopularimeterList); AddMultipleOccurrenceFrame("USER", "USER", null, m_TermsOfUseList); AddMultipleOccurrenceFrame("LINK", "LINK", "LNK", m_LinkedInformationList); //"ArtistUrl", new MethodInvoker(ValidateArtistUrl)); // TODO AddMultipleOccurrenceFrame("AENC", "AENC", "CRA", m_AudioEncryptionList); AddMultipleOccurrenceFrame(null, null, "CRM", m_EncryptedMetaFrameList); // replaced in ID3v2.3 and ID3v2.4 with encryptable frames AddMultipleOccurrenceFrame("SYLT", "SYLT", "SLT", m_SynchronizedLyricsList); AddMultipleOccurrenceFrame("EQU2", "EQUA", "EQU", m_EqualizationList); // todo: not a multi-occur frame in 2.2/2.3 AddMultipleOccurrenceFrame("COMR", "COMR", null, m_CommercialInfoList); // todo: not a multi-occur in 2.3 AddMultipleOccurrenceFrame("ENCR", "ENCR", null, m_EncryptionMethodList); AddMultipleOccurrenceFrame("GRID", "GRID", null, m_GroupIdentificationList); AddMultipleOccurrenceFrame("SIGN", "SIGN", null, m_SignatureList); // todo: not in ID3v2.3 AddMultipleOccurrenceFrame("ATXT", "ATXT", null, m_AudioTextList); // Text frames m_Title = CreateTextFrame("TIT2", "TIT2", "TT2", "Title", null); m_Album = CreateTextFrame("TALB", "TALB", "TAL", "Album", null); m_EncodedByWho = CreateTextFrame("TENC", "TENC", "TEN", "EncodedByWho", null); m_Artist = CreateTextFrame("TPE1", "TPE1", "TP1", "Artist", null); m_AlbumArtist = CreateTextFrame("TPE2", "TPE2", "TP2", "AlbumArtist", null); // Note: TYER is not a valid frame in ID3v2.4, but many ID3v2.4 tags contain this frame anyway. // It's here to allow reading, but should not be written back (use TDRL instead). m_Year = CreateTextFrame("TYER", "TYER", "TYE", "Year", ValidateYear); // Note: TDAT is not a valid frame in ID3v2.4, but many ID3v2.4 tags contain this frame anyway. // It's here to allow reading, but should not be written back (use TDRC instead). m_DateRecorded = CreateTextFrame("TDAT", "TDAT", "TDA", "DateRecorded", ValidateDateRecorded); // Note: TIME is not a valid frame in ID3v2.4, but many ID3v2.4 tags contain this frame anyway. // It's here to allow reading, but should not be written back (use TDRC instead). m_TimeRecorded = CreateTextFrame("TIME", "TIME", "TIM", "TimeRecorded", ValidateTimeRecorded); m_Genre = CreateTextFrame("TCON", "TCON", "TCO", "Genre", null); m_Composer = CreateTextFrame("TCOM", "TCOM", "TCM", "Composer", null); m_OriginalArtist = CreateTextFrame("TOPE", "TOPE", "TOA", "OriginalArtist", null); m_Copyright = CreateTextFrame("TCOP", "TCOP", "TCR", "Copyright", ValidateCopyright); m_RemixedBy = CreateTextFrame("TPE4", "TPE4", "TP4", "RemixedBy", null); m_Publisher = CreateTextFrame("TPUB", "TPUB", "TPB", "Publisher", null); m_InternetRadioStationName = CreateTextFrame("TRSN", "TRSN", null, "InternetRadioStationName", null); m_InternetRadioStationOwner = CreateTextFrame("TRSO", "TRSO", null, "InternetRadioStationOwner", null); //m_Accompaniment = CreateTextFrame("TPE2", "TPE2", "TP2", "Accompaniment", null); m_Conductor = CreateTextFrame("TPE3", "TPE3", "TP3", "Conductor", null); m_Lyricist = CreateTextFrame("TEXT", "TEXT", "TXT", "Lyricist", null); m_OriginalLyricist = CreateTextFrame("TOLY", "TOLY", "TOL", "OriginalLyricist", null); m_TrackNumber = CreateTextFrame("TRCK", "TRCK", "TRK", "TrackNumber", ValidateTrackNumber); m_BPM = CreateTextFrame("TBPM", "TBPM", "TBP", "BPM", ValidateBPM); m_FileType = CreateTextFrame("TFLT", "TFLT", "TFT", "FileType", null); m_DiscNumber = CreateTextFrame("TPOS", "TPOS", "TPA", "DiscNumber", ValidateDiscNumber); m_EncoderSettings = CreateTextFrame("TSSE", "TSSE", "TSS", "EncoderSettings", null); m_ISRC = CreateTextFrame("TSRC", "TSRC", "TRC", "ISRC", ValidateISRC); // Note: TCMP/TCP is an unofficial frame. Used by iTunes and other taggers. m_IsPartOfCompilation = CreateTextFrame("TCMP", "TCMP", "TCP", "IsPartOfCompilation", null); // TDRL is not technically supported in ID3v2.3 m_ReleaseTimestamp = CreateTextFrame("TDRL", "TDRL", null, "ReleaseTimestamp", ValidateReleaseTimestamp); // TDRC is not technically supported in ID3v2.3 m_RecordingTimestamp = CreateTextFrame("TDRC", "TDRC", null, "RecordingTimestamp", ValidateRecordingTimestamp); // TDOR is not technically supported in ID3v2.3 m_OriginalReleaseTimestamp = CreateTextFrame("TDOR", "TDOR", null, "OriginalReleaseTimestamp", null /*todo:new MethodInvoker(ValidateOriginalReleaseTimestamp)*/); m_PlaylistDelayMilliseconds = CreateTextFrame("TDLY", "TDLY", "TDY", "PlaylistDelayMilliseconds", null); m_InitialKey = CreateTextFrame("TKEY", "TKEY", "TKE", "InitialKey", null /*TODO: new MethodInvoker(ValidateInitialKey)*/); // TDEN is not technically supported in ID3v2.3 m_EncodingTimestamp = CreateTextFrame("TDEN", "TDEN", null, "EncodingTimestamp", null /*TODO*/); // TDTG is not technically supported in ID3v2.3 m_TaggingTimestamp = CreateTextFrame("TDTG", "TDTG", null, "TaggingTimestamp", null /*TODO*/); m_ContentGroup = CreateTextFrame("TIT1", "TIT1", "TT1", "ContentGroup", null); // TMOO is not technically supported in ID3v2.3 m_Mood = CreateTextFrame("TMOO", "TMOO", null, "Mood", null); m_LengthMilliseconds = CreateTextFrame("TLEN", "TLEN", "TLE", "LengthMilliseconds", null); m_MediaType = CreateTextFrame("TMED", "TMED", "TMT", "MediaType", null); // TODO: technically not supported in ID3v2.4, but probably written by some impl. anyway m_FileSizeExcludingTag = CreateTextFrame(null, "TSIZ", "TSI", "FileSizeExcludingTag", null); // Not technically in ID3v2.4 m_OriginalReleaseYear = CreateTextFrame("TORY", "TORY", "TOR", "OriginalReleaseYear", null /*TODO*/); m_OriginalSourceTitle = CreateTextFrame("TOAL", "TOAL", "TOT", "OriginalSourceTitle", null); m_OriginalFileName = CreateTextFrame("TOFN", "TOFN", "TOF", "OriginalFileName", null); m_FileOwnerName = CreateTextFrame("TOWN", "TOWN", null, "FileOwnerName", null); // Not technically in ID3v2.4 m_RecordingDates = CreateTextFrame("TRDA", "TRDA", "TRD", "RecordingDates", null /*TODO*/); m_Subtitle = CreateTextFrame("TIT3", "TIT3", "TT3", "Subtitle", null); // Technically only supported in ID3v2.4, but some ID3v2.3 implementations use this frame m_AlbumSortOrder = CreateTextFrame("TSOA", "TSOA", null, "AlbumSortOrder", null); // Technically only supported in ID3v2.4, but some ID3v2.3 implementations use this frame m_ArtistSortOrder = CreateTextFrame("TSOP", "TSOP", null, "ArtistSortOrder", null); // Technically only supported in ID3v2.4, but some ID3v2.3 implementations use this frame m_TitleSortOrder = CreateTextFrame("TSOT", "TSOT", null, "TitleSortOrder", null); // Technically only supported in ID3v2.4, but some ID3v2.3 implementations use this frame m_ProducedNotice = CreateTextFrame("TPRO", "TPRO", null, "ProducedNotice", null /*todo - same as copyright validation*/); // Technically only supported in ID3v2.4, but some ID3v2.3 implementations use this frame m_SetSubtitle = CreateTextFrame("TSST", "TSST", null, "SetSubtitle", null); m_PodcastSeriesCategory = CreateTextFrame("TCAT", "TCAT", null, "SeriesCategory", null); m_PodcastEpisodeDescription = CreateTextFrame("TDES", "TDES", null, "EpisodeDescription", null); m_PodcastEpisodeUrl = CreateTextFrame("TGID", "TGID", null, "EpisodeUrl", null); m_PodcastFeedUrl = CreateTextFrame("WFED", "WFED", null, "PodcastFeedUrl", null); m_PositionSynchronization = CreatePositionSynchronizationFrame("POSS", "POSS", null, "PositionSynchronization", null); m_Ownership = CreateOwnershipFrame("OWNE", "OWNE", null, "Ownership", null); m_RecommendedBufferSize = CreateRecommendedBufferSizeFrame("RBUF", "RBUF", "BUF", "RecommendedBufferSize", null /*todo*/); m_InvolvedPersonList = CreateInvolvedPersonListFrame("TIPL", "IPLS", "IPL", "InvolvedPersonList", null /*TODO - needs validation?*/); m_Languages = CreateLanguageFrame("TLAN", "TLAN", "TLA", "Languages", null); m_MusicCDIdentifier = CreateMusicCDIdentifierFrame("MCDI", "MCDI", "MCI", "MusicCDIdentifier", null /*TODO?*/); m_EventTiming = CreateEventTimingFrame("ETCO", "ETCO", "ETC", "EventTiming", null /*TODO - needs validation?*/); m_MpegLookupTable = CreateMpegLookupTableFrame("MLLT", "MLLT", "MLL", "MpegLookupTable", null); m_Reverb = CreateReverbFrame("RVRB", "RVRB", "REV", "Reverb", null); m_SynchronizedTempoCodes = CreateSynchronizedTempoCodesFrame("SYTC", "SYTC", "STC", "SynchronizedTempoCodeList", null); m_SeekNextTag = CreateSeekFrame("SEEK", "SEEK", null, "SeekNextTag", null); // Technically only supported in ID3v2.4, but some ID3v2.3 implementations use this frame m_MusicianCreditsList = CreateMusicianCreditsListFrame("TMCL", "TMCL", null, "MusicianCreditsList", null); m_AudioSeekPointIndex = CreateAudioSeekPointIndexFrame("ASPI", "ASPI", null, "AudioSeekPointIndex", null); m_PlayCount = CreateFrame <PlayCount>("PCNT", "PCNT", "CNT", "PlayCount"); m_IsPodcast = CreateFrame <Podcast>("PCST", "PCST", "PCS", "Podcast"); // TODO: TYER->TDRL, TDAT,TIME->TDRC (in setters, not here) // URL frames m_CopyrightUrl = CreateUrlFrame("WCOP", "WCOP", "WCP", "CopyrightUrl", ValidateCopyrightUrl); m_AudioFileUrl = CreateUrlFrame("WOAF", "WOAF", "WAF", "AudioFileUrl", ValidateAudioFileUrl); m_AudioSourceUrl = CreateUrlFrame("WOAS", "WOAS", "WAS", "AudioSourceUrl", ValidateAudioSourceUrl); m_InternetRadioStationUrl = CreateUrlFrame("WORS", "WORS", null, "InternetRadioStationUrl", ValidateInternetRadioStationUrl); m_PaymentUrl = CreateUrlFrame("WPAY", "WPAY", null, "PaymentUrl", ValidatePaymentUrl); m_PublisherUrl = CreateUrlFrame("WPUB", "WPUB", "WPB", "PublisherUrl", ValidatePublisherUrl); // Frame aliases - handles incorrectly named frames // ID3v2.4 (Bad frame, Good frame) _id3v24FrameAliases.Add("RVAD", "RVA2"); _id3v24FrameAliases.Add("IPLS", "TIPL"); _id3v24FrameAliases.Add("EQUA", "EQU2"); // ID3v2.3 (Bad frame, Good frame) _id3v23FrameAliases.Add("RVA2", "RVAD"); _id3v23FrameAliases.Add("TIPL", "IPLS"); _id3v23FrameAliases.Add("EQU2", "EQUA"); }