NorMIT-nav  22.09
An IGT application
cxVideoImplService.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 
12 #ifndef CXTRACKINGIMPLSERVICE_H_
13 #define CXTRACKINGIMPLSERVICE_H_
14 
15 #include "cxVideoService.h"
16 #include "org_custusx_core_video_Export.h"
18 
19 class ctkPluginContext;
20 
21 namespace cx
22 {
23 typedef boost::shared_ptr<class VideoConnection> VideoConnectionPtr;
24 typedef boost::shared_ptr<class VideoServiceBackend> VideoServiceBackendPtr;
25 
34 class org_custusx_core_video_EXPORT VideoImplService : public VideoService
35 {
36  Q_INTERFACES(cx::VideoService)
37 public:
38  VideoImplService(ctkPluginContext* context);
39  virtual ~VideoImplService();
40  virtual StreamerServicePtr getStreamerService(QString uid);
41  virtual QList<StreamerServicePtr> getStreamerServices();
42 
43  virtual bool isNull();
44 
45  virtual VideoSourcePtr getActiveVideoSource();
46  virtual void setActiveVideoSource(QString uid);
47  virtual std::vector<VideoSourcePtr> getVideoSources();
48 
49  virtual void setPlaybackMode(PlaybackTimePtr controller);
50  virtual std::vector<TimelineEvent> getPlaybackEvents();
51 
52  virtual QString getConnectionMethod();
53  virtual void setConnectionMethod(QString connectionMethod);
54  virtual void openConnection();
55  virtual void closeConnection();
56  virtual bool isConnected() const;
57 
58 private slots:
65  void autoSelectActiveVideoSource();
66  void fpsSlot(QString source, int val);
67 
68 private:
82  VideoSourcePtr getGuessForActiveVideoSource(VideoSourcePtr old);
83 
84  QString mConnectionMethod;
85  VideoConnectionPtr mVideoConnection;
86 
87  VideoSourcePtr mActiveVideoSource;
88  VideoSourcePtr mEmptyVideoSource;
89  std::vector<USAcquisitionVideoPlaybackPtr> mUSAcquisitionVideoPlaybacks;
90  VideoServiceBackendPtr mBackend;
91 
92  void initServiceListener();
93  void onStreamerServiceAdded(StreamerService *service);
94  void onStreamerServiceRemoved(StreamerService *service);
95 
96  boost::shared_ptr<ServiceTrackerListener<StreamerService> > mStreamerServiceListener;
97 
98 private:
99  ctkPluginContext *mContext;
100 };
101 typedef boost::shared_ptr<VideoImplService> VideoImplServicePtr;
102 
103 } /* namespace cx */
104 
105 #endif /* CXTRACKINGIMPLSERVICE_H_ */
106 
cxServiceTrackerListener.h
cx::VideoService
Provides access to all video sources in the system, and connection stuff for the sources.
Definition: cxVideoService.h:75
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::VideoImplService
Definition: cxVideoImplService.h:34
cx::PlaybackTimePtr
boost::shared_ptr< class PlaybackTime > PlaybackTimePtr
Definition: cxTrackingSystemBronchoscopyService.h:42
cx::VideoSourcePtr
boost::shared_ptr< class VideoSource > VideoSourcePtr
Definition: cxForwardDeclarations.h:109
cx::StreamerServicePtr
boost::shared_ptr< class StreamerService > StreamerServicePtr
Definition: cxPlusConnectWidget.h:26
cxVideoService.h
cx::VideoConnectionPtr
boost::shared_ptr< VideoConnection > VideoConnectionPtr
Definition: cxVideoConnection.h:100
cx::StreamerService
Abstract class. Interface to Streamers.
Definition: cxStreamerService.h:42
cx::VideoServiceBackendPtr
boost::shared_ptr< class VideoServiceBackend > VideoServiceBackendPtr
Definition: cxPlaybackUSAcquisitionVideo.h:28
cx::VideoImplServicePtr
boost::shared_ptr< VideoImplService > VideoImplServicePtr
Definition: cxVideoImplService.h:101