1 #pragma once 2 #include "SongInfo.h" 3 class CPlaylistFile 4 { 5 public: 6 enum Type //�����б��ʽ 7 { 8 PL_PLAYLIST, //MusicPlayer2�����б� 9 PL_M3U, //m3u�����б� 10 PL_M3U8 //m3u8�����б� 11 }; 12 13 CPlaylistFile(); 14 ~CPlaylistFile(); 15 void LoadFromFile(const wstring& file_path); 16 void SaveToFile(const wstring& file_path, Type type = PL_PLAYLIST) const; 17 vector<SongInfo> GetPlaylist() const; 18 void AddFiles(const vector<wstring>& files); 19 void AddFiles(const vector<SongInfo>& files); 20 void FromSongList(const vector<SongInfo>& song_list); 21 void ToSongList(vector<SongInfo>& song_list); 22 bool IsFileInPlaylist(const SongInfo& file); 23 void RemoveFile(const wstring& file); 24 25 static bool IsPlaylistFile(const wstring& file_path); 26 27 public: 28 const static vector<wstring> m_surpported_playlist; //֧�ֵIJ����б��ļ�����չ���б� 29 30 private: 31 void DisposePlaylistFileLine(const string& str_current_line, bool utf8); 32 33 private: 34 vector<SongInfo> m_playlist; 35 }; 36 37