Пример #1
0
        private void getTagsFromURL()
        {
            if (BassTags.BASS_TAG_GetFromURL(streamRef, tagInfo))
            {
                int trackNum = 0;
                Int32.TryParse(tagInfo.track, out trackNum);
                int year = 0;
                Int32.TryParse(tagInfo.year, out year);
                Track t = new Track(0,
                                    tagInfo.title + tagInfo.artist, // need something since equals uses filepath
                                    Track.FileType.None,
                                    tagInfo.title,
                                    String.Empty,
                                    tagInfo.artist,
                                    tagInfo.albumartist,
                                    tagInfo.composer,
                                    String.Empty,
                                    String.Empty,
                                    0,
                                    trackNum,
                                    0,
                                    year,
                                    0,
                                    0,
                                    tagInfo.bitrate,
                                    0,
                                    false,
                                    DateTime.Now,
                                    DateTime.Now,
                                    DateTime.Now,
                                    tagInfo.encodedby,
                                    tagInfo.channelinfo.chans,
                                    tagInfo.channelinfo.sample,
                                    ChangeType.None,
                                    null,
                                    float.MinValue,
                                    float.MinValue);

                if (station.Name.Length == 0 && tagInfo.album.Trim().Length > 0)
                {
                    station.Name = tagInfo.album.Trim();
                    Radio.StationNameChanged();
                }
                if (station.Name.Length == 0 && tagInfo.title.Trim().Length > 0)
                {
                    station.Name = tagInfo.title.Trim();
                    Radio.StationNameChanged();
                }
                if (station.Genre.Length == 0 && tagInfo.genre.Trim().Length > 0)
                {
                    station.Genre = tagInfo.genre.Trim();
                    Radio.StationGenreChanged();
                }

                if (tagInfo.bitrate > 0)
                {
                    station.BitRate = tagInfo.bitrate;
                }

                Radio.InvalidateInstance();
                controller.RadioTrack = t;
                controller.Invalidate();
            }
        }