bool Accidentals::getNote(int pitch, QString& stp, int& alt, int& oct, Accid& acc) { int noteNumber = normalize(pitch); if (!notes_req[noteNumber]) { return false; } stp = notes_sharp[out_root_note[noteNumber]].left(1); oct = pitch / stPerOct; alt = pitch - (oct * stPerOct + out_root_note[noteNumber]); acc = out_accidental[noteNumber]; oct--; // correct oct (as 40 / stPerOct = 3 i.s.o. 2) if ((acc != None) && (!mustPrntAllAcc(noteNumber))) { naReset(stp, oct); } // if requested, suppress printing of second and following accidentals // but make sure that if both F natural and F accidental are printed, // all F's in the chord get an accidental even if printAllAccInCh = false if ((getAccPrnt(stp) > 0) && !printAllAccInChrd && !mustPrntAllAcc(noteNumber) && !printAccAllInst) { acc = None; } countAccPrnt(stp, acc); // if no accidental printed, check pending accidentals if ((acc == None) && naGet(stp, oct)) { acc = new_acc_state[out_root_note[noteNumber]]; naReset(stp, oct); } return true; }
/* * Class: jetdrone_nalib_NGLView * Method: nReset * Signature: (I)Z */ static jboolean nReset(JNIEnv *env, jclass clazz, jint pRef, jobject cb) { if(pRef) { naAppState *instance = (naAppState *) pRef; if(instance->userData) { return naReset(instance->userData, (void *) cb); } } LOG_DEBUG("NA","fast exit"); return JNI_FALSE; }