MUSX Document Model
Loading...
Searching...
No Matches
musx::dom::details::StaffGroup Class Reference

Represents the attributes of a Finale staff group that brackets staves. More...

#include <Details.h>

+ Inheritance diagram for musx::dom::details::StaffGroup:

Classes

class  Bracket
 Embedded class to represent the "bracket" node. More...
 

Public Types

enum class  DrawBarlineStyle { OnlyOnStaves , ThroughStaves , Mensurstriche }
 Enum for how to draw group barlines. More...
 
enum class  HideStaves { Normally , AsGroup , None }
 Enum for optimization options. More...
 
enum class  BracketStyle : int {
  None = 0 , ThickLine = 1 , BracketStraightHooks = 2 , PianoBrace = 3 ,
  Unknown4 , Unknown5 , BracketCurvedHooks = 6 , Unknown7 ,
  DeskBracket = 8
}
 Bracket style enum for StaffGroup. More...
 
using BarlineType = others::Measure::BarlineType
 Enum for barline justification.
 
using AlignJustify = others::NamePositioning::AlignJustify
 Enum for horizontal alignment.
 
- Public Types inherited from musx::dom::Base
enum class  ShareMode { All , Partial , None }
 Describes how this instance is shared between part and score. More...
 
using SharedNodes = std::set< std::string >
 The container type for shared nodes.
 

Public Member Functions

 StaffGroup (const DocumentWeakPtr &document, Cmper partId, Base::ShareMode shareMode, Cmper cmper1, Cmper cmper2)
 Constructor.
 
std::string getFullName (util::EnigmaString::AccidentalStyle accidentalStyle=util::EnigmaString::AccidentalStyle::Ascii) const
 Get the full staff name without Enigma tags.
 
std::string getAbbreviatedName (util::EnigmaString::AccidentalStyle accidentalStyle=util::EnigmaString::AccidentalStyle::Ascii) const
 Get the abbreviated staff name without Enigma tags.
 
std::shared_ptr< others::MultiStaffInstrumentGroupgetMultiStaffInstGroup () const
 Returns the others::MultiStaffInstrumentGroup for this group if it is part of one. Otherwise nullptr.
 
std::string getFullInstrumentName (util::EnigmaString::AccidentalStyle accidentalStyle=util::EnigmaString::AccidentalStyle::Ascii) const
 Returns the full instrument name for this group without Enigma tags and with autonumbering (if any).
 
std::string getAbbreviatedInstrumentName (util::EnigmaString::AccidentalStyle accidentalStyle=util::EnigmaString::AccidentalStyle::Ascii) const
 Returns the abbreviated instrument name for this group without Enigma tags and with autonumbering (if any)
 
bool isAllMeasures () const
 Returns true if this group spans all measures.
 
void integrityCheck () override
 Allows a class to determine if it has been properly contructed by the factory and fix issues that it can, such as creating default instances of contained classes.
 
- Public Member Functions inherited from musx::dom::DetailsBase
Cmper getCmper1 () const
 Gets the cmper1 key value.
 
Cmper getCmper2 () const
 Gets the cmper2 key value.
 
std::optional< IncigetInci () const
 Gets the optional array index (inci).
 
- Public Member Functions inherited from musx::dom::Base
virtual ~Base () noexcept(false)=default
 Virtual destructor for polymorphic behavior.
 
DocumentPtr getDocument () const
 Gets a reference to the Document.
 
Cmper getPartId () const
 Gets the partId for this instance (or 0 for score)
 
std::shared_ptr< others::PartDefinitiongetPartDefinition () const
 Gets the others::PartDefinition corresponding to getPartId.
 
ShareMode getShareMode () const
 Gets the sharing mode for this instance.
 
const SharedNodesgetUnlinkedNodes () const
 Gets the unlinked nodes for this instance. (Only populated for ShareMode::Partial)
 
void addUnlinkedNode (const std::string &nodeName)
 Adds a shared node for this instance.
 
