2022-11-11 18:13:35 +00:00
|
|
|
#ifndef cwScoreFollower_h
|
|
|
|
#define cwScoreFollower_h
|
|
|
|
|
|
|
|
namespace cw
|
|
|
|
{
|
|
|
|
namespace score_follower
|
|
|
|
{
|
2023-05-13 11:55:34 +00:00
|
|
|
|
2022-11-11 18:13:35 +00:00
|
|
|
typedef handle< struct score_follower_str > handle_t;
|
|
|
|
|
2023-01-31 00:38:11 +00:00
|
|
|
rc_t create( handle_t& hRef, const object_t* cfg, cm::handle_t cmCtxH, double srate );
|
2022-11-11 18:13:35 +00:00
|
|
|
|
|
|
|
rc_t destroy( handle_t& hRef );
|
|
|
|
|
2023-05-16 13:14:20 +00:00
|
|
|
// Set the starting search location and calls clear_match_id_array().
|
2022-11-11 18:13:35 +00:00
|
|
|
rc_t reset( handle_t h, unsigned loc );
|
2023-01-31 00:38:11 +00:00
|
|
|
|
|
|
|
// If 'new_match_fl_ref' is returned as true then there are new match id's in the current_match_id_array[]
|
2023-05-13 11:55:34 +00:00
|
|
|
rc_t exec( handle_t h, double sec, unsigned smpIdx, unsigned muid, unsigned status, uint8_t d0, uint8_t d1, bool& new_match_fl_ref );
|
2023-01-31 00:38:11 +00:00
|
|
|
|
|
|
|
// Get a pointer to the event id's associated with the latest set of matches.
|
2023-05-01 01:17:31 +00:00
|
|
|
const unsigned* current_match_id_array( handle_t h, unsigned& cur_match_id_array_cnt_ref );
|
2023-01-31 00:38:11 +00:00
|
|
|
|
|
|
|
// Clear the match id array. This should be done to empty the current_match_id_array()
|
|
|
|
void clear_match_id_array( handle_t h );
|
|
|
|
|
2023-05-21 16:41:50 +00:00
|
|
|
|
|
|
|
rc_t cw_loc_range( handle_t h, unsigned& minLocRef, unsigned& maxLocRef );
|
|
|
|
bool is_loc_in_range( handle_t h, unsigned loc );
|
|
|
|
|
|
|
|
unsigned has_stored_performance( handle_t h );
|
|
|
|
|
2023-05-13 11:55:34 +00:00
|
|
|
// Write an SVG file containing a graphic view of the score following results since the last call to reset().
|
2023-05-16 13:14:20 +00:00
|
|
|
// Set show_muid_fl to true to display the 'muid' of the performed notes in the
|
|
|
|
// SVG rendering, otherwise the performed note sequence (order of arrival) id is shown.
|
|
|
|
rc_t write_svg_file( handle_t h, const char* out_fname, bool show_muid_fl=false );
|
2023-05-13 11:55:34 +00:00
|
|
|
|
|
|
|
// Write the score to 'out_fname'.
|
|
|
|
void score_report( handle_t h, const char* out_fname );
|
|
|
|
|
|
|
|
// Use the stored MIDI data received since the last call to reset to generate a report
|
|
|
|
// using midi_state::report_events().
|
|
|
|
rc_t midi_state_rt_report( handle_t h, const char* out_fname );
|
|
|
|
|
2023-01-31 00:38:11 +00:00
|
|
|
rc_t test( const object_t* cfg );
|
2022-11-11 18:13:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|