Exemplo n.º 1
0
 public async Task SetThumbnail(StorageFile sf)
 {
     if (sf != null)
     {
         Thumbnail = await IsoStorePoc.GetThumbnailBitmapImage(sf);
     }
 }
Exemplo n.º 2
0
 public async Task SetThumbnail()
 {
     if (await FileExists())
     {
         Thumbnail = await IsoStorePoc.GetThumbnailBitmapImage(await SafeSFile());
     }
 }
Exemplo n.º 3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            tbInfo.Text = $" ... ";

            try
            {
                _state = JsonHelper.FromJson <AppState>((string)AppSettingsHelper.ReadVal(typeof(AppState).Name));

                var args = e.Parameter as Windows.ApplicationModel.Activation.IActivatedEventArgs;
                if (args?.Kind == Windows.ApplicationModel.Activation.ActivationKind.File)
                {
                    var fileArgs    = args as Windows.ApplicationModel.Activation.FileActivatedEventArgs;
                    var strFilePath = fileArgs?.Files[0].Path;
                    if (strFilePath != null)
                    {
                        me_Xm.AutoPlay = _state.AutoPlay;
                        var sf = await StorageFile.GetFileFromPathAsync(strFilePath);
                        await loadPlay(sf);

                        return;
                    }
                }

                if (_state.LastLocalMedia != null)
                {
                    me_Xm.AutoPlay = _state.AutoPlay;
                    var sf = await StorageFile.GetFileFromPathAsync(_state.LastLocalMedia);
                    await loadPlay(sf);

                    return;
                }

                var rv = await IsoStorePoc.LoadFromLibFolder(KnownFolderId.VideosLibrary);

                foreach (var storageFile in rv)
                {
                    await loadPlay(storageFile);

                    break;
                }
            }
            catch (Exception ex) { Debug.WriteLine($"$#~>{ex.Message}"); if (Debugger.IsAttached)
                                   {
                                       Debugger.Break();
                                   }                                                                          /*else throw;*/
            }
        }
Exemplo n.º 4
0
        async Task libLoad(KnownFolderId library)
        {
            IsReady = false;
            try
            {
                var max = 200;
                var sfs = await IsoStorePoc.LoadFromLibFolder(library);

                MediaInfos.Clear();
                sfs.Take(max).ToList().ForEach(sf => MediaInfos.Add(new MediaInfo(sf)));
                ApplicationView.GetForCurrentView().Title = Info = $@"Ttl {sfs.Count} in {library}, taking first {max}";
            }
            finally
            {
                IsReady = true;
            }
        }
Exemplo n.º 5
0
        async Task onLoadLib_Task(KnownFolderId library)
        {
            try
            {
                CanLoadLibs = false;

                if (library == KnownFolderId.AllAppMods)
                {
                    await onLoadLib_Task(KnownFolderId.MusicLibrary);
                    await onLoadLib_Task(KnownFolderId.VideosLibrary);

                    return;
                }

                var max = 1000;
                var sfs = await IsoStorePoc.LoadFromLibFolder(library);

                var ll = sfs.Take(max).OrderBy(r => r.Path).ThenBy(r => r.Name);
                foreach (var sf in ll)
                {
                    await addNewOrFromMru(sf);                    //async ruins the order by: ll.ToList().ForEach(async sf => await add(sf));
                }
                if (SlctMru != null)
                {
                    SlctLib = selectFromList(SlctMru.PathFile, LibLst);
                }

                ApplicationView.GetForCurrentView().Title = $@"{library}: {LibLst.Count} / {sfs.Count} ";
                TbInfo += $@"\r\n{ApplicationView.GetForCurrentView().Title} ";
            }
            catch (Exception ex) { Debug.WriteLine($"$#~>{ex.Message}"); if (Debugger.IsAttached)
                                   {
                                       Debugger.Break();
                                   }
                                   else
                                   {
                                       await popEx(ex, GetType().FullName);
                                   } }
            finally { CanLoadLibs = true; }
        }
Exemplo n.º 6
0
        async void setThumbnail(uint size = 100, ThumbnailMode mode = ThumbnailMode.MusicView)
        {
            Thumbnail = await IsoStorePoc.GetThumbnailBitmapImage(SFile);

            ArtUri = Thumbnail.UriSource ?? new Uri(FullPath);                //FInfo = $"Thumbnail Mode: {mode}\n Requested/Returned size: {size} / {Thumbnail.OriginalWidth}x{Thumbnail.OriginalHeight}";
        }