virtual bool requireAllFields () const
 Specifies if the parser should alert (print or throw) when an unknown xml tag is found for this class.
 

Static Public Member Functions

static const xml::XmlElementArray< StaffGroup > & xmlMappingArray ()
 Required for musx::factory::FieldPopulator.
 

Public Attributes

InstCmper startInst {}
 Starting staff ID.
 
InstCmper endInst {}
 Ending staff ID.
 
MeasCmper startMeas {}
 Starting measure number.
 
MeasCmper endMeas {}
 Ending measure number.
 
Cmper fullNameId {}
 Full name TextBlock cmper (xml node is <fullID>)
 
int fullNameXadj {}
 Horizontal adjustment for full name (xml node is <fullXadj>)
 
int fullNameYadj {}
 Vertical adjustment for full name (xml node is <fullYadj>)
 
std::shared_ptr< Bracketbracket {}
 Bracket Options. The factory guarantees this value to exist.
 
BarlineType barlineType {}
 Group barline type (xml node is <barline>)
 
AlignJustify fullNameJustify {}
 Full name justification (xml node is <fullJustify>)
 
AlignJustify abbrvNameJustify {}
 Abbreviated name justification (xml node is <abbrvJustify>)
 
DrawBarlineStyle drawBarlines
 "Draw Barlines" option (xml node is <groupBarlineStyle>)
 
bool ownBarline {}
 "Use Alternate Group Barline"
 
bool fullNameIndivPos {}
 Indicates if full name has individual position (xml node is <fullIndivPos>)
 
bool abbrvNameIndivPos {}
 Indicates if abbreviated name has individual position (xml node is <abbrvIndivPos>)
 
bool hideName {}
 Inverse of "Show Group Name".
 
Cmper abbrvNameId {}
 Abbreviated name TextBlock cmper (xml node is <abbrvID>)
 
int abbrvNameXadj {}
 Horizontal adjustment for abbreviated name (xml node is <abbrvXadj>)
 
int abbrvNameYadj {}
 Vertical adjustment for abbreviated name (xml node is <abbrvYadj>)
 
AlignJustify fullNameAlign {}
 Full name horizontal alignment (xml node is <fullHAlign>)
 
AlignJustify abbrvNameAlign {}
 Abbreviated name horizontal alignment (xml node is <abbrvHAlign>)
 
bool fullNameExpand {}
 "Expand Single Word" for full name (xml node is <fullExpand>)
 
bool abbrvNameExpand {}
 "Expand Single Word" for abbreviated name (xml node is <abbrvExpand>)
 
HideStaves hideStaves {}
 "When Hiding Empty Staves" option (xml node is <optimize>)
 
Cmper multiStaffGroupId {}
 
std::unordered_set< InstCmperstaves
 Calculated list of staves in the group.
 

Static Public Attributes

static constexpr std::string_view XmlNodeName = "staffGroup"
 XML node name for this type.
 

Additional Inherited Members

- Protected Member Functions inherited from musx::dom::DetailsBase
 DetailsBase (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper1, Cmper cmper2, std::optional< Inci > inci=std::nullopt)
 Constructs a DetailsBase object.
 
- Protected Member Functions inherited from musx::dom::Base
 Base (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode)
 Constructs the base class and enforces the static constexpr XmlNodeName.
 
Baseoperator= (const Base &)
 assignment constructor: m_unlinkedNodes is intentionally omitted
 

Detailed Description

Represents the attributes of a Finale staff group that brackets staves.

This class is identified by the XML node name "staffGroup".

Member Enumeration Documentation

◆ BracketStyle

Bracket style enum for StaffGroup.

Enumerator
None 

No bracket (the default)

ThickLine 

Thick line, no hooks.

BracketStraightHooks 

Thick bracket with straight hooks.

PianoBrace 

Piano brace.

Unknown4 

Possibly never used.

Unknown5 

Possibly never used.

BracketCurvedHooks 

Thick bracket with curved hooks.

