MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / setPaused

Method setPaused

app/src/API/Handlers/CSVPlayerHandler.cpp:211–228  ·  view source on GitHub ↗

* @brief Pause or resume playback (params: paused: bool) */

Source from the content-addressed store, hash-verified

209 * @brief Pause or resume playback (params: paused: bool)
210 */
211API::CommandResponse API::Handlers::CSVPlayerHandler::setPaused(const QString& id,
212 const QJsonObject& params)
213{
214 if (!params.contains(QStringLiteral("paused"))) {
215 return CommandResponse::makeError(
216 id, ErrorCode::MissingParam, QStringLiteral("Missing required parameter: paused"));
217 }
218
219 const bool paused = params.value(QStringLiteral("paused")).toBool();
220 if (paused)
221 CSV::Player::instance().pause();
222 else
223 CSV::Player::instance().play();
224
225 QJsonObject result;
226 result[QStringLiteral("isPlaying")] = CSV::Player::instance().isPlaying();
227 return CommandResponse::makeSuccess(id, result);
228}
229
230/**
231 * @brief Step delta frames forward (or backward if negative; default 1)

Callers

nothing calls this directly

Calls 5

containsMethod · 0.45
valueMethod · 0.45
pauseMethod · 0.45
playMethod · 0.45
isPlayingMethod · 0.45

Tested by

no test coverage detected