20 #include "QApplication"
33 std::vector<PropertyPtr> retval;
44 bool defaultValue =
true;
46 bool defaultValue =
false;
50 "Run streamer in a separate process",
52 retval->setAdvanced(
false);
53 retval->setGroup(
"Connection");
54 return std::move(retval);
59 QString filename =
"OpenIGTLinkServer";
64 QStringList paths = QStringList() << qApp->applicationDirPath();
72 "Name of server executable, used only if Run Local Server is set.",
76 retval->setAdvanced(
false);
77 retval->setGroup(
"Connection");
93 QStringList cmdlineArguments;
94 for (StringMap::iterator i=args.begin(); i!=args.end(); ++i)
95 cmdlineArguments << i->first << i->second;
98 QString localServer = localServerProp->getEmbeddedPath().getAbsoluteFilepath();
99 boost::shared_ptr<LocalServerStreamer> streamer;
106 mServerName(serverName),
107 mServerArguments(serverArguments)
109 mLocalVideoServerProcess.reset(
new ProcessWrapper(QString(
"Local Video Server: %1").arg(mServerName)));
112 int defaultport = 18333;
113 igtLinkStreamer->setAddress(
"Localhost", defaultport);
114 mBase = igtLinkStreamer;
125 mLocalVideoServerProcess->launchWithRelativePath(mServerName, mServerArguments.split(
" "));
128 void LocalServerStreamer::processStateChanged()
130 if(mLocalVideoServerProcess->isRunning())
131 mBase->startStreaming(
mSender);
136 mBase->stopStreaming();
138 if (mLocalVideoServerProcess->getProcess())
140 mLocalVideoServerProcess->getProcess()->close();
141 mLocalVideoServerProcess.reset();
147 return localVideoServerIsRunning();
150 bool LocalServerStreamer::localVideoServerIsRunning()
152 if (!mLocalVideoServerProcess || !mLocalVideoServerProcess->getProcess())
154 return this->mLocalVideoServerProcess->isRunning();