sscore_cheditor.hIntroductionThe chord editor DiscussionDisplays a staff with a chord to edit C Pseudoclasses
Functions
sscore_cheditor_accidental_for_chord_noteget the accidental for the note EXPORT enum sscore_cheditor_accidental_type sscore_cheditor_accidental_for_chord_note( sscore_cheditor *scedit, sscore_cheditor_noteid noteheadId, int accidental_pitch_alter); Parameterssscore_cheditor_add_chord_noteactually add a new note to the chord in the score EXPORT void sscore_cheditor_add_chord_note( sscore_cheditor *scedit, sscore_graphics *graphics, const sscore_point *p); Parameterssscore_cheditor_cancel_opcancel current operation (drag,accidental,remove,add) EXPORT void sscore_cheditor_cancel_op( sscore_cheditor *scedit); Parameterssscore_cheditor_createcreate the score editor which displays an item to be edited on a staff EXPORT sscore_cheditor *sscore_cheditor_create( sscore *score, sscore_graphics *graphics, float magnification, const sscore_rect *frame, int partIndex, int barIndex, sscore_item_handle item_h); Parameters
Discussionthe caller must install a change handler which forces a redraw of the chord editor on any state change sscore_cheditor_disposedispose all memory associated with scedit EXPORT void sscore_cheditor_dispose( sscore_cheditor *scedit); ParametersDiscussioncannot call any functions in this interface with scedit after calling sscore_cheditor_dispose sscore_cheditor_dragactively drag a notehead up or down on the staff EXPORT void sscore_cheditor_drag( sscore_cheditor *scedit, sscore_graphics *graphics, sscore_cheditor_noteid noteheadId, const sscore_point *translation); ParametersDiscussionthis is called repeatedly while dragging and the notehead will be drawn in the new position in sscore_edit_draw. The notehead will appear to slide up and down the stem with the drag, stopping at the correct space and line positions sscore_cheditor_drawdraw the score editor EXPORT void sscore_cheditor_draw( sscore_cheditor *scedit, sscore_graphics *graphics); Parameterssscore_cheditor_end_dragcalled at the end of a drag operation to update the score with the newly pitched note EXPORT void sscore_cheditor_end_drag( sscore_cheditor *scedit, sscore_graphics *graphics, sscore_cheditor_noteid noteheadId, const sscore_point *translation); Parameterssscore_cheditor_notehead_bbthe bounding box of a notehead in the chord EXPORT sscore_rect sscore_cheditor_notehead_bb( sscore_cheditor *scedit, sscore_graphics *graphics, sscore_cheditor_noteid noteheadId); ParametersReturn Valuethe bounding box of the notehead sscore_cheditor_notehead_id_atget the index of the nearest notehead to p in a displayed chord EXPORT sscore_cheditor_noteid sscore_cheditor_notehead_id_at( sscore_cheditor *scedit, sscore_graphics *graphics, const sscore_point *p, float maxdist); ParametersReturn Valuethe index of the nearest notehead in the chord - 0 is the top note or the only note. Increases downwards in the chord sscore_cheditor_invalid_id if p is further than maxdist from the closest notehead sscore_cheditor_pitch_alter_for_notehead-1 if notehead is flattened, +1 if sharpened EXPORT int sscore_cheditor_pitch_alter_for_notehead( sscore_cheditor *scedit, sscore_cheditor_noteid noteheadId); ParametersReturn Value-2,-1 if the notehead is flat, 0 if natural, +1,+2 if sharp sscore_cheditor_remove_chord_noteremove a note from a chord in the score NB we cannot remove the last - ie there must be one remaining EXPORT void sscore_cheditor_remove_chord_note( sscore_cheditor *scedit, sscore_graphics *graphics, sscore_cheditor_noteid noteheadId); Parameterssscore_cheditor_set_accidentalset the note pitch alteration in the score (an accidental is displayed if appropriate at the score location) EXPORT void sscore_cheditor_set_accidental( sscore_cheditor *scedit, sscore_graphics *graphics, sscore_cheditor_noteid noteheadId, int accidental_pitch_alter); Parameterssscore_cheditor_show_accidentalshow the note pitch alteration in the score editor with the correct accidental (grey if it will not actually be displayed at this location in the score) EXPORT void sscore_cheditor_show_accidental( sscore_cheditor *scedit, sscore_graphics *graphics, sscore_cheditor_noteid noteheadId, int accidental_pitch_alter); Parameterssscore_cheditor_show_add_chord_notedisplay a new notehead in the chord at the correct point nearest to p EXPORT void sscore_cheditor_show_add_chord_note( sscore_cheditor *scedit, sscore_graphics *graphics, const sscore_point *p); Parameterssscore_cheditor_show_remove_chord_noteupdate the chord editor to show the note missing from the chord EXPORT void sscore_cheditor_show_remove_chord_note( sscore_cheditor *scedit, sscore_graphics *graphics, sscore_cheditor_noteid noteheadId); Parameterssscore_cheditor_sizereturn size of score editor EXPORT sscore_size sscore_cheditor_size( const sscore_cheditor *scedit, sscore_graphics *graphics); ParametersTypedefs
sscore_cheditor_noteidunique identifier for a notehead in a chord typedef unsigned long sscore_cheditor_noteid; Discussionthis is unchanged on reordering the noteheads Enumerated Types
sscore_cheditor_accidental_typetypes of accidental enum sscore_cheditor_accidental_type { sscore_cheditor_noaccidental, sscore_cheditor_doubleflat, sscore_cheditor_flat, sscore_cheditor_natural, sscore_cheditor_sharp, sscore_cheditor_doublesharp }; |