sscore_contents.h
IntroductionThe C interface to the MusicXML data in the score NB LICENCING: Some functions here require contents_capable licence, and some require contents_detail_capable. The contents_detail_capable licence normally includes the contents_capable licence. Groupsdescriptive string functions for debuggingGroup members:
sscore contents access functionsGroup members:
Functions
sscore_con_barcontentsreturn information about all the items in the bar EXPORT enum sscore_error sscore_con_barcontents( const sscore *sc, int partindex, int barindex, sscore_bargroup *result); ParametersReturn Valuesscore_error = sscore_NoError if item found and XML returned in buffer, or an appropriate error value Discussionlicence contents_detail_capable is required to use this function sscore_con_boundsforitemreturn rectangular bounds of all drawn components in system which are part of a score item EXPORT enum sscore_error sscore_con_boundsforitem( const sscore *sc, const sscore_system *sys, sscore_item_handle item_h, sscore_rect *result); ParametersReturn Valuesscore_error = sscore_NoError and result filled in, or an appropriate error value Discussionlicence contents_capable is required to use this function sscore_con_componentsforitemreturn information (in result) about drawn components in system which are part of a score item EXPORT enum sscore_error sscore_con_componentsforitem( const sscore *sc, const sscore_system *sys, sscore_item_handle item_h, sscore_componentgroup *result); ParametersReturn Valuesscore_error = sscore_NoError if item found and result filled in, or an appropriate error value Discussionlicence contents_capable is required to use this function sscore_con_itemforhandleget sscore_item for the given unique handle EXPORT enum sscore_error sscore_con_itemforhandle( const sscore *sc, int partindex, int barindex, sscore_item_handle item_h, sscore_item *result); ParametersReturn Valuesscore_error = sscore_NoError if item found and item returned in result, or an appropriate error value Discussionlicence contents_detail_capable is required to use this function sscore_con_systemhittestreturn information (in result) about components in system which intersect point EXPORT enum sscore_error sscore_con_systemhittest( const sscore *sc, const sscore_system *sys, const sscore_point *p, sscore_componentgroup *result); ParametersReturn Valuesscore_error = sscore_NoError and result filled in, or an appropriate error value Discussionlicence contents_capable is required to use this function sscore_con_xmlforbarreturn the xml description of the bar (<measure>) in the part EXPORT enum sscore_error sscore_con_xmlforbar( const sscore *sc, int partindex, int barindex, char *buffer, int buffersize); ParametersReturn Valuesscore_error = sscore_NoError if item found and XML returned in buffer, or an appropriate error value Discussionlicence contents_capable is required to use this function sscore_con_xmlforitemfor the given unique item handle return the XML string describing the item in the file EXPORT enum sscore_error sscore_con_xmlforitem( const sscore *sc, int partindex, int barindex, sscore_item_handle item_h, char *buffer, int buffersize); Parameters
Return Valuesscore_error = sscore_NoError if item found and XML returned in buffer, or an appropriate error value Discussionlicence contents_capable is required to use this function sscore_stringforbarlineget a string describing sscore_barline for debugging EXPORT enum sscore_error sscore_stringforbarline( const sscore_barline *barline, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize sscore_stringforclefget a string describing sscore_clef for debugging EXPORT enum sscore_error sscore_stringforclef( const sscore_clef *clef, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize sscore_stringforcleftypeget a debugging string for enum sscore_clef_type_e EXPORT const char *sscore_stringforcleftype( enum sscore_clef_type_e tp); sscore_stringforcomponenttypeget a debugging string describing enum sscore_component_type_e EXPORT const char *sscore_stringforcomponenttype( enum sscore_component_type_e tp); sscore_stringfordirectionget a string describing sscore_direction for debugging EXPORT enum sscore_error sscore_stringfordirection( const sscore_direction *dir, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize sscore_stringfordirectiontypeget debugging string for enum sscore_direction_type EXPORT const char *sscore_stringfordirectiontype( enum sscore_direction_type tp); sscore_stringforharmonyget a string describing sscore_harmony for debugging EXPORT enum sscore_error sscore_stringforharmony( const sscore_harmony *harmony, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize sscore_stringforitemget a string describing sscore_item for debugging EXPORT enum sscore_error sscore_stringforitem( const sscore_item *item, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize sscore_stringforitemtypeget a debugging string describing enum sscore_item_type_e EXPORT const char *sscore_stringforitemtype( enum sscore_item_type_e tp); sscore_stringforkeysigget a string describing sscore_keysig for debugging EXPORT enum sscore_error sscore_stringforkeysig( const sscore_keysig *ks, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize sscore_stringfornotationstypeget a debugging string describing enum sscore_notations_type_e EXPORT const char *sscore_stringfornotationstype( enum sscore_notations_type_e tp); sscore_stringfornoteget a string describing sscore_note for debugging EXPORT enum sscore_error sscore_stringfornote( const sscore_note *note, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize sscore_stringforsoundget a string describing sscore_sound for debugging EXPORT enum sscore_error sscore_stringforsound( const sscore_sound *sound, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize sscore_stringforstepget a debugging string for enum sscore_step_e EXPORT const char *sscore_stringforstep( enum sscore_step_e tp); sscore_stringfortimesigget a string describing sscore_timesig for debugging EXPORT enum sscore_error sscore_stringfortimesig( const sscore_timesig *ts, char *buffer, int buffersize); Discussionbuffer should point to a read-write area of size buffersize Typedefs
sscore_bargroupinformation about all items in part/bar typedef struct sscore_bargroup { int partindex; // index of part containing this group int barindex; // index of bar containing this group int num; // number of items in array sscore_conciseitem items[sscore_kMaxItemsInBar]; // items in bar int divisions; // divisions per quarter note (crotchet) int divisions_in_bar; // total divisions in bar unsigned dummy[8]; // future } sscore_bargroup; sscore_barlinespecial (repeat) barline info typedef struct sscore_barline { enum barstyle_e { barline_unset, barline_regular, barline_heavy, barline_double, barline_none }; enum loc_e { loc_unset, loc_right, loc_left, loc_middle }; enum ending_startstop_e { ending_start, ending_stop, ending_undefined }; enum repeat_direction_e { repeat_backward, repeat_forward, repeat_undefined }; enum barstyle_e barstyle; enum loc_e location; bool fermata; const char *ending_numbers; // eg "1", "2" or "1,2" or NULL enum ending_startstop_e ending_type; enum repeat_direction_e repeat_type; int repeat_times; // 0 if undefined bool segno; bool coda; unsigned dummy[8]; // future } sscore_barline; sscore_clefclef info typedef struct sscore_clef { enum sscore_clef_type_e tp; unsigned dummy[8]; // future } sscore_clef; sscore_componentinformation about item in sscore_componentgroup typedef struct sscore_component { enum sscore_component_type_e tp; int partindex; int barindex; sscore_rect rect; sscore_layout_handle layout_h; // identifier of parent item in system layout sscore_item_handle item_h; // identifier of parent item in score (note/rest etc) unsigned dummy[7]; // future } sscore_component; sscore_componentgrouplist of sscore_component typedef struct sscore_componentgroup { int num; sscore_component components[sscore_kMaxComponentsInGroup]; unsigned dummy[15]; // future } sscore_componentgroup; sscore_conciseitemminimal information about item typedef struct sscore_conciseitem { enum sscore_item_type_e tp; int staff; sscore_item_handle item_h; unsigned dummy[5]; // future } sscore_conciseitem; Discussionuse sscore_itemforhandle to convert this to a full sscore_item sscore_directionlist of directions typedef struct sscore_direction { int num_dirs; enum sscore_direction_type dirs[sscore_kMaxDirections]; bool hassound; sscore_sound sound; // defined if hassound = true unsigned dummy[32]; // future } sscore_direction; sscore_harmonyharmony info typedef struct sscore_harmony { int num_harmonychords; // number of items in chords array struct { struct { enum sscore_step_e step; int alter; // semitones } root; struct kind { int value; // see values in MusicXML spec bool use_symbols; const char *text; bool stack_degrees; bool parentheses_degrees; bool bracket_degrees; } kind; int inversion; struct { enum sscore_step_e step; int alter; // semitones } bass; unsigned dummy[4]; // future } chords[sscore_kMaxHarmonyChords]; struct { int strings; int frets; int firstfret; // 0 if undefined in xml int num_framenotes; // number of items in framenotes array struct { int string; int fret; const char *fingering; // NULL if undefined enum sscore_startstop_e barre; // 0 if undefined } framenotes[sscore_kMaxFrameNotes]; unsigned dummy[4]; // future } frame; float offset; enum sscore_harmony_type_e type; bool print_object; bool print_frame; unsigned dummy[8]; // future } sscore_harmony; sscore_itemdetailed info about item typedef struct sscore_item { enum sscore_item_type_e tp; int staff; sscore_item_handle item_h; int start; // divisions int duration; // divisions union { sscore_note note; // note or rest sscore_direction dir; sscore_timesig timesig; sscore_keysig keysig; sscore_clef clef; sscore_harmony harm; sscore_sound sound; sscore_barline barline; } u; unsigned dummy[8]; // future } sscore_item; sscore_keysigkey info typedef struct sscore_keysig // support conventional only { int fifths; // + = number of sharps, - = number of flats unsigned dummy[7]; // future } sscore_keysig; sscore_layout_handlea unique handle for an item in the layout The layout item is created from the score item and they have distinct identities typedef unsigned long sscore_layout_handle; sscore_notesimplified note info typedef struct sscore_note { int midipitch; // 60 = C4; 0 => rest int type; // 2 = minim, 4 = crochet etc. int numdots; // 1 if dotted, 2 if double-dotted int duration; // divisions int accidentals; // +1 = sharp, -1 = flat bool ischord; // true if this is a chord note (not set for first note of chord) int num_notations; enum sscore_notations_type_e notations[sscore_kMaxNotations]; sscore_tied tied; bool grace; unsigned dummy[32]; // future } sscore_note; sscore_soundsound info typedef struct sscore_sound { int offset; int tempo; float dynamics; bool dacapo; const char *segno; const char *dalsegno; const char *coda; const char *tocoda; bool forward_repeat; float divisions; const char *fine; const char *timeonly; bool pizz; const char *damper_pedal; const char *soft_pedal; const char *sostenuto_pedal; unsigned dummy[8]; // future } sscore_sound; DiscussionSee the MusicXML v3.0 spec for interpretation of these values. All values are 0, false or NULL if undefined sscore_tiedtie info typedef struct sscore_tied { enum sscore_startstop_e startstop; enum sscore_placement_e placement; enum sscore_orientation_type_e orientation; unsigned dummy[8]; // future } sscore_tied; Enumerated Types
sscore_clef_type_etype of clef enum sscore_clef_type_e { sscore_clef_treble, sscore_clef_treble_sub8, // treble clef with 8 below sscore_clef_alto, sscore_clef_tenor, sscore_clef_bass, sscore_clef_percussion, sscore_clef_TAB, sscore_clef_none, sscore_clef_unknown, sscore_clef_treble_super8, // treble clef with 8 above sscore_clef_bass_sub8, // bass clef with 8 below sscore_clef_bass_super8 // bass clef with 8 above }; sscore_component_type_etype of component which might be clicked on enum sscore_component_type_e { sscore_comp_notehead, sscore_comp_rest, sscore_comp_accidental, sscore_comp_note_stem, sscore_comp_timesig, sscore_comp_keysig, sscore_comp_clef, sscore_comp_note_dots, sscore_comp_lyric, sscore_comp_ledgers, sscore_comp_beamgroup, sscore_comp_beam, sscore_comp_tremolo, sscore_comp_direction_text, sscore_comp_direction_dynamics, sscore_comp_direction_pedal, sscore_comp_direction_metro, sscore_comp_direction_reh, sscore_comp_direction_segnocoda, sscore_comp_notation_slur, sscore_comp_notation_tied, sscore_comp_notation_slide, sscore_comp_notation_glissando, sscore_comp_notation_tuplet, sscore_comp_direction_wedge, sscore_comp_direction_dashes, sscore_comp_direction_bracket, sscore_comp_direction_oshift, sscore_comp_note_ornament, sscore_comp_note_articulation, sscore_comp_note_dynamics, sscore_comp_note_fermata, sscore_comp_note_arpeggiate, sscore_comp_note_tech, sscore_comp_note_tech_fingering, sscore_comp_note_tech_string, sscore_comp_note_tech_fret, sscore_comp_note_tech_hammerpull, sscore_comp_harmony, sscore_comp_harmony_frame, sscore_comp_repeat_brace, sscore_comp_multiple, sscore_comp_parent, sscore_comp_undefined }; sscore_direction_typedirection type enum sscore_direction_type { sscore_dir_rehearsal, sscore_dir_segno, sscore_dir_words, sscore_dir_coda, sscore_dir_wedge, sscore_dir_dynamics, sscore_dir_dashes, sscore_dir_bracket, sscore_dir_pedal, sscore_dir_metronome, sscore_dir_octave_shift, sscore_dir_harp_pedals, sscore_dir_damp, sscore_dir_damp_all, sscore_dir_eyeglasses, sscore_dir_string_mute, sscore_dir_scordatura, sscore_dir_image, sscore_dir_principal_voice, sscore_dir_accordion_registration, sscore_dir_percussion, sscore_dir_other }; sscore_harmony_type_etype of harmony enum sscore_harmony_type_e { sscore_harm_unset, sscore_harm_explicit, sscore_harm_implied, sscore_harm_alternate }; sscore_item_type_ebase type of item enum sscore_item_type_e { sscore_type_noitem, // no item found for handle sscore_type_note, sscore_type_rest, sscore_type_direction, sscore_type_timesig, sscore_type_keysig, sscore_type_clef, sscore_type_harmony, sscore_type_sound, sscore_type_unknown, sscore_type_barline }; sscore_notations_type_enotation type enum sscore_notations_type_e { sscore_notat_unset, sscore_notat_tied, sscore_notat_slur, sscore_notat_tuplet, sscore_notat_glissando, sscore_notat_slide, sscore_notat_ornaments, sscore_notat_technical, sscore_notat_articulations, sscore_notat_dynamics, sscore_notat_fermata, sscore_notat_arpeggiate, sscore_notat_non_arpeggiate, sscore_notat_accidental_mark, sscore_notat_other, sscore_notat_unknown }; sscore_orientation_type_eorientation type enum sscore_orientation_type_e { sscore_orient_undef, sscore_orient_over, sscore_orient_under, sscore_orient_unknown }; sscore_placement_eplacement type enum sscore_placement_e { sscore_place_undef, sscore_place_above, sscore_place_below, sscore_place_unknown }; sscore_startstop_estart and stop type enum sscore_startstop_e { sscore_ss_undef, sscore_ss_start, sscore_ss_stop, sscore_ss_unknown }; sscore_step_epitch step enum sscore_step_e { sscore_step_A, sscore_step_B, sscore_step_C, sscore_step_D, sscore_step_E, sscore_step_F, sscore_step_G, sscore_step_undef }; |