00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023 #include <afxcoll.h>
00024 #include "PlayerListCtrl.h"
00025 #include "Playlist.h"
00026
00027 class OpenMediaData;
00028
00029 class CPlayerPlaylistBar : public CSizingControlBarG
00030 {
00031 DECLARE_DYNAMIC(CPlayerPlaylistBar)
00032
00033 private:
00034 enum {COL_NAME, COL_TIME};
00035
00036 CImageList m_fakeImageList;
00037 CPlayerListCtrl m_list;
00038
00039 int m_nTimeColWidth;
00040 void ResizeListColumn();
00041
00042 void AddItem(CString fn, CList<CString>* subs);
00043 void AddItem(CList<CString>& fns, CList<CString>* subs);
00044 void ParsePlayList(CString fn, CList<CString>* subs);
00045 void ParsePlayList(CList<CString>& fns, CList<CString>* subs);
00046
00047 bool ParseMPCPlayList(CString fn);
00048 bool SaveMPCPlayList(CString fn, CTextFile::enc e, bool fRemovePath);
00049
00050 void SetupList();
00051 void UpdateList();
00052 void EnsureVisible(POSITION pos);
00053 int FindItem(POSITION pos);
00054 POSITION FindPos(int i);
00055
00056 CImageList* m_pDragImage;
00057 BOOL m_bDragging;
00058 int m_nDragIndex, m_nDropIndex;
00059 CPoint m_ptDropPoint;
00060
00061 void DropItemOnList();
00062
00063 public:
00064 CPlayerPlaylistBar();
00065 virtual ~CPlayerPlaylistBar();
00066
00067 BOOL Create(CWnd* pParentWnd);
00068
00069 CPlaylist m_pl;
00070
00071 int GetCount();
00072 int GetSelIdx();
00073 void SetSelIdx(int i);
00074 bool IsAtEnd();
00075 bool GetCur(CPlaylistItem& pli);
00076 CString GetCur();
00077 void SetNext(), SetPrev(), SetFirst(), SetLast();
00078 void SetCurValid(bool fValid);
00079 void SetCurTime(REFERENCE_TIME rt);
00080
00081 void Refresh();
00082 void Empty();
00083
00084 void Open(CList<CString>& fns, bool fMulti, CList<CString>* subs = NULL);
00085 void Append(CList<CString>& fns, bool fMulti, CList<CString>* subs = NULL);
00086
00087 void Open(CStringW vdn, CStringW adn, int vinput, int vchannel, int ainput);
00088 void Append(CStringW vdn, CStringW adn, int vinput, int vchannel, int ainput);
00089
00090 OpenMediaData* GetCurOMD(REFERENCE_TIME rtStart = 0);
00091
00092 void LoadPlaylist();
00093 void SavePlaylist();
00094
00095 protected:
00096 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00097 virtual BOOL PreTranslateMessage(MSG* pMsg);
00098
00099 DECLARE_MESSAGE_MAP()
00100
00101 public:
00102 afx_msg void OnSize(UINT nType, int cx, int cy);
00103 afx_msg void OnLvnKeyDown(NMHDR* pNMHDR, LRESULT* pResult);
00104 afx_msg void OnNMDblclkList(NMHDR* pNMHDR, LRESULT* pResult);
00105 afx_msg void OnLvnKeydownList(NMHDR* pNMHDR, LRESULT* pResult);
00106
00107 afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
00108 afx_msg BOOL OnFileClosePlaylist(UINT nID);
00109 afx_msg BOOL OnPlayPlay(UINT nID);
00110 afx_msg void OnDropFiles(HDROP hDropInfo);
00111 afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
00112 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00113 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00114 afx_msg BOOL OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
00115 afx_msg void OnTimer(UINT nIDEvent);
00116 afx_msg void OnContextMenu(CWnd* , CPoint );
00117 afx_msg void OnLvnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult);
00118 };