25 |
25 |
26 //FORWARD CLASS DECLARATION |
26 //FORWARD CLASS DECLARATION |
27 class VideoServiceUriFetch; |
27 class VideoServiceUriFetch; |
28 class VideoServicePlay; |
28 class VideoServicePlay; |
29 class VideoServiceView; |
29 class VideoServiceView; |
30 class QVideoPlayerEngine; |
30 class VideoPlayerEngine; |
31 |
31 |
32 class VideoServices : public QObject |
32 class VideoServices : public QObject |
33 { |
33 { |
34 Q_OBJECT |
34 Q_OBJECT |
35 |
35 |
36 public: |
36 public: |
37 |
37 |
38 /** |
38 /** |
39 * Returns singleton instance for this class. |
39 * Returns singleton instance for this class. |
40 * |
40 * WARNING! Not safe to call this from destructor of another function scope static object! |
41 * WARNING! Not safe to call this from destructor of another function scope static object! |
41 * @return The singleton instance. |
42 * |
42 */ |
43 * @return The singleton instance. |
43 static VideoServices *instance( VideoPlayerEngine* engine = 0 ); |
44 */ |
|
45 static VideoServices *instance(QVideoPlayerEngine* engine = 0); |
|
46 |
44 |
47 /** |
45 /** |
48 * Decreases the reference count, when count reaches zero cleanup is done. |
46 * Decreases the reference count, when count reaches zero cleanup is done. |
49 * |
47 * |
50 */ |
48 */ |
51 void decreaseReferenceCount(); |
49 void decreaseReferenceCount(); |
52 |
50 |
53 enum TVideoService |
51 enum TVideoService |
54 { |
52 { |
55 ENoService, |
53 ENoService, |
56 EUriFetcher, |
54 EUriFetcher, |
57 EPlayback, |
55 EPlayback, |
58 EView |
56 EView |
59 }; |
57 }; |
60 |
58 |
61 /** |
59 /** |
62 * Returns service active status |
60 * Returns service active status |
63 * |
61 * @return bool true if active, false if not active |
64 * @return bool true if active, false if not active |
62 */ |
65 * |
63 VideoServices::TVideoService currentService(); |
66 */ |
|
67 VideoServices::TVideoService currentService(); |
|
68 |
64 |
69 private: |
65 private: |
|
66 |
|
67 /** |
|
68 * Constructor |
|
69 */ |
|
70 VideoServices(); |
70 |
71 |
71 /** |
72 /** |
72 * Constructor |
73 * Constructor |
73 */ |
74 */ |
74 VideoServices(); |
75 VideoServices( VideoPlayerEngine* engine ); |
75 |
76 |
76 /** |
77 /** |
77 * Constructor |
78 * Destructor. |
78 */ |
79 */ |
79 VideoServices(QVideoPlayerEngine* engine); |
80 virtual ~VideoServices(); |
80 |
81 |
81 /** |
82 void setCurrentService( VideoServices::TVideoService service ); |
82 * Destructor. |
|
83 */ |
|
84 virtual ~VideoServices(); |
|
85 |
83 |
86 void setCurrentService(VideoServices::TVideoService service); |
84 Q_DISABLE_COPY( VideoServices ) |
87 |
85 |
88 Q_DISABLE_COPY(VideoServices) |
86 signals: |
89 |
|
90 signals: |
|
91 void activated( int command ); |
87 void activated( int command ); |
92 |
88 |
93 private: |
89 private: |
94 |
90 |
95 /** |
91 /** |
96 * Singleton instance. |
92 * Singleton instance. |
97 */ |
93 */ |
98 static VideoServices* mInstance; |
94 static VideoServices* mInstance; |
99 |
95 |
100 VideoServiceUriFetch* mServiceUriFetch; |
96 VideoServiceUriFetch* mServiceUriFetch; |
|
97 VideoServicePlay* mServicePlay; |
|
98 VideoServiceView* mServiceView; |
|
99 VideoServices::TVideoService mCurrentService; |
101 |
100 |
102 VideoServicePlay* mServicePlay; |
101 friend class VideoServiceUriFetch; |
103 |
102 friend class VideoServicePlay; |
104 VideoServiceView* mServiceView; |
103 friend class VideoServiceView; |
105 |
104 |
106 VideoServices::TVideoService mCurrentService; |
105 public: |
107 |
106 |
108 friend class VideoServiceUriFetch; |
107 /** |
|
108 * Reference count. |
|
109 */ |
|
110 static int mReferenceCount; |
109 |
111 |
110 friend class VideoServicePlay; |
112 /* |
111 |
113 * indicate fetch service and attach operation has been selected |
112 friend class VideoServiceView; |
114 */ |
113 |
115 bool mFetchSelected; |
114 public: |
|
115 |
|
116 /** |
|
117 * Reference count. |
|
118 */ |
|
119 static int mReferenceCount; |
|
120 |
|
121 /* |
|
122 * indicate fetch service and attach operation has been selected |
|
123 */ |
|
124 bool mFetchSelected; |
|
125 |
116 |
126 }; |
117 }; |
127 |
118 |
128 #endif //__VIDEOSERVICES_H__ |
119 #endif //__VIDEOSERVICES_H__ |