Added: Voicemeeter Potato support
Improved: Device strings like "Output A5" no longer accidentally match GUIDs. Now, only strings containing { will match GUIDs.
This commit is contained in:
1 parent
5a795a2d26
commit
5b886a9e7a
7 files changed
+28
-11
No files matched your search
@@ -38,7 +38,7 @@ static const wchar_t* clientFilename = L"VoicemeeterClient.exe";
|
|||||||
static const wchar_t* voicemeeterClientKeyPath = USER_REGPATH L"\\Voicemeeter Client";
|
static const wchar_t* voicemeeterClientKeyPath = USER_REGPATH L"\\Voicemeeter Client";
|
||||||
static const wchar_t* sampleRateValueName = L"sampleRate";
|
static const wchar_t* sampleRateValueName = L"sampleRate";
|
||||||
|
|
||||||
typedef NTSTATUS (NTAPI * pfnNtQueryInformationProcess)(
|
typedef NTSTATUS (NTAPI* pfnNtQueryInformationProcess)(
|
||||||
IN HANDLE ProcessHandle,
|
IN HANDLE ProcessHandle,
|
||||||
IN PROCESSINFOCLASS ProcessInformationClass,
|
IN PROCESSINFOCLASS ProcessInformationClass,
|
||||||
OUT PVOID ProcessInformation,
|
OUT PVOID ProcessInformation,
|
||||||
@@ -59,10 +59,16 @@ void VoicemeeterAPOInfo::prependInfos(vector<shared_ptr<AbstractAPOInfo> >& list
|
|||||||
size_t index = voicemeeterDirectory.find_last_of(L'\\');
|
size_t index = voicemeeterDirectory.find_last_of(L'\\');
|
||||||
|
|
||||||
wstring setupFilename = voicemeeterDirectory.substr(index + 1);
|
wstring setupFilename = voicemeeterDirectory.substr(index + 1);
|
||||||
bool banana = (setupFilename == L"VoicemeeterProSetup.exe");
|
long voicemeeterType = 1;
|
||||||
|
if (setupFilename == L"VoicemeeterProSetup.exe")
|
||||||
|
voicemeeterType = 2;// banana
|
||||||
|
else if (setupFilename == L"Voicemeeter8Setup.exe")
|
||||||
|
voicemeeterType = 3;// potato
|
||||||
|
|
||||||
unsigned outputCount;
|
unsigned outputCount;
|
||||||
if (banana)
|
if (voicemeeterType == 3)
|
||||||
|
outputCount = 5;
|
||||||
|
else if (voicemeeterType == 2)
|
||||||
outputCount = 3;
|
outputCount = 3;
|
||||||
else
|
else
|
||||||
outputCount = 1;
|
outputCount = 1;
|
||||||
|
|||||||
@@ -92,7 +92,11 @@ VoicemeeterClient::VoicemeeterClient(const vector<wstring>& outputs)
|
|||||||
if (index != wstring::npos)
|
if (index != wstring::npos)
|
||||||
{
|
{
|
||||||
wstring setupFilename = voicemeeterDirectory.substr(index + 1);
|
wstring setupFilename = voicemeeterDirectory.substr(index + 1);
|
||||||
banana = (setupFilename == L"VoicemeeterProSetup.exe");
|
voicemeeterType = 1;
|
||||||
|
if (setupFilename == L"VoicemeeterProSetup.exe")
|
||||||
|
voicemeeterType = 2;// banana
|
||||||
|
else if (setupFilename == L"Voicemeeter8Setup.exe")
|
||||||
|
voicemeeterType = 3;// potato
|
||||||
|
|
||||||
voicemeeterDirectory = voicemeeterDirectory.substr(0, index);
|
voicemeeterDirectory = voicemeeterDirectory.substr(0, index);
|
||||||
|
|
||||||
@@ -137,11 +141,13 @@ void VoicemeeterClient::start()
|
|||||||
{
|
{
|
||||||
long type;
|
long type;
|
||||||
if (vmr.VBVMR_GetVoicemeeterType(&type) == 0)
|
if (vmr.VBVMR_GetVoicemeeterType(&type) == 0)
|
||||||
banana = (type == 2);
|
voicemeeterType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned outputCount;
|
unsigned outputCount;
|
||||||
if (banana)
|
if (voicemeeterType == 3)
|
||||||
|
outputCount = 5;
|
||||||
|
else if (voicemeeterType == 2)
|
||||||
outputCount = 3;
|
outputCount = 3;
|
||||||
else
|
else
|
||||||
outputCount = 1;
|
outputCount = 1;
|
||||||
|
|||||||
@@ -43,6 +43,6 @@ private:
|
|||||||
std::vector<FilterEngine*> engines;
|
std::vector<FilterEngine*> engines;
|
||||||
std::vector<int> idleSampleCounts;
|
std::vector<int> idleSampleCounts;
|
||||||
bool loggedIn = false;
|
bool loggedIn = false;
|
||||||
bool banana = false;
|
long voicemeeterType = 1;
|
||||||
std::vector<std::wstring> outputs;
|
std::vector<std::wstring> outputs;
|
||||||
};
|
};
|
||||||
@@ -149,11 +149,11 @@
|
|||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\..\..\..\Users\Jonas\Downloads\VoicemeeterRemoteAPI_Pack6\VoicemeeterRemote.h" />
|
|
||||||
<ClInclude Include="..\helpers\MemoryHelper.h" />
|
<ClInclude Include="..\helpers\MemoryHelper.h" />
|
||||||
<ClInclude Include="..\stdafx.h" />
|
<ClInclude Include="..\stdafx.h" />
|
||||||
<ClInclude Include="resource.h" />
|
<ClInclude Include="resource.h" />
|
||||||
<ClInclude Include="VoicemeeterClient.h" />
|
<ClInclude Include="VoicemeeterClient.h" />
|
||||||
|
<ClInclude Include="VoicemeeterRemote.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\helpers\MemoryHelper.cpp" />
|
<ClCompile Include="..\helpers\MemoryHelper.cpp" />
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="VoicemeeterClient.h" />
|
<ClInclude Include="VoicemeeterClient.h" />
|
||||||
<ClInclude Include="..\stdafx.h" />
|
<ClInclude Include="..\stdafx.h" />
|
||||||
<ClInclude Include="..\..\..\..\..\Users\Jonas\Downloads\VoicemeeterRemoteAPI_Pack6\VoicemeeterRemote.h" />
|
|
||||||
<ClInclude Include="resource.h" />
|
<ClInclude Include="resource.h" />
|
||||||
<ClInclude Include="..\helpers\MemoryHelper.h">
|
<ClInclude Include="..\helpers\MemoryHelper.h">
|
||||||
<Filter>helpers</Filter>
|
<Filter>helpers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="VoicemeeterRemote.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="VoicemeeterClient.cpp" />
|
<ClCompile Include="VoicemeeterClient.cpp" />
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include <regex>
|
||||||
#include <mpParser.h>
|
#include <mpParser.h>
|
||||||
#include "helpers/LogHelper.h"
|
#include "helpers/LogHelper.h"
|
||||||
#include "helpers/StringHelper.h"
|
#include "helpers/StringHelper.h"
|
||||||
@@ -28,6 +29,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
static wregex regexGuid(L"\\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\}");
|
||||||
|
|
||||||
#ifndef NO_FILTERENGINE
|
#ifndef NO_FILTERENGINE
|
||||||
void DeviceFilterFactory::initialize(FilterEngine* engine)
|
void DeviceFilterFactory::initialize(FilterEngine* engine)
|
||||||
{
|
{
|
||||||
@@ -102,6 +105,8 @@ bool DeviceFilterFactory::matchDevice(const std::wstring& deviceString, const st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wstring deviceStringNoGuid = regex_replace(deviceString, regexGuid, L"");
|
||||||
|
|
||||||
bool matches = false;
|
bool matches = false;
|
||||||
|
|
||||||
for (unsigned i = 0; i < fullList.size(); i++)
|
for (unsigned i = 0; i < fullList.size(); i++)
|
||||||
@@ -114,7 +119,8 @@ bool DeviceFilterFactory::matchDevice(const std::wstring& deviceString, const st
|
|||||||
for (unsigned j = 0; j < fullList[i].size(); j++)
|
for (unsigned j = 0; j < fullList[i].size(); j++)
|
||||||
{
|
{
|
||||||
wstring word = StringHelper::toLowerCase(fullList[i][j]);
|
wstring word = StringHelper::toLowerCase(fullList[i][j]);
|
||||||
if (StringHelper::toLowerCase(deviceString).find(word) == -1)
|
const wstring& matchString = word.find('{') == wstring::npos ? deviceStringNoGuid : deviceString;
|
||||||
|
if (StringHelper::toLowerCase(matchString).find(word) == wstring::npos)
|
||||||
{
|
{
|
||||||
matches = false;
|
matches = false;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ sp_permit_cpp11_shift=false
|
|||||||
align_keep_tabs=false
|
align_keep_tabs=false
|
||||||
align_with_tabs=false
|
align_with_tabs=false
|
||||||
align_on_tabstop=false
|
align_on_tabstop=false
|
||||||
align_number_left=false
|
|
||||||
align_keep_extra_space=false
|
align_keep_extra_space=false
|
||||||
align_func_params=false
|
align_func_params=false
|
||||||
align_same_func_call_params=false
|
align_same_func_call_params=false
|
||||||
|
|||||||
Reference in new issue
Block a user