Esempio n. 1
0
        private async void SongManager_SongArtworkAvailable(object sender, Neptunium.Media.Songs.NepAppSongMetadataArtworkEventArgs e)
        {
            if ((bool)NepApp.Settings.GetSetting(AppSettings.UpdateLockScreenWithSongArt))
            {
                if (e.ArtworkType == Neptunium.Media.Songs.NepAppSongMetadataBackground.Artist)
                {
                    try
                    {
                        bool result = await NepApp.UI.LockScreen.TrySetLockScreenImageFromUriAsync(e.ArtworkUri);

                        if (!result)
                        {
                            await NepApp.UI.LockScreen.TrySetFallbackLockScreenImageAsync();
                        }
                    }
                    catch (Exception)
                    {
                        //todo make and set an image that represents the lack of artwork. maybe a dark image with the app logo?
                        //maybe allow the user to set an image to use in this case.

                        await NepApp.UI.LockScreen.TrySetFallbackLockScreenImageAsync();
                    }
                }
            }
        }
Esempio n. 2
0
 private async void SongManager_NoSongArtworkAvailable(object sender, Neptunium.Media.Songs.NepAppSongMetadataArtworkEventArgs e)
 {
     if ((bool)NepApp.Settings.GetSetting(AppSettings.UpdateLockScreenWithSongArt))
     {
         //sets the fallback lockscreen image when we don't have any artwork available.
         if (e.ArtworkType == Neptunium.Media.Songs.NepAppSongMetadataBackground.Artist)
         {
             try
             {
                 await NepApp.UI.LockScreen.TrySetFallbackLockScreenImageAsync();
             }
             catch (Exception)
             {
             }
         }
     }
 }