Beispiel #1
0
        private void ProcessTags(string[] array, bool icecast = false)
        {
            string artist = null;
            string title  = null;

            if (icecast)
            {
                foreach (var item in array)
                {
                    if (item.StartsWith("ARTIST"))
                    {
                        artist = item.Replace("ARTIST=", "");
                    }
                    else if (item.StartsWith("TITLE"))
                    {
                        title = item.Replace("TITLE=", " - ");
                    }
                    else
                    {
                        continue;
                    }
                }
                var newtags = TagFactory.CreateTagInfoForNetStream(_netadress, title, artist);
                if (newtags != _currentTags && !string.IsNullOrEmpty(artist))
                {
                    Application.Current.Dispatcher.Invoke(async() =>
                    {
                        await UpdateTags(newtags);
                    });
                }
            }
            else
            {
                var contents = array[0].Split(';');
                foreach (var item in contents)
                {
                    if (item.StartsWith("StreamTitle='"))
                    {
                        title = item.Replace("StreamTitle='", "").Replace("'", "");
                    }
                    else
                    {
                        continue;
                    }
                }
                var newtags = TagFactory.CreateTagInfoForNetStream(_netadress, title, artist);
                if (newtags != _currentTags && !string.IsNullOrEmpty(title))
                {
                    Application.Current.Dispatcher.Invoke(async() =>
                    {
                        await UpdateTags(newtags);
                    });
                }
            }
        }
Beispiel #2
0
        private async void UpdateCDTags(int drive, int track)
        {
            _currentTags = await TagFactory.CreateTagInfoForCD(drive, track);

            NotifyChanged(nameof(CurrentTags));
        }
Beispiel #3
0
        private async void UpdateFileTags(string fileName)
        {
            _currentTags = await TagFactory.CreateTagInfoFromFile(fileName);

            NotifyChanged(nameof(CurrentTags));
        }