本文整理汇总了C++中Playlist::printAsScript方法的典型用法代码示例。如果您正苦于以下问题:C++ Playlist::printAsScript方法的具体用法?C++ Playlist::printAsScript怎么用?C++ Playlist::printAsScript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist::printAsScript方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doCommand
//.........这里部分代码省略.........
muted = ! muted;
Serial.print(F("muting "));
Serial.println(muted ? F("on") : F("off"));
}
else {
playlist->setPortamento(firstParameterChar == 'P');
}
parameters++;
if(*parameters == '\0') {
return true;
}
}
playlist->setVolume(number(parameters, DEFAULT_VOLUME)); // noParam form will set volume to default
break;
case '*': // autoplay
if(noParameters) {
Serial.println(F("autoplay now"));
immediateAutoplayStart();
return false; // don't show prompt
}
else {
doAutoplaySettingsCommand(playlist, parameters);
}
break;
case '|':
Serial.println(F("limit"));
playlist->setAutoplayChirpLimit(number(parameters, PLAYLIST_CAPACITY));
break;
case '^': // times
Serial.println(F("time"));
if(noParameters) {
return ! playerLink.fetchTimeNow();
}
else if(firstParameterChar == '-') {
adjustTimeSeconds(-number(¶meters[1]));
}
else if(firstParameterChar == '+') {
adjustTimeSeconds(number(¶meters[1]));
}
if(stringToSeconds(parameters)) {
setTimeUTC(parameters);
}
break;
case '#': // scripts
if(noParameters) {
if( ! playlist->requestUpdate()) {
Serial.println(F("no script"));
}
}
else {
if(length == 2) {
if(firstParameterChar == '?') { // #? to print current playlist in script format
playlist->printAsScript();
}
else {
playlist->setUpdateFlags(number(parameters));
}
}
else {
playlist->setScriptAddress(parameters);
}
}
break;
case '/': // run named script, or update all playlists with scripts
Serial.println(F("run"));
if(noParameters) {
Playlists::updateAll(false); // false => not conditional on playlist flags
}
else {
return ! playerLink.fetchScript(-1, parameters); // -1 signals is general script, not one for a particular playlist
}
break;
case '=': // invoke trigger from the command line
Trigger::trigger(parameters);
break;
case '-':
inactivityTrigger.setWaitSeconds(number(parameters));
break;
case '%': // comment line; ignore
break;
default:
if(isAChirpCode(command)) {
playlist->add(command);
}
else {
Serial.println(F("uh?"));
}
break;
}
return true;
}