1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#![doc = include_str!("../README.md")]
use std::io::{ErrorKind, Read, Result, Write};
pub use crate::colors::{Rgb, Rgba};
pub use crate::coord::{BubFnsCoord, Coord};
pub use crate::crc::CRC_32K_4_2;
pub use crate::lpcm::{Frame, LpcmKind, Sample};
pub use crate::space::{OaoSpace, OaoSpaces};
pub mod bub;
pub mod colors;
pub mod coord;
pub mod crc;
pub mod io;
pub mod lpcm;
pub mod oao;
pub mod space;
pub mod utils;
pub mod wav;
pub trait Metadata {}
pub enum FrameIOKind<F32LE, F64LE> {
F32LE(F32LE),
F64LE(F64LE),
}
impl<F32LE, F64LE> FrameIOKind<F32LE, F64LE> {
pub fn into_f32_le(self) -> Result<F32LE> {
match self {
Self::F32LE(r) => Ok(r),
Self::F64LE(_) => Err(utils::expected_and_found_error(
ErrorKind::Other,
LpcmKind::F32LE,
LpcmKind::F64LE,
)),
}
}
pub fn into_f64_le(self) -> Result<F64LE> {
match self {
Self::F32LE(_) => Err(utils::expected_and_found_error(
ErrorKind::Other,
LpcmKind::F64LE,
LpcmKind::F32LE,
)),
Self::F64LE(r) => Ok(r),
}
}
}
pub trait FrameReader<R: Read, S: Sample>: Iterator<Item = Result<Frame<S>>> {
fn get_ref(&self) -> &R;
fn get_mut(&mut self) -> &mut R;
fn into_inner(self) -> R;
fn frames(&self) -> u64;
fn samples_per_sec(&self) -> f64;
fn number_of_channels(&self) -> u32;
}
pub trait Reader {}
pub trait FrameWriter<W: Write> {
fn flush(&mut self) -> Result<()>;
fn get_ref(&self) -> &W;
fn get_mut(&mut self) -> &mut W;
fn into_inner(self) -> W;
}
pub trait Writer {}