diff options
author | kinddragon <kinddragon@users.sourceforge.net> | 2010-04-05 03:38:08 +0400 |
---|---|---|
committer | kinddragon <kinddragon@users.sourceforge.net> | 2010-04-05 03:38:08 +0400 |
commit | e8e210fd3bb50445734d4af23076ba7400c584bf (patch) | |
tree | 66aa19bc52da4ac7879ab3f22d00878df8e9374f /src/apps/mplayerc | |
parent | bb57f7985aa831620dc5f109f4d3d5bd114e03d3 (diff) |
Improved play list
Disabling all internal filters fixed
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1778 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc')
-rw-r--r-- | src/apps/mplayerc/FGManager.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/MainFrm.cpp | 22 | ||||
-rw-r--r-- | src/apps/mplayerc/MainFrm.h | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/PPageInternalFilters.cpp | 1 | ||||
-rw-r--r-- | src/apps/mplayerc/PlayerPlaylistBar.cpp | 69 | ||||
-rw-r--r-- | src/apps/mplayerc/PlayerPlaylistBar.h | 11 | ||||
-rw-r--r-- | src/apps/mplayerc/Playlist.cpp | 9 | ||||
-rw-r--r-- | src/apps/mplayerc/Playlist.h | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/mplayerc.cpp | 2 |
9 files changed, 101 insertions, 19 deletions
diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index 0b6e4a75f..14aaac726 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -2235,6 +2235,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) m_transform.AddTail(pFGF);
*/
+#if INCLUDE_MPC_VIDEO_DECODER | INCLUDE_MPC_DXVA_VIDEO_DECODER
CMPCVideoDecFilter::FFmpegFilters = s.FFmpegFilters;
CMPCVideoDecFilter::DXVAFilters = s.DXVAFilters;
@@ -2243,6 +2244,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) {
CMPCVideoDecFilter::m_ref_frame_count_check_skip = true;
}
+#endif
// Blocked filters
diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index d0cebcd9c..40fb81ad5 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -582,7 +582,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) m_wndPlaylistBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndPlaylistBar.SetHeight(100);
LoadControlBar(&m_wndPlaylistBar, AFX_IDW_DOCKBAR_BOTTOM);
- m_wndPlaylistBar.LoadPlaylist();
+ m_wndPlaylistBar.LoadPlaylist(GetRecentFile());
m_wndEditListEditor.Create(this);
m_wndEditListEditor.SetBarStyle(m_wndEditListEditor.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
@@ -794,6 +794,18 @@ DROPEFFECT CMainFrame::OnDragScroll(DWORD dwKeyState, CPoint point) return DROPEFFECT_NONE;
}
+LPCTSTR CMainFrame::GetRecentFile()
+{
+ CRecentFileList& MRU = AfxGetAppSettings().MRU;
+ MRU.ReadList();
+ for(int i = 0; i < MRU.GetSize();i++)
+ {
+ if(!MRU[i].IsEmpty())
+ return MRU[i].GetString();
+ }
+ return NULL;
+}
+
void CMainFrame::LoadControlBar(CControlBar* pBar, UINT defDockBarID)
{
if(!pBar) return;
@@ -6082,6 +6094,9 @@ void CMainFrame::OnViewOptions() void CMainFrame::OnPlayPlay()
{
+ if(m_iMediaLoadState == MLS_CLOSED)
+ OpenCurPlaylistItem();
+
if(m_iMediaLoadState == MLS_LOADED)
{
if(GetMediaState() == State_Stopped) m_iSpeedLevel = 0;
@@ -6296,6 +6311,8 @@ void CMainFrame::OnUpdatePlayPauseStop(CCmdUI* pCmdUI) if(fs == State_Stopped && pCmdUI->m_nID == ID_PLAY_PAUSE) fEnable = false;
}
}
+ else if (pCmdUI->m_nID == ID_PLAY_PLAY && m_wndPlaylistBar.GetCount() > 0)
+ fEnable = true;
pCmdUI->Enable(fEnable);
}
@@ -12467,7 +12484,7 @@ void CMainFrame::OpenCurPlaylistItem(REFERENCE_TIME rtStart) return;
CPlaylistItem pli;
- if(!m_wndPlaylistBar.GetCur(pli)) m_wndPlaylistBar.SetFirst();
+ if(!m_wndPlaylistBar.GetCur(pli)) m_wndPlaylistBar.SetFirstSelected();
if(!m_wndPlaylistBar.GetCur(pli)) return;
CAutoPtr<OpenMediaData> p(m_wndPlaylistBar.GetCurOMD(rtStart));
@@ -13838,4 +13855,3 @@ UINT CMainFrame::OnPowerBroadcast(UINT nPowerEvent, UINT nEventData) return __super::OnPowerBroadcast(nPowerEvent, nEventData);
}
-
diff --git a/src/apps/mplayerc/MainFrm.h b/src/apps/mplayerc/MainFrm.h index c5feaa02f..b25e16193 100644 --- a/src/apps/mplayerc/MainFrm.h +++ b/src/apps/mplayerc/MainFrm.h @@ -505,6 +505,8 @@ protected: // control bar embedded members void OnDragLeave();
DROPEFFECT OnDragScroll(DWORD dwKeyState, CPoint point);
+ LPCTSTR GetRecentFile();
+
friend class CPPagePlayback; // TODO
friend class CMPlayerCApp; // TODO
diff --git a/src/apps/mplayerc/PPageInternalFilters.cpp b/src/apps/mplayerc/PPageInternalFilters.cpp index eed37fde8..0afeb47eb 100644 --- a/src/apps/mplayerc/PPageInternalFilters.cpp +++ b/src/apps/mplayerc/PPageInternalFilters.cpp @@ -193,6 +193,7 @@ s_filters[] = #if INTERNAL_DECODER_THEORA
{_T("Theora"), 3, FFM_THEORA, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
+ {NULL, 0, 0, 0, NULL}
};
IMPLEMENT_DYNAMIC(CPPageInternalFiltersListBox, CCheckListBox)
diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp index 58979b26d..473f833d9 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.cpp +++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp @@ -267,10 +267,8 @@ void CPlayerPlaylistBar::ParsePlayList(CString fn, CAtlList<CString>* subs) ParsePlayList(sl, subs);
}
-void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString>* subs)
+void CPlayerPlaylistBar::ResolveLinkFiles( CAtlList<CString> &fns )
{
- if(fns.IsEmpty()) return;
-
// resolve .lnk files
CComPtr<IShellLink> pSL;
@@ -283,15 +281,20 @@ void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString> CString& fn = fns.GetNext(pos);
TCHAR buff[_MAX_PATH];
if(CPath(fn).GetExtension().MakeLower() != _T(".lnk")
- || FAILED(pPF->Load(CStringW(fn), STGM_READ))
- || FAILED(pSL->Resolve(NULL, SLR_ANY_MATCH|SLR_NO_UI))
- || FAILED(pSL->GetPath(buff, countof(buff), NULL, 0)))
+ || FAILED(pPF->Load(CStringW(fn), STGM_READ))
+ || FAILED(pSL->Resolve(NULL, SLR_ANY_MATCH|SLR_NO_UI))
+ || FAILED(pSL->GetPath(buff, countof(buff), NULL, 0)))
continue;
fn = buff;
}
+}
- //
+void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString>* subs)
+{
+ if(fns.IsEmpty()) return;
+
+ ResolveLinkFiles(fns);
CAtlList<CString> sl;
if(SearchFiles(fns.GetHead(), sl))
@@ -478,6 +481,14 @@ void CPlayerPlaylistBar::Empty() void CPlayerPlaylistBar::Open(CAtlList<CString>& fns, bool fMulti, CAtlList<CString>* subs)
{
+ if (!fMulti)
+ {
+ ASSERT(fns.GetCount() == 1);
+ ResolveLinkFiles(fns);
+ if (SelectFileInPlaylist(fns.GetHead().GetString()))
+ return;
+ }
+
Empty();
Append(fns, fMulti, subs);
}
@@ -616,7 +627,7 @@ void CPlayerPlaylistBar::SetNext() {
POSITION pos = m_pl.GetPos(), org = pos;
while(m_pl.GetNextWrap(pos).m_fInvalid && pos != org);
-UpdateList();
+ UpdateList();
m_pl.SetPos(pos);
EnsureVisible(pos);
}
@@ -629,11 +640,27 @@ void CPlayerPlaylistBar::SetPrev() EnsureVisible(pos);
}
+void CPlayerPlaylistBar::SetFirstSelected()
+{
+ POSITION pos = m_list.GetFirstSelectedItemPosition();
+ if(pos)
+ pos = FindPos(m_list.GetNextSelectedItem(pos));
+ else
+ {
+ pos = m_pl.GetTailPosition();
+ POSITION org = pos;
+ while(m_pl.GetNextWrap(pos).m_fInvalid && pos != org);
+ }
+ UpdateList();
+ m_pl.SetPos(pos);
+ EnsureVisible(pos);
+}
+
void CPlayerPlaylistBar::SetFirst()
{
POSITION pos = m_pl.GetTailPosition(), org = pos;
while(m_pl.GetNextWrap(pos).m_fInvalid && pos != org);
-UpdateList();
+ UpdateList();
m_pl.SetPos(pos);
EnsureVisible(pos);
}
@@ -713,7 +740,26 @@ OpenMediaData* CPlayerPlaylistBar::GetCurOMD(REFERENCE_TIME rtStart) return NULL;
}
-void CPlayerPlaylistBar::LoadPlaylist()
+bool CPlayerPlaylistBar::SelectFileInPlaylist(LPCTSTR filename)
+{
+ if (!filename)
+ return false;
+ POSITION pos = m_pl.GetHeadPosition();
+ while(pos)
+ {
+ CPlaylistItem& pli = m_pl.GetAt(pos);
+ if (pli.FindFile(filename))
+ {
+ m_pl.SetPos(pos);
+ EnsureVisible(pos);
+ return true;
+ }
+ m_pl.GetNext(pos);
+ }
+ return false;
+}
+
+void CPlayerPlaylistBar::LoadPlaylist(LPCTSTR filename)
{
CString base;
if(AfxGetMyApp()->GetAppSavePath(base))
@@ -729,6 +775,7 @@ void CPlayerPlaylistBar::LoadPlaylist() {
ParseMPCPlayList(p);
Refresh();
+ SelectFileInPlaylist(filename);
}
}
}
@@ -1466,4 +1513,4 @@ void CPlayerPlaylistBar::OnLvnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) }
*pResult = 0;
-}
+}
\ No newline at end of file diff --git a/src/apps/mplayerc/PlayerPlaylistBar.h b/src/apps/mplayerc/PlayerPlaylistBar.h index 75f3d310f..147ed1207 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.h +++ b/src/apps/mplayerc/PlayerPlaylistBar.h @@ -47,6 +47,7 @@ private: void AddItem(CAtlList<CString>& fns, CAtlList<CString>* subs);
void ParsePlayList(CString fn, CAtlList<CString>* subs);
void ParsePlayList(CAtlList<CString>& fns, CAtlList<CString>* subs);
+ void ResolveLinkFiles( CAtlList<CString> &fns );
bool ParseBDMVPlayList(CString fn);
@@ -80,7 +81,11 @@ public: bool IsAtEnd();
bool GetCur(CPlaylistItem& pli);
CString GetCur();
- void SetNext(), SetPrev(), SetFirst(), SetLast();
+ void SetNext();
+ void SetPrev();
+ void SetFirstSelected();
+ void SetFirst();
+ void SetLast();
void SetCurValid(bool fValid);
void SetCurTime(REFERENCE_TIME rt);
@@ -95,9 +100,11 @@ public: OpenMediaData* GetCurOMD(REFERENCE_TIME rtStart = 0);
- void LoadPlaylist();
+ void LoadPlaylist(LPCTSTR filename);
void SavePlaylist();
+ bool SelectFileInPlaylist(LPCTSTR filename);
+
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL PreTranslateMessage(MSG* pMsg);
diff --git a/src/apps/mplayerc/Playlist.cpp b/src/apps/mplayerc/Playlist.cpp index 53e5ea562..b0e8bc006 100644 --- a/src/apps/mplayerc/Playlist.cpp +++ b/src/apps/mplayerc/Playlist.cpp @@ -69,10 +69,15 @@ CPlaylistItem& CPlaylistItem::operator = (const CPlaylistItem& pli) return(*this);
}
-POSITION CPlaylistItem::FindFile(CString path)
+POSITION CPlaylistItem::FindFile(LPCTSTR path)
{
POSITION pos = m_fns.GetHeadPosition();
- while(pos && !m_fns.GetAt(pos).CompareNoCase(path)) m_fns.GetNext(pos);
+ while(pos)
+ {
+ if (m_fns.GetAt(pos).CompareNoCase(path) == 0)
+ return pos;
+ m_fns.GetNext(pos);
+ }
return(NULL);
}
diff --git a/src/apps/mplayerc/Playlist.h b/src/apps/mplayerc/Playlist.h index 5aa6f854a..31265a4e2 100644 --- a/src/apps/mplayerc/Playlist.h +++ b/src/apps/mplayerc/Playlist.h @@ -50,7 +50,7 @@ public: CPlaylistItem(const CPlaylistItem& pli);
CPlaylistItem& operator = (const CPlaylistItem& pli);
- POSITION FindFile(CString path);
+ POSITION FindFile(LPCTSTR path);
CString GetLabel(int i = 0);
};
diff --git a/src/apps/mplayerc/mplayerc.cpp b/src/apps/mplayerc/mplayerc.cpp index be23a9d6e..d2ef521d6 100644 --- a/src/apps/mplayerc/mplayerc.cpp +++ b/src/apps/mplayerc/mplayerc.cpp @@ -232,7 +232,9 @@ public: #error Compiler is not supported!
#endif
+#if INCLUDE_MPC_VIDEO_DECODER | INCLUDE_MPC_DXVA_VIDEO_DECODER
m_FfmpegCompiler.Format (A2W(GetFfmpegCompiler()));
+#endif
UpdateData(FALSE);
return TRUE;
|