Unknown7 

Possibly never used.

DeskBracket 

Thin bracket with horizontal hook lines.

◆ DrawBarlineStyle

Enum for how to draw group barlines.

Enumerator
OnlyOnStaves 

Default value (may not appear in xml)

ThroughStaves 

Draw barlines through staves (xml value is "group")

Mensurstriche 

Draw barlines between staves (xml value is "Mensurstriche" with capitalization)

◆ HideStaves

Enum for optimization options.

Enumerator
Normally 

Hide staves as if there were no StaffGroup (this is the default and may not appear in the xml)

AsGroup 

Hide staves only if all staves are empty.

None 

Never hide the staves in this StaffGroup.

Constructor & Destructor Documentation

◆ StaffGroup()

musx::dom::details::StaffGroup::StaffGroup ( const DocumentWeakPtr document,
Cmper  partId,
Base::ShareMode  shareMode,
Cmper  cmper1,
Cmper  cmper2 
)
inline

Constructor.

Parameters
documentThe document owner of this instance
partIdThe part that owns this staff group
shareModeThe sharing mode deduced from xml attributes
cmper1In modern Finale files, all groups have 0 for cmper1. In legacy files this was a cmper for an others::InstrumentUsed list.
cmper2The identifier for the StaffGroup.

Member Function Documentation

◆ getAbbreviatedInstrumentName()

std::string musx::dom::details::StaffGroup::getAbbreviatedInstrumentName ( util::EnigmaString::AccidentalStyle  accidentalStyle = util::EnigmaString::AccidentalStyle::Ascii) const

Returns the abbreviated instrument name for this group without Enigma tags and with autonumbering (if any)

Note
Ordinal prefix numbering is currently supported only for English.
Parameters
accidentalStyleThe style for accidental subsitution in names like "Clarinet in Bb".
Returns
Abbreviated instrument name if this group is associated with a others::MultiStaffInstrumentGroup. Otherwise getAbbreviatedName.

◆ getAbbreviatedName()

std::string musx::dom::details::StaffGroup::getAbbreviatedName ( util::EnigmaString::AccidentalStyle  accidentalStyle = util::EnigmaString::AccidentalStyle::Ascii) const

Get the abbreviated staff name without Enigma tags.

Parameters
accidentalStyleThe style for accidental subsitution in names like "Clarinet in Bb".

◆ getFullInstrumentName()

std::string musx::dom::details::StaffGroup::getFullInstrumentName ( util::EnigmaString::AccidentalStyle  accidentalStyle = util::EnigmaString::AccidentalStyle::Ascii) const

Returns the full instrument name for this group without Enigma tags and with autonumbering (if any).

Note
Ordinal prefix numbering is currently supported only for English.
Parameters
accidentalStyleThe style for accidental subsitution in names like "Clarinet in Bb".
Returns
Full instrument name if this group is associated with a others::MultiStaffInstrumentGroup. Otherwise getFullName.

◆ getFullName()

std::string musx::dom::details::StaffGroup::getFullName ( util::EnigmaString::AccidentalStyle  accidentalStyle = util::EnigmaString::AccidentalStyle::Ascii) const

Get the full staff name without Enigma tags.

Parameters
accidentalStyleThe style for accidental subsitution in names like "Clarinet in Bb".

◆ integrityCheck()

void musx::dom::details::StaffGroup::integrityCheck ( )
inlineoverridevirtual

Allows a class to determine if it has been properly contructed by the factory and fix issues that it can, such as creating default instances of contained classes.

The default implementation should always be called inside an overridden implementation.

Exceptions
musx::dom::integrity_errorif there is a problem.

Reimplemented from musx::dom::Base.

Member Data Documentation

◆ multiStaffGroupId

Cmper musx::dom::details::StaffGroup::multiStaffGroupId {}

Calculated cmper for others::MultiStaffGroupId, if any. This value is not in the xml. It is set by the factory with the Resolver function for others::MultiStaffGroupId.