Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nannou_osc: update rosc from 0.1 to 0.10 #948

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nannou_osc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ homepage = "https://nannou.cc"
edition = "2018"

[dependencies]
rosc = "0.1"
rosc = "0.10"
8 changes: 4 additions & 4 deletions nannou_osc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ pub use rosc;
pub use self::recv::Receiver;
#[doc(inline)]
pub use self::rosc::{
decoder, encoder, OscBundle as Bundle, OscColor as Color, OscError as Error,
OscMessage as Message, OscMidiMessage as MidiMessage, OscType as Type,
address, decoder, encoder, OscArray as Array, OscBundle as Bundle, OscColor as Color,
OscError as Error, OscMessage as Message, OscMidiMessage as MidiMessage, OscTime as Time,
OscTimeError as TimeError, OscType as Type,
};
pub use self::send::Sender;

Expand Down Expand Up @@ -121,15 +122,14 @@ where
A: Into<String>,
{
let addr = addr.into();
let args = Some(args);
Message { addr, args }
}

/// Decodes the given slice of `bytes` into a `Packet`.
///
/// Returns an `Error` if the slice does not contain a valid OSC packet.
pub fn decode(bytes: &[u8]) -> Result<Packet, Error> {
rosc::decoder::decode(bytes).map(|p| p.into())
rosc::decoder::decode_udp(bytes).map(|(_bytes, p)| p.into())
}

/// Encodes the given `Packet` into a `Vec` of bytes.
Expand Down
Loading