xref: /MusicPlayer2/MusicPlayer2/FindDlg.h (revision 3bbfe61493ac5233d7ce8ca64697d34a45aa45b0)
1 #pragma once
2 #include "afxcmn.h"
3 #include "AudioCommon.h"
4 #include "afxwin.h"
5 #include "ListCtrlEx.h"
6 #include "Common.h"
7 
8 
9 // CFindDlg �Ի���
10 
11 class CFindDlg : public CDialog
12 {
13 	DECLARE_DYNAMIC(CFindDlg)
14 
15 public:
16 	CFindDlg(CWnd* pParent = NULL);   // ��׼���캯��
17 	virtual ~CFindDlg();
18 
19 	//wstring m_config_path;
20 
21 	//int GetSelectedTrack() const;
22 	bool IsFindCurrentPlaylist() const;
23 	void GetSongsSelected(vector<wstring>& files) const;
24 	void GetSongsSelected(vector<SongInfo>& files) const;
25 	void SaveConfig();
26 	void LoadConfig();
27 
28 // �Ի�������
29 #ifdef AFX_DESIGN_TIME
30 	enum { IDD = IDD_FIND_DIALOG };
31 #endif
32 
33 protected:
34     enum ColumeIndex
35     {
36         COL_INDEX = 0,
37         COL_FILE_NAME,
38         COL_TITLE,
39         COL_ARTIST,
40         COL_ALBUM,
41         COL_PATH,
42     };
43 
44 	//const vector<SongInfo>& m_playlist;		//�����б�
45 	//vector<int> m_find_result;			//���浱ǰ�����б�IJ��ҽ������Ŀ��ţ�
46 	wstring m_key_word;				//���ҵ��ַ���
47 	vector<SongInfo> m_find_result;		//�������в����б�IJ��ҽ��
48 
49 	CListCtrlEx m_find_result_list;		//���ҽ���ؼ�
50 	int m_item_selected{ -1 };		//���ѡ�е���Ŀ���
51     vector<int> m_items_selected;
52 	//CMenu m_menu;
53 
54 	//int m_dpi;
55 
56 	CButton m_find_file_check;
57 	CButton m_find_title_check;
58 	CButton m_find_artist_check;
59 	CButton m_find_album_check;
60 
61 	bool m_find_current_playlist{ true };		//������ҷ�ΧΪ��ǰ�����б���Ϊtrue����������в����б���Ϊfalse
62     bool m_result_in_current_playlist{ true };  //���ҽ���Ƿ�Ϊ��ǰ�����б�
63 	bool m_find_file{ true };
64 	bool m_find_title{ true };
65 	bool m_find_artist{ true };
66 	bool m_find_album{ true };
67 
68 	int m_find_option_data{};		//�������ѡ������ݣ���ÿһ��bitλ��ʾÿ������ѡ���Ƿ�ѡ��
69 
70 	int m_min_width{};
71 	int m_min_height{};
72 
73 	CString m_selected_string;
74 
75 	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV ֧��
76 	void ShowFindResult();
77 	void ShowFindInfo();
78     bool _OnAddToNewPlaylist(std::wstring& playlist_path);       //ִ����ӵ��½������б�����ɹ�����true��playlist_path���ڽ����²����б��·��
79     static UINT ViewOnlineThreadFunc(LPVOID lpParam);	//ִ�����߲鿴���̺߳���
80     void GetCurrentSongList(std::vector<SongInfo>& song_list);
81 
82 public:
83 	void ClearFindResult();
84 
85 	DECLARE_MESSAGE_MAP()
86 
87 	afx_msg void OnEnChangeFindEdit();
88 	afx_msg void OnNMClickFindList(NMHDR *pNMHDR, LRESULT *pResult);
89 	afx_msg void OnBnClickedFindButton();
90 	virtual BOOL OnInitDialog();
91 	afx_msg void OnNMDblclkFindList(NMHDR *pNMHDR, LRESULT *pResult);
92 	virtual BOOL PreTranslateMessage(MSG* pMsg);
93 public:
94 	afx_msg void OnBnClickedFindFileCheck();
95 	afx_msg void OnBnClickedFindTitleCheck();
96 	afx_msg void OnBnClickedFindArtistCheck();
97 	afx_msg void OnBnClickedFindAlbumCheck();
98 	afx_msg void OnBnClickedFindCurrentPlaylistRadio();
99 	afx_msg void OnBnClickedFindAllPlaylistRadio();
100 	afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
101 	afx_msg void OnSize(UINT nType, int cx, int cy);
102 	afx_msg void OnPlayItem();
103 	afx_msg void OnExploreTrack();
104 	afx_msg void OnNMRClickFindList(NMHDR *pNMHDR, LRESULT *pResult);
105 	afx_msg void OnCopyText();
106     afx_msg void OnPlayItemInFolderMode();
107     afx_msg void OnAddToNewPlaylist();
108     afx_msg void OnExploreOnline();
109     afx_msg void OnFormatConvert();
110     afx_msg void OnItemProperty();
111     virtual void OnOK();
112     afx_msg void OnAddToNewPalylistAndPlay();
113 private:
114 public:
115     afx_msg void OnInitMenu(CMenu* pMenu);
116     virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
117     afx_msg void OnDeleteFromDisk();
118 };
119