Version 1.0

Added: Configuration Editor, which allows to edit configurations in a graphical user interface. Contains GUIs for most commands supported by E-APO, but as lines can also be edited directly, all commands can be used.
Added: Command "GraphicEQ", which can act as a regular, fixed-band graphic equalizer (via the GUI) but also supports variable bands so that any desired frequency response can be specified. Internally, it is implemented via convolution with a generated IR.
Added: Command "Convolution", which allows to convolve the signal with a user-provided impulse response to achieve e.g. equalization or reverberation effects.
Improved: Configurator performs checks for registry values that are needed for the operation of E-APO, which may be changed by driver installations, fixing the values if necessary.
Improved: Configurator shows which is the default device as a hint to the user.
This commit is contained in:
jthedering committed 2015-09-27 16:01:21 +00:00
1 parent d68b958bc8
commit b8cdd47f71
284 files changed
+17622 -322

No files matched your search

+97 -8
View File
@@ -17,10 +17,12 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "stdafx.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <ObjBase.h>
#include "helpers/StringHelper.h"
#include "helpers/RegistryHelper.h"
#include "Configurator.h"
@@ -55,6 +57,7 @@ void Configurator::onInitDialog(HWND hDlg)
useOriginalAPOPreMix = GetDlgItem(hDlg, IDC_USE_ORIGINAL_APO_PRE_MIX);
useOriginalAPOPostMix = GetDlgItem(hDlg, IDC_USE_ORIGINAL_APO_POST_MIX);
installModeComboBox = GetDlgItem(hDlg, IDC_INSTALL_MODE_COMBOBOX);
selectOneDeviceLabel = GetDlgItem(hDlg, IDC_SELECT_ONE_DEVICE);
expandTroubleShooting(false);
@@ -118,6 +121,9 @@ void Configurator::onInitDialog(HWND hDlg)
}
ComboBox_SetCurSel(installModeComboBox, 0);
LoadStringW(hInstance, IDS_SELECT_ONE_DEVICE, stringBuf, sizeof(stringBuf) / sizeof(wchar_t));
SetWindowTextW(selectOneDeviceLabel, stringBuf);
for(int i=0; i<=1; i++)
{
HWND deviceList = deviceLists[i];
@@ -143,6 +149,7 @@ void Configurator::onInitDialog(HWND hDlg)
try
{
apoInfos[i] = DeviceAPOInfo::loadAllInfos(i==1);
wstring defaultDevice = StringHelper::toLowerCase(DeviceAPOInfo::getDefaultDevice(i==1));
int itemCount=0;
for(vector<DeviceAPOInfo>::iterator it = apoInfos[i].begin(); it != apoInfos[i].end(); it++)
@@ -158,19 +165,31 @@ void Configurator::onInitDialog(HWND hDlg)
{
ListView_SetCheckState(deviceList, itemCount, TRUE);
if(it->canBeUpgraded())
LoadStringW(hInstance, IDS_WILL_BE_UPGRADED, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
LoadStringW(hInstance, IDS_WILL_BE_UPGRADED, stringBuf, sizeof(stringBuf) / sizeof(wchar_t));
else if(it->isEnhancementsDisabled)
LoadStringW(hInstance, IDS_ENHANCEMENTS_WILL_BE_ENABLED, stringBuf, sizeof(stringBuf) / sizeof(wchar_t));
else
LoadStringW(hInstance, IDS_ALREADY_INSTALLED, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
ListView_SetItemText(deviceList, itemCount, 2, stringBuf);
}
else if(it->isExperimental())
{
LoadStringW(hInstance, IDS_CAN_BE_INSTALLED_EXPERIMENTAL, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
ListView_SetItemText(deviceList, itemCount, 2, stringBuf);
}
else
{
LoadStringW(hInstance, IDS_CAN_BE_INSTALLED, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
}
if(it->isDefaultDevice)
{
wstring statusText = stringBuf;
LoadStringW(hInstance, IDS_DEFAULT_DEVICE, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
statusText = wstring(stringBuf) + L", " + statusText;
ListView_SetItemText(deviceList, itemCount, 2, const_cast<wchar_t*>(statusText.c_str()));
}
else
{
ListView_SetItemText(deviceList, itemCount, 2, stringBuf);
}
@@ -186,6 +205,12 @@ void Configurator::onInitDialog(HWND hDlg)
ListView_SetColumnWidth(deviceList, 1, LVSCW_AUTOSIZE);
ListView_SetColumnWidth(deviceList, 2, LVSCW_AUTOSIZE);
}
if (!DeviceAPOInfo::checkProtectedAudioDG(true))
{
LoadStringW(hInstance, IDS_REGISTRY_VALUE_FIXED, stringBuf, sizeof(stringBuf) / sizeof(wchar_t));
MessageBoxW(hDlg, stringBuf, L"Info", MB_ICONINFORMATION | MB_OK);
}
}
void Configurator::onLvnItemChanged(unsigned sourceId, LPNMLISTVIEW info)
@@ -221,7 +246,7 @@ bool Configurator::onButtonClicked(unsigned sourceId)
info.install();
else if(!ListView_GetCheckState(deviceList, i) && info.isInstalled)
info.uninstall();
else if(ListView_GetCheckState(deviceList, i) && (info.canBeUpgraded() || info.hasChanges()))
else if(ListView_GetCheckState(deviceList, i) && (info.canBeUpgraded() || info.hasChanges() || info.isEnhancementsDisabled))
{
info.uninstall();
info.load(info.deviceGuid);
@@ -398,6 +423,33 @@ void Configurator::onTcnSelChange(unsigned sourceId)
updateButtons(index);
}
bool Configurator::isAnySelected()
{
bool anySelected = false;
for(int index = 0; index <= 1; index++)
{
HWND deviceList = deviceLists[index];
for(int i = 0; i < ListView_GetItemCount(deviceList); i++)
{
LVITEM item;
item.iItem = i;
item.iSubItem = 0;
item.mask = LVIF_PARAM;
ListView_GetItem(deviceList, &item);
DeviceAPOInfo apoInfo = apoInfos[index][item.lParam];
if(ListView_GetCheckState(deviceList, i) != 0)
{
anySelected = true;
break;
}
}
}
return anySelected;
}
bool Configurator::isChanged()
{
bool changed = false;
@@ -415,7 +467,7 @@ bool Configurator::isChanged()
ListView_GetItem(deviceList, &item);
DeviceAPOInfo apoInfo = apoInfos[index][item.lParam];
if((ListView_GetCheckState(deviceList, i) != 0) != apoInfo.isInstalled
|| ListView_GetCheckState(deviceList, i) && apoInfo.isInstalled && (apoInfo.canBeUpgraded() || apoInfo.hasChanges()))
|| ListView_GetCheckState(deviceList, i) && apoInfo.isInstalled && (apoInfo.canBeUpgraded() || apoInfo.hasChanges() || apoInfo.isEnhancementsDisabled))
{
changed = true;
break;
@@ -442,7 +494,7 @@ bool Configurator::hasUpgrades()
item.mask = LVIF_PARAM;
ListView_GetItem(deviceList, &item);
DeviceAPOInfo apoInfo = apoInfos[index][item.lParam];
if(ListView_GetCheckState(deviceList, i) && apoInfo.isInstalled && apoInfo.canBeUpgraded())
if(ListView_GetCheckState(deviceList, i) && apoInfo.isInstalled && (apoInfo.canBeUpgraded() || apoInfo.isEnhancementsDisabled))
{
hasUpgrades = true;
break;
@@ -457,6 +509,7 @@ void Configurator::expandTroubleShooting(bool expand)
{
int showCmd = expand ? SW_SHOW : SW_HIDE;
ShowWindow(troubleShootingGroup, showCmd);
showCmd = expand && !IsWindowEnabled(selectOneDeviceLabel) ? SW_SHOW : SW_HIDE;
ShowWindow(preMixLabel, showCmd);
ShowWindow(postMixLabel, showCmd);
ShowWindow(postMixLabel, showCmd);
@@ -465,6 +518,8 @@ void Configurator::expandTroubleShooting(bool expand)
ShowWindow(useOriginalAPOPreMix, showCmd);
ShowWindow(useOriginalAPOPostMix, showCmd);
ShowWindow(installModeComboBox, showCmd);
showCmd = expand && IsWindowEnabled(selectOneDeviceLabel) ? SW_SHOW : SW_HIDE;
ShowWindow(selectOneDeviceLabel, showCmd);
int y = expand ? 229 : 188;
@@ -509,6 +564,8 @@ void Configurator::updateList(int listIndex, int itemIndex)
LoadStringW(hInstance, IDS_WILL_BE_UPGRADED, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
else if(apoInfo.isInstalled && apoInfo.hasChanges())
LoadStringW(hInstance, IDS_WILL_BE_CHANGED, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
else if(apoInfo.isInstalled && apoInfo.isEnhancementsDisabled)
LoadStringW(hInstance, IDS_ENHANCEMENTS_WILL_BE_ENABLED, stringBuf, sizeof(stringBuf) / sizeof(wchar_t));
else if(apoInfo.isInstalled)
LoadStringW(hInstance, IDS_ALREADY_INSTALLED, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
else if(apoInfo.isExperimental())
@@ -516,7 +573,18 @@ void Configurator::updateList(int listIndex, int itemIndex)
else
LoadStringW(hInstance, IDS_CAN_BE_INSTALLED, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
ListView_SetItemText(deviceList, itemIndex, 2, stringBuf);
if(apoInfo.isDefaultDevice)
{
wstring statusText = stringBuf;
LoadStringW(hInstance, IDS_DEFAULT_DEVICE, stringBuf, sizeof(stringBuf)/sizeof(wchar_t));
statusText = wstring(stringBuf) + L", " + statusText;
ListView_SetItemText(deviceList, itemIndex, 2, const_cast<wchar_t*>(statusText.c_str()));
}
else
{
ListView_SetItemText(deviceList, itemIndex, 2, stringBuf);
}
ListView_SetColumnWidth(deviceList, 2, LVSCW_AUTOSIZE);
}
@@ -526,7 +594,21 @@ void Configurator::updateButtons(int listIndex)
{
HWND deviceList = deviceLists[listIndex];
EnableWindow(okButton, isChanged());
wchar_t stringBuf[255];
bool changed = isChanged();
if(changed || !isAnySelected())
{
ShowWindow(okButton, SW_SHOW);
EnableWindow(okButton, changed);
LoadStringW(hInstance, IDS_CANCEL, stringBuf, sizeof(stringBuf) / sizeof(wchar_t));
SetWindowText(cancelButton, stringBuf);
}
else
{
ShowWindow(okButton, SW_HIDE);
LoadStringW(hInstance, IDS_CLOSE, stringBuf, sizeof(stringBuf) / sizeof(wchar_t));
SetWindowText(cancelButton, stringBuf);
}
unsigned selectedCount = ListView_GetSelectedCount(deviceList);
EnableWindow(copyDeviceCommandButton, selectedCount > 0);
@@ -558,6 +640,7 @@ void Configurator::updateButtons(int listIndex)
EnableWindow(useOriginalAPOPreMix, enable && hasOriginalAPOPreMix && installState.installPreMix);
EnableWindow(useOriginalAPOPostMix, enable && !isInput && hasOriginalAPOPostMix && installState.installPostMix);
EnableWindow(installModeComboBox, enable);
EnableWindow(selectOneDeviceLabel, !enable);
Button_SetCheck(installPreMix, installState.installPreMix);
Button_SetCheck(installPostMix, installState.installPostMix);
@@ -566,6 +649,8 @@ void Configurator::updateButtons(int listIndex)
if(RegistryHelper::isWindowsVersionAtLeast(6, 3)) // Windows 8.1
ComboBox_SetCurSel(installModeComboBox, installState.installMode);
expandTroubleShooting(Button_GetCheck(toggleTroubleShooting) != 0);
}
INT_PTR CALLBACK dlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
@@ -575,6 +660,8 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
LPWSTR lpCmdLine,
int nCmdShow)
{
CoInitializeEx(NULL, COINIT_MULTITHREADED);
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
InitCtrls.dwICC = ICC_WIN95_CLASSES;
@@ -608,6 +695,8 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
configurator = new Configurator(hInstance, lpCmdLine);
DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAINWINDOW), GetDesktopWindow(), dlgProc);
}
CoUninitialize();
return result;
}
+2
View File
@@ -32,6 +32,7 @@ public:
void onLvnItemChanged(unsigned sourceId, LPNMLISTVIEW info);
bool onButtonClicked(unsigned sourceId);
void onTcnSelChange(unsigned sourceId);
bool isAnySelected();
bool isChanged();
bool hasUpgrades();
@@ -53,6 +54,7 @@ private:
HWND useOriginalAPOPreMix;
HWND useOriginalAPOPostMix;
HWND installModeComboBox;
HWND selectOneDeviceLabel;
std::wstring cmdLine;
void expandTroubleShooting(bool expand);
Binary file not shown.
+18 -6
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -25,6 +25,7 @@
<ClInclude Include="..\helpers\PrecisionTimer.h" />
<ClInclude Include="..\helpers\RegistryHelper.h" />
<ClInclude Include="..\helpers\StringHelper.h" />
<ClInclude Include="..\stdafx.h" />
<ClInclude Include="Configurator.h" />
<ClInclude Include="Resource.h" />
</ItemGroup>
@@ -34,6 +35,12 @@
<ClCompile Include="..\helpers\MemoryHelper.cpp" />
<ClCompile Include="..\helpers\RegistryHelper.cpp" />
<ClCompile Include="..\helpers\StringHelper.cpp" />
<ClCompile Include="..\stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Configurator.cpp" />
</ItemGroup>
<ItemGroup>
@@ -52,29 +59,34 @@
<ProjectGuid>{E18E1CA7-3D6C-4CD5-9CE9-E72565A206E5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Configurator</RootNamespace>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -118,7 +130,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;USE_WINDDK;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -131,7 +143,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;USE_WINDDK;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -139,13 +151,13 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>audioeng.lib;version.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>audioeng.lib;version.lib;wmcodecdspuuid.lib;AudioBaseProcessingObject.lib;audiomediatypecrt.lib;Shlwapi.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -162,7 +174,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -15,6 +15,7 @@
<ClCompile Include="..\helpers\StringHelper.cpp">
<Filter>helpers</Filter>
</ClCompile>
<ClCompile Include="..\stdafx.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\DeviceAPOInfo.h" />
@@ -35,6 +36,7 @@
<ClInclude Include="..\helpers\StringHelper.h">
<Filter>helpers</Filter>
</ClInclude>
<ClInclude Include="..\stdafx.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Configurator.rc" />
Binary file not shown.