114 lines
No EOL
2.1 KiB
Text
114 lines
No EOL
2.1 KiB
Text
@startuml "blip class diagram"
|
|
|
|
left to right direction
|
|
|
|
component clap {
|
|
interface Parser
|
|
}
|
|
|
|
component fasteval {
|
|
enum Instruction
|
|
}
|
|
|
|
component mp3lame-encoder {
|
|
enum Quality
|
|
enum Bitrate
|
|
}
|
|
|
|
component hound {
|
|
enum SampleFormat
|
|
}
|
|
|
|
component cli {
|
|
struct Cli {
|
|
mode: Mode
|
|
}
|
|
enum Mode {
|
|
Play(PlayOpts)
|
|
Export(ExportOpts)
|
|
Help(HelpOpts)
|
|
}
|
|
Cli --> Mode
|
|
struct PlayOpts {
|
|
input: Input
|
|
instrument: Instruction [-i, --instrument]
|
|
length: Instruction [-l, --length]
|
|
variables: HashMap<char, f64> [-v, --variable]
|
|
macros: HashMap<char, String> [-m, --macro]
|
|
slopes: HashMap<String, (char, Instruction)> [-s, --slope]
|
|
}
|
|
Mode --> PlayOpts
|
|
enum Input {
|
|
File(File)
|
|
Stdin(Stdin) [default]
|
|
String(String) [-c]
|
|
}
|
|
PlayOpts --> Input
|
|
struct ExportOpts {
|
|
playopts: PlayOpts
|
|
format: Format
|
|
output: Output [-c]
|
|
}
|
|
Mode --> ExportOpts
|
|
enum Format {
|
|
Mp3 {bitrate: Bitrate, quality: Quality}
|
|
Wav {bps: u16, sample_format: SampleFormat}
|
|
Flac {bps: usize}
|
|
Raw(RawFormat)
|
|
}
|
|
enum RawFormat {
|
|
ALaw
|
|
F32Be
|
|
F32Le
|
|
F64Be
|
|
F64Le
|
|
MuLaw
|
|
S8
|
|
S16Be
|
|
S16Le
|
|
S24Be
|
|
S24Le
|
|
S32Be
|
|
S32Le
|
|
U8
|
|
U16Be
|
|
U16Le
|
|
U24Be
|
|
U24Le
|
|
U32Be
|
|
U32Le
|
|
}
|
|
Format --> RawFormat: "feature = "raw""
|
|
ExportOpts --> Format
|
|
enum Output {
|
|
File(File)
|
|
Stdout(Stdout) [default]
|
|
}
|
|
ExportOpts --> Output
|
|
PlayOpts <-- ExportOpts
|
|
enum HelpOpts {
|
|
Syntax
|
|
Examples
|
|
Example(u8)
|
|
Format
|
|
}
|
|
Mode --> HelpOpts
|
|
}
|
|
|
|
component flacenc-rs {
|
|
|
|
}
|
|
|
|
component raw_audio {
|
|
|
|
}
|
|
|
|
cli ..|> Parser: derive
|
|
PlayOpts --> Instruction
|
|
Format --> Bitrate: "feature = "mp3""
|
|
Format --> Quality: "feature = "mp3""
|
|
Format --> SampleFormat: "feature = "wav""
|
|
Format ..> "flacenc-rs": "feature = "flac""
|
|
Format ..> raw_audio: "feature = "raw""
|
|
|
|
@enduml |