Skip to content

Commit 9d3d7a3

Browse files
committed
fix name…
1 parent b9d9e65 commit 9d3d7a3

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ jobs:
3434
context: .
3535
platforms: linux/amd64,linux/arm64,linux/arm
3636
push: true
37-
tags: texthtml/midi-synthetizer-autoconnect:latest
37+
tags: texthtml/midi-synthesizer-autoconnect:latest
3838
cache-from: type=gha
3939
cache-to: type=gha,mode=max

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "midi-synthetizer-autoconnect"
2+
name = "midi-synthesizer-autoconnect"
33
version = "0.1.0"
44
authors = ["Mathieu Rochette <[email protected]>"]
55
edition = "2018"
6-
description = "Autoconnect MIDI inputs to a MIDI synthetizer"
7-
keywords = ["ALSA", "MIDI", "synthetizer"]
6+
description = "Autoconnect MIDI inputs to a MIDI synthesizer"
7+
keywords = ["ALSA", "MIDI", "synthesizer"]
88
categories = ["command-line-utilities"]
9-
repository = "https://github.com/texthtml/midi-synthetizer-autoconnect"
9+
repository = "https://github.com/texthtml/midi-synthesizer-autoconnect"
1010
license = "AGPL-3.0"
1111

1212
[dependencies]

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ RUN apt-get update && \
2222
apt-get install -y libasound2 && \
2323
rm -rf /var/lib/apt/lists/*
2424

25-
COPY --from=builder /app/target/release/midi-synthetizer-autoconnect /usr/bin/
25+
COPY --from=builder /app/target/release/midi-synthesizer-autoconnect /usr/bin/
2626

27-
CMD ["/usr/bin/midi-synthetizer-autoconnect"]
27+
CMD ["/usr/bin/midi-synthesizer-autoconnect"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# MIDI Synthetizer autoconnect
1+
# MIDI Synthesizer autoconnect
22

3-
Autoconnect MIDI inputs to a MIDI synthetizer
3+
Autoconnect MIDI inputs to a MIDI synthesizer
44

5-
On start, midi-synthetizer-autoconnect connects MIDI sources to a synthentizer if one is found and then wait for new MIDI sources to appear and/or for a synthetizer.
5+
On start, midi-synthesizer-autoconnect connects MIDI sources to a synthentizer if one is found and then wait for new MIDI sources to appear and/or for a synthesizer.

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn start() -> res::Res<()> {
99

1010
fn main() -> res::Res<()> {
1111
if std::env::var(tracing_subscriber::EnvFilter::DEFAULT_ENV).is_err() {
12-
std::env::set_var(tracing_subscriber::EnvFilter::DEFAULT_ENV, "midi_synthetizer_autoconnect=info");
12+
std::env::set_var(tracing_subscriber::EnvFilter::DEFAULT_ENV, "midi_synthesizer_autoconnect=info");
1313
}
1414

1515
tracing_subscriber::fmt::init();

src/synchronizer.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ impl listener::ListenerHandler for &Synchronizer {
1313
tracing::info!("{}", match self.connect_all()? {
1414
(true, true) => "Waiting for more MIDI sources",
1515
(true, false) => "Waiting for MIDI sources",
16-
(false, true) => "Waiting for a synthetizer",
17-
(false, false) => "Waiting for a synthetizer and MIDI sources",
16+
(false, true) => "Waiting for a synthesizer",
17+
(false, false) => "Waiting for a synthesizer and MIDI sources",
1818
});
1919

2020
Ok(())
@@ -45,8 +45,8 @@ impl Synchronizer {
4545
fn auto_connect(&self, addr: alsa::seq::Addr) -> Res<()> {
4646
let port_info = self.seq.port_info(addr)?;
4747

48-
if Synchronizer::is_synthetizer(&port_info) {
49-
self.detected("Synthetizer", &port_info)?;
48+
if Synchronizer::is_synthesizer(&port_info) {
49+
self.detected("Synthesizer", &port_info)?;
5050

5151
let mut no_midi_sources = true;
5252

@@ -61,10 +61,10 @@ impl Synchronizer {
6161
} else if Synchronizer::is_midi_source(&port_info) {
6262
self.detected("Midi source", &port_info)?;
6363

64-
if let Some(synthetizer) = self.synthetizer() {
65-
self.connect(port_info.addr(), synthetizer.addr()).expect("connection failed");
64+
if let Some(synthesizer) = self.synthesizer() {
65+
self.connect(port_info.addr(), synthesizer.addr()).expect("connection failed");
6666
} else {
67-
tracing::warn!("Cannot connect: no synthetizer available");
67+
tracing::warn!("Cannot connect: no synthesizer available");
6868
}
6969
} else {
7070
self.detected("Unknown seq port", &port_info)?;
@@ -77,12 +77,12 @@ impl Synchronizer {
7777
let midi_sources : Vec<_> = self.midi_sources().collect();
7878
let no_midi_sources = midi_sources.is_empty();
7979

80-
if let Some(synthetizer) = self.synthetizer() {
81-
self.detected("Synthetizer", &synthetizer)?;
80+
if let Some(synthesizer) = self.synthesizer() {
81+
self.detected("Synthesizer", &synthesizer)?;
8282

8383
for midi_source in midi_sources {
8484
self.detected("Midi source", &midi_source)?;
85-
self.connect(midi_source.addr(), synthetizer.addr()).expect("connection failed");
85+
self.connect(midi_source.addr(), synthesizer.addr()).expect("connection failed");
8686
}
8787

8888
if no_midi_sources {
@@ -91,7 +91,7 @@ impl Synchronizer {
9191

9292
Ok((true, !no_midi_sources))
9393
} else {
94-
tracing::warn!("Cannot connect: no synthetizer available");
94+
tracing::warn!("Cannot connect: no synthesizer available");
9595

9696
for midi_source in midi_sources {
9797
self.detected("Midi source", &midi_source)?;
@@ -105,8 +105,8 @@ impl Synchronizer {
105105
}
106106
}
107107

108-
fn connect(&self, sender: alsa::seq::Addr, synthetizer: alsa::seq::Addr) -> Res<(bool, alsa::seq::PortSubscribe)> {
109-
self.seq.connect(sender, synthetizer).and_then(|(new, port_subscribe)| {
108+
fn connect(&self, sender: alsa::seq::Addr, synthesizer: alsa::seq::Addr) -> Res<(bool, alsa::seq::PortSubscribe)> {
109+
self.seq.connect(sender, synthesizer).and_then(|(new, port_subscribe)| {
110110
if new {
111111
tracing::info!(
112112
"{} has been connected to {}",
@@ -123,15 +123,15 @@ impl Synchronizer {
123123
})
124124
}
125125

126-
fn synthetizer(&self) -> Option<alsa::seq::PortInfo> {
127-
self.seq.ports().find(Synchronizer::is_synthetizer)
126+
fn synthesizer(&self) -> Option<alsa::seq::PortInfo> {
127+
self.seq.ports().find(Synchronizer::is_synthesizer)
128128
}
129129

130130
fn midi_sources(&self) -> impl Iterator<Item=alsa::seq::PortInfo> + '_ {
131131
self.seq.ports().filter(Synchronizer::is_midi_source)
132132
}
133133

134-
fn is_synthetizer(port_info: &alsa::seq::PortInfo) -> bool {
134+
fn is_synthesizer(port_info: &alsa::seq::PortInfo) -> bool {
135135
port_info.get_type().contains(alsa::seq::PortType::SYNTHESIZER)
136136
}
137137

0 commit comments

Comments
 (0)