1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use super::{
MeasureLayout, MeasureNumbering, PageLayout, PartAbbreviationDisplay, PartNameDisplay, StaffLayout, SystemLayout,
};
use crate::datatypes::{Id, PositiveInteger, Tenths, Token, YesNo};
use alloc::{string::String, vec::Vec};
use musicxml_internal::*;
use musicxml_macros::*;
/// Attributes pertaining to the [Print] element.
#[derive(Debug, Default, PartialEq, Eq, AttributeDeserialize, AttributeSerialize)]
pub struct PrintAttributes {
/// The number of blank pages to insert before the current measure. It is ignored if `new_page` is not "yes".
/// These blank pages have no music, but may have text or images specified by the [Credit][super::Credit] element.
/// This is used to allow a combination of pages that are all text, or all text and images, together with pages of music.
pub blank_page: Option<PositiveInteger>,
/// Specifies an ID that is unique to the entire document.
pub id: Option<Id>,
/// Indicates whether to force a page break, or to force the current music onto the same page as the preceding music.
/// Normally this is the first music data within a measure. If used in multi-part music, the attributes should be placed
/// in the same positions within each part, or the results are undefined.
pub new_page: Option<YesNo>,
/// Indicates whether to force a system break, or to force the current music onto the same system as the preceding music.
/// Normally this is the first music data within a measure. If used in multi-part music, the attributes should be placed
/// in the same positions within each part, or the results are undefined.
pub new_system: Option<YesNo>,
/// Sets the number of a new page. It is ignored if `new_page` is not "yes".
pub page_number: Option<Token>,
/// Specifies spacing between multiple staves in tenths of staff space. Deprecated as of Version 1.1; the [StaffLayout]
/// element should be used instead. If both are present, the [StaffLayout] values take priority.
pub staff_spacing: Option<Tenths>,
}
/// Contents of the [Print] element.
#[derive(Debug, Default, PartialEq, Eq, ContentDeserialize, ContentSerialize)]
pub struct PrintContents {
/// The [PageLayout] element contains general page layout parameters.
pub page_layout: Option<PageLayout>,
/// The [SystemLayout] element contains general system layout parameters.
pub system_layout: Option<SystemLayout>,
/// The [StaffLayout] element contains general staff layout parameters.
pub staff_layout: Vec<StaffLayout>,
/// The [MeasureLayout] element contains general measure layout parameters.
pub measure_layout: Option<MeasureLayout>,
/// The [MeasureNumbering] element specifies how measure numbers are displayed.
pub measure_numbering: Option<MeasureNumbering>,
/// The [PartNameDisplay] element specifies how a part name is displayed over the course of a piece.
pub part_name_display: Option<PartNameDisplay>,
/// The [PartAbbreviationDisplay] element specifies how a part abbreviation is displayed over the course of a piece.
pub part_abbreviation_display: Option<PartAbbreviationDisplay>,
}
/// The [Print] element contains general printing parameters, including layout elements.
///
/// The [PartNameDisplay] and [PartAbbreviationDisplay] elements may also be used here to change how a part name or abbreviation is
/// displayed over the course of a piece. They take effect when the current measure or a succeeding measure starts a new system.
///
/// Layout group elements in a [Print] element only apply to the current page, system, or staff. Music that follows continues to take
/// the default values from the layout determined by the [Defaults][super::Defaults] element.
#[derive(Debug, PartialEq, Eq, ElementDeserialize, ElementSerialize)]
pub struct Print {
/// Element-specific attributes
pub attributes: PrintAttributes,
#[flatten]
/// Element-specific content
pub content: PrintContents,
}