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:
jthedering committed 2019-06-05 21:15:06 +00:00
1 parent 5a795a2d26
commit 5b886a9e7a
7 files changed
+28 -11

No files matched your search

+9 -3
View File
@@ -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* sampleRateValueName = L"sampleRate";
typedef NTSTATUS (NTAPI * pfnNtQueryInformationProcess)(
typedef NTSTATUS (NTAPI* pfnNtQueryInformationProcess)(
IN HANDLE ProcessHandle,
IN PROCESSINFOCLASS ProcessInformationClass,
OUT PVOID ProcessInformation,
@@ -59,10 +59,16 @@ void VoicemeeterAPOInfo::prependInfos(vector<shared_ptr<AbstractAPOInfo> >& list
size_t index = voicemeeterDirectory.find_last_of(L'\\');
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;
if (banana)
if (voicemeeterType == 3)
outputCount = 5;
else if (voicemeeterType == 2)
outputCount = 3;
else
outputCount = 1;
+9 -3
View File
@@ -92,7 +92,11 @@ VoicemeeterClient::VoicemeeterClient(const vector<wstring>& outputs)
if (index != wstring::npos)
{
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);
@@ -137,11 +141,13 @@ void VoicemeeterClient::start()
{
long type;
if (vmr.VBVMR_GetVoicemeeterType(&type) == 0)
banana = (type == 2);
voicemeeterType = type;
}
unsigned outputCount;
if (banana)
if (voicemeeterType == 3)
outputCount = 5;
else if (voicemeeterType == 2)
outputCount = 3;
else
outputCount = 1;
+1 -1
View File
@@ -43,6 +43,6 @@ private:
std::vector<FilterEngine*> engines;
std::vector<int> idleSampleCounts;
bool loggedIn = false;
bool banana = false;
long voicemeeterType = 1;
std::vector<std::wstring> outputs;
};
+1 -1
View File
@@ -149,11 +149,11 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\Users\Jonas\Downloads\VoicemeeterRemoteAPI_Pack6\VoicemeeterRemote.h" />
<ClInclude Include="..\helpers\MemoryHelper.h" />
<ClInclude Include="..\stdafx.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="VoicemeeterClient.h" />
<ClInclude Include="VoicemeeterRemote.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\helpers\MemoryHelper.cpp" />
@@ -3,11 +3,11 @@
<ItemGroup>
<ClInclude Include="VoicemeeterClient.h" />
<ClInclude Include="..\stdafx.h" />
<ClInclude Include="..\..\..\..\..\Users\Jonas\Downloads\VoicemeeterRemoteAPI_Pack6\VoicemeeterRemote.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="..\helpers\MemoryHelper.h">
<Filter>helpers</Filter>
</ClInclude>
<ClInclude Include="VoicemeeterRemote.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="VoicemeeterClient.cpp" />
+7 -1
View File
@@ -18,6 +18,7 @@
*/
#include "stdafx.h"
#include <regex>
#include <mpParser.h>
#include "helpers/LogHelper.h"
#include "helpers/StringHelper.h"
@@ -28,6 +29,8 @@
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
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;
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++)
{
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;
break;
-1
View File
@@ -47,7 +47,6 @@ sp_permit_cpp11_shift=false
align_keep_tabs=false
align_with_tabs=false
align_on_tabstop=false
align_number_left=false
align_keep_extra_space=false
align_func_params=false
align_same_func_call_params=false