FileProperties: Add new method

This commit is contained in:
Serial 2022-09-09 01:13:14 -04:00
parent 14a8548e4c
commit 3fa73f5065
No known key found for this signature in database
GPG key ID: DA95198DC17C4568
2 changed files with 22 additions and 0 deletions

View file

@ -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

View file

@ -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