-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added rustdoc comments to most public types
- Loading branch information
Showing
21 changed files
with
160 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
//! Traits for type conversions. | ||
/// Like from, but will conceptually overflow if the value is too big | ||
/// this is useful from going from higher ranges to lower ranges | ||
pub trait FromOverFlow<T>: Sized { | ||
/// Convert with overflowing. | ||
fn from_overflow(_: T) -> Self; | ||
} | ||
|
||
/// Like from, but will clamp the value to a maximum value | ||
pub trait FromClamped<T>: Sized { | ||
/// Convert with clamping. | ||
fn from_clamped(_: T) -> Self; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//! Primitive types with bit lengths used in USB MIDI data. | ||
pub mod from_traits; | ||
pub mod u4; | ||
pub mod u7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
//! Type for the raw MIDI message. | ||
use crate::data::byte::u7::U7; | ||
|
||
/// Represents the payloads that the midi message may contain | ||
/// Represents the payloads that the midi message may contain. | ||
pub enum Payload { | ||
/// No payload. | ||
Empty, | ||
/// One-byte payload. | ||
SingleByte(U7), | ||
/// Two-byte payload. | ||
DoubleByte(U7, U7), | ||
} | ||
|
||
/// A struct that captures the valid states | ||
/// a midi message may be in, but without domain logic | ||
/// mainly useful for serializing. | ||
/// This represents the possible 'shapes', doesn't verify if | ||
/// the data makes sense though! | ||
/// A struct that captures the valid states. | ||
/// | ||
/// A midi message may be in, but without domain logic mainly useful for serializing. | ||
/// This represents the possible 'shapes', doesn't verify if the data makes sense though! | ||
pub struct Raw { | ||
/// Status byte. | ||
pub status: u8, | ||
/// Payload of maximum 2 bytes. | ||
pub payload: Payload, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//! MIDI message and related types. | ||
pub mod channel; | ||
pub mod message; | ||
pub mod notes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//! Primitives and structures used in USB MIDI data. | ||
pub mod byte; | ||
pub mod midi; | ||
pub mod usb; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
//! General items used for USB communication. | ||
pub mod constants; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.