From d248555f1cfa3a5825589d2700bc05f39c5707ea Mon Sep 17 00:00:00 2001 From: "milkdropper.com" Date: Sat, 6 Jun 2020 22:39:53 +0400 Subject: [PATCH 1/3] F12 not F1 - help menu changes. --- vis_milk2/plugin.rc | 4 ++-- vis_milk2/text1.bin | 48 ++++++++++++++++++++------------------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/vis_milk2/plugin.rc b/vis_milk2/plugin.rc index 9a8e32e5..074af7f4 100644 --- a/vis_milk2/plugin.rc +++ b/vis_milk2/plugin.rc @@ -850,7 +850,7 @@ BEGIN IDS_CONFIG_PANEL_BUTTON_8 " " IDS_EXTRA_FONT_1_NAME "Tooltips" IDS_EXTRA_FONT_2_NAME "Animated Songtitles" - IDS_PRESS_F1_MSG "Press F1 for Help " + IDS_PRESS_F1_MSG "Press F12 for Help " IDS_GRAPHICS_SUBSYSTEM_IS_TEMPORARILY_UNSTABLE "One or more fullscreen display adapters are behaving strangely and will not\nreport a list of display modes. It's quite possible that your graphics subsystem\nis temporarily unstable.\n\nSUGGESTED ACTION: If you have modified your multimon setup or Windows,\ndisplay settings, or have updated any display drivers or installed\nany new programs, you should probably REBOOT YOUR COMPUTER before\ntrying to configure (or run) the plug-in again." END @@ -893,7 +893,7 @@ BEGIN IDS_FORCE_INTO_DESKTOP_MODE_HELP "Enable this to force the plug-in to start in desktop mode." IDS_HELP_ON_F1 "Help on 'Press F1...' checkbox" - IDS_HELP_ON_F1_HELP "Disable this to prevent the 'Press F1 for Help' message\nfrom appearing when the plug-in starts." + IDS_HELP_ON_F1_HELP "Disable this to prevent the 'Press F12 for Help' message\nfrom appearing when the plug-in starts." IDS_CB_SKIN_HELP "Check this box to 'skin' the plug-in's window frame when it runs\nin a window, so that it looks like the rest of the windows that\nmake up Winamp's interface.\n\nThis feature requires Winamp 2.90 or later; if the box is greyed\nout, it means you need a newer version of Winamp." IDS_SAVE_CPU_CHECKBOX "Help on 'Save CPU' checkbox" IDS_SAVE_CPU_CHECKBOX_HELP diff --git a/vis_milk2/text1.bin b/vis_milk2/text1.bin index 139066a8..cd56bb3e 100644 --- a/vis_milk2/text1.bin +++ b/vis_milk2/text1.bin @@ -1,27 +1,21 @@ - GENERAL: - - ESC exit help / menus - ALT+ENTER toggle fullscreen - - PRESETS: - - SPACE / H soft / hard cut to next preset - BACKSPACE go back to previous preset - ` / ~ [un]lock current preset - R toggle random/sequential preset order - L load specific preset - M show/hide preset-editing Menu - S save new preset - A do random mini-mash-up - D toggle warp & comp shader locks - - PLAYBACK: - - F1 play/pause F2 stop - F3 prev F4 next - F5 volume up F6 volume down - F7 shuffle F8 repeat mode - - INFO: - - F12 help F9 title / time / preset + GENERAL: + + ESC exit help / menus + ALT+ENTER toggle fullscreen + ALT+SHIFT toggle multiple monitor stretching + + PRESETS: + + SPACE / H soft / hard cut to next preset + BACKSPACE go back to previous preset + ` / ~ [un]lock current preset + R toggle random/sequential preset order + L load specific preset + M show/hide preset-editing Menu + S save new preset + A do random mini-mash-up + D toggle warp & comp shader locks + + INFO: + + F12 help F9 title / time / preset \ No newline at end of file From 82166552769bd7c07a3ea78c1b3169b3dee8a769 Mon Sep 17 00:00:00 2001 From: "milkdropper.com" Date: Sat, 6 Jun 2020 22:40:10 +0400 Subject: [PATCH 2/3] Implement monitor stretching support --- vis_milk2/Milkdrop2PcmVisualizer.cpp | 64 +++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/vis_milk2/Milkdrop2PcmVisualizer.cpp b/vis_milk2/Milkdrop2PcmVisualizer.cpp index 33d56c54..99d79f43 100644 --- a/vis_milk2/Milkdrop2PcmVisualizer.cpp +++ b/vis_milk2/Milkdrop2PcmVisualizer.cpp @@ -43,6 +43,7 @@ static LONG lastWindowStyle = 0; static LONG lastWindowStyleEx = 0; static bool fullscreen = false; +static bool stretch = false; static RECT lastRect = { 0 }; static HMODULE module = nullptr; @@ -106,14 +107,60 @@ void DeinitD3d() { } } +void ToggleStretch(HWND hwnd) { + if (!stretch) { + int width = GetSystemMetrics(SM_CXVIRTUALSCREEN); + int height = GetSystemMetrics(SM_CYVIRTUALSCREEN); + int left = GetSystemMetrics(SM_XVIRTUALSCREEN); + int top = GetSystemMetrics(SM_YVIRTUALSCREEN); + + if (!fullscreen) { + lastWindowStyle = GetWindowLong(hwnd, GWL_STYLE); + lastWindowStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE); + lastWindowStyleEx &= ~WS_EX_TOPMOST; + GetWindowRect(hwnd, &lastRect); + } + + d3dPp.BackBufferWidth = width; + d3dPp.BackBufferHeight = height; + + pD3DDevice->Reset(&d3dPp); + stretch = false; + SetWindowLongW(hwnd, GWL_STYLE, WS_POPUP | WS_VISIBLE); + SetWindowLongW(hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW); + SetWindowPos(hwnd, HWND_NOTOPMOST, left, top, width, height, SWP_DRAWFRAME | SWP_FRAMECHANGED); + + stretch = true; + } else { + ShowCursor(TRUE); + + int width = lastRect.right - lastRect.left; + int height = lastRect.bottom - lastRect.top; + + d3dPp.BackBufferWidth = width; + d3dPp.BackBufferHeight = height; + + pD3DDevice->Reset(&d3dPp); + stretch = false; + + SetWindowLongW(hwnd, GWL_STYLE, lastWindowStyle); + SetWindowLongW(hwnd, GWL_EXSTYLE, lastWindowStyleEx); + SetWindowPos(hwnd, HWND_NOTOPMOST, lastRect.left, lastRect.top, width, height, SWP_DRAWFRAME | SWP_FRAMECHANGED); + SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + } + fullscreen = false; +} + void ToggleFullScreen(HWND hwnd) { if (!fullscreen) { ShowCursor(FALSE); - lastWindowStyle = GetWindowLong(hwnd, GWL_STYLE); - lastWindowStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE); - lastWindowStyleEx &= ~WS_EX_TOPMOST; - GetWindowRect(hwnd, &lastRect); + if (!stretch) { + lastWindowStyle = GetWindowLong(hwnd, GWL_STYLE); + lastWindowStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE); + lastWindowStyleEx &= ~WS_EX_TOPMOST; + GetWindowRect(hwnd, &lastRect); + } HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); @@ -152,6 +199,7 @@ void ToggleFullScreen(HWND hwnd) { SetWindowPos(hwnd, HWND_NOTOPMOST, lastRect.left, lastRect.top, width, height, SWP_DRAWFRAME | SWP_FRAMECHANGED); SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); } + stretch = false; } LRESULT CALLBACK StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -204,6 +252,10 @@ LRESULT CALLBACK StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara if (wParam == VK_F4) { PostQuitMessage(0); } + else if (wParam == VK_SHIFT) + { + ToggleStretch(hWnd); + } else if (wParam == VK_RETURN) { ToggleFullScreen(hWnd); } @@ -264,7 +316,7 @@ unsigned __stdcall CreateWindowAndRun(void* data) { int windowWidth = DEFAULT_WIDTH; int windowHeight = DEFAULT_HEIGHT; - + RECT rc; SetRect(&rc, 0, 0, windowWidth, windowHeight); AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, false); @@ -294,7 +346,7 @@ unsigned __stdcall CreateWindowAndRun(void* data) { SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM) icon); SendMessageW(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) icon); - + ShowWindow(hwnd, SW_SHOW); int lastWidth = windowWidth; From 22c34e84e49e3622c8cf633af0439ad1136d1725 Mon Sep 17 00:00:00 2001 From: "milkdropper.com" Date: Sat, 6 Jun 2020 22:47:07 +0400 Subject: [PATCH 3/3] Not needed --- vis_milk2/Milkdrop2PcmVisualizer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/vis_milk2/Milkdrop2PcmVisualizer.cpp b/vis_milk2/Milkdrop2PcmVisualizer.cpp index 99d79f43..f6690e35 100644 --- a/vis_milk2/Milkdrop2PcmVisualizer.cpp +++ b/vis_milk2/Milkdrop2PcmVisualizer.cpp @@ -125,7 +125,6 @@ void ToggleStretch(HWND hwnd) { d3dPp.BackBufferHeight = height; pD3DDevice->Reset(&d3dPp); - stretch = false; SetWindowLongW(hwnd, GWL_STYLE, WS_POPUP | WS_VISIBLE); SetWindowLongW(hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW); SetWindowPos(hwnd, HWND_NOTOPMOST, left, top, width, height, SWP_DRAWFRAME | SWP_FRAMECHANGED);