1 #pragma once 2 #include "SongInfo.h" 3 class CPlaylist 4 { 5 public: 6 enum Type //�����б��ʽ 7 { 8 PL_PLAYLIST, //MusicPlayer2�����б� 9 PL_M3U, //m3u�����б� 10 PL_M3U8 //m3u8�����б� 11 }; 12 13 CPlaylist(); 14 ~CPlaylist(); 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 private: 26 vector<SongInfo> m_playlist; 27 }; 28 29