Example #1
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            hashcode = (hashcode * 397) + IdLocalTrack.GetHashCode();
            if (__isset.idConsumer)
            {
                hashcode = (hashcode * 397) + IdConsumer.GetHashCode();
            }
            if (__isset.fileName)
            {
                hashcode = (hashcode * 397) + FileName.GetHashCode();
            }
            if (__isset.artistName)
            {
                hashcode = (hashcode * 397) + ArtistName.GetHashCode();
            }
            if (__isset.title)
            {
                hashcode = (hashcode * 397) + Title.GetHashCode();
            }
        }
        return(hashcode);
    }
Example #2
0
        public override int GetHashCode()
        {
            int hash = 13;

            hash = (hash * 7) + ArtistName.GetHashCode();
            return(hash);
        }
        void ReleaseDesignerOutlets()
        {
            if (ArtistName != null)
            {
                ArtistName.Dispose();
                ArtistName = null;
            }

            if (BackgroundImage != null)
            {
                BackgroundImage.Dispose();
                BackgroundImage = null;
            }

            if (NextButton != null)
            {
                NextButton.Dispose();
                NextButton = null;
            }

            if (PartyCodeLabel != null)
            {
                PartyCodeLabel.Dispose();
                PartyCodeLabel = null;
            }

            if (PlayButton != null)
            {
                PlayButton.Dispose();
                PlayButton = null;
            }

            if (PreviousButton != null)
            {
                PreviousButton.Dispose();
                PreviousButton = null;
            }

            if (SongNameLabel != null)
            {
                SongNameLabel.Dispose();
                SongNameLabel = null;
            }

            if (SongProgressView != null)
            {
                SongProgressView.Dispose();
                SongProgressView = null;
            }

            if (SongsView != null)
            {
                SongsView.Dispose();
                SongsView = null;
            }
        }
Example #4
0
        public override int GetHashCode()
        {
            int hash = 13;

            hash = (hash * 7) + (!Object.ReferenceEquals(null, Name) ? Name.GetHashCode() : 0);
            hash = (hash * 7) + (!Object.ReferenceEquals(null, ArtistName) ? ArtistName.GetHashCode() : 0);
            hash = (hash * 7) + (!Object.ReferenceEquals(null, _musicbrainzID) ? _musicbrainzID.GetHashCode() : 0);
            hash = (hash * 7) + (!Object.ReferenceEquals(null, _date) ? _date.GetHashCode() : 0);
            return(hash);
        }
Example #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ArtistName != null ? ArtistName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DateOfShow.GetHashCode();
         return(hashCode);
     }
 }
Example #6
0
        void ReleaseDesignerOutlets()
        {
            if (AlbumArtView != null)
            {
                AlbumArtView.Dispose();
                AlbumArtView = null;
            }

            if (BlurOverlay != null)
            {
                BlurOverlay.Dispose();
                BlurOverlay = null;
            }

            if (TrackName != null)
            {
                TrackName.Dispose();
                TrackName = null;
            }

            if (ArtistName != null)
            {
                ArtistName.Dispose();
                ArtistName = null;
            }

            if (InstrumentalTag != null)
            {
                InstrumentalTag.Dispose();
                InstrumentalTag = null;
            }

            if (PlayerIcon != null)
            {
                PlayerIcon.Dispose();
                PlayerIcon = null;
            }

            if (ThumbnailView != null)
            {
                ThumbnailView.Dispose();
                ThumbnailView = null;
            }

            if (SettingsButton != null)
            {
                SettingsButton.Dispose();
                SettingsButton = null;
            }
        }
Example #7
0
        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.
            Artist p = obj as Artist;

            if ((Object)p == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return(ArtistName.Equals(p.ArtistName, StringComparison.CurrentCultureIgnoreCase));//.Equals(p.ArtistName);
        }
Example #8
0
        /* Getters */

        /*
         * protected MPDAlbum(Parcel in) {
         *              name = in.readString();
         *              musicbrainzID = in.readString();
         *              artistName = in.readString();
         *              imageFetching = in.readByte() != 0;
         *              date = (Date)in.readSerializable();
         * }
         *
         * public static final Creator<MPDAlbum> CREATOR = new Creator<MPDAlbum>() {
         *              @Override
         *              public MPDAlbum createFromParcel(Parcel in) {
         *                              return new MPDAlbum(in);
         *              }
         *
         *              @Override
         *              public MPDAlbum[] newArray(int size) {
         *                              return new MPDAlbum[size];
         *              }
         * };
         */

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            MPDAlbum album = obj as MPDAlbum;

            if ((object)album == null)
            {
                return(false);
            }

            bool result = Name.Equals(album.Name) &&
                          ArtistName.Equals(ArtistName) &&
                          _musicbrainzID.Equals(album._musicbrainzID) &&
                          _date.Equals(album._date);

            return(result);
        }
