musicxml/elements/
player.rs

1use super::PlayerName;
2use crate::datatypes::Id;
3use alloc::{string::String, vec::Vec};
4use musicxml_internal::*;
5use musicxml_macros::*;
6
7/// Attributes pertaining to the [Player] element.
8#[derive(Debug, PartialEq, Eq, AttributeDeserialize, AttributeSerialize)]
9pub struct PlayerAttributes {
10  /// Specifies an ID that is unique to the entire document.
11  pub id: Id,
12}
13
14/// Contents of the [Player] element.
15#[derive(Debug, PartialEq, Eq, ContentDeserialize, ContentSerialize)]
16pub struct PlayerContents {
17  /// The [PlayerName] element specifies the name of the player.
18  pub player_name: PlayerName,
19}
20
21/// The [Player] element allows for multiple players per [ScorePart][super::ScorePart] for use in listening applications.
22///
23/// One player may play multiple instruments, while a single instrument may include multiple players in divisi sections.
24#[derive(Debug, PartialEq, Eq, ElementDeserialize, ElementSerialize)]
25pub struct Player {
26  /// Element-specific attributes
27  pub attributes: PlayerAttributes,
28  #[flatten]
29  /// Element-specific content
30  pub content: PlayerContents,
31}