Skip to content

Commit

Permalink
chore: merge branch 'hotfix/0.6.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Leadbetter committed Jan 13, 2025
2 parents 756ec54 + 8bb1e1e commit c378c60
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.6.4
* fix: realtime bytes messages should have no data bytes

# 0.6.3
* fix: correct delta clock stamp status code

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "midi2"
version = "0.6.3"
version = "0.6.4"
description = "Ergonomic, versatile, strong types wrapping MIDI 2.0 message data."
edition = "2021"
readme = "README.md"
Expand Down Expand Up @@ -37,7 +37,7 @@ utility = []
[dependencies]
derive_more = { version = "0.99.17", features = ["from"], default-features = false }
fixed = "1.27.0"
midi2_proc = { version = "0.6.3", path = "midi2_proc" }
midi2_proc = { version = "0.6.4", path = "midi2_proc" }
ux = "0.1.6"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ You'll want to setup midi2 without default features to compile
without the `std` feature.

```toml
midi2 = { version = "0.6.3", default-features = false, features = ["channel-voice2", "sysex7"], }
midi2 = { version = "0.6.4", default-features = false, features = ["channel-voice2", "sysex7"], }
```

### Generic Representation
Expand Down
2 changes: 1 addition & 1 deletion midi2_proc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "midi2_proc"
description = "Internal procedural macro crate. Only intended for use with midi2"
version = "0.6.3"
version = "0.6.4"
edition = "2021"
readme = "README.md"
license = "MIT OR Apache-2.0"
Expand Down
80 changes: 67 additions & 13 deletions src/system_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod tune_request {
system_common::{self, UMP_MESSAGE_TYPE},
};
pub(crate) const STATUS: u8 = 0xF6;
/// MIDI 2.0 Channel Voice Tune Request Message
/// Tune Request Message
///
/// See the [module docs](crate::system_common) for more info.
#[midi2_proc::generate_message(
Expand All @@ -36,14 +36,14 @@ mod timing_clock {
system_common::{self, UMP_MESSAGE_TYPE},
};
pub(crate) const STATUS: u8 = 0xF8;
/// MIDI 2.0 Channel Voice Timing Clock Message
/// Timing Clock Message
///
/// See the [module docs](crate::system_common) for more info.
#[midi2_proc::generate_message(
Via(system_common::SystemCommon),
FixedSize,
MinSizeUmp(1),
MinSizeBytes(2)
MinSizeBytes(1)
)]
struct TimingClock {
#[property(common_properties::UmpMessageTypeProperty<UMP_MESSAGE_TYPE>)]
Expand All @@ -60,14 +60,14 @@ mod start {
system_common::{self, UMP_MESSAGE_TYPE},
};
pub(crate) const STATUS: u8 = 0xFA;
/// MIDI 2.0 Channel Voice Start Message
/// Start Message
///
/// See the [module docs](crate::system_common) for more info.
#[midi2_proc::generate_message(
Via(system_common::SystemCommon),
FixedSize,
MinSizeUmp(1),
MinSizeBytes(2)
MinSizeBytes(1)
)]
struct Start {
#[property(common_properties::UmpMessageTypeProperty<UMP_MESSAGE_TYPE>)]
Expand All @@ -84,14 +84,14 @@ mod cont {
system_common::{self, UMP_MESSAGE_TYPE},
};
pub(crate) const STATUS: u8 = 0xFB;
/// MIDI 2.0 Channel Voice Continue Message
/// Continue Message
///
/// See the [module docs](crate::system_common) for more info.
#[midi2_proc::generate_message(
Via(system_common::SystemCommon),
FixedSize,
MinSizeUmp(1),
MinSizeBytes(2)
MinSizeBytes(1)
)]
struct Continue {
#[property(common_properties::UmpMessageTypeProperty<UMP_MESSAGE_TYPE>)]
Expand All @@ -108,14 +108,14 @@ mod stop {
system_common::{self, UMP_MESSAGE_TYPE},
};
pub(crate) const STATUS: u8 = 0xFC;
/// MIDI 2.0 Channel Voice Stop Message
/// Stop Message
///
/// See the [module docs](crate::system_common) for more info.
#[midi2_proc::generate_message(
Via(system_common::SystemCommon),
FixedSize,
MinSizeUmp(1),
MinSizeBytes(2)
MinSizeBytes(1)
)]
struct Stop {
#[property(common_properties::UmpMessageTypeProperty<UMP_MESSAGE_TYPE>)]
Expand All @@ -132,14 +132,14 @@ mod active_sensing {
system_common::{self, UMP_MESSAGE_TYPE},
};
pub(crate) const STATUS: u8 = 0xFE;
/// MIDI 2.0 Channel Voice Active Sensing Message
/// Active Sensing Message
///
/// See the [module docs](crate::system_common) for more info.
#[midi2_proc::generate_message(
Via(system_common::SystemCommon),
FixedSize,
MinSizeUmp(1),
MinSizeBytes(2)
MinSizeBytes(1)
)]
struct ActiveSensing {
#[property(common_properties::UmpMessageTypeProperty<UMP_MESSAGE_TYPE>)]
Expand All @@ -156,14 +156,14 @@ mod reset {
system_common::{self, UMP_MESSAGE_TYPE},
};
pub(crate) const STATUS: u8 = 0xFF;
/// MIDI 2.0 Channel Voice Reset Message
/// Reset Message
///
/// See the [module docs](crate::system_common) for more info.
#[midi2_proc::generate_message(
Via(system_common::SystemCommon),
FixedSize,
MinSizeUmp(1),
MinSizeBytes(2)
MinSizeBytes(1)
)]
struct Reset {
#[property(common_properties::UmpMessageTypeProperty<UMP_MESSAGE_TYPE>)]
Expand Down Expand Up @@ -308,6 +308,60 @@ mod tests {
use super::*;
use pretty_assertions::assert_eq;

#[test]
fn timing_clock_bytes_data() {
use crate::Data;
assert_eq!(
TimingClock::try_from(&[0xF8_u8][..]).unwrap().data(),
&[0xF8_u8][..]
);
}

#[test]
fn start_bytes_data() {
use crate::Data;
assert_eq!(
Start::try_from(&[0xFA_u8][..]).unwrap().data(),
&[0xFA_u8][..]
);
}

#[test]
fn continue_bytes_data() {
use crate::Data;
assert_eq!(
Continue::try_from(&[0xFB_u8][..]).unwrap().data(),
&[0xFB_u8][..]
);
}

#[test]
fn stop_bytes_data() {
use crate::Data;
assert_eq!(
Stop::try_from(&[0xFC_u8][..]).unwrap().data(),
&[0xFC_u8][..]
);
}

#[test]
fn active_sensing_bytes_data() {
use crate::Data;
assert_eq!(
ActiveSensing::try_from(&[0xFE_u8][..]).unwrap().data(),
&[0xFE_u8][..]
);
}

#[test]
fn reset_bytes_data() {
use crate::Data;
assert_eq!(
Reset::try_from(&[0xFF_u8][..]).unwrap().data(),
&[0xFF_u8][..]
);
}

#[test]
fn from_byte_data() {
assert_eq!(
Expand Down

0 comments on commit c378c60

Please sign in to comment.