MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / playback_url

Function playback_url

src/server/NymphCastServer.cpp:1493–1527  ·  view source on GitHub ↗

--- PLAYBACK URL --- uint8 playback_url(string)

Source from the content-addressed store, hash-verified

1491// --- PLAYBACK URL ---
1492// uint8 playback_url(string)
1493NymphMessage* playback_url(int session, NymphMessage* msg, void* data) {
1494 NymphMessage* returnMsg = msg->getReplyMessage();
1495
1496 std::string url = msg->parameters()[0]->getString();
1497 bool ret = streamTrack(url);
1498
1499 NymphType* retval = new NymphType((uint8_t) 1);
1500 if (ret) {
1501 if (serverMode == NCS_MODE_MASTER) {
1502 std::vector<NymphType*> values;
1503 std::string* tUrl = new std::string(url);
1504 values.push_back(new NymphType(tUrl, true));
1505 for (int i = 0; i < slave_remotes.size(); ++i) {
1506 NymphCastSlaveRemote& rm = slave_remotes[i];
1507 std::string result;
1508 NymphType* returnValue = 0;
1509 if (!NymphRemoteServer::callMethod(rm.handle, "playback_url", values, returnValue, result)) {
1510 // TODO:
1511 }
1512
1513 delete returnValue;
1514 }
1515 }
1516
1517 retval->setValue((uint8_t) 0);
1518 }
1519
1520 // Send status update to client.
1521 sendStatusUpdate(DataBuffer::getSessionHandle());
1522
1523 returnMsg->setResultValue(retval);
1524 msg->discard();
1525
1526 return returnMsg;
1527}
1528
1529
1530

Callers

nothing calls this directly

Calls 5

streamTrackFunction · 0.85
sendStatusUpdateFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected