Skip to content

Commit c2c876d

Browse files
Merge pull request #62 from GoXLR-on-Linux/dev-0.11.0
Dev 0.11.0
2 parents 08fab25 + e7c9585 commit c2c876d

37 files changed

+150
-62
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
sudo apt-get install libdbus-1-dev pkg-config libspeechd-dev
1414
- uses: actions/checkout@v3
1515
- uses: dtolnay/rust-toolchain@stable
16-
- run: cargo check
16+
- run: cargo check --all-features
1717

1818
test_linux:
1919
name: Test Linux Suite
@@ -25,23 +25,23 @@ jobs:
2525
sudo apt-get install libpulse0 libdbus-1-dev pkg-config libspeechd-dev
2626
- uses: actions/checkout@v3
2727
- uses: dtolnay/rust-toolchain@stable
28-
- run: cargo test
28+
- run: cargo test --all-features
2929

3030
test_windows:
3131
name: Test Windows Suite
3232
runs-on: windows-latest
3333
steps:
3434
- uses: actions/checkout@v3
3535
- uses: dtolnay/rust-toolchain@stable
36-
- run: cargo test
36+
- run: cargo test --all-features
3737

3838
test_macos:
3939
name: Test MacOS Suite
4040
runs-on: macos-latest
4141
steps:
4242
- uses: actions/checkout@v3
4343
- uses: dtolnay/rust-toolchain@stable
44-
- run: cargo test
44+
- run: cargo test --all-features
4545

4646
fmt:
4747
name: Rustfmt
@@ -65,7 +65,7 @@ jobs:
6565
- uses: dtolnay/rust-toolchain@stable
6666
with:
6767
components: clippy
68-
- run: cargo clippy --all-targets -- -D warnings
68+
- run: cargo clippy --all-targets --all-features -- -D warnings
6969

7070
clippy_macos:
7171
name: Clippy MacOS
@@ -75,7 +75,7 @@ jobs:
7575
- uses: dtolnay/rust-toolchain@stable
7676
with:
7777
components: clippy
78-
- run: cargo clippy --all-targets -- -D warnings
78+
- run: cargo clippy --all-targets --all-features -- -D warnings
7979

8080
clippy_windows:
8181
name: Clippy Windows
@@ -85,4 +85,4 @@ jobs:
8585
- uses: dtolnay/rust-toolchain@stable
8686
with:
8787
components: clippy
88-
- run: cargo clippy --all-targets -- -D warnings
88+
- run: cargo clippy --all-targets --all-features -- -D warnings

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions-rs/cargo@v1
3737
with:
3838
command: build
39-
args: --release
39+
args: --release --all-features
4040

4141
- name: Build Packages
4242
run: iscc.exe goxlr-utility.iss
@@ -59,7 +59,7 @@ jobs:
5959
toolchain: stable
6060
override: true
6161

