Esempio n. 1
0
        internal void ResetMetadata()
        {
            DeactivateProgramBlockTimer();

            CurrentSong    = null;
            CurrentStation = null;

            RaisePropertyChanged(nameof(CurrentSong));
            PreSongChanged?.Invoke(this, new NepAppSongChangedEventArgs(null));
        }
Esempio n. 2
0
        private void SetCurrentMetadataToUnknownInternal(string program = null)
        {
            //todo make a readonly field
            SongMetadata unknown = GetUnknownSongMetadata();

            CurrentSong = unknown;
            //this is used for the now playing bar via data binding.
            RaisePropertyChanged(nameof(CurrentSong));

            PreSongChanged?.Invoke(this, new NepAppSongChangedEventArgs(unknown));

            ArtworkProcessor.UpdateArtworkMetadata();
        }
Esempio n. 3
0
        internal void RefreshMetadata()
        {
            if (CurrentSong == null || CurrentStation == null)
            {
                SetCurrentMetadataToUnknown();
            }
            else
            {
                //this is used for the now playing bar via data binding.
                RaisePropertyChanged(nameof(CurrentSong));

                //part of the reason for the double-song announcement bug. why is this here again?
                PreSongChanged?.Invoke(this, new NepAppSongChangedEventArgs(CurrentSong));
            }
        }
Esempio n. 4
0
        private async void HandleStationSongMetadata(SongMetadata songMetadata, StationStream currentStream, StationItem currentStation)
        {
            if (CurrentProgram != null)
            {
                if (CurrentProgram.Style == StationProgramStyle.Hosted)
                {
                    CurrentProgram = null; //hosted program ended.
                }
            }

            //filter out station messages
            if (!string.IsNullOrWhiteSpace(currentStream.ParentStation))
            {
                if (currentStation.StationMessages != null)
                {
                    if (currentStation.StationMessages.Contains(songMetadata.Track) ||
                        currentStation.StationMessages.Contains(songMetadata.Artist))
                    {
                        NepAppStationMessageReceived?.Invoke(this, new NepAppStationMessageReceivedEventArgs(songMetadata));
                        metadataLock.Release();
                        return;
                    }
                }
            }

            if (CurrentSong != null)
            {
                if (CurrentSong.ToString().Equals(songMetadata.ToString()))
                {
                    return;
                }
            }

            CurrentSong = songMetadata;
            //this is used for the now playing bar via data binding.
            RaisePropertyChanged(nameof(CurrentSong));

            PreSongChanged?.Invoke(this, new NepAppSongChangedEventArgs(songMetadata));

            await HandleStationSongMetadataStage2Async(songMetadata);
        }