Example #1
0
        private static UiBlocker InternalCreate(string msg)
        {
            _current?.Dismiss();

            var curtain = new UiBlocker();
            curtain.UpdateProgress(msg);

            _current = curtain;
            return curtain;
        }
Example #2
0
        private static UiBlocker InternalCreate(string msg)
        {
            _current?.Dismiss();

            var curtain = new UiBlocker();

            curtain.UpdateProgress(msg);

            _current = curtain;
            return(curtain);
        }
Example #3
0
 public void Dismiss()
 {
     try
     {
         if (_popup != null)
             _popup.IsOpen = false;
         _popup = null;
         _current = null;
     }
     catch
     {
         // ignored
     }
 }
Example #4
0
 public void Dismiss()
 {
     try
     {
         if (_popup != null)
         {
             _popup.IsOpen = false;
         }
         _popup   = null;
         _current = null;
     }
     catch
     {
         // ignored
     }
 }
Example #5
0
        private async Task PrepareTrackAsync(Track track)
        {
            switch (track.Status)
            {
                case TrackStatus.Matching:
                    throw new AppException("Track is still matching.");
                case TrackStatus.NoMatch:
                    throw new AppException("No match found for track, try manual matching it.");
                case TrackStatus.NotAvailable:
                    throw new AppException("The audio file is not available.");
            }

            if (track.Type == TrackType.Stream
                && track.AudioWebUri == null)
                using (var blocker = new UiBlocker())
                {
                    blocker.UpdateProgress("Matching...");
                    var uri = await _matchEngineService.GetLinkAsync(track.Title, track.DisplayArtist);

                    if (uri == null)
                    {
                        throw new AppException("Problem matching the song, try saving and manual matching it.");
                    }
                    track.AudioWebUri = uri.ToString();
                }
        }
Example #6
0
 private async Task<Track> ConvertToTrackAsync(WebSong webSong)
 {
     var track = webSong.PreviousConversion as Track;
     if (track == null)
         using (var blocker = new UiBlocker())
         {
             blocker.UpdateProgress("Getting data...");
             track = await _webSongConverter.ConvertAsync(webSong);
         }
     return track;
 }