Skip to content

Commit

Permalink
Re-export common data types in the message module
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcebox committed Jan 14, 2025
1 parent 50a287d commit 410629e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

This release focuses on improving the internal message data types and their usage.

### Added

- `Message` enum variants for *System Common* and *System Realtime* messages.
- `U14` primitive value type used by *Pitch Wheel* and *Song Position Pointer* messages.
- Derive `Debug`, `Clone`, `Eq`, and `PartialEq` for `U4`.
- Derive `Debug`, `Clone`, `Eq`, and `PartialEq` for `InvalidU4`.
- Derive `Debug`, `Clone`, `Eq`, and `PartialEq` for `InvalidU7`.
- Re-exports of common data types in the `message` module.

### Changed

Expand Down
22 changes: 10 additions & 12 deletions src/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@ pub mod data;
pub mod notes;
pub mod raw;

use crate::message::channel::Channel;
use crate::message::control_function::ControlFunction;
use crate::message::data::u14::U14;
use crate::message::data::u7::U7;
use crate::message::data::FromClamped;
use crate::message::notes::Note;
pub use crate::message::channel::Channel;
pub use crate::message::control_function::ControlFunction;
pub use crate::message::data::u14::U14;
pub use crate::message::data::u7::U7;
pub use crate::message::data::{FromClamped, FromOverFlow};
pub use crate::message::notes::Note;

use crate::message::raw::{Payload, Raw};
use crate::packet::cable_number::CableNumber;
use crate::packet::code_index_number::CodeIndexNumber;
use crate::packet::{UsbMidiEventPacket, UsbMidiEventPacketError};

type Velocity = U7;
/// Note velocity value.
pub type Velocity = U7;

/// Represents midi messages.
///
/// Note: not current exhaustive and SysEx messages end up
/// being a confusing case. So are currently note implemented
/// they are sort-of unbounded
/// Represents the MIDI messages.
#[derive(Debug, Eq, PartialEq, Clone)]
pub enum Message {
/// Note On message.
Expand Down

0 comments on commit 410629e

Please sign in to comment.