Skip to content

Commit

Permalink
Fix broken emscripten build
Browse files Browse the repository at this point in the history
Looks like making the fields public means they
are now exposed in JS so they need wasm_bindgen

I added the attribute on the input side too: the
CI test only needs the output side but it only
makes sense to have it both ways.
  • Loading branch information
danutsu committed Jul 12, 2024
1 parent 0ce67a5 commit a9bf97a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,15 @@ pub struct Data {
/// | wasapi | `QueryPerformanceCounter` |
/// | asio | `timeGetTime` |
/// | emscripten | `AudioContext.getOutputTimestamp` |
#[cfg_attr(target_os = "emscripten", wasm_bindgen)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
pub struct StreamInstant {
pub secs: i64,
pub nanos: u32,
}

/// A timestamp associated with a call to an input stream's data callback.
#[cfg_attr(target_os = "emscripten", wasm_bindgen)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub struct InputStreamTimestamp {
/// The instant the stream's data callback was invoked.
Expand All @@ -350,6 +352,7 @@ pub struct InputStreamTimestamp {
}

/// A timestamp associated with a call to an output stream's data callback.
#[cfg_attr(target_os = "emscripten", wasm_bindgen)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub struct OutputStreamTimestamp {
/// The instant the stream's data callback was invoked.
Expand All @@ -361,6 +364,7 @@ pub struct OutputStreamTimestamp {
}

/// Information relevant to a single call to the user's input stream data callback.
#[cfg_attr(target_os = "emscripten", wasm_bindgen)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct InputCallbackInfo {
pub timestamp: InputStreamTimestamp,
Expand Down

0 comments on commit a9bf97a

Please sign in to comment.