void Parents::handleInput(int16 key, int16 mouseX, int16 mouseY, MouseButtons mouseButtons) { if ((key == kKeyEscape) || (mouseButtons == kMouseButtonsRight)) abortPlay(); if (((key == kKeySpace) || (mouseButtons == kMouseButtonsLeft)) && (_currentLoop < kLoopCount)) skipLoop(_loopID[_currentLoop]); }
void ToneEx::playRtttl(char *p) { // Absolutely no error checking in here if (isPlaying()) abortPlay(); _default_dur = 4; _default_oct = 6; _bpm = 63; // format: d=N,o=N,b=NNN: // find the start (skip name, etc) while(*p != ':') p++; // ignore name p++; // skip ':' // get default duration if(*p == 'd') { p++; p++; // skip "d=" _num = 0; while(isdigit(*p)) { _num = (_num * 10) + (*p++ - '0'); } if(_num > 0) _default_dur = _num; p++; // skip comma } // get default octave if(*p == 'o') { p++; p++; // skip "o=" _num = *p++ - '0'; if(_num >= 3 && _num <=7) _default_oct = _num; p++; // skip comma } // get BPM if(*p == 'b') { p++; p++; // skip "b=" _num = 0; while(isdigit(*p)) { _num = (_num * 10) + (*p++ - '0'); } _bpm = _num; p++; // skip colon } // BPM usually expresses the number of quarter notes per minute _wholenote = (60 * 1000L / _bpm) * 4; // this is the time for whole note (in milliseconds) _tunePntr = p; _isPlaying = true; pushNextNote(); }
void SEQFile::handleInput(int16 key, int16 mouseX, int16 mouseY, MouseButtons mouseButtons) { if (_abortable && ((key != 0) || (mouseButtons != kMouseButtonsNone))) abortPlay(); }