Compare commits
102 Commits
proposed-p
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
fca05c9251 | ||
|
5283c4321b | ||
|
7e881e9800 | ||
|
51278c17ef | ||
|
249df58bc5 | ||
|
58269e8292 | ||
|
d93c906850 | ||
|
5f49ede204 | ||
|
085abaa50b | ||
|
e78f17fa6e | ||
|
0e5e64376c | ||
|
32e3231d60 | ||
|
885230b7bc | ||
|
611ebcc216 | ||
|
90b23d53d3 | ||
|
e699020cf2 | ||
|
b742c6f063 | ||
|
a0516a91ce | ||
|
0c35e24b2b | ||
|
4715292f93 | ||
|
e4b1f96fdb | ||
|
b7c0613588 | ||
|
07523c314c | ||
|
b6bc76dc16 | ||
|
0997b8dcaa | ||
|
444591366f | ||
|
59293e676d | ||
|
34626be565 | ||
|
0f37a36b10 | ||
|
697e652c34 | ||
|
c865457e18 | ||
|
a69ca3e80c | ||
|
076d265ad3 | ||
|
91ca0a055d | ||
|
372559e41c | ||
|
fd53f9f1fb | ||
|
ba602a0a4d | ||
|
5106ba5307 | ||
|
71eb3a90df | ||
|
9c1cfa6934 | ||
|
942d78cd4d | ||
|
a4fc381177 | ||
|
bfb61128d2 | ||
|
48c5e060dc | ||
|
18205a16f6 | ||
|
50ecde89ae | ||
|
3463766729 | ||
|
d16bd0e897 | ||
|
82e08ce167 | ||
|
a2d1ebdde2 | ||
|
9f82090b15 | ||
|
aafd9f697a | ||
|
3bf85e6060 | ||
|
e2f2907d0c | ||
|
fa8fac1fed | ||
|
64d8cafff7 | ||
|
f5627caf69 | ||
|
d59646298b | ||
|
51a9599a85 | ||
|
eec3ff33c0 | ||
|
94d7816b82 | ||
|
267acca9bb | ||
|
4a50e66d59 | ||
|
fbe8fcf75b | ||
|
60bd6bf53a | ||
|
8dfad9dede | ||
|
666f410cbf | ||
|
dbab91af93 | ||
|
04ea894b46 | ||
|
564c7dc34a | ||
|
a421b7a39a | ||
|
206e511a11 | ||
|
d6342b5b38 | ||
|
7a4e923ebb | ||
|
e6b4f44705 | ||
|
d1ce662804 | ||
|
fcc0dc0f01 | ||
|
1e0ac82f4e | ||
|
3bc8f1a6a0 | ||
|
cb02a6e908 | ||
|
3fcceaca92 | ||
|
422e0f694e | ||
|
bd635460fa | ||
|
b0c8780d87 | ||
|
dbe603cf10 | ||
|
7b9a6581d4 | ||
|
e1bd6be308 | ||
|
d7e7489a0f | ||
|
25412fe21a | ||
|
a7317f3037 | ||
|
316f4aa25c | ||
|
03ca09933a | ||
|
cb2cf67cb1 | ||
|
ea582dd52b | ||
|
f780164376 | ||
|
00f17c3ad7 | ||
|
6e890f42f2 | ||
|
c1d1fa61b9 | ||
|
200889f9ce | ||
|
f6cb564dcd | ||
|
89bc79a70b | ||
|
e75e8edac9 |
@ -4,7 +4,9 @@
|
||||
"repoType": "github",
|
||||
"repoHost": "https://github.com",
|
||||
"files": [
|
||||
"README.md"
|
||||
"README.md",
|
||||
"i18n/LISEZMOI.md",
|
||||
"i18n/ПРОЧТИМЕНЯ.md"
|
||||
],
|
||||
"imageSize": 50,
|
||||
"commit": true,
|
||||
@ -258,6 +260,35 @@
|
||||
"bug",
|
||||
"test"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "3JlOy-PYCCKUi",
|
||||
"name": "3JlOy_PYCCKUi",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/46464602?v=4",
|
||||
"profile": "https://github.com/3JlOy-PYCCKUi",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "FuRyQC",
|
||||
"name": "FuRyQC",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/91005051?v=4",
|
||||
"profile": "https://github.com/FuRyQC",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "moralrecordings",
|
||||
"name": "Scott Percival",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/16875700?v=4",
|
||||
"profile": "https://moral.net.au",
|
||||
"contributions": [
|
||||
"bug",
|
||||
"test",
|
||||
"code"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 2,
|
||||
|
59
.github/ISSUE_TEMPLATE/bug_report.md
vendored
59
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,59 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve Soundux
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Console output** <!-- REQUIRED -->
|
||||
<!-- Please specify **the entire** console output up to the point where the problem occurs. See https://github.com/Soundux/Soundux/wiki/Debugging on how to start Soundux with debug features enabled -->
|
||||
```
|
||||
Paste output here
|
||||
```
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop:** <!-- Please complete the following information, REQUIRED -->
|
||||
- Environment: [Windows Installer/Portable or Linux Flathub/Snap/AUR/DEB/RPM/COPR/self-compiled]
|
||||
- Version [Version number or commit]
|
||||
<!-- REMOVE THIS LINE IF USING LINUX
|
||||
- Distribution:
|
||||
REMOVE THIS LINE IF USING LINUX -->
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
**Checklist**
|
||||
|
||||
I confirm that...
|
||||
- [ ] I have collected all the required information and read all the comments in this document
|
||||
- [ ] I searched for an existing bug report for this issue
|
||||
- [ ] the problem does occur with the reproduction steps I provided
|
||||
- [ ] what I described is indeed a problem
|
||||
|
||||
<!--
|
||||
Please tick these boxes by replacing the whitespace between the braces with an x,
|
||||
so that it looks like this:
|
||||
- [x] I have ...
|
||||
|
||||
Or you can tick the boxes by clicking them with your mouse after submitting the issue
|
||||
-->
|
||||
|
||||
<!--
|
||||
Please confirm that what you're reporting is actually a problem, so that we don't have to deal with things like in https://github.com/Soundux/Soundux/issues/145
|
||||
-->
|
73
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
73
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
name: Bug Report
|
||||
description: Create a report to help us improve Soundux
|
||||
labels: ["bug"]
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: ✍️ Bug Description
|
||||
description: A clear and concise description of what the bug is.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 🔁 Steps to reproduce
|
||||
description: Steps to reproduce the behavior.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 🖥️ Console Output
|
||||
description: Everything that was printed to the console up until the problem occured. For more information see [Debugging](https://github.com/Soundux/Soundux/wiki/Debugging)
|
||||
render: ""
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: ❔ Expected behaviour
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 👀 Screenshots
|
||||
description: If applicable, add screenshots to help explain your problem.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: 🖥️ Operating System
|
||||
description: The operating system the problem occured on.
|
||||
options:
|
||||
- Linux
|
||||
- Windows 11
|
||||
- Windows 10
|
||||
- Windows 8.1
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: 🖥️ Distribution
|
||||
description: "If you're using linux or a special windows version please state it here"
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: ✅ I confirm that...
|
||||
description: Please confirm these things by clicking the checkboxes
|
||||
options:
|
||||
- label: I have collected all the required information and read all the comments in this document
|
||||
required: true
|
||||
- label: I searched for an existing bug report for this issue
|
||||
required: true
|
||||
- label: the problem does occur with the reproduction steps I provided
|
||||
required: true
|
||||
- label: what I described is indeed a problem
|
||||
required: true
|
11
.github/dependabot.yml
vendored
11
.github/dependabot.yml
vendored
@ -1,11 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
open-pull-requests-limit: 15
|
||||
- package-ecosystem: "gitsubmodule"
|
||||
directory: "."
|
||||
schedule:
|
||||
interval: "daily"
|
2
.github/workflows/build_flatpak.yml
vendored
2
.github/workflows/build_flatpak.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
with:
|
||||
submodules: true
|
||||
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v3
|
||||
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
|
||||
with:
|
||||
cache-key: flatpak-builder-${{ github.sha }}
|
||||
bundle: "soundux.flatpak"
|
||||
|
2
.github/workflows/compile_linux.yml
vendored
2
.github/workflows/compile_linux.yml
vendored
@ -15,7 +15,7 @@ on:
|
||||
name: Build on Linux
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
9
.github/workflows/compile_windows.yml
vendored
9
.github/workflows/compile_windows.yml
vendored
@ -22,9 +22,6 @@ jobs:
|
||||
language: ["cpp"]
|
||||
|
||||
steps:
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v2.1.5
|
||||
|
||||
- name: Setup NuGet.exe for use with actions
|
||||
uses: NuGet/setup-nuget@v1.0.5
|
||||
|
||||
@ -34,7 +31,7 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install OpenSSL
|
||||
uses: crazy-max/ghaction-chocolatey@v1.5.0
|
||||
uses: crazy-max/ghaction-chocolatey@v1.6.0
|
||||
with:
|
||||
args: install openssl -y
|
||||
|
||||
@ -51,12 +48,12 @@ jobs:
|
||||
path: build/Release
|
||||
|
||||
- name: Install InnoSetup
|
||||
uses: crazy-max/ghaction-chocolatey@v1.5.0
|
||||
uses: crazy-max/ghaction-chocolatey@v1.6.0
|
||||
with:
|
||||
args: install innosetup -y
|
||||
|
||||
- name: Install Sed
|
||||
uses: crazy-max/ghaction-chocolatey@v1.5.0
|
||||
uses: crazy-max/ghaction-chocolatey@v1.6.0
|
||||
with:
|
||||
args: install sed -y
|
||||
|
||||
|
8
.github/workflows/upload_full_src.yml
vendored
8
.github/workflows/upload_full_src.yml
vendored
@ -15,7 +15,7 @@ on:
|
||||
name: Upload source with submodules
|
||||
jobs:
|
||||
upload-full-src:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -28,6 +28,12 @@ jobs:
|
||||
submodules: recursive
|
||||
path: Soundux
|
||||
|
||||
- name: Install build dependencies
|
||||
run: "sudo apt-get update && sudo apt-get install git build-essential cmake libx11-dev libpipewire-0.3-dev ninja-build libxi-dev libwnck-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev libpulse-dev"
|
||||
|
||||
- name: Fetch Required External Dependencies
|
||||
run: 'cd Soundux && cmake -GNinja . && find build -not -name "_deps" -delete && rm CMakeCache.txt'
|
||||
|
||||
- name: Create tarball
|
||||
uses: master-atul/tar-action@v1.0.2
|
||||
with:
|
||||
|
5
.github/workflows/windows_debug.yml
vendored
5
.github/workflows/windows_debug.yml
vendored
@ -10,9 +10,6 @@ jobs:
|
||||
language: ["cpp"]
|
||||
|
||||
steps:
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v2.1.5
|
||||
|
||||
- name: Setup NuGet.exe for use with actions
|
||||
uses: NuGet/setup-nuget@v1.0.5
|
||||
|
||||
@ -22,7 +19,7 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install OpenSSL
|
||||
uses: crazy-max/ghaction-chocolatey@v1.5.0
|
||||
uses: crazy-max/ghaction-chocolatey@v1.6.0
|
||||
with:
|
||||
args: install openssl -y
|
||||
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -41,6 +41,3 @@
|
||||
[submodule "lib/guardpp"]
|
||||
path = lib/guardpp
|
||||
url = https://github.com/Soundux/guardpp
|
||||
[submodule "lib/libremidi"]
|
||||
path = lib/libremidi
|
||||
url = https://github.com/Soundux/libremidi
|
||||
|
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
project(soundux VERSION 0.2.7 DESCRIPTION "A crossplatform soundboard")
|
||||
project(soundux VERSION 0.2.8 DESCRIPTION "A crossplatform soundboard")
|
||||
|
||||
set(FULL_VERSION_STRING "0.2.7")
|
||||
set(FULL_VERSION_STRING "0.2.8")
|
||||
option(EMBED_PATH "The path used for embedding" "OFF")
|
||||
option(USE_FLATPAK "Allows the program to run under flatpak" OFF)
|
||||
|
||||
@ -39,7 +39,11 @@ if (WIN32)
|
||||
target_compile_options(soundux PRIVATE /W4)
|
||||
else()
|
||||
add_executable(soundux ${src})
|
||||
target_compile_options(soundux PRIVATE -Wall -Werror -Wextra -pedantic -Wno-unused-lambda-capture -Wno-gnu)
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(STATUS "Enabling warning and error flags for debug build")
|
||||
target_compile_options(soundux PRIVATE -Wall -Werror -Wextra -pedantic -Wno-unused-lambda-capture -Wno-gnu)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_compile_definitions(soundux PRIVATE SOUNDUX_VERSION="${FULL_VERSION_STRING}" WNCK_I_KNOW_THIS_IS_UNSTABLE=1)
|
||||
@ -74,7 +78,6 @@ add_subdirectory(lib/nativefiledialog-extended EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(lib/tiny-process-library EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(lib/backward-cpp EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(lib/traypp EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(lib/libremidi)
|
||||
add_subdirectory(lib/guardpp)
|
||||
add_subdirectory(lib/lockpp)
|
||||
|
||||
@ -90,7 +93,7 @@ set(HTTPLIB_REQUIRE_OPENSSL ON)
|
||||
add_subdirectory(lib/cpp-httplib EXCLUDE_FROM_ALL)
|
||||
target_include_directories(soundux SYSTEM PRIVATE "lib/cpp-httplib")
|
||||
|
||||
target_link_libraries(soundux PRIVATE webview nfd tiny-process-library tray guard httplib lockpp libremidi)
|
||||
target_link_libraries(soundux PRIVATE webview nfd tiny-process-library tray guardpp httplib lockpp)
|
||||
|
||||
if (${EMBED_PATH} STREQUAL "OFF")
|
||||
message("Web-content will not be embedded")
|
||||
|
30
README.md
30
README.md
@ -1,5 +1,24 @@
|
||||
<div align="center">
|
||||
|
||||
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
|
||||
|
||||
> [!NOTE]
|
||||
> Soundux is undergoing a major rewrite right now, for more information see https://github.com/Soundux/Soundux/issues/591
|
||||
|
||||
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
|
||||
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div align="center">
|
||||
<p>
|
||||
Read the documentation in:
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/README.md">[English]</a>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/i18n/LISEZMOI.md">[French]</a>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/i18n/ПРОЧТИМЕНЯ.md">[Russian]</a>
|
||||
<br><br><br>
|
||||
<img src="assets/logo.gif" height="200"/>
|
||||
<br>
|
||||
<h6>A cross-platform soundboard 🔊</h6>
|
||||
@ -90,14 +109,14 @@ We also provide a `soundux-git` package which compiles from the master branch
|
||||
### <img src="https://www.vectorlogo.zone/logos/ubuntu/ubuntu-icon.svg" height="20"/> Ubuntu and derivatives
|
||||
You can install Soundux via [pacstall](https://github.com/pacstall/pacstall)
|
||||
```sh
|
||||
sudo pacstall -I soundux
|
||||
pacstall -I soundux
|
||||
```
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/getfedora/getfedora-icon.svg" height="20"> Fedora
|
||||
Soundux can be installed via this [COPR repository](https://copr.fedorainfracloud.org/coprs/rivenirvana/soundux/)
|
||||
```sh
|
||||
sudo dnf copr enable rivenirvana/soundux
|
||||
sudo dnf install soundux
|
||||
sudo dnf install soundux pipewire-devel
|
||||
```
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/linuxfoundation/linuxfoundation-icon.svg" height="20" /> Distro-agnostic packages
|
||||
@ -235,6 +254,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
||||
<td align="center"><a href="https://github.com/lucasvbeek"><img src="https://avatars.githubusercontent.com/u/29404838?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Lucas van Beek</b></sub></a><br /><a href="#translation-lucasvbeek" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/underhood"><img src="https://avatars.githubusercontent.com/u/6674623?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Timotej S.</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Aunderhood" title="Bug reports">🐛</a> <a href="https://github.com/Soundux/Soundux/commits?author=underhood" title="Tests">⚠️</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/3JlOy-PYCCKUi"><img src="https://avatars.githubusercontent.com/u/46464602?v=4?s=50" width="50px;" alt=""/><br /><sub><b>3JlOy_PYCCKUi</b></sub></a><br /><a href="#translation-3JlOy-PYCCKUi" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/FuRyQC"><img src="https://avatars.githubusercontent.com/u/91005051?v=4?s=50" width="50px;" alt=""/><br /><sub><b>FuRyQC</b></sub></a><br /><a href="#translation-FuRyQC" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://moral.net.au"><img src="https://avatars.githubusercontent.com/u/16875700?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Scott Percival</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Amoralrecordings" title="Bug reports">🐛</a> <a href="https://github.com/Soundux/Soundux/commits?author=moralrecordings" title="Tests">⚠️</a> <a href="https://github.com/Soundux/Soundux/commits?author=moralrecordings" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
|
@ -55,6 +55,24 @@
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<releases>
|
||||
<release version="0.2.8" date="2022-05-18">
|
||||
<url>https://github.com/Soundux/Soundux/releases/tag/0.2.8</url>
|
||||
<description>
|
||||
<p>Last bugfix release for this iteration of the project</p>
|
||||
<p>If you didn't know already: We're currently in the progress of a major rework. See issue #591 on GitHub</p>
|
||||
<ul>
|
||||
<li>Update translations</li>
|
||||
<li>Hotkeys rework and MIDI support</li>
|
||||
<li>Mute during playback on PipeWire</li>
|
||||
<li>Language override setting</li>
|
||||
<li>Automatically unload problematic PulseAudio modules</li>
|
||||
<li>Disable downloader button when not on a tab</li>
|
||||
<li>Don't prompt for VB-Cable setup when it was not detected</li>
|
||||
<li>Fixed an issue with the PulseAudio backend (#587)</li>
|
||||
<li>General bug fixes and stability improvements</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="0.2.7" date="2021-06-04">
|
||||
<url>https://github.com/Soundux/Soundux/releases/tag/0.2.7</url>
|
||||
<description>
|
||||
|
@ -1,5 +1,5 @@
|
||||
Package: soundux
|
||||
Version: 0.2.7
|
||||
Version: 0.2.8
|
||||
Architecture: all
|
||||
Maintainer: D3SOX <d3sox@protonmail.com>
|
||||
Depends: libgtk-3-0, libwnck-3-0, libappindicator3-1, libwebkit2gtk-4.0-37, libx11-6, pulseaudio
|
||||
|
40
deployment/ebuild/soundux.ebuild
Normal file
40
deployment/ebuild/soundux.ebuild
Normal file
@ -0,0 +1,40 @@
|
||||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit optfeature cmake
|
||||
|
||||
DESCRIPTION="A cross-platform soundboard"
|
||||
HOMEPAGE="https://soundux.rocks"
|
||||
SRC_URI="https://github.com/Soundux/Soundux/releases/download/${PV}/soundux-${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
DEPEND="
|
||||
dev-libs/libappindicator:3
|
||||
dev-libs/openssl
|
||||
media-sound/pulseaudio
|
||||
media-video/pipewire
|
||||
net-libs/webkit-gtk:4
|
||||
x11-base/xorg-server
|
||||
x11-libs/gtk+:3
|
||||
"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
S="${WORKDIR}/Soundux"
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DCMAKE_INSTALL_PREFIX="${EPREFIX}"
|
||||
-DEMBED_PATH="OFF"
|
||||
)
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
optfeature "Downloader support" media-video/ffmpeg net-misc/youtube-dl
|
||||
optfeature "Icon support" x11-libs/libwnck:3
|
||||
}
|
@ -1,16 +1,20 @@
|
||||
app-id: io.github.Soundux
|
||||
runtime: org.gnome.Platform
|
||||
runtime-version: "40"
|
||||
runtime-version: "42"
|
||||
sdk: org.gnome.Sdk
|
||||
command: soundux
|
||||
finish-args:
|
||||
- --device=all
|
||||
- --device=shm
|
||||
- --share=network
|
||||
- --device=dri
|
||||
- --socket=pulseaudio
|
||||
- --socket=x11
|
||||
- --filesystem=host
|
||||
- --share=network
|
||||
- --share=ipc
|
||||
- --filesystem=xdg-run/pipewire-0
|
||||
- --filesystem=xdg-music:ro
|
||||
- --filesystem=xdg-download:ro
|
||||
- --filesystem=xdg-documents:ro
|
||||
- --filesystem=/run/media:ro
|
||||
- --filesystem=/media:ro
|
||||
modules:
|
||||
- "shared-modules/libappindicator/libappindicator-gtk3-introspection-12.10.json"
|
||||
- name: libwnck
|
||||
@ -31,14 +35,15 @@ modules:
|
||||
config-opts:
|
||||
- -DUSE_FLATPAK=ON
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DFETCHCONTENT_FULLY_DISCONNECTED=ON
|
||||
post-install:
|
||||
- "install -Dm 644 -t /app/share/metainfo deployment/appstream/io.github.Soundux.metainfo.xml"
|
||||
- "install -Dm 644 -t /app/share/applications deployment/appstream/io.github.Soundux.desktop"
|
||||
- "install -Dm 644 deployment/flatpak/icons/io.github.Soundux-256.png /app/share/icons/hicolor/256x256/apps/io.github.Soundux.png"
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/Soundux/Soundux.git
|
||||
branch: master
|
||||
- type: archive
|
||||
url: https://github.com/Soundux/Soundux/releases/download/0.2.8/soundux-0.2.8.tar.gz
|
||||
sha256: d007841ae5bab71d8a25cc86d27ce137b01b29a7f2b42a5bd62b4ed50dd74043
|
||||
- name: ffmpeg
|
||||
config-opts:
|
||||
- --enable-shared
|
||||
@ -51,8 +56,8 @@ modules:
|
||||
- --enable-libvorbis
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://www.ffmpeg.org/releases/ffmpeg-4.4.tar.xz
|
||||
sha256: 06b10a183ce5371f915c6bb15b7b1fffbe046e8275099c96affc29e17645d909
|
||||
url: https://www.ffmpeg.org/releases/ffmpeg-5.0.1.tar.xz
|
||||
sha256: ef2efae259ce80a240de48ec85ecb062cecca26e4352ffb3fda562c21a93007b
|
||||
post-install:
|
||||
- install -Dm644 COPYING.LGPLv3 /app/share/licenses/ffmpeg/COPYING
|
||||
cleanup:
|
||||
@ -65,7 +70,7 @@ modules:
|
||||
- PYTHON=/usr/bin/python
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://github.com/ytdl-org/youtube-dl/releases/download/2021.06.06/youtube-dl-2021.06.06.tar.gz
|
||||
sha256: 3ccb0e4db9fd172338ed1c32bae0be2f716458dca4143e55732ff55260b20ac3
|
||||
url: https://github.com/ytdl-org/youtube-dl/releases/download/2021.12.17/youtube-dl-2021.12.17.tar.gz
|
||||
sha256: 9f3b99c8b778455165b4525f21505e86c7ff565f3ac319e19733d810194135df
|
||||
post-install:
|
||||
- install -Dm0755 -t /app/bin youtube-dl
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit db9b7869185288b9824a8331595dffe297d3e688
|
||||
Subproject commit 1b470b7982aa820ab2c972c8242f860e83ab6971
|
@ -2,7 +2,7 @@
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
|
||||
#define MyAppName "Soundux"
|
||||
#define MyAppVersion "0.2.7"
|
||||
#define MyAppVersion "0.2.8"
|
||||
#define MyAppPublisher "Soundux"
|
||||
#define MyAppURL "https://soundux.rocks"
|
||||
#define MyAppExeName "soundux.exe"
|
||||
@ -167,8 +167,8 @@ begin
|
||||
DownloadPage.Add('https://download.vb-audio.com/Download_CABLE/VBCABLE_Driver_Pack43.zip', 'VBCABLE_Driver_Pack43.zip', '')
|
||||
end;
|
||||
if WizardIsComponentSelected('FfmpegYouTubeDL') then begin
|
||||
DownloadPage.Add('https://github.com/eugeneware/ffmpeg-static/releases/download/b4.3.2/win32-x64', 'ffmpeg.exe', '')
|
||||
DownloadPage.Add('https://github.com/ytdl-org/youtube-dl/releases/download/2021.06.06/youtube-dl.exe', 'youtube-dl.exe', '')
|
||||
DownloadPage.Add('https://github.com/eugeneware/ffmpeg-static/releases/download/b5.0/win32-x64', 'ffmpeg.exe', '')
|
||||
DownloadPage.Add('https://github.com/ytdl-org/youtube-dl/releases/download/2021.12.17/youtube-dl.exe', 'youtube-dl.exe', '')
|
||||
|
||||
DownloadPage.Add('https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe', 'vcredist_x86.exe', '')
|
||||
DownloadPage.Add('https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe', 'vcredist_x64.exe', '')
|
||||
|
@ -2,7 +2,7 @@
|
||||
%global repo_url https://github.com/Soundux/Soundux
|
||||
|
||||
Name: soundux
|
||||
Version: 0.2.7
|
||||
Version: 0.2.8
|
||||
Release: 1%{?dist}
|
||||
Summary: A cross-platform soundboard
|
||||
|
||||
|
258
i18n/LISEZMOI.md
Normal file
258
i18n/LISEZMOI.md
Normal file
@ -0,0 +1,258 @@
|
||||
<div align="center">
|
||||
<p>
|
||||
Lisez la documentation dans:
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/README.md">[Anglais/English]</a>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/i18n/LISEZMOI.md">[Français/French]</a>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/i18n/ПРОЧТИМЕНЯ.md">[Russe/Russian]</a>
|
||||
<br><br><br>
|
||||
<img src="../assets/logo.gif" height="200"/>
|
||||
<br>
|
||||
<h6>Un soundboard Multi-Plateformes 🔊</h6>
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/releases">
|
||||
<img src="https://img.shields.io/github/release/Soundux/Soundux.svg?style=flat-square" alt="Latest Stable Release" />
|
||||
</a>
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/Soundux/soundux?style=flat-square" alt="GitHub Repo stars">
|
||||
</a>
|
||||
<a href="https://github.com/Soundux/Soundux/issues">
|
||||
<img src="https://img.shields.io/github/issues/Soundux/soundux?style=flat-square" alt="GitHub issues">
|
||||
</a>
|
||||
<a href="https://github.com/Soundux/Soundux/pulls">
|
||||
<img src="https://img.shields.io/github/issues-pr-raw/Soundux/soundux?label=pulls&style=flat-square" alt="GitHub pull requests">
|
||||
</a>
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/Soundux/Soundux.svg?style=flat-square" alt="License" />
|
||||
</a>
|
||||
<a href="https://discord.gg/4HwSGN4Ec2">
|
||||
<img src="https://img.shields.io/discord/697348809591750706?label=discord&style=flat-square" alt="Discord" />
|
||||
</a>
|
||||
<a href="https://matrix.to/#/!XlIlRgKzoRavKnurkt:matrix.org">
|
||||
<img src="https://img.shields.io/badge/chat-matrix%20space-blue?style=flat-square" alt="Matrix" />
|
||||
</a>
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/actions?query=workflow%3A%22Build+on+Windows%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/Soundux/Soundux/Build%20on%20Windows?label=windows%20build&style=flat-square" alt="Windows Build" />
|
||||
</a>
|
||||
<a href="https://github.com/Soundux/Soundux/actions?query=workflow%3A%22Build+on+Linux%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/Soundux/Soundux/Build%20on%20Linux?label=linux%20build&style=flat-square" alt="Linux Build" />
|
||||
</a>
|
||||
<a href="https://github.com/Soundux/Soundux/actions?query=workflow%3A%22Build+Flatpak%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/Soundux/Soundux/Build%20Flatpak?label=flatpak%20build&style=flat-square" alt="Flatpak Build" />
|
||||
</a>
|
||||
<hr>
|
||||
<a href="https://discord.com/invite/4HwSGN4Ec2">
|
||||
<img src="https://invidget.switchblade.xyz/4HwSGN4Ec2" alt="Discord Invite"/>
|
||||
</a>
|
||||
<a href="https://hosted.weblate.org/engage/soundux/">
|
||||
<img src="https://hosted.weblate.org/widgets/soundux/-/frontend/multi-green.svg" alt="Translation status" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
# 👀 Aperçu
|
||||
|  |  |
|
||||
| -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
# 👋 Introduction
|
||||
Soundux est un Soundboard multi-plateformes qui possède une interface utilisateur simple .
|
||||
Avec Soundux vous pouvez jouer de l'audio à une application en particulier sous linux et pour votre VB-Cable sink pour Windows.
|
||||
|
||||
# Dépendances d'exécution
|
||||
Ces fichiers sont nécéssaire pour le fonctionnement du programe.
|
||||
|
||||
## 🐧 Linux
|
||||
S'il vous plait, vous référez aux instructions pour votre distribution Linux.
|
||||
- [pulseaudio](https://gitlab.freedesktop.org/pulseaudio/pulseaudio) / [pipewire](https://pipewire.org/) >= 0.3.26
|
||||
- Xorg
|
||||
- Libwnck3 (optionnel,pour le support d'icones)
|
||||
- Webkit2gtk
|
||||
- libappindicator3
|
||||
- [youtube-dl](https://youtube-dl.org/) & [ffmpeg](https://www.ffmpeg.org/) (optionnel, Pour utiliser la fonction de téléchargement)
|
||||
## <img src="https://www.vectorlogo.zone/logos/microsoft/microsoft-icon.svg" height="20"/> Windows
|
||||
- [VB-CABLE](https://vb-audio.com/Cable/) (Notre installateur installe automatiquement VB-Cable)
|
||||
- [Webview2 Runtime](https://developer.microsoft.com/microsoft-edge/webview2/) (ceci est d'office dans l'installateur)
|
||||
- [youtube-dl](https://youtube-dl.org/) & [ffmpeg](https://www.ffmpeg.org/) (optionnel, Pour utiliser la fonction de téléchargement)
|
||||
|
||||
# 📥 Installation
|
||||
|
||||
## 🐧 Linux
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/archlinux/archlinux-icon.svg" height="20"/> Arch Linux et dérivés.
|
||||
Vous pouvez installer notre paquet avec votre AUR helper de choix ce qui vas automatiquement compiler et installer la dernière version
|
||||
publiée.
|
||||
```sh
|
||||
yay -S soundux
|
||||
```
|
||||
Nous avons aussi un paquet `soundux-git` qui se compile directement de la branche maitre (master)
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/ubuntu/ubuntu-icon.svg" height="20"/> Ubuntu et dérivés
|
||||
Vous pouvez installer Soundux via [pacstall](https://github.com/pacstall/pacstall)
|
||||
```sh
|
||||
pacstall -I soundux
|
||||
```
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/getfedora/getfedora-icon.svg" height="20"> Fedora
|
||||
Soundux peut être installé via [COPR repository](https://copr.fedorainfracloud.org/coprs/rivenirvana/soundux/)
|
||||
```sh
|
||||
sudo dnf copr enable rivenirvana/soundux
|
||||
sudo dnf install soundux pipewire-devel
|
||||
```
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/linuxfoundation/linuxfoundation-icon.svg" height="20" /> Paquets Distro-agnostic
|
||||
Vous pouvez prendre directement la dernière version depuis le snapstore ou flathub
|
||||
|
||||
[](https://snapcraft.io/soundux)
|
||||
|
||||
<a href='https://flathub.org/apps/details/io.github.Soundux'>
|
||||
<img width='240' alt='Download on Flathub' src='https://flathub.org/assets/badges/flathub-badge-en.png'/>
|
||||
</a>
|
||||
|
||||
## <img src="https://www.vectorlogo.zone/logos/microsoft/microsoft-icon.svg" height="20"/> Windows
|
||||
Télécharger notre installateur ou version portable [de la dernière version publiée](https://github.com/Soundux/Soundux/releases/latest)
|
||||
|
||||
# 🔨 Compilation
|
||||
|
||||
## 🔗 build les dépendances
|
||||
|
||||
### 🐧 Linux
|
||||
- Webkit2gtk
|
||||
- PulseAudio development headers
|
||||
- PipeWire development headers
|
||||
- X11 client-side development headers
|
||||
- libappindicator3 development headers
|
||||
- OpenSSL development headers
|
||||
- G++ >= 9
|
||||
- Certaines distributions ont toujours la G++ versions < 9 dans leur repos. Les utilisé résulterons a une erreur de construction (pour plus d'informations se réfferer à (anglais) [#71](https://github.com/Soundux/Soundux/issues/71)).
|
||||
|
||||
#### <img src="https://www.vectorlogo.zone/logos/debian/debian-icon.svg" height="20"/> Debian / <img src="https://www.vectorlogo.zone/logos/ubuntu/ubuntu-icon.svg" height="20"/> Ubuntu et dérivés
|
||||
```sh
|
||||
sudo apt install git build-essential cmake libx11-dev libxi-dev libwebkit2gtk-4.0-dev libappindicator3-dev libssl-dev libpulse-dev libpipewire-0.3-dev
|
||||
```
|
||||
> Si vous êtes sous Ubuntu 20.04 ou plus vieux, vous devrez peut être ajouter le PipeWire PPA:
|
||||
> `sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream`
|
||||
#### <img src="https://www.vectorlogo.zone/logos/getfedora/getfedora-icon.svg" height="20"> Fedora et dérivés
|
||||
```sh
|
||||
sudo dnf install git webkit2gtk3 cmake llvm clang libXi-devel gtk3-devel webkit2gtk3-devel libappindicator-gtk3-devel pulseaudio-libs-devel pipewire-devel
|
||||
```
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/microsoft/microsoft-icon.svg" height="20"/> Windows
|
||||
- Nuget
|
||||
- MSVC
|
||||
- CMake
|
||||
- OpenSSL
|
||||
|
||||
## 👷 Build
|
||||
Clonez le repo
|
||||
```sh
|
||||
git clone https://github.com/Soundux/Soundux.git
|
||||
cd Soundux
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
Créer un dossier de build et commencer la compilation
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . --config Release
|
||||
```
|
||||
Pour lancer le programme
|
||||
```sh
|
||||
./soundux # .\soundux.exe on Windows
|
||||
```
|
||||
|
||||
## 🖥️ Installation
|
||||
|
||||
### 🐧 Linux
|
||||
```sh
|
||||
sudo make install
|
||||
```
|
||||
|
||||
# 📝 Pourquoi _Soundux_?
|
||||
|
||||
Le projet a démarré comme **Sound**board pour Lin**ux**
|
||||
|
||||
# 🗒️ License
|
||||
Le code est licensé sous [GPLv3](../LICENSE)
|
||||
|
||||
# ✍️ Contribution
|
||||
Les règles de conduite pour la contribution peuvent être trouvé [ici](../CONTRIBUTING.md), S'il vous plait, consultez les si vous prévoyez de contribuer.
|
||||
# ✨ Aidants
|
||||
|
||||
Milles merci à tout ce beaux monde! ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Curve"><img src="https://avatars.githubusercontent.com/u/37805707?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Noah</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3ACurve" title="Bug reports">🐛</a> <a href="#business-Curve" title="Business development">💼</a> <a href="https://github.com/Soundux/Soundux/commits?author=Curve" title="Code">💻</a> <a href="#design-Curve" title="Design">🎨</a> <a href="#ideas-Curve" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-Curve" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-Curve" title="Maintenance">🚧</a> <a href="#platform-Curve" title="Packaging/porting to new platform">📦</a> <a href="#projectManagement-Curve" title="Project Management">📆</a> <a href="#question-Curve" title="Answering Questions">💬</a> <a href="https://github.com/Soundux/Soundux/pulls?q=is%3Apr+reviewed-by%3ACurve" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/Soundux/Soundux/commits?author=Curve" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/D3SOX"><img src="https://avatars.githubusercontent.com/u/24937357?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Nico</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3AD3SOX" title="Bug reports">🐛</a> <a href="#business-D3SOX" title="Business development">💼</a> <a href="https://github.com/Soundux/Soundux/commits?author=D3SOX" title="Code">💻</a> <a href="#design-D3SOX" title="Design">🎨</a> <a href="#ideas-D3SOX" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-D3SOX" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-D3SOX" title="Maintenance">🚧</a> <a href="#platform-D3SOX" title="Packaging/porting to new platform">📦</a> <a href="#projectManagement-D3SOX" title="Project Management">📆</a> <a href="#question-D3SOX" title="Answering Questions">💬</a> <a href="https://github.com/Soundux/Soundux/pulls?q=is%3Apr+reviewed-by%3AD3SOX" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/Soundux/Soundux/commits?author=D3SOX" title="Tests">⚠️</a> <a href="#translation-D3SOX" title="Translation">🌍</a> <a href="#a11y-D3SOX" title="Accessibility">️️️️♿️</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/MrKingMichael"><img src="https://avatars.githubusercontent.com/u/30067605?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Michael</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3AMrKingMichael" title="Bug reports">🐛</a> <a href="#ideas-MrKingMichael" title="Ideas, Planning, & Feedback">🤔</a> <a href="#translation-MrKingMichael" title="Translation">🌍</a> <a href="https://github.com/Soundux/Soundux/commits?author=MrKingMichael" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/BrandonKMLee"><img src="https://avatars.githubusercontent.com/u/58927531?v=4?s=50" width="50px;" alt=""/><br /><sub><b>BrandonKMLee</b></sub></a><br /><a href="#ideas-BrandonKMLee" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Toadfield"><img src="https://avatars.githubusercontent.com/u/68649672?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Toadfield</b></sub></a><br /><a href="#ideas-Toadfield" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/Soundux/Soundux/issues?q=author%3AToadfield" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://github.com/fubka"><img src="https://avatars.githubusercontent.com/u/44064746?v=4?s=50" width="50px;" alt=""/><br /><sub><b>fubka</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Afubka" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/TheOriginalTripleD"><img src="https://avatars.githubusercontent.com/u/6907054?v=4?s=50" width="50px;" alt=""/><br /><sub><b>TheOriginalTripleD</b></sub></a><br /><a href="#research-TheOriginalTripleD" title="Research">🔬</a></td>
|
||||
<td align="center"><a href="https://github.com/UltraBlackLinux"><img src="https://avatars.githubusercontent.com/u/62404294?v=4?s=50" width="50px;" alt=""/><br /><sub><b>UltraBlackLinux</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3AUltraBlackLinux" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://bendem.be/"><img src="https://avatars.githubusercontent.com/u/2681677?v=4?s=50" width="50px;" alt=""/><br /><sub><b>bendem</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Abendem" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://edgar.bzh/"><img src="https://avatars.githubusercontent.com/u/46636609?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Edgar Onghena</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Aedgarogh" title="Bug reports">🐛</a> <a href="#research-edgarogh" title="Research">🔬</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/moggesmith10"><img src="https://avatars.githubusercontent.com/u/33375517?v=4?s=50" width="50px;" alt=""/><br /><sub><b>moggesmith10</b></sub></a><br /><a href="#ideas-moggesmith10" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://belmoussaoui.com/"><img src="https://avatars.githubusercontent.com/u/7660997?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Bilal Elmoussaoui</b></sub></a><br /><a href="#platform-bilelmoussaoui" title="Packaging/porting to new platform">📦</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/thomasfinstad"><img src="https://avatars.githubusercontent.com/u/5358752?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Thomas Finstad Larsen</b></sub></a><br /><a href="#ideas-thomasfinstad" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="http://arthurmelton.me"><img src="https://avatars.githubusercontent.com/u/29708070?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Arthur Melton</b></sub></a><br /><a href="#ideas-AMTitan" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/serkan-maker"><img src="https://avatars.githubusercontent.com/u/63740626?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Serkan ÖNDER</b></sub></a><br /><a href="#translation-serkan-maker" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/pizzadude"><img src="https://avatars.githubusercontent.com/u/1454420?v=4?s=50" width="50px;" alt=""/><br /><sub><b>PizzaDude</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Apizzadude" title="Bug reports">🐛</a> <a href="#research-pizzadude" title="Research">🔬</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Kylianalex"><img src="https://avatars.githubusercontent.com/u/66625058?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Kylianalex</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3AKylianalex" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="http://gregerstoltnilsen.net/"><img src="https://avatars.githubusercontent.com/u/1364443?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Greger</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Agregersn" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/rivenirvana"><img src="https://avatars.githubusercontent.com/u/43519644?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Arvin Verain</b></sub></a><br /><a href="#platform-rivenirvana" title="Packaging/porting to new platform">📦</a></td>
|
||||
<td align="center"><a href="http://einfacheinalex.eu/"><img src="https://avatars.githubusercontent.com/u/20642291?v=4?s=50" width="50px;" alt=""/><br /><sub><b>EinfachEinAlex</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/commits?author=EinfachEinAlex" title="Code">💻</a> <a href="#research-EinfachEinAlex" title="Research">🔬</a> <a href="https://github.com/Soundux/Soundux/commits?author=EinfachEinAlex" title="Tests">⚠️</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://discord.gg/ubmTQnuM3Z"><img src="https://avatars.githubusercontent.com/u/69876322?v=4?s=50" width="50px;" alt=""/><br /><sub><b>MeblIkea</b></sub></a><br /><a href="#translation-MeblIkea" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://nathanbonnemains.squill.fr/"><img src="https://avatars.githubusercontent.com/u/45366162?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Nathan Bonnemains</b></sub></a><br /><a href="#translation-NathanBnm" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/lucasvbeek"><img src="https://avatars.githubusercontent.com/u/29404838?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Lucas van Beek</b></sub></a><br /><a href="#translation-lucasvbeek" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/underhood"><img src="https://avatars.githubusercontent.com/u/6674623?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Timotej S.</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Aunderhood" title="Bug reports">🐛</a> <a href="https://github.com/Soundux/Soundux/commits?author=underhood" title="Tests">⚠️</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/3JlOy-PYCCKUi"><img src="https://avatars.githubusercontent.com/u/46464602?v=4?s=50" width="50px;" alt=""/><br /><sub><b>3JlOy_PYCCKUi</b></sub></a><br /><a href="#translation-3JlOy-PYCCKUi" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/FuRyQC"><img src="https://avatars.githubusercontent.com/u/91005051?v=4?s=50" width="50px;" alt=""/><br /><sub><b>FuRyQC</b></sub></a><br /><a href="#translation-FuRyQC" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://moral.net.au"><img src="https://avatars.githubusercontent.com/u/16875700?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Scott Percival</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Amoralrecordings" title="Bug reports">🐛</a> <a href="https://github.com/Soundux/Soundux/commits?author=moralrecordings" title="Tests">⚠️</a> <a href="https://github.com/Soundux/Soundux/commits?author=moralrecordings" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
Ce projet suis les spécifications de [all-contributors](https://github.com/all-contributors/all-contributors) Les contributions de toute sortes sont bienvenue!
|
258
i18n/ПРОЧТИМЕНЯ.md
Normal file
258
i18n/ПРОЧТИМЕНЯ.md
Normal file
@ -0,0 +1,258 @@
|
||||
<div align="center">
|
||||
<p>
|
||||
Читайте документацию на:
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/README.md">[Английском/English]</a>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/i18n/LISEZMOI.md">[Французском/French]</a>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/i18n/ПРОЧТИМЕНЯ.md">[Русском/Russian]</a>
|
||||
<br><br><br>
|
||||
<img src="../assets/logo.gif" height="200"/>
|
||||
<br>
|
||||
<h6>Кроссплатформенный soundboard 🔊</h6>
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/releases">
|
||||
<img src="https://img.shields.io/github/release/Soundux/Soundux.svg?style=flat-square" alt="Latest Stable Release" />
|
||||
</a>
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/Soundux/soundux?style=flat-square" alt="GitHub Repo stars">
|
||||
</a>
|
||||
<a href="https://github.com/Soundux/Soundux/issues">
|
||||
<img src="https://img.shields.io/github/issues/Soundux/soundux?style=flat-square" alt="GitHub issues">
|
||||
</a>
|
||||
<a href="https://github.com/Soundux/Soundux/pulls">
|
||||
<img src="https://img.shields.io/github/issues-pr-raw/Soundux/soundux?label=pulls&style=flat-square" alt="GitHub pull requests">
|
||||
</a>
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/blob/master/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/Soundux/Soundux.svg?style=flat-square" alt="License" />
|
||||
</a>
|
||||
<a href="https://discord.gg/4HwSGN4Ec2">
|
||||
<img src="https://img.shields.io/discord/697348809591750706?label=discord&style=flat-square" alt="Discord" />
|
||||
</a>
|
||||
<a href="https://matrix.to/#/!XlIlRgKzoRavKnurkt:matrix.org">
|
||||
<img src="https://img.shields.io/badge/chat-matrix%20space-blue?style=flat-square" alt="Matrix" />
|
||||
</a>
|
||||
<br>
|
||||
<a href="https://github.com/Soundux/Soundux/actions?query=workflow%3A%22Build+on+Windows%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/Soundux/Soundux/Build%20on%20Windows?label=windows%20build&style=flat-square" alt="Windows Build" />
|
||||
</a>
|
||||
<a href="https://github.com/Soundux/Soundux/actions?query=workflow%3A%22Build+on+Linux%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/Soundux/Soundux/Build%20on%20Linux?label=linux%20build&style=flat-square" alt="Linux Build" />
|
||||
</a>
|
||||
<a href="https://github.com/Soundux/Soundux/actions?query=workflow%3A%22Build+Flatpak%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/Soundux/Soundux/Build%20Flatpak?label=flatpak%20build&style=flat-square" alt="Flatpak Build" />
|
||||
</a>
|
||||
<hr>
|
||||
<a href="https://discord.com/invite/4HwSGN4Ec2">
|
||||
<img src="https://invidget.switchblade.xyz/4HwSGN4Ec2" alt="Discord Invite"/>
|
||||
</a>
|
||||
<a href="https://hosted.weblate.org/engage/soundux/">
|
||||
<img src="https://hosted.weblate.org/widgets/soundux/-/frontend/multi-green.svg" alt="Translation status" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
# 👀 Предпросмотр
|
||||
|  |  |
|
||||
| -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
# 👋 Введение
|
||||
Soundux это кроссплатформенный soundboard с простым интерфейсом.
|
||||
С помощью Soundux вы можете проигрывать аудиофайлы в определенное приложение на Linux и в VB-CABLE на Windows.
|
||||
|
||||
# 🏃 Зависимости запуска
|
||||
Эти зависимости необходимы чтобы запустить программу
|
||||
|
||||
## 🐧 Linux
|
||||
Пожалуйста воспользуйтесь инструкцией вашего дистрибутива по установке
|
||||
- [pulseaudio](https://gitlab.freedesktop.org/pulseaudio/pulseaudio) / [pipewire](https://pipewire.org/) >= 0.3.26
|
||||
- Xorg
|
||||
- Libwnck3 (опционально, для поддержки иконок)
|
||||
- Webkit2gtk
|
||||
- libappindicator3
|
||||
- [youtube-dl](https://youtube-dl.org/) & [ffmpeg](https://www.ffmpeg.org/) (опционально, для поддержки загрузки)
|
||||
## <img src="https://www.vectorlogo.zone/logos/microsoft/microsoft-icon.svg" height="20"/> Windows
|
||||
- [VB-CABLE](https://vb-audio.com/Cable/) (Наш установщик автоматически устанавливает VB-CABLE)
|
||||
- [Webview2 Runtime](https://developer.microsoft.com/microsoft-edge/webview2/) (Тоже поставляется вместе с установщиком)
|
||||
- [youtube-dl](https://youtube-dl.org/) & [ffmpeg](https://www.ffmpeg.org/) (опционально, для поддержки загрузки)
|
||||
|
||||
# 📥 Установка
|
||||
|
||||
## 🐧 Linux
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/archlinux/archlinux-icon.svg" height="20"/> Arch Linux и производные
|
||||
Вы можете установить наш пакет с помощью вашего AUR помошника, который автоматически соберет и установит последний релиз
|
||||
```sh
|
||||
yay -S soundux
|
||||
```
|
||||
Мы так же предоставляем пакет `soundux-git` который соберет программу из ветки master
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/ubuntu/ubuntu-icon.svg" height="20"/> Ubuntu и производные
|
||||
Вы можете установить Soundux с помощью [pacstall](https://github.com/pacstall/pacstall)
|
||||
```sh
|
||||
pacstall -I soundux
|
||||
```
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/getfedora/getfedora-icon.svg" height="20"> Fedora
|
||||
Soundux может быть установлен с помощью этого [COPR репозитория](https://copr.fedorainfracloud.org/coprs/rivenirvana/soundux/)
|
||||
```sh
|
||||
sudo dnf copr enable rivenirvana/soundux
|
||||
sudo dnf install soundux pipewire-devel
|
||||
```
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/linuxfoundation/linuxfoundation-icon.svg" height="20" /> Дистрибутивонезависимые пакеты
|
||||
Вы можете получить последний релиз из Snap Store или Flathub
|
||||
|
||||
[](https://snapcraft.io/soundux)
|
||||
|
||||
<a href='https://flathub.org/apps/details/io.github.Soundux'>
|
||||
<img width='240' alt='Установить из Flathub' src='https://flathub.org/assets/badges/flathub-badge-en.png'/>
|
||||
</a>
|
||||
|
||||
## <img src="https://www.vectorlogo.zone/logos/microsoft/microsoft-icon.svg" height="20"/> Windows
|
||||
Скачайте наш установщик или портативную версию [последнего релиза](https://github.com/Soundux/Soundux/releases/latest)
|
||||
|
||||
# 🔨 Сборка
|
||||
|
||||
## 🔗 Зависимости сборки
|
||||
|
||||
### 🐧 Linux
|
||||
- Webkit2gtk
|
||||
- PulseAudio development headers
|
||||
- PipeWire development headers
|
||||
- X11 client-side development headers
|
||||
- libappindicator3 development headers
|
||||
- OpenSSL development headers
|
||||
- G++ >= 9
|
||||
- Некоторые дистрибутивы все еще имеют G++ версии < 9 в своих репозиториях, используя их вы получите ошибку сборки (подробнее [#71](https://github.com/Soundux/Soundux/issues/71)).
|
||||
|
||||
#### <img src="https://www.vectorlogo.zone/logos/debian/debian-icon.svg" height="20"/> Debian / <img src="https://www.vectorlogo.zone/logos/ubuntu/ubuntu-icon.svg" height="20"/> Ubuntu и производные
|
||||
```sh
|
||||
sudo apt install git build-essential cmake libx11-dev libxi-dev libwebkit2gtk-4.0-dev libappindicator3-dev libssl-dev libpulse-dev libpipewire-0.3-dev
|
||||
```
|
||||
> Если вы на Ubuntu 20.04 или ниже вам возможно придется добавить PipeWire PPA:
|
||||
> `sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream`
|
||||
#### <img src="https://www.vectorlogo.zone/logos/getfedora/getfedora-icon.svg" height="20"> Fedora и производные
|
||||
```sh
|
||||
sudo dnf install git webkit2gtk3 cmake llvm clang libXi-devel gtk3-devel webkit2gtk3-devel libappindicator-gtk3-devel pulseaudio-libs-devel pipewire-devel
|
||||
```
|
||||
|
||||
### <img src="https://www.vectorlogo.zone/logos/microsoft/microsoft-icon.svg" height="20"/> Windows
|
||||
- Nuget
|
||||
- MSVC
|
||||
- CMake
|
||||
- OpenSSL
|
||||
|
||||
## 👷 Сборка
|
||||
Склонируйте репозиторий
|
||||
```sh
|
||||
git clone https://github.com/Soundux/Soundux.git
|
||||
cd Soundux
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
Создайте дирректорию сборки и начите сборку
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . --config Release
|
||||
```
|
||||
Чтобы запустить программу
|
||||
```sh
|
||||
./soundux # .\soundux.exe на Windows
|
||||
```
|
||||
|
||||
## 🖥️ Установка
|
||||
|
||||
### 🐧 Linux
|
||||
```sh
|
||||
sudo make install
|
||||
```
|
||||
|
||||
# 📝 Почему _Soundux_?
|
||||
|
||||
Проект начался как **Sound**board для Lin**ux**
|
||||
|
||||
# 🗒️ Лицензия
|
||||
Исходный код лицензирован под [GPLv3](LICENSE)
|
||||
|
||||
# ✍️ Внести вклад
|
||||
Руководство вы можете найти [здесь](CONTRIBUTING.md), пожалуйста, изучите его если вы собираетесь вносить вклад!
|
||||
|
||||
# ✨ Contributors
|
||||
|
||||
Спасибо этим замечательным людям ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Curve"><img src="https://avatars.githubusercontent.com/u/37805707?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Noah</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3ACurve" title="Bug reports">🐛</a> <a href="#business-Curve" title="Business development">💼</a> <a href="https://github.com/Soundux/Soundux/commits?author=Curve" title="Code">💻</a> <a href="#design-Curve" title="Design">🎨</a> <a href="#ideas-Curve" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-Curve" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-Curve" title="Maintenance">🚧</a> <a href="#platform-Curve" title="Packaging/porting to new platform">📦</a> <a href="#projectManagement-Curve" title="Project Management">📆</a> <a href="#question-Curve" title="Answering Questions">💬</a> <a href="https://github.com/Soundux/Soundux/pulls?q=is%3Apr+reviewed-by%3ACurve" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/Soundux/Soundux/commits?author=Curve" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/D3SOX"><img src="https://avatars.githubusercontent.com/u/24937357?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Nico</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3AD3SOX" title="Bug reports">🐛</a> <a href="#business-D3SOX" title="Business development">💼</a> <a href="https://github.com/Soundux/Soundux/commits?author=D3SOX" title="Code">💻</a> <a href="#design-D3SOX" title="Design">🎨</a> <a href="#ideas-D3SOX" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-D3SOX" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-D3SOX" title="Maintenance">🚧</a> <a href="#platform-D3SOX" title="Packaging/porting to new platform">📦</a> <a href="#projectManagement-D3SOX" title="Project Management">📆</a> <a href="#question-D3SOX" title="Answering Questions">💬</a> <a href="https://github.com/Soundux/Soundux/pulls?q=is%3Apr+reviewed-by%3AD3SOX" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/Soundux/Soundux/commits?author=D3SOX" title="Tests">⚠️</a> <a href="#translation-D3SOX" title="Translation">🌍</a> <a href="#a11y-D3SOX" title="Accessibility">️️️️♿️</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/MrKingMichael"><img src="https://avatars.githubusercontent.com/u/30067605?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Michael</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3AMrKingMichael" title="Bug reports">🐛</a> <a href="#ideas-MrKingMichael" title="Ideas, Planning, & Feedback">🤔</a> <a href="#translation-MrKingMichael" title="Translation">🌍</a> <a href="https://github.com/Soundux/Soundux/commits?author=MrKingMichael" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/BrandonKMLee"><img src="https://avatars.githubusercontent.com/u/58927531?v=4?s=50" width="50px;" alt=""/><br /><sub><b>BrandonKMLee</b></sub></a><br /><a href="#ideas-BrandonKMLee" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Toadfield"><img src="https://avatars.githubusercontent.com/u/68649672?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Toadfield</b></sub></a><br /><a href="#ideas-Toadfield" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/Soundux/Soundux/issues?q=author%3AToadfield" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://github.com/fubka"><img src="https://avatars.githubusercontent.com/u/44064746?v=4?s=50" width="50px;" alt=""/><br /><sub><b>fubka</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Afubka" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/TheOriginalTripleD"><img src="https://avatars.githubusercontent.com/u/6907054?v=4?s=50" width="50px;" alt=""/><br /><sub><b>TheOriginalTripleD</b></sub></a><br /><a href="#research-TheOriginalTripleD" title="Research">🔬</a></td>
|
||||
<td align="center"><a href="https://github.com/UltraBlackLinux"><img src="https://avatars.githubusercontent.com/u/62404294?v=4?s=50" width="50px;" alt=""/><br /><sub><b>UltraBlackLinux</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3AUltraBlackLinux" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://bendem.be/"><img src="https://avatars.githubusercontent.com/u/2681677?v=4?s=50" width="50px;" alt=""/><br /><sub><b>bendem</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Abendem" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://edgar.bzh/"><img src="https://avatars.githubusercontent.com/u/46636609?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Edgar Onghena</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Aedgarogh" title="Bug reports">🐛</a> <a href="#research-edgarogh" title="Research">🔬</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/moggesmith10"><img src="https://avatars.githubusercontent.com/u/33375517?v=4?s=50" width="50px;" alt=""/><br /><sub><b>moggesmith10</b></sub></a><br /><a href="#ideas-moggesmith10" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://belmoussaoui.com/"><img src="https://avatars.githubusercontent.com/u/7660997?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Bilal Elmoussaoui</b></sub></a><br /><a href="#platform-bilelmoussaoui" title="Packaging/porting to new platform">📦</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/thomasfinstad"><img src="https://avatars.githubusercontent.com/u/5358752?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Thomas Finstad Larsen</b></sub></a><br /><a href="#ideas-thomasfinstad" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="http://arthurmelton.me"><img src="https://avatars.githubusercontent.com/u/29708070?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Arthur Melton</b></sub></a><br /><a href="#ideas-AMTitan" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/serkan-maker"><img src="https://avatars.githubusercontent.com/u/63740626?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Serkan ÖNDER</b></sub></a><br /><a href="#translation-serkan-maker" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/pizzadude"><img src="https://avatars.githubusercontent.com/u/1454420?v=4?s=50" width="50px;" alt=""/><br /><sub><b>PizzaDude</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Apizzadude" title="Bug reports">🐛</a> <a href="#research-pizzadude" title="Research">🔬</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Kylianalex"><img src="https://avatars.githubusercontent.com/u/66625058?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Kylianalex</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3AKylianalex" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="http://gregerstoltnilsen.net/"><img src="https://avatars.githubusercontent.com/u/1364443?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Greger</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Agregersn" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/rivenirvana"><img src="https://avatars.githubusercontent.com/u/43519644?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Arvin Verain</b></sub></a><br /><a href="#platform-rivenirvana" title="Packaging/porting to new platform">📦</a></td>
|
||||
<td align="center"><a href="http://einfacheinalex.eu/"><img src="https://avatars.githubusercontent.com/u/20642291?v=4?s=50" width="50px;" alt=""/><br /><sub><b>EinfachEinAlex</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/commits?author=EinfachEinAlex" title="Code">💻</a> <a href="#research-EinfachEinAlex" title="Research">🔬</a> <a href="https://github.com/Soundux/Soundux/commits?author=EinfachEinAlex" title="Tests">⚠️</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://discord.gg/ubmTQnuM3Z"><img src="https://avatars.githubusercontent.com/u/69876322?v=4?s=50" width="50px;" alt=""/><br /><sub><b>MeblIkea</b></sub></a><br /><a href="#translation-MeblIkea" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://nathanbonnemains.squill.fr/"><img src="https://avatars.githubusercontent.com/u/45366162?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Nathan Bonnemains</b></sub></a><br /><a href="#translation-NathanBnm" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/lucasvbeek"><img src="https://avatars.githubusercontent.com/u/29404838?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Lucas van Beek</b></sub></a><br /><a href="#translation-lucasvbeek" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/underhood"><img src="https://avatars.githubusercontent.com/u/6674623?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Timotej S.</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Aunderhood" title="Bug reports">🐛</a> <a href="https://github.com/Soundux/Soundux/commits?author=underhood" title="Tests">⚠️</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/3JlOy-PYCCKUi"><img src="https://avatars.githubusercontent.com/u/46464602?v=4?s=50" width="50px;" alt=""/><br /><sub><b>3JlOy_PYCCKUi</b></sub></a><br /><a href="#translation-3JlOy-PYCCKUi" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/FuRyQC"><img src="https://avatars.githubusercontent.com/u/91005051?v=4?s=50" width="50px;" alt=""/><br /><sub><b>FuRyQC</b></sub></a><br /><a href="#translation-FuRyQC" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://moral.net.au"><img src="https://avatars.githubusercontent.com/u/16875700?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Scott Percival</b></sub></a><br /><a href="https://github.com/Soundux/Soundux/issues?q=author%3Amoralrecordings" title="Bug reports">🐛</a> <a href="https://github.com/Soundux/Soundux/commits?author=moralrecordings" title="Tests">⚠️</a> <a href="https://github.com/Soundux/Soundux/commits?author=moralrecordings" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
Этот проект следует спецификации [all-contributors](https://github.com/all-contributors/all-contributors). Любой вклад приветствуется!
|
@ -1 +1 @@
|
||||
Subproject commit 77946058afe52a1d43f5b6243384fe45e7c2aa64
|
||||
Subproject commit 3bb9240cb15459768adb3e7d963a20e1523a6294
|
@ -1 +1 @@
|
||||
Subproject commit 676f1b5a2682b1b682e3e8159142500e3c84443a
|
||||
Subproject commit 429750092850b18abeccb7bd390e9fb88baf2b1b
|
@ -1 +1 @@
|
||||
Subproject commit 51816d2f7eeebf99cee0c0e8ea1f1acbc9f6800c
|
||||
Subproject commit 59a29ea3437e06d38a3d64ea2230d022b0294f0d
|
@ -1 +0,0 @@
|
||||
Subproject commit e2213b724d8426366235f3de70db25fb231a0b07
|
@ -1 +1 @@
|
||||
Subproject commit 199d6a7875b4288af6a7b615367c8fdc2019b03c
|
||||
Subproject commit 4d813cfe23c28db165cce6785419fee9d2399766
|
@ -1 +1 @@
|
||||
Subproject commit 8ea68626a484de06d48ebcba8db99f8fd393ddd4
|
||||
Subproject commit 698db7d58dd450cc9e30dc12d3bd0c5ca4d6a5b1
|
@ -33,11 +33,11 @@ namespace Soundux
|
||||
inline Objects::Queue gQueue;
|
||||
inline Objects::Config gConfig;
|
||||
inline Objects::YoutubeDl gYtdl;
|
||||
inline Objects::Hotkeys gHotKeys;
|
||||
inline Objects::Settings gSettings;
|
||||
inline std::unique_ptr<Objects::Window> gGui;
|
||||
inline std::shared_ptr<Objects::Hotkeys> gHotKeys;
|
||||
|
||||
inline std::shared_ptr<Instance::Guard> gGuard;
|
||||
inline std::shared_ptr<guardpp::guard> gGuard;
|
||||
|
||||
/* Allows for fast & easy sound access, is populated on start up */
|
||||
inline sxl::var_guard<std::map<std::uint32_t, std::reference_wrapper<Objects::Sound>>> gSounds;
|
||||
|
@ -1,10 +1,6 @@
|
||||
#include "hotkeys.hpp"
|
||||
#include "keys.hpp"
|
||||
#include "linux/x11.hpp"
|
||||
#include "windows/windows.hpp"
|
||||
#include <core/global/globals.hpp>
|
||||
#include <cstdint>
|
||||
#include <fancy.hpp>
|
||||
|
||||
namespace Soundux
|
||||
{
|
||||
@ -23,117 +19,38 @@ namespace Soundux
|
||||
} // namespace traits
|
||||
namespace Objects
|
||||
{
|
||||
std::shared_ptr<Hotkeys> Hotkeys::createInstance()
|
||||
void Hotkeys::init()
|
||||
{
|
||||
std::shared_ptr<Hotkeys> rtn;
|
||||
#if defined(__linux__)
|
||||
rtn = std::shared_ptr<X11>(new X11()); // NOLINT
|
||||
#elif defined(_WIN32)
|
||||
rtn = std::shared_ptr<WindowsHotkeys>(new WindowsHotkeys()); // NOLINT
|
||||
#endif
|
||||
rtn->setup();
|
||||
return rtn;
|
||||
listener = std::thread([this] { listen(); });
|
||||
}
|
||||
|
||||
void Hotkeys::setup()
|
||||
{
|
||||
try
|
||||
{
|
||||
midi.open_port();
|
||||
midi.set_callback([this](const libremidi::message &message) {
|
||||
if (message.size() < 3)
|
||||
{
|
||||
Fancy::fancy.logTime().failure()
|
||||
<< "Midi Message contains less than 3 bytes, can't parse information";
|
||||
return;
|
||||
}
|
||||
|
||||
auto byte0 = message[0];
|
||||
auto byte1 = message[1];
|
||||
auto byte2 = message[2];
|
||||
|
||||
MidiKey key;
|
||||
key.byte0 = byte0;
|
||||
key.key = byte1;
|
||||
key.byte2 = byte2;
|
||||
key.type = Enums::KeyType::Midi;
|
||||
|
||||
if (byte0 == 144)
|
||||
{
|
||||
onKeyDown(key);
|
||||
}
|
||||
else if (byte0 == 128)
|
||||
{
|
||||
onKeyUp(key);
|
||||
}
|
||||
else if (byte0 == 176)
|
||||
{
|
||||
if (shouldNotifyKnob)
|
||||
{
|
||||
Globals::gGui->onHotKeyReceived({key}); // NOLINT
|
||||
}
|
||||
else
|
||||
{
|
||||
auto newVolume = static_cast<int>((static_cast<float>(byte2) / 127.f) * 100);
|
||||
|
||||
if (Globals::gSettings.localVolumeKnob && key == Globals::gSettings.localVolumeKnob)
|
||||
{
|
||||
Globals::gSettings.localVolume = newVolume;
|
||||
Globals::gGui->onVolumeChanged();
|
||||
|
||||
Globals::gQueue.push([=]() { Globals::gGui->onLocalVolumeChanged(newVolume); });
|
||||
}
|
||||
else if (Globals::gSettings.remoteVolumeKnob && key == Globals::gSettings.remoteVolumeKnob)
|
||||
{
|
||||
Globals::gSettings.remoteVolume = newVolume;
|
||||
Globals::gGui->onVolumeChanged();
|
||||
|
||||
Globals::gQueue.push([=]() { Globals::gGui->onRemoteVolumeChanged(newVolume); });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
midi.ignore_types(false, false, false);
|
||||
}
|
||||
catch (const libremidi::midi_exception &e)
|
||||
{
|
||||
Fancy::fancy.logTime().failure() << "Failed to initialize libremidi: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
void Hotkeys::notify(bool state)
|
||||
void Hotkeys::shouldNotify(bool status)
|
||||
{
|
||||
pressedKeys.clear();
|
||||
shouldNotify = state;
|
||||
notify = status;
|
||||
}
|
||||
void Hotkeys::requestKnob(bool state)
|
||||
void Hotkeys::onKeyUp(int key)
|
||||
{
|
||||
shouldNotifyKnob = state;
|
||||
}
|
||||
void Hotkeys::onKeyUp(const Key &key)
|
||||
{
|
||||
if (std::find(pressedKeys.begin(), pressedKeys.end(), key) != pressedKeys.end())
|
||||
if (notify && !pressedKeys.empty() &&
|
||||
std::find(pressedKeys.begin(), pressedKeys.end(), key) != pressedKeys.end())
|
||||
{
|
||||
if (shouldNotify)
|
||||
{
|
||||
Globals::gGui->onHotKeyReceived(pressedKeys);
|
||||
pressedKeys.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
pressedKeys.erase(std::remove_if(pressedKeys.begin(), pressedKeys.end(),
|
||||
[&](const auto &keyItem) { return key == keyItem; }),
|
||||
pressedKeys.end());
|
||||
}
|
||||
Globals::gGui->onHotKeyReceived(pressedKeys);
|
||||
pressedKeys.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
pressedKeys.erase(std::remove_if(pressedKeys.begin(), pressedKeys.end(),
|
||||
[key](const auto &item) { return key == item; }),
|
||||
pressedKeys.end());
|
||||
}
|
||||
}
|
||||
bool isCloseMatch(const std::vector<Key> &pressedKeys, const std::vector<Key> &keys)
|
||||
bool isCloseMatch(const std::vector<int> &pressedKeys, const std::vector<int> &keys)
|
||||
{
|
||||
if (pressedKeys.size() >= keys.size())
|
||||
{
|
||||
bool allMatched = true;
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
if (std::find(pressedKeys.begin(), pressedKeys.end(), key) == pressedKeys.end()) // NOLINT
|
||||
if (std::find(pressedKeys.begin(), pressedKeys.end(), key) == pressedKeys.end())
|
||||
{
|
||||
allMatched = false;
|
||||
}
|
||||
@ -142,14 +59,13 @@ namespace Soundux
|
||||
}
|
||||
return false;
|
||||
}
|
||||
template <typename T> std::optional<Sound> getBestMatch(const T &list, const std::vector<Key> &pressedKeys)
|
||||
template <typename T> std::optional<Sound> getBestMatch(const T &list, const std::vector<int> &pressedKeys)
|
||||
{
|
||||
std::optional<Sound> rtn;
|
||||
|
||||
for (const auto &_sound : list)
|
||||
{
|
||||
const auto &sound = [&]() constexpr
|
||||
{
|
||||
const auto &sound = [&] {
|
||||
if constexpr (traits::is_pair<std::decay_t<decltype(_sound)>>::value)
|
||||
{
|
||||
return _sound.second.get();
|
||||
@ -158,13 +74,12 @@ namespace Soundux
|
||||
{
|
||||
return _sound;
|
||||
}
|
||||
}
|
||||
();
|
||||
}();
|
||||
|
||||
if (sound.hotkeys.empty())
|
||||
continue;
|
||||
|
||||
if (pressedKeys == sound.hotkeys)
|
||||
if (sound.hotkeys == pressedKeys)
|
||||
{
|
||||
rtn = sound;
|
||||
break;
|
||||
@ -182,81 +97,78 @@ namespace Soundux
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
void Hotkeys::onKeyDown(const Key &key)
|
||||
void Hotkeys::onKeyDown(int key)
|
||||
{
|
||||
if (std::find(pressedKeys.begin(), pressedKeys.end(), key) != pressedKeys.end())
|
||||
if (std::find(keysToPress.begin(), keysToPress.end(), key) != keysToPress.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (std::find(pressedKeys.begin(), pressedKeys.end(), key) == pressedKeys.end())
|
||||
{
|
||||
pressedKeys.emplace_back(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pressedKeys.emplace_back(key);
|
||||
if (!shouldNotify)
|
||||
if (notify)
|
||||
{
|
||||
if (!Globals::gSettings.stopHotkey.empty() &&
|
||||
(Globals::gSettings.stopHotkey == pressedKeys ||
|
||||
isCloseMatch(pressedKeys, Globals::gSettings.stopHotkey)))
|
||||
{
|
||||
Globals::gGui->stopSounds();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
std::optional<Sound> bestMatch;
|
||||
if (!Globals::gSettings.stopHotkey.empty() && (pressedKeys == Globals::gSettings.stopHotkey ||
|
||||
isCloseMatch(pressedKeys, Globals::gSettings.stopHotkey)))
|
||||
{
|
||||
Globals::gGui->stopSounds();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Globals::gSettings.tabHotkeysOnly)
|
||||
std::optional<Sound> bestMatch;
|
||||
|
||||
if (Globals::gSettings.tabHotkeysOnly)
|
||||
{
|
||||
if (Globals::gData.isOnFavorites)
|
||||
{
|
||||
if (Globals::gData.isOnFavorites)
|
||||
{
|
||||
auto sounds = Globals::gData.getFavorites();
|
||||
bestMatch = getBestMatch(sounds, pressedKeys);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto tab = Globals::gData.getTab(Globals::gSettings.selectedTab);
|
||||
if (tab)
|
||||
{
|
||||
bestMatch = getBestMatch(tab->sounds, pressedKeys);
|
||||
}
|
||||
}
|
||||
auto sounds = Globals::gData.getFavorites();
|
||||
bestMatch = getBestMatch(sounds, pressedKeys);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto scopedSounds = Globals::gSounds.scoped();
|
||||
bestMatch = getBestMatch(*scopedSounds, pressedKeys);
|
||||
}
|
||||
|
||||
if (bestMatch)
|
||||
{
|
||||
auto pSound = Globals::gGui->playSound(bestMatch->id);
|
||||
if (pSound)
|
||||
auto tab = Globals::gData.getTab(Globals::gSettings.selectedTab);
|
||||
if (tab)
|
||||
{
|
||||
Globals::gGui->onSoundPlayed(*pSound);
|
||||
bestMatch = getBestMatch(tab->sounds, pressedKeys);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
std::string Hotkeys::getKeyName(const Key &key)
|
||||
{
|
||||
if (key.type == Enums::KeyType::Midi)
|
||||
else
|
||||
{
|
||||
return "MIDI_" + std::to_string(key.key);
|
||||
auto scopedSounds = Globals::gSounds.scoped();
|
||||
bestMatch = getBestMatch(*scopedSounds, pressedKeys);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
std::string Hotkeys::getKeySequence(const std::vector<Key> &keys)
|
||||
{
|
||||
std::string rtn;
|
||||
|
||||
for (auto it = keys.begin(); it != keys.end(); ++it)
|
||||
if (bestMatch)
|
||||
{
|
||||
rtn += getKeyName(*it);
|
||||
if (std::distance(it, keys.end()) > 1)
|
||||
auto pSound = Globals::gGui->playSound(bestMatch->id);
|
||||
if (pSound)
|
||||
{
|
||||
rtn += " + ";
|
||||
Globals::gGui->onSoundPlayed(*pSound);
|
||||
}
|
||||
}
|
||||
|
||||
return rtn;
|
||||
}
|
||||
std::string Hotkeys::getKeySequence(const std::vector<int> &keys)
|
||||
{
|
||||
std::string rtn;
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
rtn += getKeyName(key) + " + ";
|
||||
}
|
||||
if (!rtn.empty())
|
||||
{
|
||||
return rtn.substr(0, rtn.length() - 3);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
} // namespace Objects
|
||||
} // namespace Soundux
|
@ -1,15 +1,7 @@
|
||||
#pragma once
|
||||
#pragma push_macro("max")
|
||||
#pragma push_macro("min")
|
||||
#undef min
|
||||
#undef max
|
||||
#include <libremidi/libremidi.hpp>
|
||||
#pragma pop_macro("min")
|
||||
#pragma pop_macro("max")
|
||||
|
||||
#include "keys.hpp"
|
||||
#include <atomic>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
namespace Soundux
|
||||
@ -18,32 +10,33 @@ namespace Soundux
|
||||
{
|
||||
class Hotkeys
|
||||
{
|
||||
libremidi::midi_in midi;
|
||||
std::thread listener;
|
||||
std::atomic<bool> kill = false;
|
||||
std::atomic<bool> notify = false;
|
||||
|
||||
protected:
|
||||
Hotkeys() = default;
|
||||
virtual void setup();
|
||||
std::vector<int> pressedKeys;
|
||||
std::vector<int> keysToPress;
|
||||
#if defined(_WIN32)
|
||||
std::thread keyPressThread;
|
||||
std::atomic<bool> shouldPressKeys = false;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
std::vector<Key> pressedKeys;
|
||||
std::atomic<bool> shouldNotify = false;
|
||||
std::atomic<bool> shouldNotifyKnob = false;
|
||||
private:
|
||||
void listen();
|
||||
|
||||
public:
|
||||
static std::shared_ptr<Hotkeys> createInstance();
|
||||
void init();
|
||||
void stop();
|
||||
void shouldNotify(bool);
|
||||
|
||||
public:
|
||||
virtual void notify(bool);
|
||||
virtual void requestKnob(bool);
|
||||
void onKeyUp(int);
|
||||
void onKeyDown(int);
|
||||
|
||||
virtual void onKeyUp(const Key &);
|
||||
virtual void onKeyDown(const Key &);
|
||||
void pressKeys(const std::vector<int> &);
|
||||
void releaseKeys(const std::vector<int> &);
|
||||
|
||||
virtual void pressKeys(const std::vector<Key> &) = 0;
|
||||
virtual void releaseKeys(const std::vector<Key> &) = 0;
|
||||
|
||||
virtual std::string getKeyName(const Key &);
|
||||
virtual std::string getKeySequence(const std::vector<Key> &);
|
||||
std::string getKeyName(const int &);
|
||||
std::string getKeySequence(const std::vector<int> &);
|
||||
};
|
||||
} // namespace Objects
|
||||
} // namespace Soundux
|
@ -1,9 +0,0 @@
|
||||
#include "keys.hpp"
|
||||
|
||||
namespace Soundux::Objects
|
||||
{
|
||||
bool Key::operator==(const Key &other) const
|
||||
{
|
||||
return other.key == key && other.type == type;
|
||||
}
|
||||
} // namespace Soundux::Objects
|
@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
namespace Soundux
|
||||
{
|
||||
namespace Enums
|
||||
{
|
||||
enum class KeyType : std::uint8_t
|
||||
{
|
||||
Keyboard,
|
||||
Mouse,
|
||||
Midi
|
||||
};
|
||||
} // namespace Enums
|
||||
|
||||
namespace Objects
|
||||
{
|
||||
struct Key
|
||||
{
|
||||
int key;
|
||||
Enums::KeyType type;
|
||||
|
||||
virtual ~Key() = default;
|
||||
bool operator==(const Key &) const;
|
||||
};
|
||||
struct MidiKey : public Key
|
||||
{
|
||||
int byte0; // Action
|
||||
int byte2; // Knob value / Press strength
|
||||
~MidiKey() override = default;
|
||||
};
|
||||
} // namespace Objects
|
||||
} // namespace Soundux
|
@ -1,26 +1,25 @@
|
||||
#if defined(__linux__)
|
||||
#include "x11.hpp"
|
||||
#if defined(__linux__) && __has_include(<X11/Xlib.h>)
|
||||
#include "../hotkeys.hpp"
|
||||
#include <X11/X.h>
|
||||
#include <X11/XKBlib.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/XI2.h>
|
||||
#include <X11/extensions/XInput2.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
#include <chrono>
|
||||
#include <core/hotkeys/keys.hpp>
|
||||
#include <cstdlib>
|
||||
#include <fancy.hpp>
|
||||
#include <thread>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace Soundux::Objects
|
||||
{
|
||||
void X11::setup()
|
||||
Display *display;
|
||||
void Hotkeys::listen()
|
||||
{
|
||||
Hotkeys::setup();
|
||||
listener = std::thread([this] { listen(); });
|
||||
}
|
||||
|
||||
void X11::listen()
|
||||
{
|
||||
auto *displayEnv = std::getenv("DISPLAY"); // NOLINT
|
||||
auto *x11Display = XOpenDisplay(displayEnv);
|
||||
auto *displayenv = std::getenv("DISPLAY"); // NOLINT
|
||||
auto *x11Display = XOpenDisplay(displayenv);
|
||||
|
||||
if (!x11Display)
|
||||
{
|
||||
@ -28,18 +27,20 @@ namespace Soundux::Objects
|
||||
if (!(x11Display = XOpenDisplay(":0")))
|
||||
{
|
||||
Fancy::fancy.logTime().failure() << "Could not open X11 Display" << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Fancy::fancy.logTime().message() << "Using DISPLAY " << displayEnv << std::endl;
|
||||
Fancy::fancy.logTime().message() << "Using DISPLAY " << displayenv << std::endl;
|
||||
}
|
||||
|
||||
display = x11Display;
|
||||
int event_rtn = 0, ext_rtn = 0;
|
||||
|
||||
int major_op = 0, event_rtn = 0, ext_rtn = 0;
|
||||
if (!XQueryExtension(display, "XInputExtension", &major_op, &event_rtn, &ext_rtn))
|
||||
{
|
||||
Fancy::fancy.logTime().failure() << "Failed to find XInputExtension" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
Window root = DefaultRootWindow(display); // NOLINT
|
||||
@ -66,106 +67,78 @@ namespace Soundux::Objects
|
||||
XNextEvent(display, &event);
|
||||
auto *cookie = reinterpret_cast<XGenericEventCookie *>(&event.xcookie);
|
||||
|
||||
if (XGetEventData(display, cookie) && cookie->type == GenericEvent && cookie->extension == major_op)
|
||||
if (XGetEventData(display, cookie) && cookie->type == GenericEvent && cookie->extension == major_op &&
|
||||
(cookie->evtype == XI_RawKeyPress || cookie->evtype == XI_RawKeyRelease ||
|
||||
cookie->evtype == XI_RawButtonPress || cookie->evtype == XI_RawButtonRelease))
|
||||
{
|
||||
if (cookie->evtype == XI_RawKeyPress || cookie->evtype == XI_RawKeyRelease)
|
||||
auto *data = reinterpret_cast<XIRawEvent *>(cookie->data);
|
||||
auto key = data->detail;
|
||||
|
||||
if (key == 1)
|
||||
continue;
|
||||
|
||||
if (cookie->evtype == XI_RawKeyPress || cookie->evtype == XI_RawButtonPress)
|
||||
{
|
||||
auto *data = reinterpret_cast<XIRawEvent *>(cookie->data);
|
||||
auto key = data->detail;
|
||||
|
||||
Key pressedKey;
|
||||
pressedKey.key = key;
|
||||
pressedKey.type = Enums::KeyType::Keyboard;
|
||||
|
||||
if (cookie->evtype == XI_RawKeyPress)
|
||||
{
|
||||
onKeyDown(pressedKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
onKeyUp(pressedKey);
|
||||
}
|
||||
onKeyDown(key);
|
||||
}
|
||||
else if (cookie->evtype == XI_RawButtonPress || cookie->evtype == XI_RawButtonRelease)
|
||||
else if (cookie->evtype == XI_RawKeyRelease || cookie->evtype == XI_RawButtonRelease)
|
||||
{
|
||||
auto *data = reinterpret_cast<XIRawEvent *>(cookie->data);
|
||||
auto button = data->detail;
|
||||
|
||||
if (button != 1)
|
||||
{
|
||||
Key pressedButton;
|
||||
pressedButton.key = button;
|
||||
pressedButton.type = Enums::KeyType::Mouse;
|
||||
|
||||
if (cookie->evtype == XI_RawButtonPress)
|
||||
{
|
||||
onKeyDown(pressedButton);
|
||||
}
|
||||
else
|
||||
{
|
||||
onKeyUp(pressedButton);
|
||||
}
|
||||
}
|
||||
onKeyUp(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
std::this_thread::sleep_for(100ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
std::string X11::getKeyName(const Key &key)
|
||||
|
||||
std::string Hotkeys::getKeyName(const int &key)
|
||||
{
|
||||
if (!Hotkeys::getKeyName(key).empty())
|
||||
// TODO(curve): There is no Keysym for the mouse buttons and I couldn't find any way to get the name for the
|
||||
// mouse buttons so they'll just be named KEY_1 (1 is the Keycode). Maybe someone will be able to help me but I
|
||||
// just can't figure it out
|
||||
|
||||
KeySym s = XkbKeycodeToKeysym(display, key, 0, 0);
|
||||
|
||||
if (s == NoSymbol)
|
||||
{
|
||||
return Hotkeys::getKeyName(key);
|
||||
return "KEY_" + std::to_string(key);
|
||||
}
|
||||
|
||||
if (key.type == Enums::KeyType::Keyboard)
|
||||
auto *str = XKeysymToString(s);
|
||||
if (str == nullptr)
|
||||
{
|
||||
KeySym keySym = XkbKeycodeToKeysym(display, key.key, 0, 0);
|
||||
|
||||
if (keySym == NoSymbol)
|
||||
{
|
||||
return "KEY_" + std::to_string(key.key);
|
||||
}
|
||||
|
||||
auto *str = XKeysymToString(keySym);
|
||||
if (!str)
|
||||
{
|
||||
return "KEY_" + std::to_string(key.key);
|
||||
}
|
||||
|
||||
return str;
|
||||
return "KEY_" + std::to_string(key);
|
||||
}
|
||||
|
||||
if (key.type == Enums::KeyType::Mouse)
|
||||
{
|
||||
return "MOUSE_" + std::to_string(key.key);
|
||||
}
|
||||
|
||||
return "";
|
||||
return str;
|
||||
}
|
||||
|
||||
void X11::pressKeys(const std::vector<Key> &keys)
|
||||
{
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
XTestFakeKeyEvent(display, key.key, True, 0);
|
||||
}
|
||||
}
|
||||
void X11::releaseKeys(const std::vector<Key> &keys)
|
||||
{
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
XTestFakeKeyEvent(display, key.key, False, 0);
|
||||
}
|
||||
}
|
||||
X11::~X11()
|
||||
void Hotkeys::stop()
|
||||
{
|
||||
kill = true;
|
||||
listener.join();
|
||||
}
|
||||
|
||||
void Hotkeys::pressKeys(const std::vector<int> &keys)
|
||||
{
|
||||
keysToPress = keys;
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
XTestFakeKeyEvent(display, key, True, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Hotkeys::releaseKeys(const std::vector<int> &keys)
|
||||
{
|
||||
keysToPress.clear();
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
XTestFakeKeyEvent(display, key, False, 0);
|
||||
}
|
||||
}
|
||||
} // namespace Soundux::Objects
|
||||
|
||||
#endif
|
@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
#if defined(__linux__)
|
||||
#include <core/hotkeys/hotkeys.hpp>
|
||||
#include <thread>
|
||||
|
||||
struct _XDisplay; // NOLINT
|
||||
using Display = _XDisplay;
|
||||
|
||||
namespace Soundux
|
||||
{
|
||||
namespace Objects
|
||||
{
|
||||
class X11 : public Hotkeys
|
||||
{
|
||||
int major_op;
|
||||
Display *display;
|
||||
std::thread listener;
|
||||
std::atomic<bool> kill = false;
|
||||
|
||||
private:
|
||||
void listen();
|
||||
void setup() override;
|
||||
|
||||
public:
|
||||
~X11();
|
||||
std::string getKeyName(const Key &key) override;
|
||||
void pressKeys(const std::vector<Key> &keys) override;
|
||||
void releaseKeys(const std::vector<Key> &keys) override;
|
||||
};
|
||||
} // namespace Objects
|
||||
} // namespace Soundux
|
||||
|
||||
#endif
|
@ -1,90 +1,88 @@
|
||||
#if defined(_WIN32)
|
||||
#include "windows.hpp"
|
||||
#include "../hotkeys.hpp"
|
||||
#include <Windows.h>
|
||||
#include <chrono>
|
||||
#include <core/global/globals.hpp>
|
||||
#include <winuser.h>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace Soundux::Objects
|
||||
{
|
||||
HHOOK WindowsHotkeys::oMouseProc;
|
||||
HHOOK WindowsHotkeys::oKeyboardProc;
|
||||
HHOOK oKeyBoardProc;
|
||||
HHOOK oMouseProc;
|
||||
|
||||
void WindowsHotkeys::setup()
|
||||
{
|
||||
Hotkeys::setup();
|
||||
|
||||
oMouseProc = SetWindowsHookEx(WH_MOUSE_LL, mouseProc, nullptr, NULL);
|
||||
oKeyboardProc = SetWindowsHookEx(WH_KEYBOARD_LL, keyBoardProc, nullptr, NULL);
|
||||
|
||||
listener = std::thread([this] { listen(); });
|
||||
keyPresser = std::thread([this] { presser(); });
|
||||
}
|
||||
LRESULT CALLBACK WindowsHotkeys::keyBoardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK keyBoardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (nCode == HC_ACTION)
|
||||
{
|
||||
auto *info = reinterpret_cast<PKBDLLHOOKSTRUCT>(lParam); // NOLINT
|
||||
|
||||
if (wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN)
|
||||
{
|
||||
Key key;
|
||||
key.type = Enums::KeyType::Keyboard;
|
||||
key.key = static_cast<int>(info->vkCode);
|
||||
|
||||
Globals::gHotKeys->onKeyDown(key);
|
||||
auto *info = reinterpret_cast<PKBDLLHOOKSTRUCT>(lParam);
|
||||
Globals::gHotKeys.onKeyDown(info->vkCode);
|
||||
}
|
||||
else if (wParam == WM_KEYUP || wParam == WM_SYSKEYUP)
|
||||
{
|
||||
Key key;
|
||||
key.type = Enums::KeyType::Keyboard;
|
||||
key.key = static_cast<int>(info->vkCode);
|
||||
|
||||
Globals::gHotKeys->onKeyUp(key);
|
||||
auto *info = reinterpret_cast<PKBDLLHOOKSTRUCT>(lParam);
|
||||
Globals::gHotKeys.onKeyUp(info->vkCode);
|
||||
}
|
||||
}
|
||||
return CallNextHookEx(oKeyboardProc, nCode, wParam, lParam);
|
||||
return CallNextHookEx(oKeyBoardProc, nCode, wParam, lParam);
|
||||
}
|
||||
LRESULT CALLBACK WindowsHotkeys::mouseProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
LRESULT CALLBACK mouseProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (nCode == HC_ACTION)
|
||||
{
|
||||
// TODO(curve): How would I tell if XButton1 or XButton2 is pressed? Is there a nicer way to do this?
|
||||
|
||||
switch (wParam)
|
||||
{
|
||||
case WM_RBUTTONUP: {
|
||||
Key key;
|
||||
key.key = VK_RBUTTON;
|
||||
key.type = Enums::KeyType::Mouse;
|
||||
Soundux::Globals::gHotKeys->onKeyUp(key);
|
||||
}
|
||||
break;
|
||||
case WM_RBUTTONDOWN: {
|
||||
Key key;
|
||||
key.key = VK_RBUTTON;
|
||||
key.type = Enums::KeyType::Mouse;
|
||||
Soundux::Globals::gHotKeys->onKeyDown(key);
|
||||
}
|
||||
break;
|
||||
case WM_MBUTTONUP: {
|
||||
Key key;
|
||||
key.key = VK_MBUTTON;
|
||||
key.type = Enums::KeyType::Mouse;
|
||||
Soundux::Globals::gHotKeys->onKeyUp(key);
|
||||
}
|
||||
break;
|
||||
case WM_MBUTTONDOWN: {
|
||||
Key key;
|
||||
key.key = VK_RBUTTON;
|
||||
key.type = Enums::KeyType::Mouse;
|
||||
Soundux::Globals::gHotKeys->onKeyDown(key);
|
||||
}
|
||||
break;
|
||||
case WM_RBUTTONUP:
|
||||
Globals::gHotKeys.onKeyUp(VK_RBUTTON);
|
||||
break;
|
||||
|
||||
case WM_RBUTTONDOWN:
|
||||
Globals::gHotKeys.onKeyDown(VK_RBUTTON);
|
||||
break;
|
||||
|
||||
case WM_MBUTTONDOWN:
|
||||
Globals::gHotKeys.onKeyDown(VK_MBUTTON);
|
||||
break;
|
||||
|
||||
case WM_MBUTTONUP:
|
||||
Globals::gHotKeys.onKeyUp(VK_MBUTTON);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CallNextHookEx(oMouseProc, nCode, wParam, lParam);
|
||||
}
|
||||
void WindowsHotkeys::listen()
|
||||
|
||||
void Hotkeys::listen()
|
||||
{
|
||||
oKeyBoardProc = SetWindowsHookEx(WH_KEYBOARD_LL, keyBoardProc, GetModuleHandle(nullptr), NULL);
|
||||
oMouseProc = SetWindowsHookEx(WH_MOUSE_LL, mouseProc, GetModuleHandle(nullptr), NULL);
|
||||
keyPressThread = std::thread([this] {
|
||||
while (!kill)
|
||||
{
|
||||
//* Yes, this is absolutely cursed. I tried to implement this by just sending the keydown event once but
|
||||
//* it does not work like that on windows, so I have to do this, thank you Microsoft, I hate you.
|
||||
if (shouldPressKeys)
|
||||
{
|
||||
for (const auto &key : keysToPress)
|
||||
{
|
||||
keybd_event(key, 0, 1, 0);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
MSG message;
|
||||
while (!GetMessage(&message, nullptr, 0, 0))
|
||||
while (!GetMessage(&message, nullptr, NULL, NULL))
|
||||
{
|
||||
if (kill)
|
||||
{
|
||||
@ -94,82 +92,68 @@ namespace Soundux::Objects
|
||||
DispatchMessage(&message);
|
||||
}
|
||||
}
|
||||
void WindowsHotkeys::presser()
|
||||
{
|
||||
std::unique_lock lock(keysToPressMutex);
|
||||
while (!kill)
|
||||
{
|
||||
cv.wait(lock, [&]() { return !keysToPress.empty() || kill; });
|
||||
//* Yes, this is absolutely cursed. I tried to implement this by just sending the keydown event once but
|
||||
//* it does not work like that on windows, so I have to do this, thank you Microsoft, I hate you.
|
||||
for (const auto &key : keysToPress)
|
||||
{
|
||||
keybd_event(key.key, 0, 1, 0);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
}
|
||||
}
|
||||
std::string WindowsHotkeys::getKeyName(const Key &key)
|
||||
{
|
||||
if (!Hotkeys::getKeyName(key).empty())
|
||||
{
|
||||
return Hotkeys::getKeyName(key);
|
||||
}
|
||||
|
||||
if (key.type == Enums::KeyType::Keyboard)
|
||||
{
|
||||
char name[128];
|
||||
auto result = GetKeyNameTextA(MapVirtualKey(key.key, MAPVK_VK_TO_VSC) << 16, name, 128);
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
return "KEY_" + std::to_string(key.key);
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
if (key.type == Enums::KeyType::Mouse)
|
||||
{
|
||||
return "MOUSE_" + std::to_string(key.key);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
void WindowsHotkeys::pressKeys(const std::vector<Key> &keys)
|
||||
{
|
||||
std::unique_lock lock(keysToPressMutex);
|
||||
keysToPress = keys;
|
||||
}
|
||||
void WindowsHotkeys::releaseKeys(const std::vector<Key> &keys)
|
||||
{
|
||||
std::unique_lock lock(keysToPressMutex);
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
for (auto it = keysToPress.begin(); it != keysToPress.end();)
|
||||
{
|
||||
if (*it == key)
|
||||
{
|
||||
it = keysToPress.erase(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
WindowsHotkeys::~WindowsHotkeys()
|
||||
void Hotkeys::stop()
|
||||
{
|
||||
kill = true;
|
||||
PostThreadMessage(GetThreadId(listener.native_handle()), WM_QUIT, 0, 0);
|
||||
|
||||
listener.join();
|
||||
cv.notify_all();
|
||||
keyPresser.join();
|
||||
|
||||
UnhookWindowsHookEx(oMouseProc);
|
||||
UnhookWindowsHookEx(oKeyboardProc);
|
||||
UnhookWindowsHookEx(oKeyBoardProc);
|
||||
PostThreadMessage(GetThreadId(listener.native_handle()), WM_QUIT, 0, 0);
|
||||
listener.join();
|
||||
keyPressThread.join();
|
||||
}
|
||||
|
||||
std::string Hotkeys::getKeyName(const int &key)
|
||||
{
|
||||
auto scanCode = MapVirtualKey(key, MAPVK_VK_TO_VSC);
|
||||
|
||||
CHAR name[128];
|
||||
int result = 0;
|
||||
switch (key)
|
||||
{
|
||||
case VK_LEFT:
|
||||
case VK_UP:
|
||||
case VK_RIGHT:
|
||||
case VK_DOWN:
|
||||
case VK_RCONTROL:
|
||||
case VK_RMENU:
|
||||
case VK_LWIN:
|
||||
case VK_RWIN:
|
||||
case VK_APPS:
|
||||
case VK_PRIOR:
|
||||
case VK_NEXT:
|
||||
case VK_END:
|
||||
case VK_HOME:
|
||||
case VK_INSERT:
|
||||
case VK_DELETE:
|
||||
case VK_DIVIDE:
|
||||
case VK_NUMLOCK:
|
||||
scanCode |= KF_EXTENDED;
|
||||
default:
|
||||
result = GetKeyNameTextA(scanCode << 16, name, 128);
|
||||
}
|
||||
if (result == 0)
|
||||
{
|
||||
return "KEY_" + std::to_string(key);
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
void Hotkeys::pressKeys(const std::vector<int> &keys)
|
||||
{
|
||||
keysToPress = keys;
|
||||
shouldPressKeys = true;
|
||||
}
|
||||
|
||||
void Hotkeys::releaseKeys([[maybe_unused]] const std::vector<int> &keys)
|
||||
{
|
||||
shouldPressKeys = false;
|
||||
keysToPress.clear();
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
keybd_event(key, 0, 2, 0);
|
||||
}
|
||||
}
|
||||
} // namespace Soundux::Objects
|
||||
#endif
|
@ -1,43 +0,0 @@
|
||||
#pragma once
|
||||
#if defined(_WIN32)
|
||||
#include <core/hotkeys/hotkeys.hpp>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <windows.h>
|
||||
|
||||
namespace Soundux
|
||||
{
|
||||
namespace Objects
|
||||
{
|
||||
class WindowsHotkeys : public Hotkeys
|
||||
{
|
||||
std::thread listener;
|
||||
std::thread keyPresser;
|
||||
std::atomic<bool> kill = false;
|
||||
|
||||
std::condition_variable cv;
|
||||
std::mutex keysToPressMutex;
|
||||
std::vector<Key> keysToPress;
|
||||
|
||||
private:
|
||||
void listen();
|
||||
void presser();
|
||||
void setup() override;
|
||||
|
||||
private:
|
||||
static HHOOK oMouseProc;
|
||||
static HHOOK oKeyboardProc;
|
||||
|
||||
static LRESULT CALLBACK mouseProc(int, WPARAM, LPARAM);
|
||||
static LRESULT CALLBACK keyBoardProc(int, WPARAM, LPARAM);
|
||||
|
||||
public:
|
||||
~WindowsHotkeys();
|
||||
std::string getKeyName(const Key &key) override;
|
||||
void pressKeys(const std::vector<Key> &keys) override;
|
||||
void releaseKeys(const std::vector<Key> &keys) override;
|
||||
};
|
||||
} // namespace Objects
|
||||
} // namespace Soundux
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@ namespace Soundux
|
||||
{
|
||||
namespace Objects
|
||||
{
|
||||
struct Key;
|
||||
struct AudioDevice;
|
||||
|
||||
struct Sound
|
||||
{
|
||||
@ -17,7 +17,7 @@ namespace Soundux
|
||||
std::string path;
|
||||
bool isFavorite = false;
|
||||
|
||||
std::vector<Key> hotkeys;
|
||||
std::vector<int> hotkeys;
|
||||
std::uint64_t modifiedDate;
|
||||
|
||||
std::optional<int> localVolume;
|
||||
|
@ -1,8 +1,7 @@
|
||||
#pragma once
|
||||
#include <core/enums/enums.hpp>
|
||||
#include <core/hotkeys/keys.hpp>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
namespace Soundux
|
||||
@ -16,18 +15,15 @@ namespace Soundux
|
||||
Enums::Theme theme = Enums::Theme::System;
|
||||
std::optional<std::string> language;
|
||||
|
||||
std::vector<Key> pushToTalkKeys;
|
||||
std::vector<Key> stopHotkey;
|
||||
|
||||
std::optional<Key> remoteVolumeKnob;
|
||||
std::optional<Key> localVolumeKnob;
|
||||
std::vector<int> pushToTalkKeys;
|
||||
std::vector<int> stopHotkey;
|
||||
|
||||
std::vector<std::string> outputs;
|
||||
std::uint32_t selectedTab = 0;
|
||||
|
||||
bool syncVolumes = false;
|
||||
int remoteVolume = 100;
|
||||
int localVolume = 50;
|
||||
bool syncVolumes = false;
|
||||
|
||||
bool allowMultipleOutputs = false;
|
||||
bool useAsDefaultDevice = false;
|
||||
|
@ -60,9 +60,12 @@ namespace Soundux::Objects
|
||||
|
||||
auto *device = new ma_device;
|
||||
auto config = ma_device_config_init(ma_device_type_playback);
|
||||
auto length_in_pcm_frames = ma_decoder_get_length_in_pcm_frames(decoder);
|
||||
|
||||
ma_uint64 length_in_pcm_frames{};
|
||||
ma_decoder_get_length_in_pcm_frames(decoder, &length_in_pcm_frames);
|
||||
|
||||
config.dataCallback = data_callback;
|
||||
config.periodSizeInMilliseconds = 100;
|
||||
config.sampleRate = decoder->outputSampleRate;
|
||||
config.playback.format = decoder->outputFormat;
|
||||
config.playback.channels = decoder->outputChannels;
|
||||
@ -190,7 +193,7 @@ namespace Soundux::Objects
|
||||
|
||||
if (!sound->paused)
|
||||
{
|
||||
if (ma_device_get_state(sound->raw.device) == MA_STATE_STARTED)
|
||||
if (ma_device_get_state(sound->raw.device) == ma_device_state_started)
|
||||
{
|
||||
ma_device_stop(sound->raw.device);
|
||||
}
|
||||
@ -228,7 +231,7 @@ namespace Soundux::Objects
|
||||
|
||||
if (sound->paused)
|
||||
{
|
||||
if (ma_device_get_state(sound->raw.device) == MA_STATE_STOPPED)
|
||||
if (ma_device_get_state(sound->raw.device) == ma_device_state_stopped)
|
||||
{
|
||||
ma_device_start(sound->raw.device);
|
||||
}
|
||||
@ -322,7 +325,9 @@ namespace Soundux::Objects
|
||||
return;
|
||||
}
|
||||
|
||||
auto readFrames = ma_decoder_read_pcm_frames(sound->raw.decoder, output, frameCount);
|
||||
ma_uint64 readFrames{};
|
||||
ma_decoder_read_pcm_frames(sound->raw.decoder, output, frameCount, &readFrames);
|
||||
|
||||
if (sound->shouldSeek)
|
||||
{
|
||||
ma_decoder_seek_to_pcm_frame(sound->raw.decoder, sound->seekTo);
|
||||
|
@ -144,8 +144,7 @@ namespace Soundux::Objects
|
||||
|
||||
fetchLoopBackSinkId();
|
||||
|
||||
if (!nullSink || !loopBack || !loopBackSink || !passthrough || !passthroughSink || !passthroughLoopBack ||
|
||||
!defaultSourceId)
|
||||
if (!nullSink || !loopBack || !loopBackSink || !passthrough || !passthroughSink || !passthroughLoopBack)
|
||||
{
|
||||
unloadLeftOvers();
|
||||
return false;
|
||||
@ -196,17 +195,6 @@ namespace Soundux::Objects
|
||||
}
|
||||
},
|
||||
this));
|
||||
await(PulseApi::context_get_sink_input_info_list(
|
||||
context,
|
||||
[]([[maybe_unused]] pa_context *ctx, const pa_sink_input_info *info, [[maybe_unused]] int eol,
|
||||
void *userData) {
|
||||
auto *thiz = reinterpret_cast<PulseAudio *>(userData);
|
||||
if (info && info->name == thiz->defaultSource)
|
||||
{
|
||||
thiz->defaultSourceId = info->index;
|
||||
}
|
||||
},
|
||||
this));
|
||||
}
|
||||
void PulseAudio::fetchLoopBackSinkId()
|
||||
{
|
||||
@ -642,7 +630,7 @@ namespace Soundux::Objects
|
||||
bool success = false;
|
||||
|
||||
await(PulseApi::context_set_sink_input_mute(
|
||||
context, *defaultSourceId, state,
|
||||
context, *loopBackSink, state,
|
||||
+[]([[maybe_unused]] pa_context *ctx, int success, void *userData) {
|
||||
*reinterpret_cast<bool *>(userData) = success;
|
||||
},
|
||||
|
@ -47,9 +47,7 @@ namespace Soundux
|
||||
//* ~= ~~~~~~~~~~~~~~~~~~~~~ =~
|
||||
|
||||
std::string serverName;
|
||||
|
||||
std::string defaultSource;
|
||||
std::optional<std::uint32_t> defaultSourceId;
|
||||
|
||||
std::map<std::string, std::uint32_t> movedApplications;
|
||||
std::map<std::string, std::uint32_t> movedPassthroughApplications;
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include <core/global/globals.hpp>
|
||||
#include <core/hotkeys/keys.hpp>
|
||||
#include <helper/audio/windows/winsound.hpp>
|
||||
#include <helper/version/check.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
@ -44,26 +43,6 @@ namespace nlohmann
|
||||
}
|
||||
}
|
||||
}; // namespace nlohmann
|
||||
template <> struct adl_serializer<Soundux::Objects::Key>
|
||||
{
|
||||
static void to_json(json &j, const Soundux::Objects::Key &obj)
|
||||
{
|
||||
j = {{"key", obj.key}, {"type", obj.type}};
|
||||
}
|
||||
static void from_json(const json &j, Soundux::Objects::Key &obj)
|
||||
{
|
||||
if (j.find("type") != j.end())
|
||||
{
|
||||
j.at("key").get_to(obj.key);
|
||||
j.at("type").get_to(obj.type);
|
||||
}
|
||||
else
|
||||
{
|
||||
j.get_to(obj.key);
|
||||
obj.type = Soundux::Enums::KeyType::Keyboard;
|
||||
}
|
||||
}
|
||||
}; // namespace nlohmann
|
||||
template <> struct adl_serializer<Soundux::Objects::Sound>
|
||||
{
|
||||
static void to_json(json &j, const Soundux::Objects::Sound &obj)
|
||||
@ -72,7 +51,7 @@ namespace nlohmann
|
||||
{"name", obj.name},
|
||||
{"hotkeys", obj.hotkeys},
|
||||
{"hotkeySequence",
|
||||
Soundux::Globals::gHotKeys->getKeySequence(obj.hotkeys)}, //* For frontend and config readability
|
||||
Soundux::Globals::gHotKeys.getKeySequence(obj.hotkeys)}, //* For frontend and config readability
|
||||
{"id", obj.id},
|
||||
{"path", obj.path},
|
||||
{"isFavorite", obj.isFavorite},
|
||||
@ -163,8 +142,6 @@ namespace nlohmann
|
||||
{"pushToTalkKeys", obj.pushToTalkKeys},
|
||||
{"tabHotkeysOnly", obj.tabHotkeysOnly},
|
||||
{"minimizeToTray", obj.minimizeToTray},
|
||||
{"localVolumeKnob", obj.localVolumeKnob},
|
||||
{"remoteVolumeKnob", obj.remoteVolumeKnob},
|
||||
{"allowOverlapping", obj.allowOverlapping},
|
||||
{"muteDuringPlayback", obj.muteDuringPlayback},
|
||||
{"useAsDefaultDevice", obj.useAsDefaultDevice},
|
||||
@ -212,8 +189,6 @@ namespace nlohmann
|
||||
get_to_safe(j, "pushToTalkKeys", obj.pushToTalkKeys);
|
||||
get_to_safe(j, "minimizeToTray", obj.minimizeToTray);
|
||||
get_to_safe(j, "tabHotkeysOnly", obj.tabHotkeysOnly);
|
||||
get_to_safe(j, "localVolumeKnob", obj.localVolumeKnob);
|
||||
get_to_safe(j, "remoteVolumeKnob", obj.remoteVolumeKnob);
|
||||
get_to_safe(j, "allowOverlapping", obj.allowOverlapping);
|
||||
get_to_safe(j, "useAsDefaultDevice", obj.useAsDefaultDevice);
|
||||
get_to_safe(j, "muteDuringPlayback", obj.muteDuringPlayback);
|
||||
|
@ -10,33 +10,29 @@ namespace Soundux::Objects
|
||||
cv.wait(lock, [&]() { return !queue.empty() || stop; });
|
||||
while (!queue.empty())
|
||||
{
|
||||
auto front = queue.begin();
|
||||
front->function();
|
||||
queue.erase(front);
|
||||
auto front = std::move(*queue.begin());
|
||||
|
||||
lock.unlock();
|
||||
front.second();
|
||||
lock.lock();
|
||||
|
||||
queue.erase(front.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Queue::push_unique(std::uint64_t id, std::function<void()> function)
|
||||
{
|
||||
{
|
||||
std::lock_guard lock(queueMutex);
|
||||
if (std::find_if(queue.begin(), queue.end(),
|
||||
[&id](const auto &entry) { return entry.id && *entry.id == id; }) != queue.end())
|
||||
if (queue.find(id) != queue.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_lock lock(queueMutex);
|
||||
queue.emplace_back(Call{std::move(function), id});
|
||||
lock.unlock();
|
||||
|
||||
cv.notify_one();
|
||||
}
|
||||
void Queue::push(std::function<void()> function)
|
||||
{
|
||||
std::unique_lock lock(queueMutex);
|
||||
queue.emplace_back(Call{std::move(function), std::nullopt});
|
||||
queue.emplace(id, std::move(function));
|
||||
lock.unlock();
|
||||
|
||||
cv.notify_one();
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <condition_variable>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <queue>
|
||||
#include <thread>
|
||||
|
||||
@ -13,14 +12,8 @@ namespace Soundux
|
||||
{
|
||||
class Queue
|
||||
{
|
||||
struct Call
|
||||
{
|
||||
std::function<void()> function;
|
||||
std::optional<std::uint64_t> id;
|
||||
};
|
||||
|
||||
std::map<std::uint64_t, std::function<void()>> queue;
|
||||
std::mutex queueMutex;
|
||||
std::vector<Call> queue;
|
||||
|
||||
std::condition_variable cv;
|
||||
std::atomic<bool> stop;
|
||||
@ -33,7 +26,6 @@ namespace Soundux
|
||||
Queue();
|
||||
~Queue();
|
||||
|
||||
void push(std::function<void()>);
|
||||
void push_unique(std::uint64_t, std::function<void()>);
|
||||
};
|
||||
} // namespace Objects
|
||||
|
@ -1,12 +1,7 @@
|
||||
#pragma once
|
||||
#include <json.hpp>
|
||||
#include <optional>
|
||||
|
||||
#pragma push_macro("UNICOCDE")
|
||||
#undef UNICODE
|
||||
#include <process.hpp>
|
||||
#pragma pop_macro("UNICOCDE")
|
||||
|
||||
#include <regex>
|
||||
#include <string>
|
||||
|
||||
|
23
src/main.cpp
23
src/main.cpp
@ -56,20 +56,35 @@ int main(int argc, char **arguments)
|
||||
}
|
||||
|
||||
backward::SignalHandling crashHandler;
|
||||
gGuard = std::make_shared<Instance::Guard>("soundux-guard");
|
||||
gGuard = std::make_shared<guardpp::guard>("soundux-guard");
|
||||
|
||||
if (std::find(args.begin(), args.end(), "--help") != args.end() ||
|
||||
std::find(args.begin(), args.end(), "-h") != args.end())
|
||||
{
|
||||
Fancy::fancy.message() << "Soundux usage" << std::endl;
|
||||
Fancy::fancy.message() << " -h --help description of launch arguments" << std::endl;
|
||||
Fancy::fancy.message() << " --hidden start application hidden to taskbar" << std::endl;
|
||||
Fancy::fancy.message() << " --reset-mutex fix 'Another instance is already running! error'" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (std::find(args.begin(), args.end(), "--reset-mutex") != args.end())
|
||||
{
|
||||
gGuard->reset();
|
||||
gGuard.reset();
|
||||
gGuard = std::make_shared<Instance::Guard>("soundux-guard");
|
||||
gGuard = std::make_shared<guardpp::guard>("soundux-guard");
|
||||
}
|
||||
|
||||
if (gGuard->isAnotherRunning())
|
||||
if (auto other_instance = gGuard->other_instance(); other_instance.has_value() && other_instance.value())
|
||||
{
|
||||
Fancy::fancy.logTime().failure() << "Another Instance is already running!" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
else if (!other_instance.has_value()) // NOLINT
|
||||
{
|
||||
Fancy::fancy.logTime().warning() << "Failed to check for other instances: " << other_instance.error()
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
gConfig.load();
|
||||
gData.set(gConfig.data);
|
||||
@ -124,4 +139,4 @@ int main(int argc, char **arguments)
|
||||
gConfig.save();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 69f1c24f0ffcc19f3d9d365fb987298652665a90
|
||||
Subproject commit c2224d58e56ed73f18f92e88f0ad5a92ecd2cac6
|
@ -1 +1 @@
|
||||
Subproject commit d43538e165a8f7a927b94718276323fc7b71eab5
|
||||
Subproject commit 7843623ec88751812ed6dbdef75979397d023fac
|
@ -9,7 +9,6 @@
|
||||
#include <helper/systeminfo/systeminfo.hpp>
|
||||
#include <helper/version/check.hpp>
|
||||
#include <helper/ytdl/youtube-dl.hpp>
|
||||
#include <javascript/function.hpp>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "../../assets/icon.h"
|
||||
@ -123,14 +122,12 @@ namespace Soundux::Objects
|
||||
webview->expose(Webview::Function("stopSounds", [this]() { stopSounds(); }));
|
||||
webview->expose(Webview::Function("changeSettings",
|
||||
[this](const Settings &newSettings) { return changeSettings(newSettings); }));
|
||||
webview->expose(Webview::Function("requestHotkey", [](bool state) { Globals::gHotKeys->notify(state); }));
|
||||
webview->expose(Webview::Function("requestHotkey", [](bool state) { Globals::gHotKeys.shouldNotify(state); }));
|
||||
webview->expose(Webview::Function(
|
||||
"setHotkey", [this](std::uint32_t id, const std::vector<Key> &keys) { return setHotkey(id, keys); }));
|
||||
webview->expose(Webview::Function("getHotkeySequence", [this](const std::vector<Key> &keys) {
|
||||
return Globals::gHotKeys->getKeySequence(keys);
|
||||
"setHotkey", [this](std::uint32_t id, const std::vector<int> &keys) { return setHotkey(id, keys); }));
|
||||
webview->expose(Webview::Function("getHotkeySequence", [this](const std::vector<int> &keys) {
|
||||
return Globals::gHotKeys.getKeySequence(keys);
|
||||
}));
|
||||
webview->expose(
|
||||
Webview::Function("getKeyName", [this](const Key &key) { return Globals::gHotKeys->getKeyName(key); }));
|
||||
webview->expose(Webview::Function("removeTab", [this](std::uint32_t id) { return removeTab(id); }));
|
||||
webview->expose(Webview::Function("refreshTab", [this](std::uint32_t id) { return refreshTab(id); }));
|
||||
webview->expose(Webview::Function(
|
||||
@ -172,8 +169,6 @@ namespace Soundux::Objects
|
||||
return setCustomRemoteVolume(id, volume);
|
||||
}));
|
||||
webview->expose(Webview::Function("toggleSoundPlayback", [this]() { return toggleSoundPlayback(); }));
|
||||
webview->expose(
|
||||
Webview::Function("requestKnob", [this](bool state) { Globals::gHotKeys->requestKnob(state); }));
|
||||
|
||||
#if !defined(__linux__)
|
||||
webview->expose(Webview::Function("getOutputs", [this]() { return getOutputs(); }));
|
||||
@ -392,10 +387,15 @@ namespace Soundux::Objects
|
||||
}
|
||||
Fancy::fancy.logTime().message() << "UI exited" << std::endl;
|
||||
}
|
||||
void WebView::onHotKeyReceived(const std::vector<Key> &keys)
|
||||
void WebView::onHotKeyReceived(const std::vector<int> &keys)
|
||||
{
|
||||
webview->callFunction<void>(
|
||||
Webview::JavaScriptFunction("window.hotkeyReceived", Globals::gHotKeys->getKeySequence(keys), keys));
|
||||
std::string hotkeySequence;
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
hotkeySequence += Globals::gHotKeys.getKeyName(key) + " + ";
|
||||
}
|
||||
webview->callFunction<void>(Webview::JavaScriptFunction(
|
||||
"window.hotkeyReceived", hotkeySequence.substr(0, hotkeySequence.length() - 3), keys));
|
||||
}
|
||||
void WebView::onSoundFinished(const PlayingSound &sound)
|
||||
{
|
||||
@ -448,12 +448,4 @@ namespace Soundux::Objects
|
||||
webview->callFunction<void>(
|
||||
Webview::JavaScriptFunction("window.getStore().commit", "setAdministrativeModal", true));
|
||||
}
|
||||
void WebView::onLocalVolumeChanged(int volume)
|
||||
{
|
||||
webview->callFunction<void>(Webview::JavaScriptFunction("window.getStore().commit", "setLocalVolume", volume));
|
||||
}
|
||||
void WebView::onRemoteVolumeChanged(int volume)
|
||||
{
|
||||
webview->callFunction<void>(Webview::JavaScriptFunction("window.getStore().commit", "setRemoteVolume", volume));
|
||||
}
|
||||
} // namespace Soundux::Objects
|
@ -28,12 +28,10 @@ namespace Soundux
|
||||
void setup() override;
|
||||
void mainLoop() override;
|
||||
void onSoundFinished(const PlayingSound &sound) override;
|
||||
void onHotKeyReceived(const std::vector<Key> &keys) override;
|
||||
void onHotKeyReceived(const std::vector<int> &keys) override;
|
||||
|
||||
void onAdminRequired() override;
|
||||
void onSettingsChanged() override;
|
||||
void onLocalVolumeChanged(int volume) override;
|
||||
void onRemoteVolumeChanged(int volume) override;
|
||||
void onSwitchOnConnectDetected(bool state) override;
|
||||
void onError(const Enums::ErrorCode &error) override;
|
||||
void onSoundPlayed(const PlayingSound &sound) override;
|
||||
|
@ -15,8 +15,7 @@ namespace Soundux::Objects
|
||||
void Window::setup()
|
||||
{
|
||||
NFD::Init();
|
||||
Globals::gHotKeys = Hotkeys::createInstance();
|
||||
|
||||
Globals::gHotKeys.init();
|
||||
for (auto &tab : Globals::gData.getTabs())
|
||||
{
|
||||
tab.sounds = getTabContent(tab);
|
||||
@ -26,6 +25,7 @@ namespace Soundux::Objects
|
||||
Window::~Window()
|
||||
{
|
||||
NFD::Quit();
|
||||
Globals::gHotKeys.stop();
|
||||
}
|
||||
std::vector<Sound> Window::getTabContent(const Tab &tab) const
|
||||
{
|
||||
@ -225,7 +225,7 @@ namespace Soundux::Objects
|
||||
}
|
||||
if (!Globals::gSettings.pushToTalkKeys.empty())
|
||||
{
|
||||
Globals::gHotKeys->pressKeys(Globals::gSettings.pushToTalkKeys);
|
||||
Globals::gHotKeys.pressKeys(Globals::gSettings.pushToTalkKeys);
|
||||
}
|
||||
|
||||
auto playingSound = Globals::gAudio.play(*sound);
|
||||
@ -297,7 +297,7 @@ namespace Soundux::Objects
|
||||
}
|
||||
if (!Globals::gSettings.pushToTalkKeys.empty())
|
||||
{
|
||||
Globals::gHotKeys->pressKeys(Globals::gSettings.pushToTalkKeys);
|
||||
Globals::gHotKeys.pressKeys(Globals::gSettings.pushToTalkKeys);
|
||||
}
|
||||
|
||||
if (Globals::gSettings.outputs.empty() && !Globals::gSettings.useAsDefaultDevice)
|
||||
@ -579,33 +579,30 @@ namespace Soundux::Objects
|
||||
onError(Enums::ErrorCode::FailedToSetCustomVolume);
|
||||
return std::nullopt;
|
||||
}
|
||||
void Window::onVolumeChanged()
|
||||
{
|
||||
for (const auto &playingSound : Globals::gAudio.getPlayingSounds())
|
||||
{
|
||||
int newVolume = 0;
|
||||
const auto &sound = playingSound.sound;
|
||||
|
||||
if (playingSound.playbackDevice.isDefault)
|
||||
{
|
||||
newVolume = sound.localVolume ? *sound.localVolume : Globals::gSettings.localVolume;
|
||||
}
|
||||
else
|
||||
{
|
||||
newVolume = sound.remoteVolume ? *sound.remoteVolume : Globals::gSettings.remoteVolume;
|
||||
}
|
||||
|
||||
playingSound.raw.device.load()->masterVolumeFactor = static_cast<float>(newVolume) / 100.f;
|
||||
}
|
||||
}
|
||||
Settings Window::changeSettings(Settings settings)
|
||||
{
|
||||
auto oldSettings = Globals::gSettings;
|
||||
Globals::gSettings = settings;
|
||||
|
||||
if ((settings.localVolume != oldSettings.localVolume || settings.remoteVolume != oldSettings.remoteVolume))
|
||||
if ((settings.localVolume != oldSettings.localVolume || settings.remoteVolume != oldSettings.remoteVolume) &&
|
||||
!Globals::gAudio.getPlayingSounds().empty())
|
||||
{
|
||||
onVolumeChanged();
|
||||
for (const auto &playingSound : Globals::gAudio.getPlayingSounds())
|
||||
{
|
||||
int newVolume = 0;
|
||||
const auto &sound = playingSound.sound;
|
||||
|
||||
if (playingSound.playbackDevice.isDefault)
|
||||
{
|
||||
newVolume = sound.localVolume ? *sound.localVolume : Globals::gSettings.localVolume;
|
||||
}
|
||||
else
|
||||
{
|
||||
newVolume = sound.remoteVolume ? *sound.remoteVolume : Globals::gSettings.remoteVolume;
|
||||
}
|
||||
|
||||
playingSound.raw.device.load()->masterVolumeFactor = static_cast<float>(newVolume) / 100.f;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__linux__)
|
||||
@ -717,9 +714,9 @@ namespace Soundux::Objects
|
||||
#endif
|
||||
return Globals::gSettings;
|
||||
}
|
||||
void Window::onHotKeyReceived([[maybe_unused]] const std::vector<Key> &keys)
|
||||
void Window::onHotKeyReceived([[maybe_unused]] const std::vector<int> &keys)
|
||||
{
|
||||
Globals::gHotKeys->notify(false);
|
||||
Globals::gHotKeys.shouldNotify(false);
|
||||
}
|
||||
std::optional<Tab> Window::refreshTab(const std::uint32_t &id)
|
||||
{
|
||||
@ -756,7 +753,7 @@ namespace Soundux::Objects
|
||||
onError(Enums::ErrorCode::TabDoesNotExist);
|
||||
return std::nullopt;
|
||||
}
|
||||
std::optional<Sound> Window::setHotkey(const std::uint32_t &id, const std::vector<Key> &hotkeys)
|
||||
std::optional<Sound> Window::setHotkey(const std::uint32_t &id, const std::vector<int> &hotkeys)
|
||||
{
|
||||
auto sound = Globals::gData.getSound(id);
|
||||
if (sound)
|
||||
@ -954,7 +951,7 @@ namespace Soundux::Objects
|
||||
{
|
||||
if (!Globals::gSettings.pushToTalkKeys.empty())
|
||||
{
|
||||
Globals::gHotKeys->releaseKeys(Globals::gSettings.pushToTalkKeys);
|
||||
Globals::gHotKeys.releaseKeys(Globals::gSettings.pushToTalkKeys);
|
||||
}
|
||||
|
||||
#if defined(__linux__)
|
||||
@ -992,7 +989,7 @@ namespace Soundux::Objects
|
||||
{
|
||||
if (!Globals::gSettings.pushToTalkKeys.empty())
|
||||
{
|
||||
Globals::gHotKeys->pressKeys(Globals::gSettings.pushToTalkKeys);
|
||||
Globals::gHotKeys.pressKeys(Globals::gSettings.pushToTalkKeys);
|
||||
}
|
||||
}
|
||||
void Window::setIsOnFavorites(bool state)
|
||||
|
@ -77,7 +77,6 @@ namespace Soundux
|
||||
virtual std::optional<Tab> setSortMode(const std::uint32_t &, Enums::SortMode);
|
||||
|
||||
protected:
|
||||
virtual void onVolumeChanged();
|
||||
virtual bool toggleSoundPlayback();
|
||||
virtual void stopSounds(bool = false);
|
||||
virtual bool stopSound(const std::uint32_t &);
|
||||
@ -89,7 +88,7 @@ namespace Soundux
|
||||
virtual std::optional<PlayingSound> repeatSound(const std::uint32_t &, bool);
|
||||
virtual std::optional<PlayingSound> seekSound(const std::uint32_t &, std::uint64_t);
|
||||
|
||||
virtual std::optional<Sound> setHotkey(const std::uint32_t &, const std::vector<Key> &);
|
||||
virtual std::optional<Sound> setHotkey(const std::uint32_t &, const std::vector<int> &);
|
||||
virtual std::optional<Sound> setCustomLocalVolume(const std::uint32_t &, const std::optional<int> &);
|
||||
virtual std::optional<Sound> setCustomRemoteVolume(const std::uint32_t &, const std::optional<int> &);
|
||||
|
||||
@ -101,13 +100,11 @@ namespace Soundux
|
||||
|
||||
virtual void onAdminRequired() = 0;
|
||||
virtual void onSettingsChanged() = 0;
|
||||
virtual void onLocalVolumeChanged(int) = 0;
|
||||
virtual void onRemoteVolumeChanged(int) = 0;
|
||||
virtual void onSwitchOnConnectDetected(bool) = 0;
|
||||
virtual void onSoundPlayed(const PlayingSound &);
|
||||
virtual void onError(const Enums::ErrorCode &) = 0;
|
||||
virtual void onSoundFinished(const PlayingSound &);
|
||||
virtual void onHotKeyReceived(const std::vector<Key> &);
|
||||
virtual void onHotKeyReceived(const std::vector<int> &);
|
||||
virtual void onSoundProgressed(const PlayingSound &) = 0;
|
||||
virtual void onDownloadProgressed(float, const std::string &) = 0;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user