Skip to content

Commit

Permalink
Changed stupid hotkey to actual SendMessage call for PaceMaker reset.
Browse files Browse the repository at this point in the history
Also upgraded C++ toolset to VS2022.
  • Loading branch information
peeveen committed Jan 23, 2022
1 parent 261c1c1 commit a507fbd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
17 changes: 7 additions & 10 deletions gen_autoDJ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ int init(void);
void config(void);
void quit(void);

// Resets PaceMaker tempo, pitch & speed settings to zeroes
#define PM_RESET (WM_APP+5)

// The instance handle of this DLL.
HINSTANCE g_hInstance = NULL;
// Handle to the Winamp window.
Expand Down Expand Up @@ -74,16 +77,10 @@ void PlayNextTrack() {
g_nextTrackStartStopPositions = { MAXUINT32,MAXUINT32,MAXUINT32,MAXUINT32 };
::ReleaseMutex(g_hNextTrackMutex);

// Reset pitch on Pacemaker.
INPUT ctrlShiftZ[] = {
{INPUT_KEYBOARD,{(WORD)VK_SHIFT,(WORD)0,(DWORD)0,(DWORD)0,(ULONG_PTR)NULL}},
{INPUT_KEYBOARD,{(WORD)VK_CONTROL,(WORD)0,(DWORD)0,(DWORD)0,(ULONG_PTR)NULL}},
{INPUT_KEYBOARD,{(WORD)0x5A,(WORD)0,(DWORD)0,(DWORD)0,(ULONG_PTR)NULL}},
{INPUT_KEYBOARD,{(WORD)0x5A,(WORD)0,(DWORD)KEYEVENTF_KEYUP,(DWORD)0,(ULONG_PTR)NULL}},
{INPUT_KEYBOARD,{(WORD)VK_CONTROL,(WORD)KEYEVENTF_KEYUP,(DWORD)0,(DWORD)0,(ULONG_PTR)NULL}},
{INPUT_KEYBOARD,{(WORD)VK_SHIFT,(WORD)KEYEVENTF_KEYUP,(DWORD)0,(DWORD)0,(ULONG_PTR)NULL}}
};
::SendInput(6, ctrlShiftZ, sizeof(INPUT));
// Reset pitch on Pacemaker, if it is running.
HWND pacemakerHwnd = ::FindWindowEx(NULL, NULL, NULL, L"PaceMaker Plug-in");
if (pacemakerHwnd)
::SendMessage(pacemakerHwnd, PM_RESET, 0, 0);

::SendMessage(g_hWinampWindow, WM_WA_IPC, 0, IPC_DELETE);
::SendMessage(g_hWinampWindow, WM_WA_IPC, (WPARAM)&w, IPC_PLAYFILEW);
Expand Down
8 changes: 4 additions & 4 deletions gen_autoDJ.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down

0 comments on commit a507fbd

Please sign in to comment.