Skip to content

Commit

Permalink
删除无用的代码
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongyang219 committed Sep 1, 2024
1 parent dcda5ad commit 6bca3e2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
35 changes: 0 additions & 35 deletions MusicPlayer2/AudioCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,41 +264,6 @@ bool CAudioCommon::IsPathContainsAudioFile(std::wstring path, bool include_sub_d
return false;
}

int CAudioCommon::GetAudioFilesNum(std::wstring path, bool include_sub_dir)
{
int audio_file_count = 0;
//文件句柄
intptr_t hFile = 0;
//文件信息
_wfinddata_t fileinfo;
if (path.back() != '\\' && path.back() != '/')
path.push_back('\\');
if ((hFile = _wfindfirst((path + L"*").c_str(), &fileinfo)) != -1)
{
do
{
wstring file_name = fileinfo.name;
if (file_name == L"." || file_name == L"..")
continue;

if (CCommon::IsFolder(path + file_name)) //当前是文件夹,则递归调用
{
if (include_sub_dir)
{
audio_file_count += GetAudioFilesNum(path + file_name, include_sub_dir);
}
}
else
{
if (FileIsAudio(file_name)) //找到了音频文件
audio_file_count++;
}
} while (_wfindnext(hFile, &fileinfo) == 0);
}
_findclose(hFile);
return audio_file_count;
}

void CAudioCommon::GetLyricFiles(wstring path, vector<wstring>& files)
{
//文件句柄
Expand Down
3 changes: 0 additions & 3 deletions MusicPlayer2/AudioCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ class CAudioCommon
//判断一个目录下是否包含音频文件, 不识别osu!的Songs文件夹
static bool IsPathContainsAudioFile(std::wstring path, bool include_sub_dir = false);

//统计一个目录下音频文件的数量, 不识别osu!的Songs文件夹
static int GetAudioFilesNum(std::wstring path, bool include_sub_dir = false);

//查找path目录下的所有歌词文件,并将文件名保存到files容器中
static void GetLyricFiles(wstring path, vector<wstring>& files);

Expand Down

0 comments on commit 6bca3e2

Please sign in to comment.