コード例 #1
0
 /// <summary>
 /// VlcMediaLibraryManager constructor
 /// </summary>
 public VlcMediaLibraryManager()
 {
     mediaItems = new VlcMediaCollection();
     mediaList = new VlcMediaCollection();
     mediaRandomList = new VlcMediaCollection();
     Random = false;
     Loop = false;
 }
コード例 #2
0
 /// <summary>
 /// VlcMediaLibraryManager constructor
 /// </summary>
 public VlcMediaLibraryManager()
 {
     mediaItems      = new VlcMediaCollection();
     mediaList       = new VlcMediaCollection();
     mediaRandomList = new VlcMediaCollection();
     Random          = false;
     Loop            = false;
 }
コード例 #3
0
        internal void Previous()
        {
            if (!Random)
            {
                UpdateMediaList();
            }
            else
            {
                UpdateRandomMediaList();
            }

            VlcMediaCollection collection = Random ? mediaRandomList : mediaList;

            MediaBase media;

            for (int cpt = 0; cpt < 2; cpt++)
            {
                media = collection.LastOrDefault(m => m.Status == MediaStates.Played);
                if (media != null)
                {
                    if (SelectedMedia != null)
                    {
                        if (MediaItems.Contains(SelectedMedia))
                        {
                            SelectedMedia.Status = collection.IndexOf(media) < collection.IndexOf(SelectedMedia) ? MediaStates.NotPlayed : MediaStates.Played;
                        }
                        else
                        {
                            collection.Remove(SelectedMedia);
                        }
                    }
                    media.Status  = MediaStates.Selected;
                    SelectedMedia = media;
                    break;
                }
                if (!Loop)
                {
                    break;
                }
                if (cpt == 0)
                {
                    collection.
                    Where(m => m.Status == MediaStates.NotPlayed).ToList().
                    ForEach(m => m.Status = MediaStates.Played);
                }
            }
        }
コード例 #4
0
        internal void Next()
        {
            if (!Random)
            {
                UpdateMediaList();
            }
            else
            {
                UpdateRandomMediaList();
            }

            VlcMediaCollection collection = Random ? mediaRandomList : mediaList;

            if (Loop && SelectedMedia != null && collection.IndexOf(SelectedMedia) == collection.Count - 1)
            {
                collection.ToList().ForEach(m => m.Status = MediaStates.NotPlayed);
            }

            MediaBase media = collection.FirstOrDefault(m => m.Status == MediaStates.NotPlayed);

            if (media != null)
            {
                if (SelectedMedia != null)
                {
                    if (SelectedMedia.Status == MediaStates.SelectedButDisabled)
                    {
                        collection.Remove(SelectedMedia);
                    }
                    else
                    {
                        SelectedMedia.Status = MediaStates.Played;
                    }
                }
                media.Status  = MediaStates.Selected;
                SelectedMedia = media;
            }
        }