mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-11-10 06:34:18 +00:00
FileProperties: Add new
method
This commit is contained in:
parent
14a8548e4c
commit
3fa73f5065
2 changed files with 22 additions and 0 deletions
|
@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- **FileProperties**: `FileProperties::new`
|
||||
|
||||
## [0.8.1] - 2022-09-09
|
||||
|
||||
### Added
|
||||
|
|
|
@ -26,6 +26,25 @@ impl Default for FileProperties {
|
|||
}
|
||||
|
||||
impl FileProperties {
|
||||
/// Create a new `FileProperties`
|
||||
pub fn new(
|
||||
duration: Duration,
|
||||
overall_bitrate: Option<u32>,
|
||||
audio_bitrate: Option<u32>,
|
||||
sample_rate: Option<u32>,
|
||||
bit_depth: Option<u8>,
|
||||
channels: Option<u8>,
|
||||
) -> Self {
|
||||
Self {
|
||||
duration,
|
||||
overall_bitrate,
|
||||
audio_bitrate,
|
||||
sample_rate,
|
||||
bit_depth,
|
||||
channels,
|
||||
}
|
||||
}
|
||||
|
||||
/// Duration
|
||||
pub fn duration(&self) -> Duration {
|
||||
self.duration
|
||||
|
|
Loading…
Reference in a new issue