-
Notifications
You must be signed in to change notification settings - Fork 469
add native dsd support #1078
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
base: master
Are you sure you want to change the base?
add native dsd support #1078
Changes from 5 commits
8d14297
2b027ec
2638bbb
7f3276b
d971024
e63c7a4
7f46481
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,6 +105,15 @@ pub enum SampleFormat { | |
|
|
||
| /// `f64` with a valid range of `-1.0..=1.0` with `0.0` being the origin. | ||
| F64, | ||
|
|
||
| /// DSD stream (U8) | ||
|
||
| DsdU8, | ||
|
|
||
| /// DSD stream (U16) | ||
| DsdU16, | ||
|
|
||
| /// DSD stream (U32) | ||
| DsdU32, | ||
| } | ||
|
|
||
| impl SampleFormat { | ||
|
|
@@ -129,6 +138,9 @@ impl SampleFormat { | |
| SampleFormat::U64 => mem::size_of::<u64>(), | ||
| SampleFormat::F32 => mem::size_of::<f32>(), | ||
| SampleFormat::F64 => mem::size_of::<f64>(), | ||
| SampleFormat::DsdU8 => mem::size_of::<u8>(), | ||
| SampleFormat::DsdU16 => mem::size_of::<u16>(), | ||
| SampleFormat::DsdU32 => mem::size_of::<u32>(), | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -153,6 +165,9 @@ impl SampleFormat { | |
| SampleFormat::U64 => u64::BITS, | ||
| SampleFormat::F32 => 32, | ||
| SampleFormat::F64 => 64, | ||
| SampleFormat::DsdU8 => 1, | ||
|
||
| SampleFormat::DsdU16 => 1, | ||
| SampleFormat::DsdU32 => 1, | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -181,6 +196,9 @@ impl SampleFormat { | |
| | SampleFormat::U32 | ||
| // | SampleFormat::U48 | ||
| | SampleFormat::U64 | ||
| | SampleFormat::DsdU8 | ||
|
||
| | SampleFormat::DsdU16 | ||
| | SampleFormat::DsdU32 | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -208,6 +226,9 @@ impl Display for SampleFormat { | |
| SampleFormat::U64 => "u64", | ||
| SampleFormat::F32 => "f32", | ||
| SampleFormat::F64 => "f64", | ||
| SampleFormat::DsdU8 => "DsdU8", | ||
|
||
| SampleFormat::DsdU16 => "DsdU16", | ||
| SampleFormat::DsdU32 => "DsdU32", | ||
| } | ||
| .fmt(f) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be
fill_typed!(DsdU8)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now when I removed structs I am not sure what to use here. any suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this?