Fraxinus  2023.01.05-dev+develop.0da12
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 
boost::shared_ptr< VideoConnection > VideoConnectionPtr
boost::shared_ptr< class VideoServiceBackend > VideoServiceBackendPtr
boost::shared_ptr< class PlaybackTime > PlaybackTimePtr
boost::shared_ptr< class VideoSource > VideoSourcePtr
Provides access to all video sources in the system, and connection stuff for the sources.
boost::shared_ptr< VideoImplService > VideoImplServicePtr
boost::shared_ptr< class StreamerService > StreamerServicePtr
Abstract class. Interface to Streamers.
Namespace for all CustusX production code.