public override int GetHashCode() { int hash = 13; hash = (hash * 7) + ArtistName.GetHashCode(); hash = (hash * 7) + SongTitle.GetHashCode(); return(hash); }
protected override Models.MusicalInspiration Parse() { return(new Models.MusicalInspiration { Id = ToInt(InspirationalMusicID), EmotionsReactions = EmotionsReactions.ToString(), Artist = Artist.ToString(), SongTitle = SongTitle.ToString(), Source = Source.ToString(), Lyrics = Lyrics.ToString(), Album = Album.ToString(), IsFavorite = ToBoolean(isFavorite), Path = FilePath.ToString() }); }
void FinishedLoading(SongData sd) { src.clip = sd.clip; length = src.clip.samples; skipRate = length / 10; src.Play(); Debug.Log("Playing " + sd.tempDir); SongTitle st = FindObjectOfType <SongTitle>(); if (st != null) { st.Set(Path.GetFileNameWithoutExtension(sd.tempDir)); } }
public override IEnumerable <IResult> SaveChanges() { if (SongTitle.Trim() == string.Empty) { MessageBox.Show("Please provide an Song Title.", "Error", MessageBoxButton.OK); yield return(null); } foreach (RawTrack media in MediaList) { try { if (SongTitle.Trim() != "Multiple Titles") { media.TrackTitle = SongTitle.Trim(); } if (SongAlbum.Trim() != "Multiple Albums") { media.AlbumTitle = SongAlbum.Trim(); } //if (SongComposer.Trim() != "Multiple Composers") //{ // var composers = new List<string>(); // foreach (string composer in SongComposer.Trim().Split(';')) // { // if (composer != null) // { // if (composer.Trim() != string.Empty) // composers.Add(composer.Trim()); // } // } // media.Composers = composers.ToArray(); //} if (SongAlbumArtist.Trim() != "Multiple Artists") { media.ArtistName = SongAlbumArtist.Trim(); } if (SongGenre.Trim() != "Multiple Genres") { media.Genre = SongGenre.Trim(); } if (SongYear != -1) { media.Year = SongYear; } if (SongId != -1) { media.TrackNumber = SongId; } if (media is Mp3Track) { (media as Mp3Track).WriteTag(); } } catch { MessageBox.Show("Could not update " + media, "Error", MessageBoxButton.OK); } } yield return(new CloseResult()); }
void ReleaseDesignerOutlets() { if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (CloseButton != null) { CloseButton.Dispose(); CloseButton = null; } if (ContentView != null) { ContentView.Dispose(); ContentView = null; } if (FavouriteSongsCollectionView != null) { FavouriteSongsCollectionView.Dispose(); FavouriteSongsCollectionView = null; } if (FavouritesTitle != null) { FavouritesTitle.Dispose(); FavouritesTitle = null; } if (FooterView != null) { FooterView.Dispose(); FooterView = null; } if (MaskView != null) { MaskView.Dispose(); MaskView = null; } if (NextLabel != null) { NextLabel.Dispose(); NextLabel = null; } if (PlayerBlurScreen != null) { PlayerBlurScreen.Dispose(); PlayerBlurScreen = null; } if (PlayingSongCoverImageView != null) { PlayingSongCoverImageView.Dispose(); PlayingSongCoverImageView = null; } if (ProgressView != null) { ProgressView.Dispose(); ProgressView = null; } if (SongArtist != null) { SongArtist.Dispose(); SongArtist = null; } if (SongsQueueTitle != null) { SongsQueueTitle.Dispose(); SongsQueueTitle = null; } if (SongsQueueView != null) { SongsQueueView.Dispose(); SongsQueueView = null; } if (SongTitle != null) { SongTitle.Dispose(); SongTitle = null; } if (SubContentViewClipped != null) { SubContentViewClipped.Dispose(); SubContentViewClipped = null; } if (SunContentView != null) { SunContentView.Dispose(); SunContentView = null; } if (TableView != null) { TableView.Dispose(); TableView = null; } }
public override bool Equals(Object obj) { // If parameter is null return false. if (obj == null) { return(false); } // If parameter cannot be cast to Artist return false. Song p = obj as Song; if ((Object)p == null) { return(false); } // Return true if the fields match: return(ArtistName.Equals(p.ArtistName, StringComparison.CurrentCultureIgnoreCase) && SongTitle.Equals(p.SongTitle, StringComparison.CurrentCultureIgnoreCase)); }