Exemplo n.º 1
0
 public BookmarkScreen(IWindowsFormsEditorService wfes, PlaylistItem plItem) : this()
 {
     _wfes = wfes;
     _showFilePath = false;
     _canAddToCurrent = false;
     this.PlaylistItem = plItem;
 }
Exemplo n.º 2
0
        public BookmarkManager(PlaylistItem plItem, bool canAddToCurrent)
            : base("TXT_BOOKMARK_MANAGER")
        {
            InitializeComponent();
            bookmarkManagerCtl.CanAddToCurrent = canAddToCurrent;
            bookmarkManagerCtl.PlaylistItem = plItem;

            this.FormClosed += new FormClosedEventHandler(BookmarkManager_FormClosed);

            this.ShowInTaskbar = true;
            this.InheritAppIcon = false;
            this.Icon = OPMedia.Core.Properties.Resources.bookmark;
        }
Exemplo n.º 3
0
 public AudioCdSubItem(PlaylistItem parent, string name)
     : base(name, parent)
 {
 }
 public PlaylistSubItem(string name, PlaylistItem parent)
 {
     _name   = name;
     _parent = parent;
 }
Exemplo n.º 5
0
 public BookmarkSubItem(PlaylistItem parent, string name)
     : base(name, parent)
 {
 }
 public DvdSubItem(string name, PlaylistItem parent)
     : base(name, parent)
 {
     _hint = DvdRenderingStartHint.Beginning;
 }
 public DvdSubItem(string name, DvdRenderingStartHint hint, PlaylistItem parent)
     : base(name, parent)
 {
     _hint = hint;
 }
