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

Method setPaused

app/src/API/Handlers/MDF4PlayerHandler.cpp:168–185  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

166 * @brief Pause or resume playback (params: paused: bool)
167 */
168API::CommandResponse API::Handlers::MDF4PlayerHandler::setPaused(const QString& id,
169 const QJsonObject& params)
170{
171 if (!params.contains(QStringLiteral("paused"))) {
172 return CommandResponse::makeError(
173 id, ErrorCode::MissingParam, QStringLiteral("Missing required parameter: paused"));
174 }
175
176 const bool paused = params.value(QStringLiteral("paused")).toBool();
177 if (paused)
178 MDF4::Player::instance().pause();
179 else
180 MDF4::Player::instance().play();
181
182 QJsonObject result;
183 result[QStringLiteral("isPlaying")] = MDF4::Player::instance().isPlaying();
184 return CommandResponse::makeSuccess(id, result);
185}
186
187/**
188 * @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