xref: /MusicPlayer2/MusicPlayer2/COSUPlayerHelper.h (revision 20c3414165b40bf8783e6c42dd160f0e33778ed0)
1 #pragma once
2 #include "SongInfo.h"
3 class COSUPlayerHelper
4 {
5 public:
6     COSUPlayerHelper();
7     ~COSUPlayerHelper();
8 
9     static bool IsOsuFolder(const std::wstring& strPath);
10     static bool IsOsuFile(const std::wstring& strPath);
11     static void GetOSUAudioFiles(wstring path, vector<SongInfo>& song_list);
12     static void GetOSUAudioFiles(wstring path, vector<wstring>& files);
13     static void GetOSUAudioTitleArtist(SongInfo& song_info);
14     static wstring GetAlbumCover(wstring file_path);
15 
16 private:
17     static void GetOSUFile(wstring folder_path);
18 };
19 
20 
21 //解析osu文件的类
22 class COSUFile
23 {
24 public:
25     COSUFile(const wchar_t* file_path);
26     wstring GetAudioFileName();
27     wstring GetArtist();
28     wstring GetTitle();
29     wstring GetAlbum();
30     wstring GetBeatampId();
31     wstring GetBeatampSetId();
32     wstring GetAlbumCoverFileName();
33 
34 private:
35     void GetTag(const string& tag, string& tag_content);
36     wstring GetTagItem(const string& tag, const string& tag_content);
37 
38 private:
39     string m_data;
40     string m_general_seg;
41     string m_metadata_seg;
42     string m_events_seg;
43 };