xref: /MusicPlayer2/MusicPlayer2/LyricSettingsDlg.h (revision 443d2d2511be730d1b1dd3181942b7fa6539aa1a)
1 #pragma once
2 #include "FolderBrowserDlg.h"
3 #include "TabDlg.h"
4 #include "ColorStaticEx.h"
5 #include "DesktopLyric.h"
6 #include "BrowseEdit.h"
7 #include "MyComboBox.h"
8 #include "SliderCtrlEx.h"
9 #include "SpinEdit.h"
10 
11 // CLyricSettingsDlg 对话框
12 
13 class CLyricSettingsDlg : public CTabDlg
14 {
15     DECLARE_DYNAMIC(CLyricSettingsDlg)
16 
17 public:
18     CLyricSettingsDlg(CWnd* pParent = NULL);   // 标准构造函数
19     virtual ~CLyricSettingsDlg();
20 
SearchBoxFontChanged()21     bool SearchBoxFontChanged() const { return m_search_box_font_changed; }
FontChanged()22     bool FontChanged()const { return m_font_changed; }
23 
24     LyricSettingData m_data;	//选项设置的数据
25     CDesktopLyric* m_pDesktopLyric = nullptr;
26 
27     // 对话框数据
28 #ifdef AFX_DESIGN_TIME
29     enum { IDD = IDD_LYRIC_SETTING_DIALOG };
30 #endif
31 
32     const int MIM_LINE_SPACE = 0;		//歌词行间距设定的最小值
33     const int MAX_LINE_SPACE = 40;		//歌词行间距设定的最大值
34 
35 protected:
36     CButton m_karaoke_disp_check;
37     CButton m_lyric_fuzzy_match_check;
38     CButton m_use_inner_lyric_chk;
39     CButton m_lyric_double_line_chk;
40     CButton m_show_album_cover_in_cortana_check;
41     CButton m_cortana_icon_beat_check;
42     CMyComboBox m_cortana_color_combo;
43     CButton m_lyric_compatible_mode_chk;
44     CButton m_keep_display_chk;
45     CButton m_show_spectrum_chk;
46     CButton m_show_lyric_in_cortana_chk;
47     CButton m_show_desktop_lyric_chk;
48     CBrowseEdit m_lyric_dir_edit;
49     CMyComboBox m_lyric_save_policy_combo;
50     CButton m_cortana_info_enable_check;
51     //CButton m_search_box_opaque_chk;
52 
53     CButton m_desktop_lyric_double_line_chk;
54     CColorStaticEx m_text_color1_static;
55     CColorStaticEx m_text_color2_static;
56     CMyComboBox m_text_gradient_combo;
57     CColorStaticEx m_highlight_color1_static;
58     CColorStaticEx m_highlight_color2_static;
59     CMyComboBox m_highlight_gradient_combo;
60     CSliderCtrlEx m_desktop_lyric_opacity_sld;
61     CButton m_lock_desktop_lyric_chk;
62     CButton m_hide_lyric_without_lyric_chk;
63     CButton m_hide_lyric_paused_chk;
64     CButton m_lyric_background_penetrate_chk;
65     CMyComboBox m_alignment_combo;
66     CButton m_show_unlock_when_locked_chk;
67     CButton m_show_default_album_icon_chk;
68     CMyComboBox m_desktop_lyric_alignment_combo;
69 
70     CSpinEdit m_lyric_line_space_edit;
71     CMyComboBox m_lyric_alignment_combo;
72 
73     CToolTipCtrl m_tool_tip;
74     bool m_search_box_font_changed{ false };
75     bool m_font_changed{ false };
76 
77     void EnableControl();
78     void EnableControlForDesktopLyric();
79     void ApplyDefaultLyricStyle(const LyricStyleDefaultData& style);
80 
81     void SetSearchBoxTransparentInWhiteTheme(bool transparent);
82     bool IsSearchBoxTransparentInWhiteTheme() const;
83 
84     static wstring GetFontInfoString(const FontInfo& font_info);
85 
86     virtual void GetDataFromUi() override;
87 
88     virtual bool InitializeControls() override;
89     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
90 
91     DECLARE_MESSAGE_MAP()
92 public:
93     virtual BOOL OnInitDialog();
94     afx_msg void OnBnClickedKaraokeDisp();
95     //afx_msg void OnBnClickedExploreLyricButton();
96     virtual void OnCancel();
97     virtual void OnOK();
98     afx_msg void OnBnClickedLyricFuzzyMatch();
99     virtual BOOL PreTranslateMessage(MSG* pMsg);
100     afx_msg void OnBnClickedShowLyricInCortana();
101     afx_msg void OnBnClickedLyricDoubleLineCheck();
102     afx_msg void OnCbnSelchangeCortanaColorCombo();
103     afx_msg void OnBnClickedShowAlbumCoverInCortana();
104     afx_msg void OnBnClickedCortanaIconDeatCheck();
105     afx_msg void OnBnClickedLyricCompatibleMode();
106     afx_msg void OnBnClickedSetFont();
107     afx_msg void OnBnClickedKeepDisplayCheck();
108     afx_msg void OnBnClickedShowSpectrumInCortana();
109     afx_msg void OnBnClickedShowLyricInCortana2();
110     //afx_msg void OnBnClickedSearchBoxOpaqueCheck();
111     afx_msg void OnBnClickedShowDesktopLyric();
112     afx_msg void OnBnClickedSetFont2();
113     afx_msg void OnCbnSelchangeTextGradientCombo();
114     afx_msg void OnCbnSelchangeHighlightGradientCombo();
115     afx_msg void OnBnClickedLockDesktopLyricCheck();
116     afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
117     afx_msg void OnBnClickedHideLyricWithoutLyricCheck();
118     afx_msg void OnBnClickedHideLyricPauseCheck();
119     afx_msg void OnBnClickedLyricDoubleLineCheck2();
120     afx_msg void OnBnClickedDefaultStyle();
121     afx_msg void OnLyricDefaultStyle1();
122     afx_msg void OnLyricDefaultStyle2();
123     afx_msg void OnLyricDefaultStyle3();
124     afx_msg void OnBnClickedHideLyricWithoutLyricCheck3();
125 protected:
126     afx_msg LRESULT OnColorSelected(WPARAM wParam, LPARAM lParam);
127 public:
128     afx_msg void OnLyricDefaultStyle1Modify();
129     afx_msg void OnLyricDefaultStyle2Modify();
130     afx_msg void OnLyricDefaultStyle3Modify();
131     afx_msg void OnRestoreDefaultStyle();
132     //    afx_msg void OnEnChangeLyricPathEdit();
133 protected:
134     afx_msg LRESULT OnEditBrowseChanged(WPARAM wParam, LPARAM lParam);
135 public:
136     afx_msg void OnCbnSelchangeAlignmentCombo();
137     afx_msg void OnCbnSelchangeLyricSaveCombo();
138     afx_msg void OnBnClickedUseInnerLyricCheck();
139     afx_msg void OnBnClickedShowUnlockWhenLocked();
140     afx_msg void OnBnClickedShowDefaultAlbumIconChk();
141     afx_msg void OnBnClickedSearchBoxTransparentInWhiteMode();
142     afx_msg void OnBnClickedSetFontButton();
143     afx_msg void OnCbnSelchangeAlignmentCombo2();
144     afx_msg void OnCbnSelchangeDesktopLyricAlignmentCombo();
145     afx_msg void OnBnClickedShowLyricTranslateCheck();
146     afx_msg void OnBnClickedLyricHideBlankLineCheck();
147     afx_msg void OnBnClickedShowSongInfoIfLyricNotExistCheck();
148 };
149