From 73ed43f9c52e2683d33d9bfa76a9dc87cd7d3590 Mon Sep 17 00:00:00 2001 From: David Neon Date: Sun, 10 Sep 2023 18:43:47 +0800 Subject: [PATCH] Add 3fps for photo slideshow Existing option of 5fps is a tad too fast human consumption, while 1fps is too slow. Thus, adding a 3fps that's just nice =) --- src/JPEGView/JPEGView.rc | 2 ++ src/JPEGView/MainDlg.cpp | 9 +++++++-- src/JPEGView/resource.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/JPEGView/JPEGView.rc b/src/JPEGView/JPEGView.rc index 1ec5fe59..4e6a5bf7 100644 --- a/src/JPEGView/JPEGView.rc +++ b/src/JPEGView/JPEGView.rc @@ -370,6 +370,8 @@ BEGIN END MENUITEM SEPARATOR MENUITEM "Movie", IDM_MOVIE_START_FPS + MENUITEM "Playback speed\t3 fps", IDM_MOVIE_3_FPS + MENUITEM "Playback speed\t5 fps", IDM_MOVIE_5_FPS MENUITEM "Playback speed\t5 fps", IDM_MOVIE_5_FPS MENUITEM "Playback speed\t10 fps", IDM_MOVIE_10_FPS MENUITEM "Playback speed\t25 fps", IDM_MOVIE_25_FPS diff --git a/src/JPEGView/MainDlg.cpp b/src/JPEGView/MainDlg.cpp index 3ce813b3..ff864558 100644 --- a/src/JPEGView/MainDlg.cpp +++ b/src/JPEGView/MainDlg.cpp @@ -2035,6 +2035,7 @@ void CMainDlg::ExecuteCommand(int nCommand) { case IDM_EFFECTTIME_VERY_SLOW: m_nTransitionTime = 125 * (1 << (nCommand - IDM_EFFECTTIME_VERY_FAST)); break; + case IDM_MOVIE_3_FPS: case IDM_MOVIE_5_FPS: case IDM_MOVIE_10_FPS: case IDM_MOVIE_25_FPS: @@ -3221,7 +3222,7 @@ void CMainDlg::GotoImage(EImagePosition ePos, int nFlags) { while (::PeekMessage(&msg, this->m_hWnd, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)); } - if (!m_pCurrentImage && (_tcscmp(strPrevImage, m_pFileList->Current()) == 0)) + if (!m_pCurrentImage && strPrevImage && (_tcscmp(strPrevImage, m_pFileList->Current()) == 0)) { if (++m_nImageRetryCnt < 2) { @@ -3613,8 +3614,10 @@ void CMainDlg::AdjustMovieSpeed(double dIncrement) dFPS = 25.0; else if (dFPS >= 5.0) dFPS = 10.0; - else if (dFPS >= 1.0) + else if (dFPS >= 3.0) dFPS = 5.0; + else if (dFPS >= 1.0) + dFPS = 3.0; else if (dFPS >= 0.5) dFPS = 1.0; else if (dFPS >= 0.32) @@ -3649,6 +3652,8 @@ void CMainDlg::AdjustMovieSpeed(double dIncrement) else if (dFPS >= 10.0) dFPS = 5.0; else if (dFPS >= 5.0) + dFPS = 3.0; + else if (dFPS >= 3.0) dFPS = 1.0; else if (dFPS >= 1.0) dFPS = 0.5; diff --git a/src/JPEGView/resource.h b/src/JPEGView/resource.h index c5fd72cf..95baafe2 100644 --- a/src/JPEGView/resource.h +++ b/src/JPEGView/resource.h @@ -211,6 +211,7 @@ #define IDM_EFFECTTIME_SLOW 7473 #define IDM_EFFECTTIME_VERY_SLOW 7474 #define IDM_MOVIE_START_FPS 7500 // Pseudo entry +#define IDM_MOVIE_3_FPS 7503 #define IDM_MOVIE_5_FPS 7505 #define IDM_MOVIE_10_FPS 7510 #define IDM_MOVIE_25_FPS 7525