diff --git a/src/flexasio/FlexASIO/control_panel.cpp b/src/flexasio/FlexASIO/control_panel.cpp index cd89d77..d5f6745 100644 --- a/src/flexasio/FlexASIO/control_panel.cpp +++ b/src/flexasio/FlexASIO/control_panel.cpp @@ -66,43 +66,43 @@ namespace flexasio { UniqueHKEY OpenFlexAsioGuiInstallRegistryKey() { HKEY registryKey; - const auto regOpenKeyError = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Fabrikat\\FlexASIOGUI\\Install", {}, KEY_QUERY_VALUE | KEY_WOW64_64KEY, ®istryKey); - if (regOpenKeyError != ERROR_SUCCESS) throw std::runtime_error("Unable to open FlexASIOGUI registry key: " + GetWindowsErrorString(regOpenKeyError)); + const auto regOpenKeyError = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\KoordASIO\\Install", {}, KEY_QUERY_VALUE | KEY_WOW64_64KEY, ®istryKey); + if (regOpenKeyError != ERROR_SUCCESS) throw std::runtime_error("Unable to open KoordASIOSetup registry key: " + GetWindowsErrorString(regOpenKeyError)); return UniqueHKEY(registryKey); } std::wstring GetFlexAsioGuiInstallDirectory() { - Log() << "Attempting to open FlexASIOGUI install registry key"; + Log() << "Attempting to open KoordASIOSetup install registry key"; const auto installRegistryKey = OpenFlexAsioGuiInstallRegistryKey(); - Log() << "Attempting to query FlexASIOGUI install path registry value"; + Log() << "Attempting to query KoordASIOSetup install path registry value"; return GetStringRegistryValue(installRegistryKey.get(), L"InstallPath"); } void OpenFlexAsioGui(HWND windowHandle) { const auto installDirectory = GetFlexAsioGuiInstallDirectory(); - Log() << "FlexASIOGUI install directory: " << ConvertToUTF8(installDirectory); + Log() << "KoordASIOSetup install directory: " << ConvertToUTF8(installDirectory); - Execute(windowHandle, installDirectory + L"\\FlexASIOGUI.exe"); + Execute(windowHandle, installDirectory + L"\\KoordASIOSetup.exe"); } void OpenConfigurationDocs(HWND windowHandle) { - Execute(windowHandle, std::wstring(L"/~https://github.com/dechamps/FlexASIO/blob/") + ConvertFromUTF8(::dechamps_CMakeUtils_gitDescription) + L"/CONFIGURATION.md"); + Execute(windowHandle, std::wstring(L"/~https://github.com/koord-live/KoordASIO/blob/") + ConvertFromUTF8(::dechamps_CMakeUtils_gitDescription) + L"/CONFIGURATION.md"); } } void OpenControlPanel(HWND windowHandle) { - Log() << "Attempting to open FlexASIO GUI"; + Log() << "Attempting to open KoordASIOSetup"; try { OpenFlexAsioGui(windowHandle); return; } catch (const std::exception& exception) { - Log() << "Unable to open FlexASIO GUI: " << ::dechamps_cpputil::GetNestedExceptionMessage(exception); + Log() << "Unable to open KoordASIOSetup: " << ::dechamps_cpputil::GetNestedExceptionMessage(exception); } catch (...) { - Log() << "Unable to open FlexASIO GUI due to unknown exception"; + Log() << "Unable to open KoordASIOSetup due to unknown exception"; } Log() << "Attempting to open configuration docs"; diff --git a/src/kdasioconfig/images/Fader BTN.png b/src/kdasioconfig/images/Fader BTN.png index f958456..0f2a2bb 100644 Binary files a/src/kdasioconfig/images/Fader BTN.png and b/src/kdasioconfig/images/Fader BTN.png differ diff --git a/src/kdasioconfig/images/Koord Logo.png b/src/kdasioconfig/images/Koord Logo.png index 5b7dbd1..bd4f541 100644 Binary files a/src/kdasioconfig/images/Koord Logo.png and b/src/kdasioconfig/images/Koord Logo.png differ diff --git a/src/kdasioconfig/kdasioconfig.cpp b/src/kdasioconfig/kdasioconfig.cpp index 991ad70..be25b57 100644 --- a/src/kdasioconfig/kdasioconfig.cpp +++ b/src/kdasioconfig/kdasioconfig.cpp @@ -8,6 +8,10 @@ #include "toml.h" #include #include +#include +#include +#include +#include KdASIOConfigBase::KdASIOConfigBase(QWidget *parent) : QMainWindow(parent) @@ -29,9 +33,20 @@ KdASIOConfig::KdASIOConfig(QWidget *parent) connect(outputAudioSettButton, &QPushButton::pressed, this, &KdASIOConfig::outputAudioSettClicked); connect(bufferSizeSlider, &QSlider::valueChanged, this, &KdASIOConfig::bufferSizeChanged); connect(bufferSizeSlider, &QSlider::valueChanged, this, &KdASIOConfig::bufferSizeDisplayChange); + // info buttons + connect(inputInfoButton, &QPushButton::pressed, this, &KdASIOConfig::inputInfoClicked); + connect(outputInfoButton, &QPushButton::pressed, this, &KdASIOConfig::outputInfoClicked); + connect(renderInfoButton, &QPushButton::pressed, this, &KdASIOConfig::renderInfoClicked); + connect(bufferInfoButton, &QPushButton::pressed, this, &KdASIOConfig::bufferInfoClicked); + // connect footer buttons + connect(koordLiveButton, &QPushButton::pressed, this, &KdASIOConfig::koordLiveClicked); + connect(githubButton, &QPushButton::pressed, this, &KdASIOConfig::githubClicked); // bufferSizeDisplay->setStyleSheet("background-color: black"); + koordLiveButton->setCursor(Qt::PointingHandCursor); + githubButton->setCursor(Qt::PointingHandCursor); + // populate input device choices inputDeviceBox->clear(); const auto input_devices = m_devices->audioInputs(); @@ -191,6 +206,7 @@ void KdASIOConfig::bufferSizeChanged(int idx) // THUS avoiding lots of spurious intermediate updates on buffer changes bufferSize = bufferSizes[idx]; bufferSizeSlider->setValue(idx); + latencyLabel->setText(QString::number(double(bufferSize) / 48, 'f', 2)); writeTomlFile(); } @@ -252,12 +268,102 @@ void KdASIOConfig::inputAudioSettClicked() { // open Windows audio input settings control panel QProcess *myProcess = new QProcess(this); - myProcess->startDetached(inputAudioSettPath); + myProcess->startDetached("control", QStringList() << inputAudioSettPath); } void KdASIOConfig::outputAudioSettClicked() { // open Windows audio output settings control panel QProcess *myProcess = new QProcess(this); - myProcess->startDetached(outputAudioSettPath); + myProcess->startDetached("control", QStringList() << outputAudioSettPath); +} + + +void KdASIOConfig::inputInfoClicked() +{ + QDialog *qd = new QDialog(this); + QLabel *qlab = new QLabel(); + QString inputInfoText = "" + + tr ( "AUDIO INPUT DEVICE - Tips" ) + + " " + + "
" + "
" + + "Choose your Audio Input Device here, eg your microphone. " + + "
" + "
" + + "Click the tool button to go to Windows audio control panel and configure."; + qlab->setText(inputInfoText); + QVBoxLayout *layout = new QVBoxLayout(); + layout->addWidget(qlab); + qd->setLayout(layout); + qd->setPalette(QPalette("#1d1f21")); + qd->show(); +} + +void KdASIOConfig::outputInfoClicked() +{ + QDialog *qd = new QDialog(this); + QLabel *qlab = new QLabel(); + QString outputInfoText = "" + + tr ( "AUDIO OUTPUT DEVICE - Tips" ) + + " " + + "
" + "
" + + "Choose your Audio Output Device here, eg your headphones. " + + "
" + "
" + + "Click the tool button to go to Windows audio control panel and configure."; + qlab->setText(outputInfoText); + QVBoxLayout *layout = new QVBoxLayout(); + layout->addWidget(qlab); + qd->setLayout(layout); + qd->setPalette(QPalette("#1d1f21")); + qd->show(); +} + +void KdASIOConfig::renderInfoClicked() +{ + QDialog *qd = new QDialog(this); + QLabel *qlab = new QLabel(); + QString renderInfoText = "" + + tr ( "RENDERING MODE - Tips" ) + + " " + + "
" + "
" + + "Choose between Shared and Exclusive modes, provided by the WASAPI Windows audio system." + + "
" + "
" + + "Shared Mode: mix ASIO with regular Windows audio." + + "
" + "
" + + "Exclusive Mode: lowest latency, locks out access from other audio applications." + ; + qlab->setText(renderInfoText); + QVBoxLayout *layout = new QVBoxLayout(); + layout->addWidget(qlab); + qd->setLayout(layout); + qd->setPalette(QPalette("#1d1f21")); + qd->show(); +} + +void KdASIOConfig::bufferInfoClicked() +{ + QDialog *qd = new QDialog(this); + QLabel *qlab = new QLabel(); + QString inputInfoText = "" + + tr ( "BUFFER SIZE - Tips" ) + + " " + + "
" + "
" + + "Select the size of the ASIO Buffer, by the number of samples. " + + "
" + "
" + + "A lower size may cause glitches in your sound, while higher size causes higher latency."; + qlab->setText(inputInfoText); + QVBoxLayout *layout = new QVBoxLayout(); + layout->addWidget(qlab); + qd->setLayout(layout); + qd->setPalette(QPalette("#1d1f21")); + qd->show(); +} + +void KdASIOConfig::koordLiveClicked() +{ + QDesktopServices::openUrl(QUrl("https://koord.live", QUrl::TolerantMode)); +} + +void KdASIOConfig::githubClicked() +{ + QDesktopServices::openUrl(QUrl("/~https://github.com/koord-live/KoordASIO/releases", QUrl::TolerantMode)); } diff --git a/src/kdasioconfig/kdasioconfig.h b/src/kdasioconfig/kdasioconfig.h index b9e5fe9..65ca536 100644 --- a/src/kdasioconfig/kdasioconfig.h +++ b/src/kdasioconfig/kdasioconfig.h @@ -87,8 +87,8 @@ class KdASIOConfig : public KdASIOConfigBase QString outputDeviceName; QString inputDeviceName; QString fullpath = QDir::homePath() + "/.KoordASIO-builtin.toml"; - QString inputAudioSettPath = "control mmsys.cpl,,1"; - QString outputAudioSettPath = "control mmsys.cpl"; + QString inputAudioSettPath = "mmsys.cpl,,1"; + QString outputAudioSettPath = "mmsys.cpl"; QList bufferSizes = { 32, 64, 128, 256, 512, 1024, 2048 }; private slots: @@ -105,6 +105,12 @@ private slots: void setValuesFromToml(std::ifstream *ifs, toml::ParseResult *pr); void inputAudioSettClicked(); void outputAudioSettClicked(); + void inputInfoClicked(); + void outputInfoClicked(); + void renderInfoClicked(); + void bufferInfoClicked(); + void koordLiveClicked(); + void githubClicked(); }; #endif diff --git a/src/kdasioconfig/kdasioconfigbase.ui b/src/kdasioconfig/kdasioconfigbase.ui index d8d58fd..8c0c419 100644 --- a/src/kdasioconfig/kdasioconfigbase.ui +++ b/src/kdasioconfig/kdasioconfigbase.ui @@ -133,6 +133,12 @@ + + + 16777215 + 20 + + Rubik @@ -143,7 +149,13 @@ color: gray; - open-source, universal ASIO + open-source universal ASIO driver + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false @@ -247,7 +259,7 @@ - :/img/images/CONFIG BTN ON.png:/img/images/CONFIG BTN ON.png + :/img/images/CONFIG BTN OFF.png:/img/images/CONFIG BTN OFF.png @@ -261,7 +273,7 @@ - + 0 @@ -279,6 +291,15 @@ PreferDefault + + + + + + + + + false @@ -287,7 +308,7 @@ - :/img/images/INFO BTN ON.png:/img/images/INFO BTN ON.png + :/img/images/INFO BTN OFF.png:/img/images/INFO BTN OFF.png @@ -295,6 +316,9 @@ 25 + + false + false @@ -672,7 +696,7 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ - :/img/images/CONFIG BTN ON.png:/img/images/CONFIG BTN ON.png + :/img/images/CONFIG BTN OFF.png:/img/images/CONFIG BTN OFF.png @@ -686,7 +710,7 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ - + 0 @@ -707,7 +731,8 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ - :/img/images/INFO BTN ON.png:/img/images/INFO BTN ON.png + :/img/images/INFO BTN OFF.png + :/img/images/INFO BTN ON.png:/img/images/INFO BTN OFF.png @@ -715,6 +740,9 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ 25 + + true + false @@ -871,7 +899,7 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ - + 0 @@ -886,7 +914,7 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ - :/img/images/INFO BTN ON.png:/img/images/INFO BTN ON.png + :/img/images/INFO BTN OFF.png:/img/images/INFO BTN OFF.png @@ -959,8 +987,8 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ padding-right: -4px; padding-bottom: -2px; border-radius: 5px; - border: 2px solid black; - background-color: black; + border: 2px solid #1d1f21; + background-color: #1d1f21; } @@ -1025,8 +1053,8 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ padding-right: -4px; padding-bottom: -2px; border-radius: 5px; - border: 2px solid black; - background-color: black; + border: 2px solid #1d1f21; + background-color: #1d1f21; } @@ -1149,7 +1177,7 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ - + 0 @@ -1164,7 +1192,7 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ - :/img/images/INFO BTN ON.png:/img/images/INFO BTN ON.png + :/img/images/INFO BTN OFF.png:/img/images/INFO BTN OFF.png @@ -1221,8 +1249,8 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ QLCDNumber{ - background-color: black; - border: 2px solid black; + background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #17191A, stop:1 #1E2122); + border: 2px solid #1d1f21; border-width: 2px; border-radius: 5px; color: orange; @@ -1242,6 +1270,13 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ + + + + TextLabel + + + @@ -1270,8 +1305,9 @@ QComboBox::down-arrow:on { /* shift the arrow when popup is open */ QSlider::groove:horizontal { - height: 12px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ - background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4); + height: 18px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ + background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #BF740D, stop:1 #FF9B12); + border-radius: 5px; } @@ -1279,16 +1315,18 @@ QSlider::handle:horizontal { image: url(:/img/images/Fader BTN.png); width: 30px; margin: -20px 20px; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */ + margin-left: -3px; + margin-right: -3px; border-radius: 3px; } -QSlider::add-page:horizontal { +/*QSlider::add-page:horizontal { background: #1d1f21; } QSlider::sub-page:horizontal { background: #ff9c12; -} +}*/ 6 @@ -1392,25 +1430,32 @@ QSlider::sub-page:horizontal { - - - - 0 - 0 - - + - 108 - 27 + 101 + 15 - - image: url(:/img/images/Koord Logo.png); + + false + + + :/img/images/Koord Logo.png:/img/images/Koord Logo.png + + + + 166 + 29 + + + + true + @@ -1427,24 +1472,22 @@ QSlider::sub-page:horizontal { - - - - 0 - 0 - + + + - + + + :/img/images/mark-github-24.png:/img/images/mark-github-24.png + + - 24 - 24 + 18 + 18 - - image: url(:/img/images/mark-github-24.png); - - - + + true diff --git a/src/kdasioconfig/main.cpp b/src/kdasioconfig/main.cpp index b985e85..296dbd8 100644 --- a/src/kdasioconfig/main.cpp +++ b/src/kdasioconfig/main.cpp @@ -55,7 +55,7 @@ int main(int argv, char **args) { QApplication app(argv, args); - app.setApplicationName("Audio Device Test"); + app.setApplicationName("KoordASIO Setup"); KdASIOConfig audio; audio.show(); diff --git a/windows/deploy_windows.ps1 b/windows/deploy_windows.ps1 index 3590949..ad5db0a 100644 --- a/windows/deploy_windows.ps1 +++ b/windows/deploy_windows.ps1 @@ -262,7 +262,7 @@ Function Build-App Invoke-Native-Command -Command "$Env:QtWinDeployPath" ` -Arguments ("--$BuildConfig", "--no-compiler-runtime", "--dir=$DeployPath\$BuildArch", ` "--no-system-d3d-compiler", "--no-opengl-sw", ` - "$BuildPath\$BuildConfig\kdasioconfig\kdasioconfig.exe") + "$BuildPath\$BuildConfig\kdasioconfig\KoordASIOSetup.exe") # Get-ChildItem -Recurse "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\" @@ -272,15 +272,15 @@ Function Build-App # all build files: # kdasioconfig files inc qt dlls now in # D:/a/KoordASIO/KoordASIO/deploy/x86_64/ - # - kdasioconfig.exe + # - KoordASIOSetup.exe # all qt dlls etc ... # flexasio files in: # D:\a\KoordASIO\KoordASIO\build\flexasio\install\bin # - FlexASIO.dll # - portaudio_x64.dll - # Move kdasioconfig.exe to deploy dir - Move-Item -Path "$BuildPath\$BuildConfig\kdasioconfig\kdasioconfig.exe" -Destination "$DeployPath\$BuildArch" -Force + # Move KoordASIOSetup.exe to deploy dir + Move-Item -Path "$BuildPath\$BuildConfig\kdasioconfig\KoordASIOSetup.exe" -Destination "$DeployPath\$BuildArch" -Force # Move 2 x FlexASIO dlls to deploy dir, rename DLL here for separation Move-Item -Path "$BuildPath\$BuildConfig\flexasio\install\bin\KoordASIO.dll" -Destination "$DeployPath\$BuildArch" -Force Move-Item -Path "$BuildPath\$BuildConfig\flexasio\install\bin\portaudio_x64.dll" -Destination "$DeployPath\$BuildArch" -Force diff --git a/windows/kdinstaller.iss b/windows/kdinstaller.iss index 3d82280..a1295e3 100644 --- a/windows/kdinstaller.iss +++ b/windows/kdinstaller.iss @@ -3,8 +3,7 @@ [Setup] AppID=KoordASIO AppName=KoordASIO -AppVerName=KoordASIO_1.7a-k03 -AppVersion=1.7a-k03 +AppVersion=2.0 AppPublisher=Koord.Live AppPublisherURL=/~https://github.com/koord-live/KoordASIO AppSupportURL=/~https://github.com/koord-live/KoordASIO/issues @@ -18,7 +17,7 @@ ArchitecturesInstallIn64BitMode=x64 [Files] Source:"deploy\x86_64\KoordASIO.dll"; DestDir: "{app}"; Flags: ignoreversion regserver 64bit; Check: Is64BitInstallMode -; install everything else in deploy dir, including portaudio.dll, kdasioconfig.exe and all Qt dll deps +; install everything else in deploy dir, including portaudio.dll, KoordASIOSetup.exe and all Qt dll deps Source:"deploy\x86_64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs 64bit; Check: Is64BitInstallMode ; Source:"x86\install\bin\FlexASIO.dll"; DestDir: "{app}\x86"; Flags: ignoreversion regserver ; Source:"x86\install\bin\*"; DestDir: "{app}\x86"; Flags: ignoreversion @@ -26,12 +25,12 @@ Source:"deploy\x86_64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs ; Source:"*.md"; DestDir:"{app}"; Flags: ignoreversion [Icons] -Name: "{group}\KoordASIO Config"; Filename: "{app}\kdasioconfig.exe"; WorkingDir: "{app}" +Name: "{group}\KoordASIO Config"; Filename: "{app}\KoordASIOSetup.exe"; WorkingDir: "{app}" [Run] -Filename: "{app}\kdasioconfig.exe"; Description: "Run KoordASIO Config"; Flags: postinstall nowait skipifsilent +Filename: "{app}\KoordASIOSetup.exe"; Description: "Run KoordASIO Config"; Flags: postinstall nowait skipifsilent -; install reg key to locate kdasioconfig at runtime +; install reg key to locate KoordASIOSetup at runtime [Registry] Root: HKLM64; Subkey: "Software\Koord"; Flags: uninsdeletekeyifempty Root: HKLM64; Subkey: "Software\Koord\KoordASIO"; Flags: uninsdeletekey