Skip to content
Merged
Show file tree
Hide file tree
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
53 changes: 53 additions & 0 deletions src/include/mx/api/ChordData.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,55 @@ MXAPI_EQUALS_MEMBER(printObject)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(Extension);

enum class FrameBarre
{
none,
start,
stop
};

class FrameNoteData
{
public:
FrameNoteData();

int stringNumber;
int fretNumber;
int fingering;
bool isFingeringSpecified;
FrameBarre barre;
};

MXAPI_EQUALS_BEGIN(FrameNoteData)
MXAPI_EQUALS_MEMBER(stringNumber)
MXAPI_EQUALS_MEMBER(fretNumber)
MXAPI_EQUALS_MEMBER(fingering)
MXAPI_EQUALS_MEMBER(isFingeringSpecified)
MXAPI_EQUALS_MEMBER(barre)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(FrameNoteData);

class FrameData
{
public:
FrameData();

int stringCount;
int fretCount;
int firstFret;
bool isFirstFretSpecified;
std::vector<FrameNoteData> notes;
};

MXAPI_EQUALS_BEGIN(FrameData)
MXAPI_EQUALS_MEMBER(stringCount)
MXAPI_EQUALS_MEMBER(fretCount)
MXAPI_EQUALS_MEMBER(firstFret)
MXAPI_EQUALS_MEMBER(isFirstFretSpecified)
MXAPI_EQUALS_MEMBER(notes)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(FrameData);

class ChordData
{
public:
Expand All @@ -157,6 +206,8 @@ class ChordData
int bassAlter;
std::vector<Extension> extensions;
std::vector<MiscData> miscData;
bool hasFrameData;
FrameData frameData;
PositionData positionData;
};

Expand All @@ -170,6 +221,8 @@ MXAPI_EQUALS_MEMBER(bass)
MXAPI_EQUALS_MEMBER(bassAlter)
MXAPI_EQUALS_MEMBER(extensions)
MXAPI_EQUALS_MEMBER(miscData)
MXAPI_EQUALS_MEMBER(hasFrameData)
MXAPI_EQUALS_MEMBER(frameData)
MXAPI_EQUALS_MEMBER(positionData)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(ChordData);
Expand Down
59 changes: 56 additions & 3 deletions src/include/mx/api/DirectionData.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,46 @@ namespace mx
{
namespace api
{
enum class DirectionComponentKind
{
tempo,
mark,
wedgeStart,
wedgeStop,
ottavaStart,
ottavaStop,
bracketStart,
bracketStop,
dashesStart,
dashesStop,
pedalStart,
pedalStop,
words,
chord,
segno,
coda,
rehearsal
};

struct DirectionComponent
{
DirectionComponentKind kind;
int index;

DirectionComponent() : kind{DirectionComponentKind::tempo}, index{0}
{
}

DirectionComponent(DirectionComponentKind inKind, int inIndex) : kind{inKind}, index{inIndex}
{
}
};

MXAPI_EQUALS_BEGIN(DirectionComponent)
MXAPI_EQUALS_MEMBER(kind)
MXAPI_EQUALS_MEMBER(index)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(DirectionComponent);

// MusicXML Documentation: A direction is a musical indication that is not attached to a specific
// note. Two or more may be combined to indicate starts and stops of wedges, dashes, etc.
Expand Down Expand Up @@ -63,16 +103,21 @@ struct DirectionData
std::vector<SpannerStop> ottavaStops;
std::vector<SpannerStart> bracketStarts;
std::vector<SpannerStop> bracketStops;
std::vector<SpannerStart> dashesStarts;
std::vector<SpannerStop> dashesStops;
std::vector<SpannerStart> pedalStarts;
std::vector<SpannerStop> pedalStops;
std::vector<WordsData> words;
std::vector<ChordData> chords;
std::vector<SegnoData> segnos;
std::vector<CodaData> codas;
std::vector<RehearsalData> rehearsals;
std::vector<DirectionComponent> orderedComponents;

DirectionData()
: tickTimePosition{0}, placement{Placement::unspecified}, voice{-1}, isStaffValueSpecified{true}, marks{},
wedgeStarts{}, wedgeStops{}, ottavaStarts{}, ottavaStops{}, bracketStarts{}, bracketStops{}, words{},
chords{}, segnos{}
wedgeStarts{}, wedgeStops{}, ottavaStarts{}, ottavaStops{}, bracketStarts{}, bracketStops{}, dashesStarts{},
dashesStops{}, pedalStarts{}, pedalStops{}, words{}, chords{}, segnos{}
{
}
};
Expand All @@ -82,9 +127,12 @@ inline bool isDirectionDataEmpty(const DirectionData &directionData)
return directionData.tempos.size() == 0 && directionData.marks.size() == 0 &&
directionData.wedgeStarts.size() == 0 && directionData.wedgeStops.size() == 0 &&
directionData.bracketStarts.size() == 0 && directionData.bracketStops.size() == 0 &&
directionData.dashesStarts.size() == 0 && directionData.dashesStops.size() == 0 &&
directionData.pedalStarts.size() == 0 && directionData.pedalStops.size() == 0 &&
directionData.tempos.size() == 0 && directionData.ottavaStarts.size() == 0 &&
directionData.ottavaStops.size() == 0 && directionData.words.size() == 0 &&
directionData.segnos.size() == 0 && directionData.codas.size() == 0;
directionData.segnos.size() == 0 && directionData.codas.size() == 0 &&
directionData.orderedComponents.size() == 0;
}

