Skip to content

Commit

Permalink
Merge pull request #4 from nicola02nb/main
Browse files Browse the repository at this point in the history
Merging all the great improvements from @nicola02nb
  • Loading branch information
LeoKlaus authored Sep 3, 2024
2 parents ef8ba7b + 856ac44 commit 3eeecfc
Show file tree
Hide file tree
Showing 47 changed files with 5,209 additions and 1,097 deletions.
157 changes: 157 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Build and Release

on:
push:
tags:
- 'v*'

jobs:
build-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: "6.7.2"
add-tools-to-path: true

- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1

- name: Build
run: |
mkdir build
cd build
qmake ../
nmake
- name: Remove source and object files
shell: pwsh
run: |
$buildDir = "build/release"
if (Test-Path $buildDir) {
Get-ChildItem -Path $buildDir -Include *.cpp, *.h, *.obj, *.res -Recurse | Remove-Item -Force
} else {
Write-Host "Directory not found: $buildDir"
}
- name: Deploy Qt
shell: pwsh
run: |
cd build
$windeployqtPath = "D:\a\HeadsetControl-GUI\Qt\6.7.2\msvc2019_64\bin\windeployqt6.exe"
if (Test-Path $windeployqtPath) {
& $windeployqtPath `
--exclude-plugins qsvgicon,qsvg,qico,qjpeg,qgif,qnetworklistmanager,qtuiotouchplugin `
--no-opengl-sw `
--no-system-dxc-compiler `
--no-compiler-runtime `
--no-translations `
--no-system-d3d-compiler `
D:\a\HeadsetControl-GUI\HeadsetControl-GUI\build\release\HeadsetControl-GUI.exe
} else {
Write-Error "windeploygui not found at the expected path!"
exit 1
}
- name: Download ZIP from other repo
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://github.com/Sapd/HeadsetControl/releases/latest/download/headsetcontrol-windows.zip" -OutFile headsetcontrol-windows.zip
Expand-Archive -Path headsetcontrol-windows.zip -DestinationPath build/release/
- name: Zip binaries folder
run: |
$zipFile = "HeadsetControl-GUI_windows_64.zip"
$folder = "build/release/"
Compress-Archive -Path $folder -DestinationPath $zipFile
shell: pwsh

- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: HeadsetControl-GUI_windows_64
path: HeadsetControl-GUI_windows_64.zip

build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: "6.7.2"
host: "linux"
add-tools-to-path: true

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libgl1-mesa-dev
- name: Build with qmake
run: |
mkdir build
cd build
qmake ../HeadsetControl-GUI.pro CONFIG+=release
make -j$(nproc)
- name: Zip binaries folder
run: |
zip build/HeadsetControl-GUI_linux_64.zip build/HeadsetControl-GUI
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: HeadsetControl-GUI_linux_64
path: build/HeadsetControl-GUI_linux_64.zip

create-release:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest

steps:
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: HeadsetControl-GUI_linux_64

- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: HeadsetControl-GUI_windows_64

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release v${{ github.ref }}
draft: false
prerelease: false

- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./HeadsetControl-GUI_linux_64.zip
asset_name: HeadsetControl-GUI_linux_64.zip
asset_content_type: application/octet-stream

- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./HeadsetControl-GUI_windows_64.zip
asset_name: HeadsetControl-GUI_windows_64.zip
asset_content_type: application/octet-stream
58 changes: 58 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build

on:
push:
branches: [main]
paths-ignore:
- '.src/**'
- 'HeadsetControl-GUI.pro'
pull_request:
branches: [main]

jobs:
build-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: "6.7.2"
add-tools-to-path: true

- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1

- name: Build
run: |
mkdir build
cd build
qmake ../
nmake
build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: "6.7.2"
host: "linux"
add-tools-to-path: true

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libgl1-mesa-dev
- name: Build with qmake
run: |
mkdir build
cd build
qmake ../HeadsetControl-GUI.pro CONFIG+=release
make -j$(nproc)
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@
*.exe
*.out
*.app

# Folders
build/*

# User files
HeadsetControl-GUI.pro.user
52 changes: 37 additions & 15 deletions HeadsetControl-GUI.pro
Original file line number Diff line number Diff line change
@@ -1,30 +1,52 @@
QT += core gui
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 5): QT += widgets

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17

CONFIG += c++11

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
INCLUDEPATH += \
src/DataTypes \
src/UI \
src/Utils

SOURCES += \
main.cpp \
mainwindow.cpp
src/UI/settingswindow.cpp \
src/main.cpp \
src/DataTypes/device.cpp \
src/DataTypes/settings.cpp \
src/UI/dialoginfo.cpp \
src/UI/loaddevicewindow.cpp \
src/UI/mainwindow.cpp \
src/Utils/utils.cpp

HEADERS += \
mainwindow.h
src/DataTypes/device.h \
src/DataTypes/settings.h \
src/UI/dialoginfo.h \
src/UI/loaddevicewindow.h \
src/UI/mainwindow.h \
src/UI/settingswindow.h \
src/Utils/utils.h

FORMS += \
mainwindow.ui
src/UI/dialoginfo.ui \
src/UI/loaddevicewindow.ui \
src/UI/mainwindow.ui \
src/UI/settingswindow.ui

TRANSLATIONS += \
HeadsetControl-GUI_en_US.ts
src/Resources/tr/HeadsetControl_GUI_en_US.ts \
src/Resources/tr/HeadsetControl_GUI_it_IT.ts

RESOURCES += \
src/Resources/icons.qrc \
src/Resources/translations.qrc

RC_FILE = src/Resources/appicon.rc

DISTFILES += \
.gitignore

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
icons.qrc
3 changes: 0 additions & 3 deletions HeadsetControl-GUI_en_US.ts

This file was deleted.

73 changes: 36 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,61 @@
# HeadsetControl-GUI
This is a GUI for [Sapds great HeadsetControl](https://github.com/Sapd/HeadsetControl/). It's just a frontend to graphically interact with the original HeadsetControl and has no functionality by itself.
A simply remake of [HeadsetControl-GUI](https://github.com/LeoKlaus/HeadsetControl-GUI) by @LeoKlaus
# HeadsetControl-GUI [![Github All Releases](https://img.shields.io/github/downloads/nicola02nb/headsetcontrol-gui/total.svg)]() [![license](https://img.shields.io/github/license/nicola02nb/HeadsetControl-GUI)]()
This is a GUI for [Sapds great HeadsetControl](https://github.com/Sapd/HeadsetControl/).</br>
It's just a frontend to graphically interact with the original HeadsetControl and has no functionality by itself.</br>

I have to give a huge thank you to Sapd for doing all the heavy lifting and developing the command line tool HeadsetControl without which this project wouldn't be possible.

**Disclaimer**:
This program is in no way affiliated with Sapd or HeadsetControl.
All issues regarding the functionality of HeadsetControl (like compatiblity with devices) are beyond the scope of this project.
## Platforms

OS | Compiled | Tested
:------------ | :-------------| :-------------
Windows | ✅ | ✅
Linux | ✅ | ❌
MacOS | ❌ | ❌

If you are on Linux or Mac and try to build the app and test it, I'd be happy to hear if it did or didn't work.

## Installation (Windows only for now)
Download the [latest release](https://github.com/LeoKlaus/HeadsetControl-GUI/releases/latest/) of HeadsetControl-GUI from the [releases section](https://github.com/LeoKlaus/HeadsetControl-GUI/releases) of this page.
Download the corresponding version of [Sapds HeadsetControl from their GitHub page](https://github.com/Sapd/HeadsetControl/releases/).
## Installation (Windows)
1. Download the [latest release](https://github.com/nicola02nb/HeadsetControl-GUI/releases/latest/) of HeadsetControl-GUI from the [releases section](https://github.com/nicola02nb/HeadsetControl-GUI/releases) of this page.
2. Extract HeadsetControl-GUI to any folder.

Extract HeadsetControl-GUI to any folder of your choice and drop HeadsetControl into the same folder.
The finished folder should look something like this:

![Screenshot of the folder structure](https://i.imgur.com/bbymxL6.jpg "Screenshot of the folder structure")
![image](https://github.com/user-attachments/assets/0145ca37-6e59-4170-ba26-804e8856dbc8)

You HAVE to download a version of the [original headsetcontrol](https://github.com/Sapd/HeadsetControl/releases/) and put it in the same folder.
The executable of headsetcontrol has to be called "HeadsetControl".
Only if both these requirements are met, the GUI can work.
### Usage
Start HeadsetControl-GUI by double-clicking "HeadsetControl-GUI.exe", and if your headset is supported and everything was set up correctly, you will be greeted by the following screen HeadsetControl-GUI has..

## Usage
Start HeadsetControl-GUI by double-clicking "HeadsetControl-GUI.exe".
If your headset is supported and everything was set up correctly, you will be greeted by the only screen HeadsetControl-GUI has.
If you don't find some features in you ui, probably it's not supported by your headset or it has not been implemented by [HeadsetControl](https://github.com/Sapd/HeadsetControl/).

![Screenshot of the GUI with a Corsair Void Pro Wireless](https://i.imgur.com/xALkNjr.jpg)
![image](https://github.com/nicola02nb/HeadsetControl-GUI/assets/61830443/ce6a9628-4705-4a79-a262-8c43db2c92b0)

Here you can adjust all settings supported by your headset.
In my experience, these changes persist even after rebooting the system or turning the headset off.
If you have a wired headset and are finished changing settings, you can close the GUI and call it day. Yay!
Changes may or may not persist even after rebooting the system or turning the headset off(It depends on how headsets stores their own settings).

If you have a wireless headset with support for battery levels, you can also minimize HeadsetControl-GUI to the system tray.

![HeadsetControl-GUI in the system tray](https://i.imgur.com/83Apn66.jpg)
![image](https://github.com/nicola02nb/HeadsetControl-GUI/assets/61830443/ea327c0a-e39a-4035-aa99-bc6325724571)

That way, you will be able to see the battery status at a glance and get a reminder when the batteries of your headset run low (below 30%).
That way, you will be able to see the battery status at a glance and get a reminder when the batteries of your headset run low (below 15%).
Hovering over the tray icon will show you the current battery percentage. You can also right-click the tray icon to bring up a context menu with quick access to the light control. You can also open or completely close the GUI through the context menu.

![The tray icon context menu](https://i.imgur.com/2IWhbfa.jpg)
![image](https://github.com/nicola02nb/HeadsetControl-GUI/assets/61830443/0213a37c-806c-44d5-b8d7-5cc6b5d69407)

## Performance
### Performance
While the concept of calling another app for every single interaction has some inherit overhead, HeadsetControl-GUI is very light on ressources.
Being open in the background, HeadsetControl-GUI consists of a single process that uses virtually no CPU time and less than 8MB of system memory.

![Screenshot of the background task in task manager](https://i.imgur.com/3PaxKF6.jpg)
Being open in the background, HeadsetControl-GUI consists of a single process that uses virtually no CPU time and about 8-10MB of system memory.

![image](https://github.com/user-attachments/assets/3171e62d-8a0c-49b6-88bd-e5b03393c7fe)

## Building from source
To build HeadsetControl-GUI from source, you have to have a proper QT-ready development environment.
I developed, built and tested the program with Qt 6.0.3, though there's no apparent reason why it wouldn't work with older or newer versions of Qt.
Clone the source code, import the project into Qt creator or your favourite IDE and build it.

## Support for other platforms
I haven't used any platform-specific code, so generally, you should be able to build and run this app on Linux or MacOS just fine.
I haven't taken the time to build and test on neither Linux nor MacOS (yet), so I can't make any definitive claims on what is supported and what isn't.
If you are on Linux or Mac and try to build the app, I'd be happy to hear if it did or didn't work.
To build HeadsetControl-GUI from source, you have to have a proper QT-ready development environment.</br>
I developed, built and tested the program with Qt 6.7.0 and [Qt Creator](https://www.qt.io/product/development-tools) as IDE.</br>
Clone the source code, import the project into [Qt Creator](https://www.qt.io/product/development-tools) or your favourite IDE and build it.

## Additional information
This was written in a day and I'm aware the code is pretty ugly. I plan to fix this and add some additional functionality like persistent settings later down the road.
This software comes with no warranty whatsoever.</br>
It's not properly tested for memory leakage and may or may not work with configurations other than those I've tested.

This software comes with no warranty whatsoever. It's not properly tested for memory leakage and may or may not work with configurations other than those I've tested.
**Disclaimer**:
This program is in no way affiliated with Sapd or HeadsetControl.
All issues regarding the functionality of HeadsetControl (like compatiblity with devices) are beyond the scope of this project.
Loading

0 comments on commit 3eeecfc

Please sign in to comment.