Example #9
0
        public void WriteTag()
        {
            File file = TagLib.File.Create(_filepath);

            if (file == null)
            {
                return;
            }

            //checking for readonly
            var fileInfo = new FileInfo(_filepath);

            if (fileInfo.IsReadOnly)
            {
                fileInfo.IsReadOnly = false;
            }

            // artist tag editor
            file.Tag.Performers = ArtistName.Split('&');

            // album tag editor
            file.Tag.Album  = AlbumTitle;
            file.Tag.Genres = new[] { Genre };
            //file.Tag.Composers = Composers;
            //file.Tag.Conductor = Conductor;
            uint year;

            if (UInt32.TryParse(Year.ToString(CultureInfo.InvariantCulture), out year))
            {
                file.Tag.Year = year;
            }

            // song
            file.Tag.Title = TrackTitle;
            file.Tag.Track = Convert.ToUInt32(TrackNumber);

            // save
            file.Save();
        }
Example #10
0
        private void ParsePath(string path)
        {
            ArtistName  = String.Empty;
            AlbumTitle  = String.Empty;
            TrackTitle  = String.Empty;
            TrackNumber = 0;
            Match match;

            SafeUri uri      = new SafeUri(path);
            string  filename = path;

            if (uri.IsLocalPath)
            {
                filename = uri.AbsolutePath;
            }

            match = Regex.Match(filename, @"(\d+)\.? *(.*)$");
            if (match.Success)
            {
                TrackNumber = Convert.ToInt32(match.Groups[1].ToString());
                filename    = match.Groups[2].ToString().Trim();
            }

            // Artist - Album - Title
            match = Regex.Match(filename, @"\s*(.*)-\s*(.*)-\s*(.*)$");
            if (match.Success)
            {
                ArtistName = match.Groups[1].ToString();
                AlbumTitle = match.Groups[2].ToString();
                TrackTitle = match.Groups[3].ToString();
            }
            else
            {
                // Artist - Title
                match = Regex.Match(filename, @"\s*(.*)-\s*(.*)$");
                if (match.Success)
                {
                    ArtistName = match.Groups[1].ToString();
                    TrackTitle = match.Groups[2].ToString();
                }
                else
                {
                    // Title
                    TrackTitle = filename;
                }
            }

            while (!String.IsNullOrEmpty(path))
            {
                filename = Path.GetFileName(path);
                path     = Path.GetDirectoryName(path);
                if (AlbumTitle == String.Empty)
                {
                    AlbumTitle = filename;
                    continue;
                }

                if (ArtistName == String.Empty)
                {
                    ArtistName = filename;
                    continue;
                }

                break;
            }

            ArtistName = ArtistName.Trim();
            AlbumTitle = AlbumTitle.Trim();
            TrackTitle = TrackTitle.Trim();

            if (ArtistName.Length == 0)
            {
                ArtistName = /*"Unknown Artist"*/ null;
            }

            if (AlbumTitle.Length == 0)
            {
                AlbumTitle = /*"Unknown Album"*/ null;
            }

            if (TrackTitle.Length == 0)
            {
                TrackTitle = /*"Unknown Title"*/ null;
            }
        }
Example #11
0
        void ReleaseDesignerOutlets()
        {
            if (ProgressBar != null)
            {
                ProgressBar.Dispose();
                ProgressBar = null;
            }

            if (ProgressBackground != null)
            {
                ProgressBackground.Dispose();
                ProgressBackground = null;
            }

            if (MainScroll != null)
            {
                MainScroll.Dispose();
                MainScroll = null;
            }

            if (LyricsTextView != null)
            {
                LyricsTextView.Dispose();
                LyricsTextView = null;
            }

            if (AlbumArtView != null)
            {
                AlbumArtView.Dispose();
                AlbumArtView = null;
            }

            if (BlurOverlay != null)
            {
                BlurOverlay.Dispose();
                BlurOverlay = null;
            }

            if (TrackName != null)
            {
                TrackName.Dispose();
                TrackName = null;
            }

            if (ArtistName != null)
            {
                ArtistName.Dispose();
                ArtistName = null;
            }

            if (ThumbnailView != null)
            {
                ThumbnailView.Dispose();
                ThumbnailView = null;
            }

            if (PlayerIcon != null)
            {
                PlayerIcon.Dispose();
                PlayerIcon = null;
            }

            if (ExplicitTag != null)
            {
                ExplicitTag.Dispose();
                ExplicitTag = null;
            }

            if (OpenInBrowserButton != null)
            {
                OpenInBrowserButton.Dispose();
                OpenInBrowserButton = null;
            }

            if (ChangeTextSizeButton != null)
            {
                ChangeTextSizeButton.Dispose();
                ChangeTextSizeButton = null;
            }

            if (SettingsButton != null)
            {
                SettingsButton.Dispose();
                SettingsButton = null;
            }
        }