62-
- name: Install Pulse Client Libraries
62+
- name: Install Required Libraries
6363
run: |
6464
sudo apt-get update
6565
sudo apt-get install libpulse0 libdbus-1-dev pkg-config libspeechd-dev

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ We currently provide the following via the [releases page](https://github.com/Go
1616
* `.deb` files, usable on Debian based systems (Ubuntu, Mint, Pop!_OS, etc)
1717
* `.rpm` files, usable on Redhat based systems (CentOS, Fedora, etc)
1818

19+
1920
We also provide the utility through the [Arch User Repository](https://aur.archlinux.org/packages/goxlr-utility) via the
2021
`goxlr-utility` package.
2122

@@ -92,16 +93,29 @@ which will contain details.
9293
Copy `50-goxlr.rules` to `/etc/udev/rules.d/` and then reload with `sudo udevadm control --reload-rules && sudo udevadm trigger`.
9394

9495
## Building from source
96+
9597
### Prerequisites
9698
* Have a GoXLR :)
9799
* Install [Rust](https://rustup.rs/)
98100
* For Linux:
99101
* Debian: `sudo apt-get install pkg-config libdbus-1-dev libpulse0`
100102
* Fedora: `sudo dnf install pkgconf-pkg-config dbus-devel pulseaudio-libs`
101103

104+
### Features
105+
The GoXLR Utility contains compile-time features, which can be used to enable functionality during the build process by
106+
adding `--features "a b c"` to the `cargo` command (with `a`, `b` and `c` being separate feature names, for example
107+
`cargo build --features "tts"`). These features often require separate dependencies to be installed, and are documented
108+
as such below.
109+
110+
#### Text to Speech on Button Press
111+
* Feature Name: `tts`
112+
* Dependencies:
113+
* Debian: `sudo apt-get install clang libspeechd-dev`
114+
* Fedora: `sudo dnf install clang speech-dispatcher-devel`
102115

103116
### Building
104-
The easiest way to build is by using the following commands to compile and install the executables:
117+
The easiest way to build is by using the following commands to compile and install the executables (remembering to add
118+
features you may want!):
105119
- `cargo install --path daemon` for the daemon
106120
- `cargo install --path client` for the client to interact with the daemon
107121
- `cargo install --path defaults` for the Default Profile Handlers

audio/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "goxlr-audio"
3-
version = "0.10.2"
3+
version = "0.11.0"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

ci/build-and-install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ sudo cp target/release/goxlr-daemon /usr/bin/
2525
sudo cp target/release/goxlr-client /usr/bin/
2626
sudo cp target/release/goxlr-defaults /usr/bin/
2727
sudo cp target/release/goxlr-launcher /usr/bin/
28+
sudo cp target/release/goxlr-firmware /usr/bin/
2829

2930
sudo chmod 755 /usr/bin/goxlr-client /usr/bin/goxlr-daemon /usr/bin/goxlr-defaults /usr/bin/goxlr-launcher
3031

ci/build-packages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fi
2424
# Neither 'cargo deb' or 'cargo generate-rpm' seem to provide a way to specify an asset that is created at build time.
2525
# To work around this, we force a release build, copy out the shell completions produced from that build, put it into
2626
# a predictable location and then build the packages, which knows where to look.
27-
cargo build --release
27+
cargo build --release --all-features
2828

2929
strip target/release/goxlr-client
3030
strip target/release/goxlr-daemon

client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "goxlr-client"
3-
version = "0.10.2"
3+
version = "0.11.0"
44
edition = "2021"
55
build = "build.rs"
66
authors = ["Nathan Adams <[email protected]>", "Craig McLure <[email protected]>", "Lars Mühlbauer <[email protected]>"]

daemon/Cargo.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[package]
22
name = "goxlr-daemon"
3-
version = "0.10.2"
3+
version = "0.11.0"
44
edition = "2021"
55
authors = ["Nathan Adams <[email protected]>", "Craig McLure <[email protected]>", "Lars Mühlbauer <[email protected]>"]
66
description = "Allows control of a TC-Helicon GoXLR or GoXLR Mini, by maintaining an interaction with it over USB in the background."
77
repository = "https://github.com/GoXLR-on-Linux/GoXLR-Utility"
88
license = "MIT"
99
categories = ["hardware-support", "command-line-utilities"]
1010

11-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
11+
[features]
12+
tts = ["dep:tts"]
1213

1314
[dependencies]
1415
goxlr-usb = { path = "../usb" }
@@ -39,7 +40,7 @@ glob = "0.3.0"
3940
cfg-if = "1.0.0"
4041
lazy_static = "1.4.0"
4142

42-
tts = { version = "0.25.1", features=["tolk"] }
43+
tts = { version = "0.25.1", features = ["tolk"], optional = true }
4344
interprocess = { version = "1.2.1", features = ["tokio_support"] }
4445

4546
notify = "5.0.0"
@@ -50,7 +51,7 @@ actix = "0.13.0"
5051
actix-web-actors = "4.1.0"
5152

5253
# All we really need from actix-web are macros and compression, TLS and cookies aren't required
53-
actix-web = { version = "4.2.1", default-features = false, features = ["macros", "compress-brotli", "compress-gzip" ] }
54+
actix-web = { version = "4.2.1", default-features = false, features = ["macros", "compress-brotli", "compress-gzip"] }
5455
actix-cors = "0.6.4"
5556
mime_guess = "2.0.4"
5657
include_dir = "0.7.3"
@@ -95,6 +96,7 @@ assets = [
9596
["../target/release/goxlr-client", "usr/bin/", "755"],
9697
["../target/release/goxlr-defaults", "usr/bin/", "755"],
9798
["../target/release/goxlr-launcher", "usr/bin/", "755"],
99+
["../target/release/goxlr-firmware", "usr/bin/", "755"],
98100
["../50-goxlr.rules", "etc/udev/rules.d/", "644"],
99101
["../daemon/resources/goxlr-utility.png", "usr/share/icons/hicolor/48x48/apps/", "644"],
100102
["../daemon/resources/goxlr-utility-large.png", "usr/share/pixmaps/goxlr-utility.png", "644"],
@@ -123,6 +125,7 @@ assets = [
123125
{ source = "../target/release/goxlr-client", dest = "/usr/bin/goxlr-client", mode = "0755" },
124126
{ source = "../target/release/goxlr-defaults", dest = "/usr/bin/goxlr-defaults", mode = "0755" },
125127
{ source = "../target/release/goxlr-launcher", dest = "/usr/bin/goxlr-launcher", mode = "0755" },
128+
{ source = "../target/release/goxlr-firmware", dest = "/usr/bin/goxlr-firmware", mode = "0755" },
126129
{ source = "../50-goxlr.rules", dest = "/etc/udev/rules.d/50-goxlr.rules", mode = "0644" },
127130
{ source = "../daemon/resources/goxlr-utility.png", dest = "/usr/share/icons/hicolor/48x48/apps/goxlr-utility.png", mode = "0644" },
128131
{ source = "../daemon/resources/goxlr-utility-large.png", dest = "/usr/share/pixmaps/goxlr-utility.png", mode = "0644" },
@@ -151,5 +154,6 @@ auto-req = "no"
151154
[package.metadata.generate-rpm.requires]
152155
# It should be noted, that bzip2 and libusb get statically linked against the binary, so they're not actually
153156
# required, this leaves us with dbus and pulseaudio libs :)
154-
dbus-libs = "*"
155-
pulseaudio-libs = "*"
157+
dbus-libs = ">= 1.9.14"
158+
pulseaudio-libs = ">= 10.0"
159+
speech-dispatcher = ">= 0.7"

daemon/src/device.rs

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,12 +1250,15 @@ impl<'a> Device<'a> {
12501250
self.profile.get_pitch_knob_position(),
12511251
encoders[0]
12521252
);
1253-
let message = format!("Pitch {}", encoders[0]);
1254-
let _ = self.global_events.send(TTSMessage(message)).await;
1255-
12561253
value_changed = true;
12571254
self.profile.set_pitch_knob_position(encoders[0])?;
12581255
self.apply_effects(LinkedHashSet::from_iter([EffectKey::PitchAmount]))?;
1256+
1257+
let user_value = self
1258+
.mic_profile
1259+
.get_effect_value(EffectKey::PitchAmount, self.profile());
1260+
let message = format!("Pitch {}", user_value);
1261+
let _ = self.global_events.send(TTSMessage(message)).await;
12591262
}
12601263

12611264
if encoders[1] != self.profile.get_gender_value() {
@@ -1264,12 +1267,23 @@ impl<'a> Device<'a> {
12641267
self.profile.get_gender_value(),
12651268
encoders[1]
12661269
);
1267-
let message = format!("Gender {}", encoders[1]);
1268-
let _ = self.global_events.send(TTSMessage(message)).await;
12691270

1270-
value_changed = true;
1271+
let current_value = self
1272+
.mic_profile
1273+
.get_effect_value(EffectKey::GenderAmount, self.profile());
1274+
12711275
self.profile.set_gender_value(encoders[1])?;
1272-
self.apply_effects(LinkedHashSet::from_iter([EffectKey::GenderAmount]))?;
1276+
value_changed = true;
1277+
1278+
let new_value = self
1279+
.mic_profile
1280+
.get_effect_value(EffectKey::GenderAmount, self.profile());
1281+
1282+
if new_value != current_value {
1283+
self.apply_effects(LinkedHashSet::from_iter([EffectKey::GenderAmount]))?;
1284+
let message = format!("Gender {}", new_value);
1285+
let _ = self.global_events.send(TTSMessage(message)).await;
1286+
}
12731287
}
12741288

12751289
if encoders[2] != self.profile.get_reverb_value() {
@@ -1278,12 +1292,19 @@ impl<'a> Device<'a> {
12781292
self.profile.get_reverb_value(),
12791293
encoders[2]
12801294
);
1281-
let message = format!("Reverb {}", encoders[2]);
1282-
let _ = self.global_events.send(TTSMessage(message)).await;
12831295

12841296
value_changed = true;
12851297
self.profile.set_reverb_value(encoders[2])?;
1298+
1299+
let new_value = self
1300+
.mic_profile
1301+
.get_effect_value(EffectKey::ReverbAmount, self.profile());
1302+
12861303
self.apply_effects(LinkedHashSet::from_iter([EffectKey::ReverbAmount]))?;
1304+
1305+
let percent = 100 - ((new_value as f32 / -36.) * 100.) as i32;
1306+
let message = format!("Reverb {} percent", percent);
1307+
let _ = self.global_events.send(TTSMessage(message)).await;
12871308
}
12881309

12891310
if encoders[3] != self.profile.get_echo_value() {
@@ -1292,12 +1313,16 @@ impl<'a> Device<'a> {
12921313
self.profile.get_echo_value(),
12931314
encoders[3]
12941315
);
1295-
let message = format!("Echo {}", encoders[3]);
1296-
let _ = self.global_events.send(TTSMessage(message)).await;
1297-
12981316
value_changed = true;
12991317
self.profile.set_echo_value(encoders[3])?;
13001318
self.apply_effects(LinkedHashSet::from_iter([EffectKey::EchoAmount]))?;
1319+
1320+
let mut user_value = self
1321+
.mic_profile
1322+
.get_effect_value(EffectKey::EchoAmount, self.profile());
1323+
user_value = 100 - ((user_value as f32 / -36.) * 100.) as i32;
1324+
let message = format!("Echo {} percent", user_value);
1325+
let _ = self.global_events.send(TTSMessage(message)).await;
13011326
}
13021327

13031328
Ok(value_changed)

daemon/src/platform/windows.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use winreg::RegKey;
1717
use winrt_notification::{Sound, Toast};
1818

1919
const GOXLR_APP_NAME: &str = "GoXLR App.exe";
20+
const GOXLR_BETA_APP_NAME: &str = "GoXLR Beta App.exe";
2021
const AUTOSTART_FILENAME: &str = "GoXLR Utility.lnk";
2122

2223
lazy_static! {
@@ -25,8 +26,10 @@ lazy_static! {
2526

2627
pub fn perform_platform_preflight() -> Result<()> {
2728
let system = System::new_all();
28-
let processes = system.processes_by_exact_name(GOXLR_APP_NAME);
29-
if processes.count() > 0 {
29+
let mut count = system.processes_by_exact_name(GOXLR_APP_NAME).count();
30+
count += system.processes_by_exact_name(GOXLR_BETA_APP_NAME).count();
31+
32+
if count > 0 {
3033
throw_notification();
3134
error!("Detected Official GoXLR Application Running, Failing Preflight.");
3235
bail!("Official GoXLR App Running, Please terminate it before running the Daemon");
@@ -55,8 +58,9 @@ pub async fn spawn_platform_runtime(
5558
select! {
5659
_ = duration.tick() => {
5760
system.refresh_processes();
58-
let processes = system.processes_by_exact_name(GOXLR_APP_NAME);
59-
if processes.count() > 0 {
61+
let mut count = system.processes_by_exact_name(GOXLR_APP_NAME).count();
62+
count += system.processes_by_exact_name(GOXLR_BETA_APP_NAME).count();
63+
if count > 0 {
6064
throw_notification();
6165

6266
// The processes list isn't Sendable, so this can't be triggered asynchronously.

0 commit comments

Comments
 (0)