MXAPI_EQUALS_BEGIN(DirectionData)
Expand All @@ -100,10 +148,15 @@ MXAPI_EQUALS_MEMBER(ottavaStarts)
MXAPI_EQUALS_MEMBER(ottavaStops)
MXAPI_EQUALS_MEMBER(bracketStarts)
MXAPI_EQUALS_MEMBER(bracketStops)
MXAPI_EQUALS_MEMBER(dashesStarts)
MXAPI_EQUALS_MEMBER(dashesStops)
MXAPI_EQUALS_MEMBER(pedalStarts)
MXAPI_EQUALS_MEMBER(pedalStops)
MXAPI_EQUALS_MEMBER(words)
MXAPI_EQUALS_MEMBER(chords)
MXAPI_EQUALS_MEMBER(segnos)
MXAPI_EQUALS_MEMBER(codas)
MXAPI_EQUALS_MEMBER(orderedComponents)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(DirectionData);
} // namespace api
Expand Down
25 changes: 25 additions & 0 deletions src/include/mx/api/LyricData.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,47 @@
#pragma once

#include "mx/api/ApiCommon.h"
#include "mx/api/PositionData.h"
#include "mx/api/PrintData.h"

namespace mx
{
namespace api
{
enum class LyricSyllabic
{
single,
begin,
end,
middle
};

class LyricData
{
public:
LyricData()
: text{}, verseNumber{}, verseName{}, syllabic{LyricSyllabic::single}, hasExtend{false}, positionData{},
printData{}
{
}

std::string text;
std::string verseNumber;
std::string verseName;
LyricSyllabic syllabic;
bool hasExtend;
PositionData positionData;
PrintData printData;
};

MXAPI_EQUALS_BEGIN(LyricData)
MXAPI_EQUALS_MEMBER(text)
MXAPI_EQUALS_MEMBER(verseNumber)
MXAPI_EQUALS_MEMBER(verseName)
MXAPI_EQUALS_MEMBER(syllabic)
MXAPI_EQUALS_MEMBER(hasExtend)
MXAPI_EQUALS_MEMBER(positionData)
MXAPI_EQUALS_MEMBER(printData)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(LyricData);
} // namespace api
Expand Down
22 changes: 17 additions & 5 deletions src/include/mx/api/MarkData.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,18 @@ enum class MarkType
tripleTongue,
stopped,
snapPizzicato,
// fret,
// string_,
fret,
string_,
// hammerOn,
// pullOff,
// bend,
// tap,
heel,
toe,
fingernails,
// hole,
// arrow,
// handbell,
hole,
arrow,
handbell,
otherTechnical,
unknownTechnical,

Expand Down Expand Up @@ -214,6 +214,12 @@ struct MarkData
int tickTimePosition;
PrintData printData;
PositionData positionData;
Bool mordentLong;
bool hasMordentLong;
Placement mordentApproach;
bool hasMordentApproach;
Placement mordentDeparture;
bool hasMordentDeparture;

MarkData();
MarkData(MarkType inMarkType);
Expand All @@ -226,6 +232,12 @@ MXAPI_EQUALS_MEMBER(name)
MXAPI_EQUALS_MEMBER(tickTimePosition)
MXAPI_EQUALS_MEMBER(printData)
MXAPI_EQUALS_MEMBER(positionData)
MXAPI_EQUALS_MEMBER(mordentLong)
MXAPI_EQUALS_MEMBER(hasMordentLong)
MXAPI_EQUALS_MEMBER(mordentApproach)
MXAPI_EQUALS_MEMBER(hasMordentApproach)
MXAPI_EQUALS_MEMBER(mordentDeparture)
MXAPI_EQUALS_MEMBER(hasMordentDeparture)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(MarkData);
} // namespace api
Expand Down
3 changes: 3 additions & 0 deletions src/include/mx/api/NoteData.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#pragma once

