本文整理汇总了C++中SigTimer::setTempo方法的典型用法代码示例。如果您正苦于以下问题:C++ SigTimer::setTempo方法的具体用法?C++ SigTimer::setTempo怎么用?C++ SigTimer::setTempo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SigTimer
的用法示例。
在下文中一共展示了SigTimer::setTempo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyboardchar
void keyboardchar(int key) {
switch (key) {
case ',': // slow the tempo down
case '<':
tempo *= 0.95;
metronome.setTempo(tempo);
cout << "Tempo = " << tempo << endl;
maxwait = calculateMaxWait(tempo);
break;
case '.': // speed the tempo up
case '>':
tempo *= 1.05;
metronome.setTempo(tempo);
cout << "Tempo = " << tempo << endl;
maxwait = calculateMaxWait(tempo);
break;
case '[': // decrease the beat lag time in determing a chord
lagmaxinsec -= 0.05;
if (lagmaxinsec < 0.05) {
lagmaxinsec = 0.05;
}
cout << "Chord decision time set to " << lagmaxinsec << endl;
maxwait = calculateMaxWait(tempo);
break;
case ']': // increase the beat lag time in determing a chord
lagmaxinsec += 0.05;
if (lagmaxinsec > 60.0/tempo - 0.05) {
lagmaxinsec = 60.0/tempo - 0.05;
}
cout << "Chord decision time set to " << lagmaxinsec << endl;
maxwait = calculateMaxWait(tempo);
break;
default:
cout << "Undefined keyboard command" << endl;
}
}
示例2: initialization
void initialization(void) {
cout << "Enter a tempo for melody performance: ";
echoKeysOn();
cin >> tempo;
echoKeysOff();
metronome.setTempo(tempo);
maxwait = calculateMaxWait(tempo);
playChord = playChordByRules;
cout << "Using rules for playing accompaniment" << endl;
}