Skip to content
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

ItemKey: Distinguish between Bpm and IntegerBpm #335

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/tag/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ gen_map!(
"TKEY" => InitialKey,
"COLOR" => Color,
"TMOO" => Mood,
"TBPM" => Bpm,
"TBPM" => IntegerBpm,
"TCOP" => CopyrightMessage,
"TDES" => PodcastDescription,
"TCAT" => PodcastSeriesCategory,
Expand Down Expand Up @@ -277,7 +277,8 @@ gen_map!(
"\u{a9}gen" => Genre,
"----:com.apple.iTunes:COLOR" => Color,
"----:com.apple.iTunes:MOOD" => Mood,
"tmpo" | "----:com.apple.iTunes:BPM" => Bpm, // integer bpm (fourcc atom) vs. precise bpm (freeform atom)
"tmpo" => IntegerBpm,
"----:com.apple.iTunes:BPM" => Bpm,
"----:com.apple.iTunes:initialkey" => InitialKey,
"----:com.apple.iTunes:replaygain_album_gain" => ReplayGainAlbumGain,
"----:com.apple.iTunes:replaygain_album_peak" => ReplayGainAlbumPeak,
Expand Down Expand Up @@ -665,7 +666,19 @@ gen_item_keys!(
InitialKey,
Color,
Mood,
/// Decimal BPM value with arbitrary precision
///
/// Only read and written if the tag format supports a field for decimal BPM values
/// that are not restricted to integer values.
///
/// Not supported by ID3v2 that restricts BPM values to integers in `TBPM`.
Bpm,
/// Non-fractional BPM value with integer precision
///
/// Only read and written if the tag format has a field for integer BPM values,
/// e.g. ID3v2 ([`TBPM` frame](https://github.com/id3/ID3v2.4/blob/516075e38ff648a6390e48aff490abed987d3199/id3v2.4.0-frames.txt#L376))
/// and MP4 (`tmpo` integer atom).
IntegerBpm,

// Legal
CopyrightMessage,
Expand Down