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 sscore_bargroup returned in result, 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_closefeaturesreturn information (in result) about components in system which are within distance of point, sorted by increasing distance EXPORT enum sscore_error sscore_con_closefeatures( const sscore *sc, const sscore_system *sys, const sscore_point *p, float distance, 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_componentsfordirectiontypeget the components for the given direction-type EXPORT enum sscore_error sscore_con_componentsfordirectiontype( const sscore_system *sys, const sscore_con_directiontype *dir, sscore_componentgroup *result); ParametersReturn Valueany error 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_direction_isdirectiveget the directive flag for the direction EXPORT bool sscore_con_direction_isdirective( const sscore *sc, const sscore_con_directiontype *dir); ParametersReturn Valuetrue if this is a directive (aligned to left of time signature) sscore_con_direction_placementget the placement - above staff or below EXPORT enum sscore_placement_e sscore_con_direction_placement( const sscore *sc, const sscore_con_directiontype *dir); ParametersReturn Valuethe placement sscore_con_direction_staffindexget the staff index for the direction - 0 is top or only staff, 1 is bottom staff EXPORT int sscore_con_direction_staffindex( const sscore *sc, const sscore_con_directiontype *dir); ParametersReturn Valuethe staff index sscore_con_direction_wordsget the words information for a direction-type words EXPORT sscore_con_words_directiontype sscore_con_direction_words( const sscore *sc, const sscore_con_directiontype *dir); ParametersReturn Valuethe words for a direction-type words sscore_con_directionforidget the direction-type with the id dir_type_h EXPORT sscore_con_directiontype sscore_con_directionforid( const sscore *sc, int partindex, int barindex, sscore_directiontype_handle dir_type_h); ParametersReturn Valuethe direction-type or .tp = sscore_dir_undefined if not found sscore_con_directionsatitemget the direction(s) which occur at the same time as the item (note or direction) defined by item_h EXPORT enum sscore_error sscore_con_directionsatitem( const sscore *sc, const sscore_system *sys, int partindex, int barindex, sscore_item_handle item_h, sscore_con_directiongroup *result); ParametersReturn Valueany error 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 sscore_bl_barstyle_e barstyle; enum sscore_bl_loc_e location; bool fermata; const char *ending_numbers; // eg "1", "2" or "1,2" or NULL enum sscore_bl_ending_startstop_e ending_type; enum sscore_bl_repeat_direction_e repeat_type; int repeat_times; // 0 if undefined bool segno; bool coda; unsigned dummy[8]; // future } sscore_barline; sscore_chordchord info typedef struct sscore_chord { int type; // 2 = minim, 4 = crochet etc. int numdots; // 1 if dotted, 2 if double-dotted int duration; // divisions int num_notations; enum sscore_notations_type_e notations[sscore_kMaxNotations]; bool grace; int numnotes; struct sscore_chordnote notes[ sscore_kMaxChordNotes]; unsigned dummy[32]; // future } sscore_chord; Discussionassume all chord notes have same type, duration, dots and notations sscore_chordnoteinfo for note which is part of a chord typedef struct sscore_chordnote { int midipitch; int accidentals; // +1 = sharp, -1 = flat sscore_tied tied; unsigned dummy[4]; // future } sscore_chordnote; 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) int staffindex; sscore_item_handle inner_h; unsigned flags; // enum sscore_component_flags_e enum sscore_comp_controlpoint_e controlid; unsigned dummy[3]; // future } sscore_component; sscore_component_handlea unique handle for an item in the layout typedef unsigned long sscore_layout_handle; DiscussionThe layout item is created from the score item and they have distinct identities See Also sscore_componentgrouplist of sscore_component typedef struct sscore_componentgroup { int num; sscore_component components[sscore_kMaxComponentsInGroup]; unsigned dummy[15]; // future } sscore_componentgroup; sscore_con_directiongrouplist of sscore_con_directiontype typedef struct sscore_con_directiongroup { int num; sscore_con_directiontype directions[ sscore_kMaxDirectionsInGroup]; unsigned dummy[15]; // future } sscore_con_directiongroup; See Also sscore_con_directiontypecorresponds to direction-type element in musicxml typedef struct sscore_con_directiontype { enum sscore_direction_type tp; int partindex; int barindex; sscore_item_handle dir_h; sscore_directiontype_handle dirType_h; } sscore_con_directiontype; sscore_con_formattedtextcorresponds to formatted-text element in musicxml typedef struct sscore_con_formattedtext { char text[sscore_kMaxDirectionTextStringLength]; unsigned dummy[32]; // future } sscore_con_formattedtext; sscore_con_words_directiontypecorresponds to direction-type words element in musicxml typedef struct sscore_con_words_directiontype { sscore_con_formattedtext words[sscore_kMaxDirectionWords]; unsigned dummy[32]; // future } sscore_con_words_directiontype; 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_con_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_directiongrouplist of sscore_con_directiontype typedef struct sscore_con_directiongroup { int num; sscore_con_directiontype directions[ sscore_kMaxDirectionsInGroup]; unsigned dummy[15]; // future } sscore_con_directiongroup; See Also sscore_directiontype_handlea handle for a direction-type inside a direction element typedef unsigned long sscore_directiontype_handle; 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; sscore_chord chord; } 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 typedef unsigned long sscore_layout_handle; DiscussionThe layout item is created from the score item and they have distinct identities See Also 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, // C-clef on line 3 sscore_clef_tenor, // C-clef on line 4 sscore_clef_soprano, // C-clef on line 1 (rare) 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_comp_controlpoint_eidentify type of control point enum sscore_comp_controlpoint_e { sscore_comp_controlnone, sscore_comp_controlcentre, sscore_comp_controlleft, sscore_comp_controlright, sscore_comp_controlbezierleft, sscore_comp_controlbezierright }; sscore_comp_flags_eflags describing component enum sscore_comp_flags_e { sscore_comp_flag_isfragment = 0x1, // set if the component is a fragment of a wedge/slur/tied etc. sscore_comp_flag_isendpoint = 0x2, // set if the component is an endpoint of a wedge/slur/tied etc. sscore_comp_flag_isbeziercontrol = 0x4 // set if the component is a bezier inner control point (slur/tied) }; 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_segno, sscore_comp_direction_coda, 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_direction_principalvoice, 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_undefined, 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_type_chord // a chord (struct sscore_chord) }; 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 }; |