diff --git a/midi2/src/channel_voice2/per_note_management.rs b/midi2/src/channel_voice2/per_note_management.rs index fc415d1..5e98455 100644 --- a/midi2/src/channel_voice2/per_note_management.rs +++ b/midi2/src/channel_voice2/per_note_management.rs @@ -9,7 +9,7 @@ pub(crate) const STATUS: u8 = 0b1111; /// MIDI 2.0 Channel Voice Per Note Management Message /// /// See the [module docs](crate::channel_voice2) for more info. -#[midi2_proc::generate_message(Via(crate::channel_voice2::ChannelVoice2), FixedSize, MinSizeUmp(1))] +#[midi2_proc::generate_message(Via(crate::channel_voice2::ChannelVoice2), FixedSize, MinSizeUmp(2))] struct PerNoteManagement { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -49,7 +49,7 @@ mod tests { #[test] fn note_number() { assert_eq!( - PerNoteManagement::try_from(&[0x4BF9_1C03][..]) + PerNoteManagement::try_from(&[0x4BF9_1C03, 0x0][..]) .unwrap() .note_number(), u7::new(0x1C), @@ -58,14 +58,14 @@ mod tests { #[test] fn detach() { - assert!(PerNoteManagement::try_from(&[0x4BF9_1C03][..]) + assert!(PerNoteManagement::try_from(&[0x4BF9_1C03, 0x0][..]) .unwrap() .detach(),); } #[test] fn reset() { - assert!(PerNoteManagement::try_from(&[0x4BF9_1C03][..]) + assert!(PerNoteManagement::try_from(&[0x4BF9_1C03, 0x0][..]) .unwrap() .reset(),); } diff --git a/midi2/src/flex_data.rs b/midi2/src/flex_data.rs old mode 100644 new mode 100755 index 66b6d24..13ad909 --- a/midi2/src/flex_data.rs +++ b/midi2/src/flex_data.rs @@ -1224,7 +1224,7 @@ mod tests { #[test] fn try_from_set_tempo() { - let buffer = [0xD710_0000_u32, 0xF751_FE05]; + let buffer = [0xD710_0000_u32, 0xF751_FE05, 0x0, 0x0]; assert_eq!( FlexData::try_from(&buffer[..]), Ok(FlexData::SetTempo( @@ -1235,8 +1235,9 @@ mod tests { #[test] fn read_bank() { + // Set Tempo assert_eq!( - FlexData::try_from(&[0xD710_0000_u32, 0xF751_FE05][..]) + FlexData::try_from(&[0xD710_0000_u32, 0xF751_FE05, 0x0, 0x0][..]) .unwrap() .bank(), Bank::SetupAndPerformance, diff --git a/midi2/src/flex_data/set_key_signature.rs b/midi2/src/flex_data/set_key_signature.rs index 6f55e58..e45f479 100644 --- a/midi2/src/flex_data/set_key_signature.rs +++ b/midi2/src/flex_data/set_key_signature.rs @@ -9,7 +9,7 @@ const STATUS: u8 = 0x5; /// MIDI 2.0 Flex Data Set Key Signature Message /// /// See the [module docs](crate::flex_data) for more info. -#[midi2_proc::generate_message(Via(crate::flex_data::FlexData), FixedSize, MinSizeUmp(2))] +#[midi2_proc::generate_message(Via(crate::flex_data::FlexData), FixedSize, MinSizeUmp(4))] struct SetKeySignature { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -147,7 +147,7 @@ mod tests { #[test] fn tonic() { assert_eq!( - SetKeySignature::try_from(&[0xD410_0005, 0x5400_0000][..]) + SetKeySignature::try_from(&[0xD410_0005, 0x5400_0000, 0x0, 0x0][..]) .unwrap() .tonic(), flex_data::tonic::Tonic::D, @@ -157,7 +157,7 @@ mod tests { #[test] fn sharps_flats() { assert_eq!( - SetKeySignature::try_from(&[0xD410_0005, 0x5400_0000][..]) + SetKeySignature::try_from(&[0xD410_0005, 0x5400_0000, 0x0, 0x0][..]) .unwrap() .sharps_flats(), SharpsFlats::Sharps(u3::new(5)), @@ -167,7 +167,7 @@ mod tests { #[test] fn sharps_flats_with_flats() { assert_eq!( - SetKeySignature::try_from(&[0xD410_0005, 0xB400_0000][..]) + SetKeySignature::try_from(&[0xD410_0005, 0xB400_0000, 0x0, 0x0][..]) .unwrap() .sharps_flats(), SharpsFlats::Flats(u3::new(5)), @@ -177,7 +177,7 @@ mod tests { #[test] fn sharps_flats_non_standard() { assert_eq!( - SetKeySignature::try_from(&[0xD410_0005, 0x8000_0000][..]) + SetKeySignature::try_from(&[0xD410_0005, 0x8000_0000, 0x0, 0x0][..]) .unwrap() .sharps_flats(), SharpsFlats::NonStandard, @@ -187,7 +187,7 @@ mod tests { #[test] fn channel() { assert_eq!( - SetKeySignature::try_from(&[0xD40D_0005, 0x8000_0000][..]) + SetKeySignature::try_from(&[0xD40D_0005, 0x8000_0000, 0x0, 0x0][..]) .unwrap() .optional_channel(), Some(u4::new(0xD)), @@ -197,7 +197,7 @@ mod tests { #[test] fn no_channel() { assert_eq!( - SetKeySignature::try_from(&[0xD410_0005, 0x8000_0000][..]) + SetKeySignature::try_from(&[0xD410_0005, 0x8000_0000, 0x0, 0x0][..]) .unwrap() .optional_channel(), None, diff --git a/midi2/src/flex_data/set_metronome.rs b/midi2/src/flex_data/set_metronome.rs index f1e0716..9f59999 100644 --- a/midi2/src/flex_data/set_metronome.rs +++ b/midi2/src/flex_data/set_metronome.rs @@ -8,7 +8,7 @@ const STATUS: u8 = 0x2; /// MIDI 2.0 Flex Data Set Metronome Message /// /// See the [module docs](crate::flex_data) for more info. -#[midi2_proc::generate_message(Via(crate::flex_data::FlexData), FixedSize, MinSizeUmp(3))] +#[midi2_proc::generate_message(Via(crate::flex_data::FlexData), FixedSize, MinSizeUmp(4))] struct SetMetronome { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -81,7 +81,7 @@ mod tests { #[test] fn number_of_clocks_per_primary_click() { assert_eq!( - SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000][..]) + SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000, 0x0][..]) .unwrap() .number_of_clocks_per_primary_click(), 0x9B, @@ -91,7 +91,7 @@ mod tests { #[test] fn bar_accent1() { assert_eq!( - SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000][..]) + SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000, 0x0][..]) .unwrap() .bar_accent1(), 0x4A, @@ -101,7 +101,7 @@ mod tests { #[test] fn bar_accent2() { assert_eq!( - SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000][..]) + SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000, 0x0][..]) .unwrap() .bar_accent2(), 0xFE, @@ -111,7 +111,7 @@ mod tests { #[test] fn bar_accent3() { assert_eq!( - SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000][..]) + SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000, 0x0][..]) .unwrap() .bar_accent3(), 0x56, @@ -121,7 +121,7 @@ mod tests { #[test] fn number_of_subdivision_clicks1() { assert_eq!( - SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000][..]) + SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000, 0x0][..]) .unwrap() .number_of_subdivision_clicks1(), 0xB8, @@ -131,7 +131,7 @@ mod tests { #[test] fn number_of_subdivision_clicks2() { assert_eq!( - SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000][..]) + SetMetronome::try_from(&[0xD110_0002, 0x9B4A_FE56, 0xB81B_0000, 0x0][..]) .unwrap() .number_of_subdivision_clicks2(), 0x1B, diff --git a/midi2/src/flex_data/set_tempo.rs b/midi2/src/flex_data/set_tempo.rs index 486f397..7ae41a5 100644 --- a/midi2/src/flex_data/set_tempo.rs +++ b/midi2/src/flex_data/set_tempo.rs @@ -8,7 +8,7 @@ const STATUS: u8 = 0x0; /// MIDI 2.0 Flex Data Set Tempo Message /// /// See the [module docs](crate::flex_data) for more info. -#[midi2_proc::generate_message(Via(crate::flex_data::FlexData), FixedSize, MinSizeUmp(2))] +#[midi2_proc::generate_message(Via(crate::flex_data::FlexData), FixedSize, MinSizeUmp(4))] struct SetTempo { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -48,7 +48,7 @@ mod tests { #[test] fn number_of_10_nanosecond_units_per_quarter_note() { assert_eq!( - SetTempo::try_from(&[0xD710_0000, 0xF751_FE05,][..]) + SetTempo::try_from(&[0xD710_0000, 0xF751_FE05, 0x0, 0x0][..]) .unwrap() .number_of_10_nanosecond_units_per_quarter_note(), 0xF751FE05, diff --git a/midi2/src/flex_data/set_time_signature.rs b/midi2/src/flex_data/set_time_signature.rs index 0bb4f41..47815b6 100644 --- a/midi2/src/flex_data/set_time_signature.rs +++ b/midi2/src/flex_data/set_time_signature.rs @@ -8,7 +8,7 @@ const STATUS: u8 = 0x1; /// MIDI 2.0 Flex Data Set Time Signature Message /// /// See the [module docs](crate::flex_data) for more info. -#[midi2_proc::generate_message(Via(crate::flex_data::FlexData), FixedSize, MinSizeUmp(2))] +#[midi2_proc::generate_message(Via(crate::flex_data::FlexData), FixedSize, MinSizeUmp(4))] struct SetTimeSignature { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -63,7 +63,7 @@ mod tests { #[test] fn numerator() { assert_eq!( - SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00,][..]) + SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00, 0x0, 0x0][..]) .unwrap() .numerator(), 0xCD, @@ -73,7 +73,7 @@ mod tests { #[test] fn denominator() { assert_eq!( - SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00,][..]) + SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00, 0x0, 0x0][..]) .unwrap() .denominator(), 0x90, @@ -83,7 +83,7 @@ mod tests { #[test] fn number_of_32nd_notes() { assert_eq!( - SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00,][..]) + SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00, 0x0, 0x0][..]) .unwrap() .number_of_32nd_notes(), 0x7E, @@ -93,7 +93,7 @@ mod tests { #[test] fn bank() { assert_eq!( - SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00,][..]) + SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00, 0x0, 0x0][..]) .unwrap() .bank(), flex_data::Bank::SetupAndPerformance, @@ -103,7 +103,7 @@ mod tests { #[test] fn status() { assert_eq!( - SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00,][..]) + SetTimeSignature::try_from(&[0xDA10_0001, 0xCD90_7E00, 0x0, 0x0][..]) .unwrap() .status(), STATUS, diff --git a/midi2/src/ump_stream/end_of_clip.rs b/midi2/src/ump_stream/end_of_clip.rs index 8f1df90..91e151d 100644 --- a/midi2/src/ump_stream/end_of_clip.rs +++ b/midi2/src/ump_stream/end_of_clip.rs @@ -2,7 +2,7 @@ use crate::{detail::common_properties, ump_stream, ump_stream::UMP_MESSAGE_TYPE} pub(crate) const STATUS: u16 = 0x21; -#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(1))] +#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(4))] struct EndOfClip { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -28,8 +28,8 @@ mod tests { #[test] fn from_data() { assert_eq!( - EndOfClip::try_from(&[0xF021_0000][..]), - Ok(EndOfClip(&[0xF021_0000][..])) + EndOfClip::try_from(&[0xF021_0000, 0x0, 0x0, 0x0][..]), + Ok(EndOfClip(&[0xF021_0000, 0x0, 0x0, 0x0][..])) ); } } diff --git a/midi2/src/ump_stream/endpoint_discovery.rs b/midi2/src/ump_stream/endpoint_discovery.rs index 66472fa..2a2e782 100644 --- a/midi2/src/ump_stream/endpoint_discovery.rs +++ b/midi2/src/ump_stream/endpoint_discovery.rs @@ -6,7 +6,7 @@ use crate::{ pub(crate) const STATUS: u16 = 0x0; -#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(2))] +#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(4))] struct EndpointDiscovery { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -54,7 +54,7 @@ mod tests { #[test] fn ump_version_major() { assert_eq!( - EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F][..]) + EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F, 0x0, 0x0][..]) .unwrap() .ump_version_major(), 0x1, @@ -64,7 +64,7 @@ mod tests { #[test] fn ump_version_minor() { assert_eq!( - EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F][..]) + EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F, 0x0, 0x0][..]) .unwrap() .ump_version_minor(), 0x1, @@ -74,7 +74,7 @@ mod tests { #[test] fn request_endpoint_info() { assert_eq!( - EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F][..]) + EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F, 0x0, 0x0][..]) .unwrap() .request_endpoint_info(), true, @@ -84,7 +84,7 @@ mod tests { #[test] fn request_device_identity() { assert_eq!( - EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F][..]) + EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F, 0x0, 0x0][..]) .unwrap() .request_device_identity(), true, @@ -94,7 +94,7 @@ mod tests { #[test] fn request_endpoint_name() { assert_eq!( - EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F][..]) + EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F, 0x0, 0x0][..]) .unwrap() .request_endpoint_name(), true, @@ -104,7 +104,7 @@ mod tests { #[test] fn request_product_instance_id() { assert_eq!( - EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F][..]) + EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F, 0x0, 0x0][..]) .unwrap() .request_product_instance_id(), true, @@ -114,7 +114,7 @@ mod tests { #[test] fn request_stream_configuration() { assert_eq!( - EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F][..]) + EndpointDiscovery::try_from(&[0xF000_0101, 0x0000_001F, 0x0, 0x0][..]) .unwrap() .request_stream_configuration(), true, diff --git a/midi2/src/ump_stream/endpoint_info.rs b/midi2/src/ump_stream/endpoint_info.rs index e92752c..0d1dc37 100644 --- a/midi2/src/ump_stream/endpoint_info.rs +++ b/midi2/src/ump_stream/endpoint_info.rs @@ -7,7 +7,7 @@ use crate::{ pub(crate) const STATUS: u16 = 0x01; -#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(2))] +#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(4))] struct EndpointInfo { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -64,9 +64,16 @@ mod tests { #[test] fn ump_version_major() { assert_eq!( - EndpointInfo::try_from(&[0xF001_0101, 0b1010_0000_0000_0000_0000_0011_0000_0011,][..]) - .unwrap() - .ump_version_major(), + EndpointInfo::try_from( + &[ + 0xF001_0101, + 0b1010_0000_0000_0000_0000_0011_0000_0011, + 0x0, + 0x0 + ][..] + ) + .unwrap() + .ump_version_major(), 0x1, ); } @@ -74,9 +81,16 @@ mod tests { #[test] fn ump_version_minor() { assert_eq!( - EndpointInfo::try_from(&[0xF001_0101, 0b1010_0000_0000_0000_0000_0011_0000_0011,][..]) - .unwrap() - .ump_version_minor(), + EndpointInfo::try_from( + &[ + 0xF001_0101, + 0b1010_0000_0000_0000_0000_0011_0000_0011, + 0x0, + 0x0 + ][..] + ) + .unwrap() + .ump_version_minor(), 0x1, ); } @@ -84,9 +98,16 @@ mod tests { #[test] fn static_function_blocks() { assert_eq!( - EndpointInfo::try_from(&[0xF001_0101, 0b1010_0000_0000_0000_0000_0011_0000_0011,][..]) - .unwrap() - .static_function_blocks(), + EndpointInfo::try_from( + &[ + 0xF001_0101, + 0b1010_0000_0000_0000_0000_0011_0000_0011, + 0x0, + 0x0 + ][..] + ) + .unwrap() + .static_function_blocks(), true, ); } @@ -94,9 +115,16 @@ mod tests { #[test] fn number_of_function_blocks() { assert_eq!( - EndpointInfo::try_from(&[0xF001_0101, 0b1010_0000_0000_0000_0000_0011_0000_0011,][..]) - .unwrap() - .number_of_function_blocks(), + EndpointInfo::try_from( + &[ + 0xF001_0101, + 0b1010_0000_0000_0000_0000_0011_0000_0011, + 0x0, + 0x0 + ][..] + ) + .unwrap() + .number_of_function_blocks(), u7::new(0x20), ); } @@ -104,9 +132,16 @@ mod tests { #[test] fn supports_midi2_protocol() { assert_eq!( - EndpointInfo::try_from(&[0xF001_0101, 0b1010_0000_0000_0000_0000_0011_0000_0011,][..]) - .unwrap() - .supports_midi2_protocol(), + EndpointInfo::try_from( + &[ + 0xF001_0101, + 0b1010_0000_0000_0000_0000_0011_0000_0011, + 0x0, + 0x0 + ][..] + ) + .unwrap() + .supports_midi2_protocol(), true, ); } @@ -114,9 +149,16 @@ mod tests { #[test] fn supports_midi1_protocol() { assert_eq!( - EndpointInfo::try_from(&[0xF001_0101, 0b1010_0000_0000_0000_0000_0011_0000_0011,][..]) - .unwrap() - .supports_midi1_protocol(), + EndpointInfo::try_from( + &[ + 0xF001_0101, + 0b1010_0000_0000_0000_0000_0011_0000_0011, + 0x0, + 0x0 + ][..] + ) + .unwrap() + .supports_midi1_protocol(), true, ); } @@ -124,9 +166,16 @@ mod tests { #[test] fn supports_sending_jr_timestamps() { assert_eq!( - EndpointInfo::try_from(&[0xF001_0101, 0b1010_0000_0000_0000_0000_0011_0000_0011,][..]) - .unwrap() - .supports_sending_jr_timestamps(), + EndpointInfo::try_from( + &[ + 0xF001_0101, + 0b1010_0000_0000_0000_0000_0011_0000_0011, + 0x0, + 0x0 + ][..] + ) + .unwrap() + .supports_sending_jr_timestamps(), true, ); } @@ -134,9 +183,16 @@ mod tests { #[test] fn supports_receiving_jr_timestamps() { assert_eq!( - EndpointInfo::try_from(&[0xF001_0101, 0b1010_0000_0000_0000_0000_0011_0000_0011,][..]) - .unwrap() - .supports_receiving_jr_timestamps(), + EndpointInfo::try_from( + &[ + 0xF001_0101, + 0b1010_0000_0000_0000_0000_0011_0000_0011, + 0x0, + 0x0 + ][..] + ) + .unwrap() + .supports_receiving_jr_timestamps(), true, ); } diff --git a/midi2/src/ump_stream/function_block_info.rs b/midi2/src/ump_stream/function_block_info.rs index fdb5768..410945b 100644 --- a/midi2/src/ump_stream/function_block_info.rs +++ b/midi2/src/ump_stream/function_block_info.rs @@ -7,7 +7,7 @@ use crate::{ pub(crate) const STATUS: u16 = 0x11; -#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(2))] +#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(4))] struct FunctionBlockInfo { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -262,7 +262,7 @@ mod tests { #[test] fn active() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .active(), true @@ -272,7 +272,7 @@ mod tests { #[test] fn function_block_number() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .function_block_number(), u7::new(0x11), @@ -282,7 +282,7 @@ mod tests { #[test] fn first_group() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .first_group(), u4::new(0xD), @@ -292,7 +292,7 @@ mod tests { #[test] fn number_of_groups_spanned() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .number_of_groups_spanned(), 0x8, @@ -302,7 +302,7 @@ mod tests { #[test] fn midi_ci_version() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .midi_ci_version(), 0x1, @@ -312,7 +312,7 @@ mod tests { #[test] fn max_number_of_midi_ci_streams() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .max_number_of_midi_ci_streams(), 0x20, @@ -322,7 +322,7 @@ mod tests { #[test] fn ui_hint() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .ui_hint(), UiHint::SenderReciever, @@ -332,7 +332,7 @@ mod tests { #[test] fn midi1_port() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .midi1_port(), Some(Midi1Port::DontRestrictBandwidth), @@ -342,7 +342,7 @@ mod tests { #[test] fn direction() { assert_eq!( - FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120][..]) + FunctionBlockInfo::try_from(&[0xF011_9136, 0x0D08_0120, 0x0, 0x0][..]) .unwrap() .direction(), Direction::Output, diff --git a/midi2/src/ump_stream/start_of_clip.rs b/midi2/src/ump_stream/start_of_clip.rs index 9bbc730..ac94fb9 100644 --- a/midi2/src/ump_stream/start_of_clip.rs +++ b/midi2/src/ump_stream/start_of_clip.rs @@ -2,7 +2,7 @@ use crate::{detail::common_properties, ump_stream, ump_stream::UMP_MESSAGE_TYPE} pub(crate) const STATUS: u16 = 0x20; -#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(1))] +#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(4))] struct StartOfClip { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -28,8 +28,8 @@ mod tests { #[test] fn from_data() { assert_eq!( - StartOfClip::try_from(&[0xF020_0000][..]), - Ok(StartOfClip(&[0xF020_0000][..])), + StartOfClip::try_from(&[0xF020_0000, 0x0, 0x0, 0x0][..]), + Ok(StartOfClip(&[0xF020_0000, 0x0, 0x0, 0x0][..])), ); } } diff --git a/midi2/src/ump_stream/stream_configuration_notification.rs b/midi2/src/ump_stream/stream_configuration_notification.rs index 4ffd91b..554bdeb 100644 --- a/midi2/src/ump_stream/stream_configuration_notification.rs +++ b/midi2/src/ump_stream/stream_configuration_notification.rs @@ -6,7 +6,7 @@ use crate::{ pub(crate) const STATUS: u16 = 0x6; -#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(1))] +#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(4))] struct StreamConfigurationNotification { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -42,7 +42,7 @@ mod tests { #[test] fn protocol() { assert_eq!( - StreamConfigurationNotification::try_from(&[0xF006_0203][..]) + StreamConfigurationNotification::try_from(&[0xF006_0203, 0x0, 0x0, 0x0][..]) .unwrap() .protocol(), 0x2 @@ -52,7 +52,7 @@ mod tests { #[test] fn receive_jr_timestamps() { assert_eq!( - StreamConfigurationNotification::try_from(&[0xF006_0203][..]) + StreamConfigurationNotification::try_from(&[0xF006_0203, 0x0, 0x0, 0x0][..]) .unwrap() .receive_jr_timestamps(), true @@ -62,7 +62,7 @@ mod tests { #[test] fn send_jr_timestamps() { assert_eq!( - StreamConfigurationNotification::try_from(&[0xF006_0203][..]) + StreamConfigurationNotification::try_from(&[0xF006_0203, 0x0, 0x0, 0x0][..]) .unwrap() .send_jr_timestamps(), true diff --git a/midi2/src/ump_stream/stream_configuration_request.rs b/midi2/src/ump_stream/stream_configuration_request.rs index 86e04c0..8cf3879 100644 --- a/midi2/src/ump_stream/stream_configuration_request.rs +++ b/midi2/src/ump_stream/stream_configuration_request.rs @@ -6,7 +6,7 @@ use crate::{ pub(crate) const STATUS: u16 = 0x5; -#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(1))] +#[midi2_proc::generate_message(Via(ump_stream::UmpStream), FixedSize, MinSizeUmp(4))] struct StreamConfigurationRequest { #[property(common_properties::UmpMessageTypeProperty)] ump_type: (), @@ -42,7 +42,7 @@ mod tests { #[test] fn protocol() { assert_eq!( - StreamConfigurationRequest::try_from(&[0xF005_0203][..]) + StreamConfigurationRequest::try_from(&[0xF005_0203, 0x0, 0x0, 0x0][..]) .unwrap() .protocol(), 0x2 @@ -52,7 +52,7 @@ mod tests { #[test] fn receive_jr_timestamps() { assert_eq!( - StreamConfigurationRequest::try_from(&[0xF005_0203][..]) + StreamConfigurationRequest::try_from(&[0xF005_0203, 0x0, 0x0, 0x0][..]) .unwrap() .receive_jr_timestamps(), true @@ -62,7 +62,7 @@ mod tests { #[test] fn send_jr_timestamps() { assert_eq!( - StreamConfigurationRequest::try_from(&[0xF005_0203][..]) + StreamConfigurationRequest::try_from(&[0xF005_0203, 0x0, 0x0, 0x0][..]) .unwrap() .send_jr_timestamps(), true