From d02f2bf2124d97bb6790e07fde09aca10f7227cd Mon Sep 17 00:00:00 2001 From: Zhong Yang Date: Fri, 22 Nov 2019 21:57:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MusicPlayer2/MusicPlayer2.rc | Bin 368800 -> 369184 bytes MusicPlayer2/MusicPlayerDlg.cpp | 29 +++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/MusicPlayer2/MusicPlayer2.rc b/MusicPlayer2/MusicPlayer2.rc index cc3b86d0033080baadc8b3e05609a940b0b88857..ba82e4dd7af7adc7315b1485da3914caffe5c481 100644 GIT binary patch delta 76 zcmV-S0JHy~!4{yz7J#$?Y|58TF9NKV0|F$Mo}~e9m#`@U!k0j-0S=ZY0tAP?%K?YJ i%L1pq%LCAtz+?mlmdymFmmtXm9EZl61h>YU1=<9~u^=x1 delta 54 zcmZ2*L~Ox9v4$;-Ij5%gEoH2mUZBNvXu881M!x9>)R|b?>&`F&G1Kz8Gt3v-?dGy< Kx0}oQhy?(O&lddv diff --git a/MusicPlayer2/MusicPlayerDlg.cpp b/MusicPlayer2/MusicPlayerDlg.cpp index 40394998..d2284080 100644 --- a/MusicPlayer2/MusicPlayerDlg.cpp +++ b/MusicPlayer2/MusicPlayerDlg.cpp @@ -1098,7 +1098,7 @@ void CMusicPlayerDlg::IniPlaylistPopupMenu() } }; - CMenu* add_to_menu = theApp.m_menu_set.m_list_popup_menu.GetSubMenu(0)->GetSubMenu(8); + CMenu* add_to_menu = theApp.m_menu_set.m_list_popup_menu.GetSubMenu(0)->GetSubMenu(10); ASSERT(add_to_menu != nullptr); initAddToMenu(add_to_menu); @@ -3297,13 +3297,21 @@ void CMusicPlayerDlg::OnCopyFileTo() { vector source_files; for (const auto& index : m_items_selected) - source_files.push_back(CPlayer::GetInstance().GetCurrentDir() + CPlayer::GetInstance().GetPlayList()[index].file_name); + { + const auto& song = CPlayer::GetInstance().GetPlayList()[index]; + if(!song.is_cue) + source_files.push_back(song.file_path); + } + if (source_files.empty()) + return; CCommon::CopyFiles(this->GetSafeHwnd(), source_files, wstring(folderPickerDlg.GetPathName())); } else { - wstring source_file = CPlayer::GetInstance().GetCurrentDir() + CPlayer::GetInstance().GetPlayList()[m_item_selected].file_name; - CCommon::CopyAFile(this->GetSafeHwnd(), CPlayer::GetInstance().GetCurrentFilePath(), wstring(folderPickerDlg.GetPathName())); + const auto& song = CPlayer::GetInstance().GetPlayList()[m_item_selected]; + if (song.is_cue) + return; + CCommon::CopyAFile(this->GetSafeHwnd(), song.file_path, wstring(folderPickerDlg.GetPathName())); } } } @@ -3333,14 +3341,23 @@ void CMusicPlayerDlg::OnMoveFileTo() if (CCommon::IsItemInVector(m_items_selected, CPlayer::GetInstance().GetIndex())) //如果选中的文件中有正在播放的文件,则移动前必须先关闭文件 CPlayer::GetInstance().MusicControl(Command::CLOSE); for (const auto& index : m_items_selected) - source_files.push_back(CPlayer::GetInstance().GetCurrentDir() + CPlayer::GetInstance().GetPlayList()[index].file_name); + { + const auto& song = CPlayer::GetInstance().GetPlayList()[index]; + if(!song.is_cue) + source_files.push_back(song.file_path); + } + if (source_files.empty()) + return; rtn = CCommon::MoveFiles(m_hWnd, source_files, wstring(folderPickerDlg.GetPathName())); } else { if (m_item_selected == CPlayer::GetInstance().GetIndex()) //如果移动的文件是正在播放的文件,则移动前必须先关闭文件 CPlayer::GetInstance().MusicControl(Command::CLOSE); - source_file = CPlayer::GetInstance().GetCurrentDir() + CPlayer::GetInstance().GetPlayList()[m_item_selected].file_name; + const auto& song = CPlayer::GetInstance().GetPlayList()[m_item_selected]; + if (song.is_cue) + return; + source_file = song.file_path; rtn = CCommon::MoveAFile(m_hWnd, source_file, wstring(folderPickerDlg.GetPathName())); } if (rtn == 0)