CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxLocalServerStreamerServer.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXLOCALSERVERSTREAMERSERVER_H
12 #define CXLOCALSERVERSTREAMERSERVER_H
13 
14 #include "org_custusx_core_video_Export.h"
15 #include "cxStreamerService.h"
16 #include "cxStreamer.h"
17 #include "cxProcessWrapper.h"
18 
19 class ctkPluginContext;
20 
21 namespace cx
22 {
23 typedef boost::shared_ptr<class StringPropertyBase> StringPropertyBasePtr;
24 typedef boost::shared_ptr<class DoublePropertyBase> DoublePropertyBasePtr;
25 typedef boost::shared_ptr<class Property> PropertyPtr;
26 typedef boost::shared_ptr<class FilePathProperty> FilePathPropertyPtr;
27 typedef boost::shared_ptr<class BoolPropertyBase> BoolPropertyBasePtr;
28 
29 
37 class org_custusx_core_video_EXPORT LocalServerStreamerArguments
38 {
39 public:
40  std::vector<PropertyPtr> getSettings(QDomElement root);
41 
42  BoolPropertyBasePtr getRunLocalServerOption(QDomElement root);
43  FilePathPropertyPtr getLocalServerNameOption(QDomElement root);
44 };
45 
53 class org_custusx_core_video_EXPORT LocalServerStreamer: public Streamer
54 {
55 Q_OBJECT
56 
57 public:
58  LocalServerStreamer(QString serverName, QString serverArguments);
59  virtual ~LocalServerStreamer();
60  virtual void startStreaming(SenderPtr sender);
61  virtual void stopStreaming();
62  virtual bool isStreaming();
63 
64  static StreamerPtr createStreamerIfEnabled(QDomElement root, StringMap args);
65 
66 private slots:
67  virtual void streamSlot() {}
68 
69  void processStateChanged();
70 private:
71  bool localVideoServerIsRunning();
72  ProcessWrapperPtr mLocalVideoServerProcess;
73 
74  StreamerPtr mBase;
75  QString mServerName;
76  QString mServerArguments;
77 };
78 typedef boost::shared_ptr<class LocalServerStreamer> LocalServerStreamerPtr;
79 
80 } //end namespace cx
81 
82 
83 #endif // CXLOCALSERVERSTREAMERSERVER_H
std::map< QString, QString > StringMap
boost::shared_ptr< class StringPropertyBase > StringPropertyBasePtr
boost::shared_ptr< class Property > PropertyPtr
boost::shared_ptr< class BoolPropertyBase > BoolPropertyBasePtr
boost::shared_ptr< class DoublePropertyBase > DoublePropertyBasePtr
boost::shared_ptr< class LocalServerStreamer > LocalServerStreamerPtr
boost::shared_ptr< class ProcessWrapper > ProcessWrapperPtr
Definition: cxMainWindow.h:41
boost::shared_ptr< class FilePathProperty > FilePathPropertyPtr
boost::shared_ptr< Sender > SenderPtr
Definition: cxSender.h:64
boost::shared_ptr< class Streamer > StreamerPtr
Namespace for all CustusX production code.