Skip to content

Commit

Permalink
Add ability to get number of items within a Part
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Dec 9, 2024
1 parent e266aaf commit 5365b6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions amm_sdk/src/storage/midi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,4 @@ mod test {
// TODO: Implement chords
// TODO: Implement tuplets
// TODO: Attempt to implement dynamics
// TODO: Attempt to implement mordents, trills, and other ornaments based on timing data
5 changes: 5 additions & 0 deletions amm_sdk/src/structure/part.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ impl Part {
.sum()
}

#[must_use]
pub fn num_items(&self) -> usize {
self.content.len()
}

pub fn iter(&self) -> core::slice::Iter<'_, PartContent> {
self.content.iter()
}
Expand Down

0 comments on commit 5365b6d

Please sign in to comment.