cwSfScore.h/cpp :
1. The SF score now includes measurement stats from previous performances 2. event_t now contains a pointer too the section to which the event belongs.
This commit is contained in:
parent
57d35b09db
commit
36496e8b79
@ -243,6 +243,20 @@ namespace cw
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc_t _assign_section_to_events( sfscore_t* p )
|
||||||
|
{
|
||||||
|
for(unsigned si=0,ei=0; si<p->sectionN ; ++si)
|
||||||
|
{
|
||||||
|
// the last event in a section is the event just prior to the first event in the next section
|
||||||
|
unsigned end_evt_idx = si>=p->sectionN-1 ? p->eventN : p->sectionA[si+1].begEvtIndex;
|
||||||
|
|
||||||
|
for(; ei<end_evt_idx; ++ei)
|
||||||
|
p->eventA[ ei ].section = p->sectionA + si;
|
||||||
|
|
||||||
|
}
|
||||||
|
return kOkRC;
|
||||||
|
}
|
||||||
|
|
||||||
rc_t _create_section_array( sfscore_t* p )
|
rc_t _create_section_array( sfscore_t* p )
|
||||||
{
|
{
|
||||||
rc_t rc = kOkRC;
|
rc_t rc = kOkRC;
|
||||||
@ -785,6 +799,9 @@ namespace cw
|
|||||||
if((rc = _create_section_array( p )) != kOkRC )
|
if((rc = _create_section_array( p )) != kOkRC )
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
|
|
||||||
|
if((rc = _assign_section_to_events(p)) != kOkRC )
|
||||||
|
goto errLabel;
|
||||||
|
|
||||||
if((rc = _create_set_array( p )) != kOkRC )
|
if((rc = _create_set_array( p )) != kOkRC )
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ namespace cw
|
|||||||
struct loc_str;
|
struct loc_str;
|
||||||
struct set_str;
|
struct set_str;
|
||||||
|
|
||||||
|
typedef score_parse::stats_t stats_t;
|
||||||
|
|
||||||
// The score can be divided into arbitrary non-overlapping sections.
|
// The score can be divided into arbitrary non-overlapping sections.
|
||||||
typedef struct section_str
|
typedef struct section_str
|
||||||
{
|
{
|
||||||
@ -20,8 +22,7 @@ namespace cw
|
|||||||
unsigned endEvtIndex; // last element in this section
|
unsigned endEvtIndex; // last element in this section
|
||||||
unsigned setCnt; // Count of elements in setArray[]
|
unsigned setCnt; // Count of elements in setArray[]
|
||||||
struct set_str** setArray; // Ptrs to sets which are applied to this section.
|
struct set_str** setArray; // Ptrs to sets which are applied to this section.
|
||||||
|
//stats_t statsA[ score_parse::kStatCnt ];
|
||||||
//double vars[ score_parse::kVarCnt ]; // Set to DBL_MAX by default.
|
|
||||||
} section_t;
|
} section_t;
|
||||||
|
|
||||||
typedef struct var_str
|
typedef struct var_str
|
||||||
@ -43,6 +44,7 @@ namespace cw
|
|||||||
unsigned flags; // Attribute flags for this event
|
unsigned flags; // Attribute flags for this event
|
||||||
unsigned dynLevel; // Dynamcis value pppp to ffff (1 to 11) for this note.
|
unsigned dynLevel; // Dynamcis value pppp to ffff (1 to 11) for this note.
|
||||||
double frac; // Note's time value for tempo and non-grace evenness notes.
|
double frac; // Note's time value for tempo and non-grace evenness notes.
|
||||||
|
section_t* section; // The section to which this event belongs
|
||||||
unsigned barNumb; // Bar id of the measure containing this event.
|
unsigned barNumb; // Bar id of the measure containing this event.
|
||||||
unsigned barNoteIdx; // Index of this note in this bar
|
unsigned barNoteIdx; // Index of this note in this bar
|
||||||
unsigned csvRowNumb; // File row number (not index) from which this record originated
|
unsigned csvRowNumb; // File row number (not index) from which this record originated
|
||||||
|
Loading…
Reference in New Issue
Block a user