Exemplo n.º 8
0
        public void LoadnewPlaylistItem(PlaylistItem plItem, bool callFromProperty)
        {
            try
            {
                if (_plItem != null && _plItem.MediaFileInfo != null)
                {
                    _plItem.MediaFileInfo.BookmarkCollectionChanged -=
                        new EventHandler(MediaFileInfo_BookmarkCollectionChanged);
                }

                if (plItem == null && callFromProperty)
                {
                    List<PlaylistItem> plItems = playlistScreen.GetPlaylistItems();
                    if (plItems != null && plItems.Count > 0)
                    {
                        plItem = plItems[0];
                    }
                }

                _plItem = plItem;

                if (_plItem != null && callFromProperty)
                {
                    playlistScreen.SetFirstSelectedPlaylistItem(_plItem);
                }

                LoadBookmarks();

                if (_plItem != null && _plItem.MediaFileInfo != null)
                {
                    _plItem.MediaFileInfo.BookmarkCollectionChanged +=
                        new EventHandler(MediaFileInfo_BookmarkCollectionChanged);
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Exemplo n.º 9
0
        private void UpdateFileType()
        {
            PlaylistItem pli = null;

            Image img = null;
            if (!string.IsNullOrEmpty(_mediaName))
            {
                try
                {
                    if (DvdMedia.FromPath(_mediaName) != null)
                    {
                        pli = new DvdPlaylistItem(_mediaName);
                        img = pli.GetImage(true);
                    }
                    else
                    {
                        pli = new PlaylistItem(_mediaName, false);
                        img = pli.GetImage(true);
                    }
                }
                catch
                {
                }

                if (img == null)
                    img = ImageProvider.GetIcon(_mediaName, true);
            }

            tslFileType.Image = img;
            tslFileType.Tag = pli;
        }
Exemplo n.º 10
0
        //private void UpdateButtonsState()
        //{
        //    bool singleItemSelected = (lvPlaylist.SelectedItems.Count == 1);
        //    bool itemsSelected = (lvPlaylist.SelectedItems.Count > 0);
        //    bool itemsPresent = (lvPlaylist.Items.Count > 0);

        //    if (singleItemSelected)
        //    {
        //        PlaylistItem plItem = lvPlaylist.SelectedItems[0].Tag as PlaylistItem;
        //        if (plItem != null)
        //        {
        //            bookmarkManagerCtl.PlaylistItem = plItem;
        //        }
        //    }
        //}

        //private void lvPlaylist_SelectionChanged(object sender, EventArgs e)
        //{
        //    bookmarkManagerCtl.PlaylistItem = null;
        //    UpdateButtonsState();
        //}

        internal bool JumpToPlaylistItem(PlaylistItem plItem)
        {
            return playlist.MoveToItem(plItem);
        }
Exemplo n.º 11
0
 internal bool IsActiveItem(PlaylistItem plItem)
 {
     return playlist.ActivePlaylistItem == plItem;
 }
Exemplo n.º 12
0
 internal void SetFirstSelectedPlaylistItem(PlaylistItem plItem)
 {
     if (lvPlaylist.Items.Count > 0)
     {
         lvPlaylist.SelectedItems.Clear();
         foreach (ListViewItem lvItem in lvPlaylist.Items)
         {
             if (lvItem.Tag == plItem)
             {
                 lvItem.Selected = true;
                 lvItem.Focused = true;
                 lvPlaylist.EnsureVisible(lvItem.Index);
                 break;
             }
         }
     }
 }
Exemplo n.º 13
0
        private void SetItemRelation(ListViewItem lvItem, PlaylistItem plItem)
        {
            if (lvItem != null && plItem != null)
            {
                lvItem.Tag = plItem;
                lvItem.SubItems[colFile.Index].Text = plItem.DisplayName;

                TimeSpan duration = plItem.Duration;
                bool isActive = IsActiveItem(plItem);

                if (duration.TotalMilliseconds == 0 && isActive)
                {
                    try
                    {
                        duration = TimeSpan.FromSeconds((int)MediaRenderer.DefaultInstance.MediaLength);
                    }
                    catch
                    {
                        duration = TimeSpan.FromMilliseconds(0);
                    }

                    plItem.Duration = duration;
                }

                if (duration.TotalMilliseconds == 0)
                {
                    lvItem.SubItems[colTime.Index].Text = "";
                }
                else
                {
                    lvItem.SubItems[colTime.Index].Text = duration.ToString();
                }

                lvItem.SubItems[colIcon.Index].Tag = new ExtendedSubItemDetail(plItem.GetImage(false), null);
                UpdateMiscIcon(lvItem);
            }
        }
Exemplo n.º 14
0
 public PlaylistSubItem(string name, PlaylistItem parent)
 {
     _name = name;
     _parent = parent;
 }
Exemplo n.º 15
0
 public DvdSubItem(string name, DvdRenderingStartHint hint, PlaylistItem parent)
     : base(name, parent)
 {
     _hint = hint;
 }
Exemplo n.º 16
0
 public DvdSubItem(string name, PlaylistItem parent)
     : base(name, parent)
 {
     _hint = DvdRenderingStartHint.Beginning;
 }
Exemplo n.º 17
0
 public BookmarkSubItem(PlaylistItem parent, Bookmark bookmark)
     : base(bookmark.Title, parent)
 {
     _bookmark = bookmark;
     _hint = new BookmarkStartHint(bookmark);
 }
Exemplo n.º 18
0
        public void ShowPlaylistItem(PlaylistItem plItem, bool callByProperty)
        {
            if (plItem == null && callByProperty)
            {
                List<PlaylistItem> plItems = playlistScreen.GetPlaylistItems();
                if (plItems != null && plItems.Count > 0)
                {
                    plItem = plItems[0];
                }
            }

            pgProperties.Tag = null;
            pgProperties.SelectedObject = null;
            pgProperties.Visible = false;
            lblNoInfo.Visible = true;
            lblItem.Text = string.Empty;
            _canSaveData = false;

            if (plItem != null)
            {
                lblItem.Text = plItem.MediaFileInfo.Path;

                if (plItem.SupportsTrackInfo)
                {
                    pgProperties.Tag = plItem;

                    MediaFileInfoSlim slim = plItem.MediaFileInfo.Slim();
                    FileAttributesBrowser.ProcessSingleObjectAttributes(slim);
                    pgProperties.SelectedObject = slim;
                    
                    pgProperties.Visible = true;
                    lblNoInfo.Visible = false;
                }
            }

            if (callByProperty)
            {
                try
                {
                    _canSaveData = false;
                    playlistScreen.SetFirstSelectedPlaylistItem(plItem);
                }
                finally
                {
                    _canSaveData = true;
                }
            }
        }
Exemplo n.º 19
0
        void playlistScreen_SelectedItemChanged(PlaylistItem newSelectedItem)
        {
            if (_selectEventDisabled)
                return;

            LoadnewPlaylistItem(newSelectedItem, false);
        }
Exemplo n.º 20
0
        private bool TestForMatch(PlaylistItem plItem, string[] keywords)
        {
            if (keywords == null || keywords.Length < 1)
                return true; // In absence of a keyword, all items match.

            bool match = true;

            foreach (string keyword in keywords)
            {
                string lowercaseName = plItem.DisplayName.ToLowerInvariant();

                match &= lowercaseName.Contains(keyword);

                if (!match)
                    break;
            }

            return match;
        }
Exemplo n.º 21
0
        void playlistScreen_SelectedItemChanged(PlaylistItem newSelectedItem)
        {
            if (_canSaveData)
            {
                SaveData();
            }

            ShowPlaylistItem(newSelectedItem, false);
        }
Exemplo n.º 22
0
 public void JumpToPlaylistItem(PlaylistItem plItem)
 {
     if (plItem != null)
     {
         if (pnlScreens.PlaylistScreen.JumpToPlaylistItem(plItem))
         {
             string strFile = pnlScreens.PlaylistScreen.GetActiveFile();
             PlayFile(strFile, null);
         }
     }
 }