Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/apps/mplayerc/PlayerPlaylistBar.cpp')
-rw-r--r--src/apps/mplayerc/PlayerPlaylistBar.cpp341
1 files changed, 175 insertions, 166 deletions
diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp
index aa3207efe..56427c0e8 100644
--- a/src/apps/mplayerc/PlayerPlaylistBar.cpp
+++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp
@@ -48,7 +48,7 @@ CPlayerPlaylistBar::~CPlayerPlaylistBar()
BOOL CPlayerPlaylistBar::Create(CWnd* pParentWnd)
{
- if(!CSizingControlBarG::Create(_T("Playlist"), pParentWnd, ID_VIEW_PLAYLIST)) {
+ if (!CSizingControlBarG::Create(_T("Playlist"), pParentWnd, ID_VIEW_PLAYLIST)) {
return FALSE;
}
@@ -80,7 +80,7 @@ BOOL CPlayerPlaylistBar::Create(CWnd* pParentWnd)
BOOL CPlayerPlaylistBar::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CSizingControlBarG::PreCreateWindow(cs)) {
+ if (!CSizingControlBarG::PreCreateWindow(cs)) {
return FALSE;
}
@@ -91,13 +91,13 @@ BOOL CPlayerPlaylistBar::PreCreateWindow(CREATESTRUCT& cs)
BOOL CPlayerPlaylistBar::PreTranslateMessage(MSG* pMsg)
{
- if(IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
- if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
+ if (IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
+ if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
GetParentFrame()->ShowControlBar(this, FALSE, TRUE);
return TRUE;
}
- if(IsDialogMessage(pMsg)) {
+ if (IsDialogMessage(pMsg)) {
return TRUE;
}
}
@@ -117,18 +117,18 @@ void CPlayerPlaylistBar::AddItem(CAtlList<CString>& fns, CAtlList<CString>* subs
CPlaylistItem pli;
POSITION pos = fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString fn = fns.GetNext(pos);
- if(!fn.Trim().IsEmpty()) {
+ if (!fn.Trim().IsEmpty()) {
pli.m_fns.AddTail(fn);
}
}
- if(subs) {
+ if (subs) {
POSITION pos = subs->GetHeadPosition();
- while(pos) {
+ while (pos) {
CString fn = subs->GetNext(pos);
- if(!fn.Trim().IsEmpty()) {
+ if (!fn.Trim().IsEmpty()) {
pli.m_subs.AddTail(fn);
}
}
@@ -141,7 +141,7 @@ void CPlayerPlaylistBar::AddItem(CAtlList<CString>& fns, CAtlList<CString>* subs
static bool SearchFiles(CString mask, CAtlList<CString>& sl)
{
- if(mask.Find(_T("://")) >= 0) {
+ if (mask.Find(_T("://")) >= 0) {
return(false);
}
@@ -162,9 +162,9 @@ static bool SearchFiles(CString mask, CAtlList<CString>& sl)
WIN32_FIND_DATA fd;
HANDLE h = FindFirstFile(mask, &fd);
- if(h != INVALID_HANDLE_VALUE) {
+ if (h != INVALID_HANDLE_VALUE) {
do {
- if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
+ if (fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
continue;
}
@@ -173,22 +173,22 @@ static bool SearchFiles(CString mask, CAtlList<CString>& sl)
CString ext = fn.Mid(fn.ReverseFind('.')).MakeLower();
CString path = dir + fd.cFileName;
- if(!fFilterKnownExts || mf.FindExt(ext)) {
- for(int i = 0; i < mf.GetCount(); i++) {
+ if (!fFilterKnownExts || mf.FindExt(ext)) {
+ for (int i = 0; i < mf.GetCount(); i++) {
CMediaFormatCategory& mfc = mf.GetAt(i);
/* playlist files are skipped when playing the contents of an entire directory */
- if((mfc.FindExt(ext)) && (mf[i].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE)) != 0)) {
+ if ((mfc.FindExt(ext)) && (mf[i].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE)) != 0)) {
sl.AddTail(path);
break;
}
}
}
- } while(FindNextFile(h, &fd));
+ } while (FindNextFile(h, &fd));
FindClose(h);
- if(sl.GetCount() == 0 && mask.Find(_T(":\\")) == 1) {
+ if (sl.GetCount() == 0 && mask.Find(_T(":\\")) == 1) {
GetCDROMType(mask[0], sl);
}
}
@@ -215,10 +215,10 @@ void CPlayerPlaylistBar::ResolveLinkFiles( CAtlList<CString> &fns )
CComQIPtr<IPersistFile> pPF = pSL;
POSITION pos = fns.GetHeadPosition();
- while(pSL && pPF && pos) {
+ while (pSL && pPF && pos) {
CString& fn = fns.GetNext(pos);
TCHAR buff[_MAX_PATH];
- if(CPath(fn).GetExtension().MakeLower() != _T(".lnk")
+ 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))) {
@@ -231,21 +231,21 @@ void CPlayerPlaylistBar::ResolveLinkFiles( CAtlList<CString> &fns )
void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString>* subs)
{
- if(fns.IsEmpty()) {
+ if (fns.IsEmpty()) {
return;
}
- AppSettings& s = AfxGetAppSettings();
+ AppSettings& s = AfxGetAppSettings();
ResolveLinkFiles(fns);
CAtlList<CString> sl;
- if(SearchFiles(fns.GetHead(), sl)) {
- if(sl.GetCount() > 1) {
+ if (SearchFiles(fns.GetHead(), sl)) {
+ if (sl.GetCount() > 1) {
subs = NULL;
}
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
ParsePlayList(sl.GetNext(pos), subs);
}
return;
@@ -253,20 +253,20 @@ void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString>
CAtlList<CString> redir;
CStringA ct = GetContentType(fns.GetHead(), &redir);
- if(!redir.IsEmpty()) {
+ if (!redir.IsEmpty()) {
POSITION pos = redir.GetHeadPosition();
- while(pos) {
+ while (pos) {
ParsePlayList(sl.GetNext(pos), subs);
}
return;
}
- if(ct == "application/x-mpc-playlist") {
+ if (ct == "application/x-mpc-playlist") {
ParseMPCPlayList(fns.GetHead());
return;
} else {
#if INTERNAL_SOURCEFILTER_MPEG
- if(ct == "application/x-bdmv-playlist" && s.SrcFilters[SRC_MPEG]) {
+ if (ct == "application/x-bdmv-playlist" && s.SrcFilters[SRC_MPEG]) {
ParseBDMVPlayList(fns.GetHead());
return;
}
@@ -283,7 +283,7 @@ static int s_int_comp(const void* i1, const void* i2)
static CString CombinePath(CPath p, CString fn)
{
- if(fn.Find(':') >= 0 || fn.Find(_T("\\")) == 0) {
+ if (fn.Find(':') >= 0 || fn.Find(_T("\\")) == 0) {
return fn;
}
p.Append(CPath(fn));
@@ -316,63 +316,63 @@ bool CPlayerPlaylistBar::ParseMPCPlayList(CString fn)
CAtlArray<int> idx;
CWebTextFile f;
- if(!f.Open(fn) || !f.ReadString(str) || str != _T("MPCPLAYLIST")) {
+ if (!f.Open(fn) || !f.ReadString(str) || str != _T("MPCPLAYLIST")) {
return false;
}
- if(f.GetEncoding() == CTextFile::ASCII) {
+ if (f.GetEncoding() == CTextFile::ASCII) {
f.SetEncoding(CTextFile::ANSI);
}
CPath base(fn);
base.RemoveFileSpec();
- while(f.ReadString(str)) {
+ while (f.ReadString(str)) {
CAtlList<CString> sl;
Explode(str, sl, ',', 3);
- if(sl.GetCount() != 3) {
+ if (sl.GetCount() != 3) {
continue;
}
- if(int i = _ttoi(sl.RemoveHead())) {
+ if (int i = _ttoi(sl.RemoveHead())) {
CString key = sl.RemoveHead();
CString value = sl.RemoveHead();
- if(key == _T("type")) {
+ if (key == _T("type")) {
pli[i].m_type = (CPlaylistItem::type_t)_ttol(value);
idx.Add(i);
- } else if(key == _T("label")) {
+ } else if (key == _T("label")) {
pli[i].m_label = value;
- } else if(key == _T("filename")) {
+ } else if (key == _T("filename")) {
value = CombinePath(base, value);
pli[i].m_fns.AddTail(value);
- } else if(key == _T("subtitle")) {
+ } else if (key == _T("subtitle")) {
value = CombinePath(base, value);
pli[i].m_subs.AddTail(value);
- } else if(key == _T("video")) {
- while(pli[i].m_fns.GetCount() < 2) {
+ } else if (key == _T("video")) {
+ while (pli[i].m_fns.GetCount() < 2) {
pli[i].m_fns.AddTail(_T(""));
}
pli[i].m_fns.GetHead() = value;
- } else if(key == _T("audio")) {
- while(pli[i].m_fns.GetCount() < 2) {
+ } else if (key == _T("audio")) {
+ while (pli[i].m_fns.GetCount() < 2) {
pli[i].m_fns.AddTail(_T(""));
}
pli[i].m_fns.GetTail() = value;
- } else if(key == _T("vinput")) {
+ } else if (key == _T("vinput")) {
pli[i].m_vinput = _ttol(value);
- } else if(key == _T("vchannel")) {
+ } else if (key == _T("vchannel")) {
pli[i].m_vchannel = _ttol(value);
- } else if(key == _T("ainput")) {
+ } else if (key == _T("ainput")) {
pli[i].m_ainput = _ttol(value);
- } else if(key == _T("country")) {
+ } else if (key == _T("country")) {
pli[i].m_country = _ttol(value);
}
}
}
qsort(idx.GetData(), idx.GetCount(), sizeof(int), s_int_comp);
- for(int i = 0; i < idx.GetCount(); i++) {
+ for (int i = 0; i < idx.GetCount(); i++) {
m_pl.AddTail(pli[idx[i]]);
}
@@ -382,14 +382,14 @@ bool CPlayerPlaylistBar::ParseMPCPlayList(CString fn)
bool CPlayerPlaylistBar::SaveMPCPlayList(CString fn, CTextFile::enc e, bool fRemovePath)
{
CTextFile f;
- if(!f.Save(fn, e)) {
+ if (!f.Save(fn, e)) {
return false;
}
f.WriteString(_T("MPCPLAYLIST\n"));
POSITION pos = m_pl.GetHeadPosition(), pos2;
- for(int i = 1; pos; i++) {
+ for (int i = 1; pos; i++) {
CPlaylistItem& pli = m_pl.GetNext(pos);
CString idx;
@@ -399,15 +399,15 @@ bool CPlayerPlaylistBar::SaveMPCPlayList(CString fn, CTextFile::enc e, bool fRem
str.Format(_T("%d,type,%d"), i, pli.m_type);
f.WriteString(str + _T("\n"));
- if(!pli.m_label.IsEmpty()) {
+ if (!pli.m_label.IsEmpty()) {
f.WriteString(idx + _T(",label,") + pli.m_label + _T("\n"));
}
- if(pli.m_type == CPlaylistItem::file) {
+ if (pli.m_type == CPlaylistItem::file) {
pos2 = pli.m_fns.GetHeadPosition();
- while(pos2) {
+ while (pos2) {
CString fn = pli.m_fns.GetNext(pos2);
- if(fRemovePath) {
+ if (fRemovePath) {
CPath p(fn);
p.StripPath();
fn = (LPCTSTR)p;
@@ -416,16 +416,16 @@ bool CPlayerPlaylistBar::SaveMPCPlayList(CString fn, CTextFile::enc e, bool fRem
}
pos2 = pli.m_subs.GetHeadPosition();
- while(pos2) {
+ while (pos2) {
CString fn = pli.m_subs.GetNext(pos2);
- if(fRemovePath) {
+ if (fRemovePath) {
CPath p(fn);
p.StripPath();
fn = (LPCTSTR)p;
}
f.WriteString(idx + _T(",subtitle,") + fn + _T("\n"));
}
- } else if(pli.m_type == CPlaylistItem::device && pli.m_fns.GetCount() == 2) {
+ } else if (pli.m_type == CPlaylistItem::device && pli.m_fns.GetCount() == 2) {
f.WriteString(idx + _T(",video,") + pli.m_fns.GetHead() + _T("\n"));
f.WriteString(idx + _T(",audio,") + pli.m_fns.GetTail() + _T("\n"));
str.Format(_T("%d,vinput,%d"), i, pli.m_vinput);
@@ -448,11 +448,13 @@ void CPlayerPlaylistBar::Refresh()
ResizeListColumn();
}
-void CPlayerPlaylistBar::Empty()
+bool CPlayerPlaylistBar::Empty()
{
- m_pl.RemoveAll();
+ bool bWasPlaying = m_pl.RemoveAll();
m_list.DeleteAllItems();
SavePlaylist();
+
+ return bWasPlaying;
}
void CPlayerPlaylistBar::Open(CAtlList<CString>& fns, bool fMulti, CAtlList<CString>* subs)
@@ -464,10 +466,10 @@ void CPlayerPlaylistBar::Open(CAtlList<CString>& fns, bool fMulti, CAtlList<CStr
void CPlayerPlaylistBar::Append(CAtlList<CString>& fns, bool fMulti, CAtlList<CString>* subs)
{
- if(fMulti) {
+ if (fMulti) {
ASSERT(subs == NULL || subs->GetCount() == 0);
POSITION pos = fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
ParsePlayList(fns.GetNext(pos), NULL);
}
} else {
@@ -496,10 +498,10 @@ void CPlayerPlaylistBar::Append(CStringW vdn, CStringW adn, int vinput, int vcha
CAtlList<CStringW> sl;
CStringW vfn = GetFriendlyName(vdn);
CStringW afn = GetFriendlyName(adn);
- if(!vfn.IsEmpty()) {
+ if (!vfn.IsEmpty()) {
sl.AddTail(vfn);
}
- if(!afn.IsEmpty()) {
+ if (!afn.IsEmpty()) {
sl.AddTail(afn);
}
CStringW label = Implode(sl, '|');
@@ -516,7 +518,7 @@ void CPlayerPlaylistBar::SetupList()
m_list.DeleteAllItems();
POSITION pos = m_pl.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
CPlaylistItem& pli = m_pl.GetAt(pos);
m_list.SetItemData(m_list.InsertItem(i, pli.GetLabel()), (DWORD_PTR)pos);
m_list.SetItemText(i, COL_TIME, pli.GetLabel(1));
@@ -527,7 +529,7 @@ void CPlayerPlaylistBar::SetupList()
void CPlayerPlaylistBar::UpdateList()
{
POSITION pos = m_pl.GetHeadPosition();
- for(int i = 0, j = m_list.GetItemCount(); pos && i < j; i++) {
+ for (int i = 0, j = m_list.GetItemCount(); pos && i < j; i++) {
CPlaylistItem& pli = m_pl.GetAt(pos);
m_list.SetItemData(i, (DWORD_PTR)pos);
m_list.SetItemText(i, COL_NAME, pli.GetLabel(0));
@@ -539,7 +541,7 @@ void CPlayerPlaylistBar::UpdateList()
void CPlayerPlaylistBar::EnsureVisible(POSITION pos)
{
int i = FindItem(m_pl.GetPos());
- if(i < 0) {
+ if (i < 0) {
return;
}
m_list.EnsureVisible(i, TRUE);
@@ -548,8 +550,8 @@ void CPlayerPlaylistBar::EnsureVisible(POSITION pos)
int CPlayerPlaylistBar::FindItem(POSITION pos)
{
- for(int i = 0; i < m_list.GetItemCount(); i++)
- if((POSITION)m_list.GetItemData(i) == pos) {
+ for (int i = 0; i < m_list.GetItemCount(); i++)
+ if ((POSITION)m_list.GetItemData(i) == pos) {
return(i);
}
return(-1);
@@ -557,7 +559,7 @@ int CPlayerPlaylistBar::FindItem(POSITION pos)
POSITION CPlayerPlaylistBar::FindPos(int i)
{
- if(i < 0) {
+ if (i < 0) {
return(NULL);
}
return((POSITION)m_list.GetItemData(i));
@@ -585,7 +587,7 @@ bool CPlayerPlaylistBar::IsAtEnd()
bool CPlayerPlaylistBar::GetCur(CPlaylistItem& pli)
{
- if(!m_pl.GetPos()) {
+ if (!m_pl.GetPos()) {
return(false);
}
pli = m_pl.GetAt(m_pl.GetPos());
@@ -594,7 +596,7 @@ bool CPlayerPlaylistBar::GetCur(CPlaylistItem& pli)
CPlaylistItem* CPlayerPlaylistBar::GetCur()
{
- if(!m_pl.GetPos()) {
+ if (!m_pl.GetPos()) {
return NULL;
}
return &m_pl.GetAt(m_pl.GetPos());
@@ -604,7 +606,7 @@ CString CPlayerPlaylistBar::GetCurFileName()
{
CString fn;
CPlaylistItem* pli = GetCur();
- if(pli && !pli->m_fns.IsEmpty()) {
+ if (pli && !pli->m_fns.IsEmpty()) {
fn = pli->m_fns.GetHead();
}
return(fn);
@@ -613,7 +615,7 @@ CString CPlayerPlaylistBar::GetCurFileName()
void CPlayerPlaylistBar::SetNext()
{
POSITION pos = m_pl.GetPos(), org = pos;
- while(m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
;
}
UpdateList();
@@ -624,7 +626,7 @@ void CPlayerPlaylistBar::SetNext()
void CPlayerPlaylistBar::SetPrev()
{
POSITION pos = m_pl.GetPos(), org = pos;
- while(m_pl.GetPrevWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetPrevWrap(pos).m_fInvalid && pos != org) {
;
}
m_pl.SetPos(pos);
@@ -634,12 +636,12 @@ void CPlayerPlaylistBar::SetPrev()
void CPlayerPlaylistBar::SetFirstSelected()
{
POSITION pos = m_list.GetFirstSelectedItemPosition();
- if(pos) {
+ 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) {
+ while (m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
;
}
}
@@ -651,7 +653,7 @@ void CPlayerPlaylistBar::SetFirstSelected()
void CPlayerPlaylistBar::SetFirst()
{
POSITION pos = m_pl.GetTailPosition(), org = pos;
- while(m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
;
}
UpdateList();
@@ -662,7 +664,7 @@ void CPlayerPlaylistBar::SetFirst()
void CPlayerPlaylistBar::SetLast()
{
POSITION pos = m_pl.GetHeadPosition(), org = pos;
- while(m_pl.GetPrevWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetPrevWrap(pos).m_fInvalid && pos != org) {
;
}
m_pl.SetPos(pos);
@@ -672,9 +674,9 @@ void CPlayerPlaylistBar::SetLast()
void CPlayerPlaylistBar::SetCurValid(bool fValid)
{
POSITION pos = m_pl.GetPos();
- if(pos) {
+ if (pos) {
m_pl.GetAt(pos).m_fInvalid = !fValid;
- if(!fValid) {
+ if (!fValid) {
int i = FindItem(pos);
m_list.RedrawItems(i, i);
}
@@ -684,7 +686,7 @@ void CPlayerPlaylistBar::SetCurValid(bool fValid)
void CPlayerPlaylistBar::SetCurTime(REFERENCE_TIME rt)
{
POSITION pos = m_pl.GetPos();
- if(pos) {
+ if (pos) {
CPlaylistItem& pli = m_pl.GetAt(pos);
pli.m_duration = rt;
m_list.SetItemText(FindItem(pos), COL_TIME, pli.GetLabel(1));
@@ -694,7 +696,7 @@ void CPlayerPlaylistBar::SetCurTime(REFERENCE_TIME rt)
OpenMediaData* CPlayerPlaylistBar::GetCurOMD(REFERENCE_TIME rtStart)
{
CPlaylistItem* pli = GetCur();
- if(pli == NULL) {
+ if (pli == NULL) {
return NULL;
}
@@ -702,19 +704,19 @@ OpenMediaData* CPlayerPlaylistBar::GetCurOMD(REFERENCE_TIME rtStart)
CString fn = CString(pli->m_fns.GetHead()).MakeLower();
- if(fn.Find(_T("video_ts.ifo")) >= 0
+ if (fn.Find(_T("video_ts.ifo")) >= 0
|| fn.Find(_T(".ratdvd")) >= 0) {
- if(OpenDVDData* p = DNew OpenDVDData()) {
+ if (OpenDVDData* p = DNew OpenDVDData()) {
p->path = pli->m_fns.GetHead();
p->subs.AddTailList(&pli->m_subs);
return p;
}
}
- if(pli->m_type == CPlaylistItem::device) {
- if(OpenDeviceData* p = DNew OpenDeviceData()) {
+ if (pli->m_type == CPlaylistItem::device) {
+ if (OpenDeviceData* p = DNew OpenDeviceData()) {
POSITION pos = pli->m_fns.GetHeadPosition();
- for(int i = 0; i < countof(p->DisplayName) && pos; i++) {
+ for (int i = 0; i < countof(p->DisplayName) && pos; i++) {
p->DisplayName[i] = pli->m_fns.GetNext(pos);
}
p->vinput = pli->m_vinput;
@@ -723,7 +725,7 @@ OpenMediaData* CPlayerPlaylistBar::GetCurOMD(REFERENCE_TIME rtStart)
return p;
}
} else {
- if(OpenFileData* p = DNew OpenFileData()) {
+ if (OpenFileData* p = DNew OpenFileData()) {
p->fns.AddTailList(&pli->m_fns);
p->subs.AddTailList(&pli->m_subs);
p->rtStart = rtStart;
@@ -740,7 +742,7 @@ bool CPlayerPlaylistBar::SelectFileInPlaylist(LPCTSTR filename)
return false;
}
POSITION pos = m_pl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CPlaylistItem& pli = m_pl.GetAt(pos);
if (pli.FindFile(filename)) {
m_pl.SetPos(pos);
@@ -756,12 +758,12 @@ void CPlayerPlaylistBar::LoadPlaylist(LPCTSTR filename)
{
CString base;
- if(AfxGetMyApp()->GetAppSavePath(base)) {
+ if (AfxGetMyApp()->GetAppSavePath(base)) {
CPath p;
p.Combine(base, _T("default.mpcpl"));
- if(p.FileExists()) {
- if(AfxGetAppSettings().bRememberPlaylistItems) {
+ if (p.FileExists()) {
+ if (AfxGetAppSettings().bRememberPlaylistItems) {
ParseMPCPlayList(p);
Refresh();
SelectFileInPlaylist(filename);
@@ -776,18 +778,18 @@ void CPlayerPlaylistBar::SavePlaylist()
{
CString base;
- if(AfxGetMyApp()->GetAppSavePath(base)) {
+ if (AfxGetMyApp()->GetAppSavePath(base)) {
CPath p;
p.Combine(base, _T("default.mpcpl"));
- if(AfxGetAppSettings().bRememberPlaylistItems) {
+ if (AfxGetAppSettings().bRememberPlaylistItems) {
// Only create this folder when needed
- if(!::PathFileExists(base)) {
+ if (!::PathFileExists(base)) {
::CreateDirectory(base, NULL);
}
SaveMPCPlayList(p, CTextFile::UTF8, false);
- } else if(p.FileExists()) {
+ } else if (p.FileExists()) {
::DeleteFile(p);
}
}
@@ -816,7 +818,7 @@ END_MESSAGE_MAP()
void CPlayerPlaylistBar::ResizeListColumn()
{
- if(::IsWindow(m_list.m_hWnd)) {
+ if (::IsWindow(m_list.m_hWnd)) {
CRect r;
GetClientRect(r);
r.DeflateRect(2, 2);
@@ -843,15 +845,15 @@ void CPlayerPlaylistBar::OnLvnKeyDown(NMHDR* pNMHDR, LRESULT* pResult)
CList<int> items;
POSITION pos = m_list.GetFirstSelectedItemPosition();
- while(pos) {
+ while (pos) {
items.AddHead(m_list.GetNextSelectedItem(pos));
}
- if(pLVKeyDown->wVKey == VK_DELETE && items.GetCount() > 0) {
+ if (pLVKeyDown->wVKey == VK_DELETE && items.GetCount() > 0) {
pos = items.GetHeadPosition();
- while(pos) {
+ while (pos) {
int i = items.GetNext(pos);
- if(m_pl.RemoveAt(FindPos(i))) {
+ if (m_pl.RemoveAt(FindPos(i))) {
((CMainFrame*)AfxGetMainWnd())->CloseMedia();
}
m_list.DeleteItem(i);
@@ -865,7 +867,7 @@ void CPlayerPlaylistBar::OnLvnKeyDown(NMHDR* pNMHDR, LRESULT* pResult)
ResizeListColumn();
*pResult = TRUE;
- } else if(pLVKeyDown->wVKey == VK_SPACE && items.GetCount() == 1) {
+ } else if (pLVKeyDown->wVKey == VK_SPACE && items.GetCount() == 1) {
m_pl.SetPos(FindPos(items.GetHead()));
((CMainFrame*)AfxGetMainWnd())->OpenCurPlaylistItem();
@@ -878,7 +880,7 @@ void CPlayerPlaylistBar::OnNMDblclkList(NMHDR* pNMHDR, LRESULT* pResult)
{
LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR;
- if(lpnmlv->iItem >= 0 && lpnmlv->iSubItem >= 0) {
+ if (lpnmlv->iItem >= 0 && lpnmlv->iSubItem >= 0) {
AppSettings& s = AfxGetAppSettings();
FILE_POSITION* FilePosition = s.CurrentFilePosition();
if (FilePosition) {
@@ -899,11 +901,11 @@ void CPlayerPlaylistBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
*pResult = CDRF_DODEFAULT;
- if(CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
+ if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
{
*pResult = CDRF_NOTIFYPOSTPAINT|CDRF_NOTIFYITEMDRAW;
}
- else if(CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
+ else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
{
pLVCD->nmcd.uItemState &= ~CDIS_SELECTED;
pLVCD->nmcd.uItemState &= ~CDIS_FOCUS;
@@ -913,11 +915,11 @@ void CPlayerPlaylistBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
*pResult = CDRF_NOTIFYPOSTPAINT;
}
- else if(CDDS_ITEMPOSTPAINT == pLVCD->nmcd.dwDrawStage)
+ else if (CDDS_ITEMPOSTPAINT == pLVCD->nmcd.dwDrawStage)
{
int nItem = static_cast<int>(pLVCD->nmcd.dwItemSpec);
- if(m_list.GetItemState(pLVCD->nmcd.dwItemSpec, LVIS_SELECTED))
+ if (m_list.GetItemState(pLVCD->nmcd.dwItemSpec, LVIS_SELECTED))
{
CRect r, r2;
m_list.GetItemRect(nItem, &r, LVIR_BOUNDS);
@@ -928,7 +930,7 @@ void CPlayerPlaylistBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
*pResult = CDRF_SKIPDEFAULT;
}
- else if(CDDS_POSTPAINT == pLVCD->nmcd.dwDrawStage)
+ else if (CDDS_POSTPAINT == pLVCD->nmcd.dwDrawStage)
{
}
}
@@ -936,7 +938,7 @@ void CPlayerPlaylistBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
- if(nIDCtl != IDC_PLAYLIST) {
+ if (nIDCtl != IDC_PLAYLIST) {
return;
}
@@ -948,7 +950,7 @@ void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruc
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
- if(!!m_list.GetItemState(nItem, LVIS_SELECTED)) {
+ if (!!m_list.GetItemState(nItem, LVIS_SELECTED)) {
FillRect(pDC->m_hDC, rcItem, CBrush(0xf1dacc));
FrameRect(pDC->m_hDC, rcItem, CBrush(0xc56a31));
} else {
@@ -956,16 +958,16 @@ void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruc
}
COLORREF textcolor = fSelected?0xff:0;
- if(pli.m_fInvalid) {
+ if (pli.m_fInvalid) {
textcolor |= 0xA0A0A0;
}
CString time = !pli.m_fInvalid ? m_list.GetItemText(nItem, COL_TIME) : _T("Invalid");
CSize timesize(0, 0);
CPoint timept(rcItem.right, 0);
- if(time.GetLength() > 0) {
+ if (time.GetLength() > 0) {
timesize = pDC->GetTextExtent(time);
- if((3+timesize.cx+3) < rcItem.Width()/2) {
+ if ((3+timesize.cx+3) < rcItem.Width()/2) {
timept = CPoint(rcItem.right-(3+timesize.cx+3), (rcItem.top+rcItem.bottom-timesize.cy)/2);
pDC->SetTextColor(textcolor);
@@ -977,12 +979,12 @@ void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruc
fmt.Format(_T("%%0%dd. %%s"), (int)log10(0.1+m_pl.GetCount())+1);
file.Format(fmt, nItem+1, m_list.GetItemText(nItem, COL_NAME));
CSize filesize = pDC->GetTextExtent(file);
- while(3+filesize.cx+6 > timept.x && file.GetLength() > 3) {
+ while (3+filesize.cx+6 > timept.x && file.GetLength() > 3) {
file = file.Left(file.GetLength()-4) + _T("...");
filesize = pDC->GetTextExtent(file);
}
- if(file.GetLength() > 3) {
+ if (file.GetLength() > 3) {
pDC->SetTextColor(textcolor);
pDC->TextOut(rcItem.left+3, (rcItem.top+rcItem.bottom-filesize.cy)/2, file);
}
@@ -1007,7 +1009,7 @@ void CPlayerPlaylistBar::OnDropFiles(HDROP hDropInfo)
CAtlList<CString> sl;
UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
- for(UINT iFile = 0; iFile < nFiles; iFile++) {
+ for (UINT iFile = 0; iFile < nFiles; iFile++) {
TCHAR szFileName[_MAX_PATH];
::DragQueryFile(hDropInfo, iFile, szFileName, _MAX_PATH);
sl.AddTail(szFileName);
@@ -1039,7 +1041,7 @@ void CPlayerPlaylistBar::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult)
void CPlayerPlaylistBar::OnMouseMove(UINT nFlags, CPoint point)
{
- if(m_bDragging) {
+ if (m_bDragging) {
m_ptDropPoint = point;
ClientToScreen(&m_ptDropPoint);
@@ -1055,13 +1057,13 @@ void CPlayerPlaylistBar::OnMouseMove(UINT nFlags, CPoint point)
int iTopItem = m_list.GetTopIndex();
int iBottomItem = m_list.GetBottomIndex();
- if(iOverItem == iTopItem && iTopItem != 0) { // top of list
+ if (iOverItem == iTopItem && iTopItem != 0) { // top of list
SetTimer(1, 100, NULL);
} else {
KillTimer(1);
}
- if(iOverItem >= iBottomItem && iBottomItem != (m_list.GetItemCount() - 1)) { // bottom of list
+ if (iOverItem >= iBottomItem && iBottomItem != (m_list.GetItemCount() - 1)) { // bottom of list
SetTimer(2, 100, NULL);
} else {
KillTimer(2);
@@ -1077,19 +1079,19 @@ void CPlayerPlaylistBar::OnTimer(UINT_PTR nIDEvent)
int iTopItem = m_list.GetTopIndex();
int iBottomItem = iTopItem + m_list.GetCountPerPage() - 1;
- if(m_bDragging) {
+ if (m_bDragging) {
m_pDragImage->DragShowNolock(FALSE);
- if(nIDEvent == 1) {
+ if (nIDEvent == 1) {
m_list.EnsureVisible(iTopItem - 1, false);
m_list.UpdateWindow();
- if(m_list.GetTopIndex() == 0) {
+ if (m_list.GetTopIndex() == 0) {
KillTimer(1);
}
- } else if(nIDEvent == 2) {
+ } else if (nIDEvent == 2) {
m_list.EnsureVisible(iBottomItem + 1, false);
m_list.UpdateWindow();
- if(m_list.GetBottomIndex() == (m_list.GetItemCount() - 1)) {
+ if (m_list.GetBottomIndex() == (m_list.GetItemCount() - 1)) {
KillTimer(2);
}
}
@@ -1102,7 +1104,7 @@ void CPlayerPlaylistBar::OnTimer(UINT_PTR nIDEvent)
void CPlayerPlaylistBar::OnLButtonUp(UINT nFlags, CPoint point)
{
- if(m_bDragging) {
+ if (m_bDragging) {
::ReleaseCapture();
m_bDragging = FALSE;
@@ -1118,7 +1120,7 @@ void CPlayerPlaylistBar::OnLButtonUp(UINT nFlags, CPoint point)
CPoint pt(point);
ClientToScreen(&pt);
- if(WindowFromPoint(pt) == &m_list) {
+ if (WindowFromPoint(pt) == &m_list) {
DropItemOnList();
}
}
@@ -1143,7 +1145,7 @@ void CPlayerPlaylistBar::DropItemOnList()
lvi.cchTextMax = _MAX_PATH;
m_list.GetItem(&lvi);
- if(m_nDropIndex < 0) {
+ if (m_nDropIndex < 0) {
m_nDropIndex = m_list.GetItemCount();
}
lvi.iItem = m_nDropIndex;
@@ -1154,10 +1156,10 @@ void CPlayerPlaylistBar::DropItemOnList()
lvi.mask = LVIF_TEXT;
lvi.iItem = m_nDropIndex;
//INDEX OF DRAGGED ITEM WILL CHANGE IF ITEM IS DROPPED ABOVE ITSELF
- if(m_nDropIndex < m_nDragIndex) {
+ if (m_nDropIndex < m_nDragIndex) {
m_nDragIndex++;
}
- for(int col=1; col < nColumnCount; col++) {
+ for (int col=1; col < nColumnCount; col++) {
_tcscpy(lvi.pszText, (LPCTSTR)(m_list.GetItemText(m_nDragIndex, col)));
lvi.iSubItem = col;
m_list.SetItem(&lvi);
@@ -1167,20 +1169,20 @@ void CPlayerPlaylistBar::DropItemOnList()
CList<CPlaylistItem> tmp;
UINT id = (UINT)-1;
- for(int i = 0; i < m_list.GetItemCount(); i++) {
+ for (int i = 0; i < m_list.GetItemCount(); i++) {
POSITION pos = (POSITION)m_list.GetItemData(i);
CPlaylistItem& pli = m_pl.GetAt(pos);
tmp.AddTail(pli);
- if(pos == m_pl.GetPos()) {
+ if (pos == m_pl.GetPos()) {
id = pli.m_id;
}
}
m_pl.RemoveAll();
POSITION pos = tmp.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
CPlaylistItem& pli = tmp.GetNext(pos);
m_pl.AddTail(pli);
- if(pli.m_id == id) {
+ if (pli.m_id == id) {
m_pl.SetPos(m_pl.GetTailPosition());
}
m_list.SetItemData(i, (DWORD_PTR)m_pl.GetTailPosition());
@@ -1200,7 +1202,7 @@ BOOL CPlayerPlaylistBar::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResul
int row = ((pNMHDR->idFrom-1) >> 10) & 0x3fffff;
int col = (pNMHDR->idFrom-1) & 0x3ff;
- if(row < 0 || row >= m_pl.GetCount()) {
+ if (row < 0 || row >= m_pl.GetCount()) {
return FALSE;
}
@@ -1208,37 +1210,37 @@ BOOL CPlayerPlaylistBar::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResul
CString strTipText;
- if(col == COL_NAME) {
+ if (col == COL_NAME) {
POSITION pos = pli.m_fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
strTipText += _T("\n") + pli.m_fns.GetNext(pos);
}
strTipText.Trim();
- if(pli.m_type == CPlaylistItem::device) {
+ if (pli.m_type == CPlaylistItem::device) {
CString str;
str.Format(_T("Video Input %d"), pli.m_vinput);
- if(pli.m_vinput >= 0) {
+ if (pli.m_vinput >= 0) {
strTipText += _T("\n") + str;
}
str.Format(_T("Video Channel %d"), pli.m_vchannel);
- if(pli.m_vchannel >= 0) {
+ if (pli.m_vchannel >= 0) {
strTipText += _T("\n") + str;
}
str.Format(_T("Audio Input %d"), pli.m_ainput);
- if(pli.m_ainput >= 0) {
+ if (pli.m_ainput >= 0) {
strTipText += _T("\n") + str;
}
}
::SendMessage(pNMHDR->hwndFrom, TTM_SETMAXTIPWIDTH, 0, (LPARAM)(INT)1000);
- } else if(col == COL_TIME) {
+ } else if (col == COL_TIME) {
return FALSE;
}
static CStringW m_strTipTextW;
- if(pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
+ if (pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
m_strTipTextW = strTipText;
pTTTW->lpszText = (LPWSTR)(LPCWSTR)m_strTipTextW;
}
@@ -1263,7 +1265,7 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
m.CreatePopupMenu();
enum {
- M_OPEN=1, M_ADD, M_REMOVE, M_CLIPBOARD, M_SAVEAS,
+ M_OPEN=1, M_ADD, M_REMOVE, M_CLEAR, M_CLIPBOARD, M_SAVEAS,
M_SORTBYNAME, M_SORTBYPATH, M_RANDOMIZE, M_SORTBYID,
M_REMEMBERPLAYLIST, M_SHUFFLE, M_HIDEFULLSCREEN
};
@@ -1271,11 +1273,13 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
AppSettings& s = AfxGetAppSettings();
m.AppendMenu(MF_STRING|(!fOnItem?(MF_DISABLED|MF_GRAYED):MF_ENABLED), M_OPEN, ResStr(IDS_PLAYLIST_OPEN));
- if(((CMainFrame*)AfxGetMainWnd())->GetPlaybackMode() == PM_CAPTURE) {
+ if (((CMainFrame*)AfxGetMainWnd())->GetPlaybackMode() == PM_CAPTURE) {
m.AppendMenu(MF_STRING|MF_ENABLED, M_ADD, ResStr(IDS_PLAYLIST_ADD));
}
m.AppendMenu(MF_STRING|(/*fSelected||*/!fOnItem?(MF_DISABLED|MF_GRAYED):MF_ENABLED), M_REMOVE, ResStr(IDS_PLAYLIST_REMOVE));
m.AppendMenu(MF_SEPARATOR);
+ m.AppendMenu(MF_STRING|(!m_pl.GetCount()?(MF_DISABLED|MF_GRAYED):MF_ENABLED), M_CLEAR, ResStr(IDS_PLAYLIST_CLEAR));
+ m.AppendMenu(MF_SEPARATOR);
m.AppendMenu(MF_STRING|(!fOnItem?(MF_DISABLED|MF_GRAYED):MF_ENABLED), M_CLIPBOARD, ResStr(IDS_PLAYLIST_COPYTOCLIPBOARD));
m.AppendMenu(MF_STRING|(!m_pl.GetCount()?(MF_DISABLED|MF_GRAYED):MF_ENABLED), M_SAVEAS, ResStr(IDS_PLAYLIST_SAVEAS));
m.AppendMenu(MF_SEPARATOR);
@@ -1292,7 +1296,7 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
int nID = (int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this);
- switch(nID) {
+ switch (nID) {
case M_OPEN:
m_pl.SetPos(pos);
m_list.Invalidate();
@@ -1303,12 +1307,17 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
m_pl.SetPos(m_pl.GetTailPosition());
break;
case M_REMOVE:
- if(m_pl.RemoveAt(pos)) {
+ if (m_pl.RemoveAt(pos)) {
pMainFrm->CloseMedia();
}
m_list.DeleteItem(lvhti.iItem);
SavePlaylist();
break;
+ case M_CLEAR:
+ if (Empty()) {
+ pMainFrm->CloseMedia();
+ }
+ break;
case M_SORTBYID:
m_pl.SortById();
SetupList();
@@ -1330,18 +1339,18 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
SavePlaylist();
break;
case M_CLIPBOARD:
- if(OpenClipboard() && EmptyClipboard()) {
+ if (OpenClipboard() && EmptyClipboard()) {
CString str;
CPlaylistItem& pli = m_pl.GetAt(pos);
POSITION pos = pli.m_fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
str += _T("\r\n") + pli.m_fns.GetNext(pos);
}
str.Trim();
- if(HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, (str.GetLength()+1)*sizeof(TCHAR))) {
- if(TCHAR* s = (TCHAR*)GlobalLock(h)) {
+ if (HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, (str.GetLength()+1)*sizeof(TCHAR))) {
+ if (TCHAR* s = (TCHAR*)GlobalLock(h)) {
_tcscpy(s, str);
GlobalUnlock(h);
#ifdef UNICODE
@@ -1360,12 +1369,12 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
_T("Media Player Classic playlist (*.mpcpl)|*.mpcpl|Playlist (*.pls)|*.pls|Winamp playlist (*.m3u)|*.m3u|Windows Media playlist (*.asx)|*.asx||"),
this);
- if(fd.DoModal() != IDOK) {
+ if (fd.DoModal() != IDOK) {
break;
}
CTextFile::enc encoding = (CTextFile::enc)fd.GetEncoding();
- if(encoding == CTextFile::ASCII) {
+ if (encoding == CTextFile::ASCII) {
encoding = CTextFile::ANSI;
}
@@ -1373,7 +1382,7 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
CPath path(fd.GetPathName());
- switch(idx) {
+ switch (idx) {
case 1:
path.AddExtension(_T(".mpcpl"));
break;
@@ -1397,45 +1406,45 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
CString base = (LPCTSTR)p;
pos = m_pl.GetHeadPosition();
- while(pos && fRemovePath) {
+ while (pos && fRemovePath) {
CPlaylistItem& pli = m_pl.GetNext(pos);
- if(pli.m_type != CPlaylistItem::file) {
+ if (pli.m_type != CPlaylistItem::file) {
fRemovePath = false;
} else {
POSITION pos;
pos = pli.m_fns.GetHeadPosition();
- while(pos && fRemovePath) {
+ while (pos && fRemovePath) {
CString fn = pli.m_fns.GetNext(pos);
CPath p(fn);
p.RemoveFileSpec();
- if(base != (LPCTSTR)p) {
+ if (base != (LPCTSTR)p) {
fRemovePath = false;
}
}
pos = pli.m_subs.GetHeadPosition();
- while(pos && fRemovePath) {
+ while (pos && fRemovePath) {
CString fn = pli.m_subs.GetNext(pos);
CPath p(fn);
p.RemoveFileSpec();
- if(base != (LPCTSTR)p) {
+ if (base != (LPCTSTR)p) {
fRemovePath = false;
}
}
}
}
- if(idx == 1) {
+ if (idx == 1) {
SaveMPCPlayList(path, encoding, fRemovePath);
break;
}
CTextFile f;
- if(!f.Save(path, encoding)) {
+ if (!f.Save(path, encoding)) {
break;
}
@@ -1448,17 +1457,17 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
pos = m_pl.GetHeadPosition();
CString str;
int i;
- for(i = 0; pos; i++) {
+ for (i = 0; pos; i++) {
CPlaylistItem& pli = m_pl.GetNext(pos);
- if(pli.m_type != CPlaylistItem::file) {
+ if (pli.m_type != CPlaylistItem::file) {
continue;
}
CString fn = pli.m_fns.GetHead();
/*
- if(fRemovePath)
+ if (fRemovePath)
{
CPath p(path);
p.StripPath();
@@ -1466,7 +1475,7 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p)
}
*/
- switch(idx) {
+ switch (idx) {
case 2:
str.Format(_T("File%d=%s\n"), i+1, fn);
break;
@@ -1509,7 +1518,7 @@ void CPlayerPlaylistBar::OnLvnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVDISPINFO* pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
- if(pDispInfo->item.iItem >= 0 && pDispInfo->item.pszText) {
+ if (pDispInfo->item.iItem >= 0 && pDispInfo->item.pszText) {
CPlaylistItem& pli = m_pl.GetAt((POSITION)m_list.GetItemData(pDispInfo->item.iItem));
pli.m_label = pDispInfo->item.pszText;
m_list.SetItemText(pDispInfo->item.iItem, 0, pDispInfo->item.pszText);