#include "mx/api/DurationData.h"
#include "mx/api/LyricData.h"
#include "mx/api/NoteAttachmentData.h"
#include "mx/api/PitchData.h"
#include "mx/api/PositionData.h"
Expand Down Expand Up @@ -116,6 +117,7 @@ class NoteData
PrintData printData;

NoteAttachmentData noteAttachmentData;
std::vector<LyricData> lyrics;

// these strings will be stuffed into the editorial <footnote> element
// preceded by the string ##misc-data##. for example if you have the
Expand Down Expand Up @@ -145,6 +147,7 @@ MXAPI_EQUALS_MEMBER(beams)
MXAPI_EQUALS_MEMBER(positionData)
MXAPI_EQUALS_MEMBER(printData)
MXAPI_EQUALS_MEMBER(noteAttachmentData)
MXAPI_EQUALS_MEMBER(lyrics)
MXAPI_EQUALS_MEMBER(miscData)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(NoteData);
Expand Down
21 changes: 17 additions & 4 deletions src/include/mx/api/RehearsalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ namespace mx
{
namespace api
{
enum class RehearsalEnclosure
{
rectangle,
square,
oval,
circle,
bracket,
triangle,
diamond,
none
};

class RehearsalData
{
public:
Expand All @@ -20,11 +32,11 @@ class RehearsalData
bool isColorSpecified;
ColorData colorData;
FontData fontData;
RehearsalEnclosure enclosure;

// Additional data about enclosing shape is available
// but not supported at this time.

RehearsalData() : text{}, positionData{}, isColorSpecified{false}, colorData{}, fontData{}
RehearsalData()
: text{}, positionData{}, isColorSpecified{false}, colorData{}, fontData{},
enclosure{RehearsalEnclosure::rectangle}
{
}
};
Expand All @@ -35,6 +47,7 @@ MXAPI_EQUALS_MEMBER(positionData)
MXAPI_EQUALS_MEMBER(isColorSpecified)
MXAPI_EQUALS_MEMBER(colorData)
MXAPI_EQUALS_MEMBER(fontData)
MXAPI_EQUALS_MEMBER(enclosure)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(RehearsalData);
} // namespace api
Expand Down
4 changes: 3 additions & 1 deletion src/include/mx/api/SpannerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ struct SpannerStop
int numberLevel;
int tickTimePosition;
PositionData positionData;
LineData lineData;

SpannerStop() : numberLevel{-1}, tickTimePosition{0}, positionData{}
SpannerStop() : numberLevel{-1}, tickTimePosition{0}, positionData{}, lineData{}
{
}
};
Expand All @@ -52,6 +53,7 @@ MXAPI_EQUALS_BEGIN(SpannerStop)
MXAPI_EQUALS_MEMBER(numberLevel)
MXAPI_EQUALS_MEMBER(tickTimePosition)
MXAPI_EQUALS_MEMBER(positionData)
MXAPI_EQUALS_MEMBER(lineData)
MXAPI_EQUALS_END;
MXAPI_NOT_EQUALS_AND_VECTORS(SpannerStop);
} // namespace api
Expand Down
2 changes: 2 additions & 0 deletions src/include/mx/api/StaffData.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace api
class StaffData
{
public:
int staffLines = -1;
std::vector<ClefData> clefs;

// for the use case where key signatures
Expand Down Expand Up @@ -53,6 +54,7 @@ inline bool voicesAreEqual(const std::map<int, VoiceData> &l, const std::map<int
}

MXAPI_EQUALS_BEGIN(StaffData)
MXAPI_EQUALS_MEMBER(staffLines)
MXAPI_EQUALS_MEMBER(clefs)
MXAPI_EQUALS_MEMBER(keys)
MXAPI_EQUALS_MEMBER(directions)
Expand Down
Loading
Loading