Skip to content

Commit

Permalink
Revert "去掉已经没有必要的m_no_lbtnup和定时器"
Browse files Browse the repository at this point in the history
This reverts commit 95d2fbe.
  • Loading branch information
lrisora committed Sep 15, 2023
1 parent ee12da7 commit 0847f05
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions MusicPlayer2/MusicPlayerDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2665,6 +2665,12 @@ void CMusicPlayerDlg::OnTimer(UINT_PTR nIDEvent)
m_fps_cnt = 0;
}

else if (nIDEvent == DELAY_TIMER_ID)
{
KillTimer(DELAY_TIMER_ID);
m_no_lbtnup = false;
}

else if (nIDEvent == INGORE_COLOR_CHANGE_TIMER_ID)
{
KillTimer(INGORE_COLOR_CHANGE_TIMER_ID);
Expand Down Expand Up @@ -2907,6 +2913,8 @@ afx_msg LRESULT CMusicPlayerDlg::OnPathSelected(WPARAM wParam, LPARAM lParam)
//m_findDlg.ClearFindResult(); //更换路径后清除查找结果
CPlayer::GetInstance().SaveRecentPath();
m_play_error_cnt = 0;
SetTimer(DELAY_TIMER_ID, 500, NULL); //在媒体库对话框中选择了一个文件夹播放后,500毫秒内不响应WM_LBUTTONUP消息
m_no_lbtnup = true;
}
return 0;
}
Expand Down Expand Up @@ -5422,6 +5430,8 @@ afx_msg LRESULT CMusicPlayerDlg::OnPlaylistSelected(WPARAM wParam, LPARAM lParam
CPlayer::GetInstance().SaveRecentPath();
IniPlaylistPopupMenu();
m_play_error_cnt = 0;
SetTimer(DELAY_TIMER_ID, 500, NULL); //在媒体库对话框中选择了一个播放列表播放后,500毫秒内不响应WM_LBUTTONUP消息
m_no_lbtnup = true;
}
return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion MusicPlayer2/MusicPlayerDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ class CMusicPlayerDlg : public CMainDialogBase
CPlayerToolBar m_playlist_toolbar;
CHorizontalSplitter m_splitter_ctrl;

bool m_no_lbtnup{ false }; //当它为true时,不响应WM_LBUTTONUP消息
bool m_ignore_color_change{ false }; //当它为true时,不响应颜色变化,防止短时间内重复收到主题颜色变化的消息
enum { INGORE_COLOR_CHANGE_TIMER_ID = 1200 };
enum { DELAY_TIMER_ID = 1200, INGORE_COLOR_CHANGE_TIMER_ID = 1201 };

CDevicesManager* devicesManager;

Expand Down
3 changes: 2 additions & 1 deletion MusicPlayer2/UIWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ void CUIWindow::OnLButtonUp(UINT nFlags, CPoint point)
}
else
{
m_pUI->LButtonUp(point);
if (pMainWindow != nullptr && !pMainWindow->m_no_lbtnup)
m_pUI->LButtonUp(point);

CStatic::OnLButtonUp(nFlags, point);
}
Expand Down

0 comments on commit 0847f05

Please sign in to comment.