Skip to content

Commit b6ac1cf

Browse files
committed
Use Rust convention for capitalizing MIDI
1 parent f6e82d9 commit b6ac1cf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lighthouse-client/examples/midi_events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async fn run(lh: Lighthouse<TokioWebSocket>) -> Result<()> {
1212
let mut stream = lh.stream_input().await?;
1313
while let Some(msg) = stream.next().await {
1414
let event = msg?.payload;
15-
if let InputEvent::MIDI(midi) = event {
15+
if let InputEvent::Midi(midi) = event {
1616
match MidiMsg::from_midi(&midi.data) {
1717
Ok((msg, _)) => info!("Got MIDI message: {:?}", msg),
1818
Err(e) => warn!("Could not parse MIDI message: {:?}", e),

lighthouse-protocol/src/input/input_event.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
22

33
use crate::Direction;
44

5-
use super::{EventSource, GamepadEvent, KeyEvent, MIDIEvent, MouseEvent, UnknownEvent};
5+
use super::{EventSource, GamepadEvent, KeyEvent, MidiEvent, MouseEvent, UnknownEvent};
66

77
/// A user input event, as generated by the new frontend (LUNA).
88
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
@@ -11,7 +11,7 @@ pub enum InputEvent {
1111
Key(KeyEvent),
1212
Mouse(MouseEvent),
1313
Gamepad(GamepadEvent),
14-
MIDI(MIDIEvent),
14+
Midi(MidiEvent),
1515
#[serde(untagged)]
1616
Unknown(UnknownEvent),
1717
}
@@ -23,7 +23,7 @@ impl InputEvent {
2323
InputEvent::Key(KeyEvent { source, .. }) => source,
2424
InputEvent::Mouse(MouseEvent { source, .. }) => source,
2525
InputEvent::Gamepad(GamepadEvent { source, .. }) => source,
26-
InputEvent::MIDI(MIDIEvent { source, .. }) => source,
26+
InputEvent::Midi(MidiEvent { source, .. }) => source,
2727
InputEvent::Unknown(UnknownEvent { source, .. }) => source,
2828
}
2929
}

lighthouse-protocol/src/input/midi_event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::EventSource;
44

55
/// A MIDI message event.
66
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
7-
pub struct MIDIEvent {
7+
pub struct MidiEvent {
88
/// The client identifier. Also unique per MIDI input device.
99
pub source: EventSource,
1010
/// The binary MIDI message.

0 commit comments

Comments
 (0)