From 513bc82381fde1ff3698ff67e58c09cb8f256ee2 Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 21 Oct 2023 10:12:15 -0400 Subject: [PATCH] cwSfScore.h : Added 'perfCnt` to event_t. --- cwSfScore.cpp | 5 +++-- cwSfScore.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cwSfScore.cpp b/cwSfScore.cpp index 6efbe6a..30210c1 100644 --- a/cwSfScore.cpp +++ b/cwSfScore.cpp @@ -960,7 +960,7 @@ cw::rc_t cw::sfscore::destroy( handle_t& hRef ) void cw::sfscore::clear_all_performance_data( handle_t h ) { sfscore_t* p = _handleToPtr(h); - std::for_each( p->eventA, p->eventA + p->eventN, [](event_t& e){ e.perfFl=false; e.perfVel=0, e.perfSec=0, e.perfMatchCost=std::numeric_limits::max(); } ); + std::for_each( p->eventA, p->eventA + p->eventN, [](event_t& e){ e.perfFl=false; e.perfCnt=0; e.perfVel=0, e.perfSec=0, e.perfMatchCost=std::numeric_limits::max(); } ); std::for_each( p->setA, p->setA + p->setN, [](set_t& s){ s.perfEventCnt=0; s.perfUpdateCnt=false; } ); } @@ -997,7 +997,8 @@ cw::rc_t cw::sfscore::set_perf( handle_t h, unsigned event_idx, double secs, uin } } } - + + e->perfCnt += 1; e->perfFl = true; e->perfVel = vel; e->perfSec = secs; diff --git a/cwSfScore.h b/cwSfScore.h index cf3479a..e0906bf 100644 --- a/cwSfScore.h +++ b/cwSfScore.h @@ -53,15 +53,17 @@ namespace cw unsigned varN; // Length of varA[] unsigned bpm; // beats per minute - double bpm_rval; + double bpm_rval; // double relTempo; // relative tempo (1=min tempo) bool perfFl; // has this event been performed + unsigned perfCnt; // count of time this event was performed (if perfCnt > 1 then the event was duplicated during performance) double perfSec; // performance event time uint8_t perfVel; // performance event velocity unsigned perfDynLevel; // performance dynamic level double perfMatchCost; // performance match cost (or DBL_MAX if not valid) + } event_t; // A 'set' is a collection of events that are grouped in time and all marked with a given attribute.