1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of QMPXVideoPlaybackControlConfiguration |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: da1mmcf#20 % |
|
19 |
|
20 |
|
21 |
|
22 // INCLUDE FILES |
|
23 |
|
24 #include <QGraphicsWidget> |
|
25 |
|
26 #include "mpxvideo_debug.h" |
|
27 #include "mpxvideoplaybackdocumentloader.h" |
|
28 #include "mpxvideoplaybackviewfiledetails.h" |
|
29 #include "mpxvideoplaybackcontrolconfiguration.h" |
|
30 #include "mpxvideoplaybackcontrolscontroller.h" |
|
31 |
|
32 |
|
33 // ================= MEMBER FUNCTIONS ============================================================== |
|
34 |
|
35 // ------------------------------------------------------------------------------------------------- |
|
36 // CMPXVideoPlaybackControlConfiguration::CMPXVideoPlaybackControlConfiguration() |
|
37 // ------------------------------------------------------------------------------------------------- |
|
38 // |
|
39 QMPXVideoPlaybackControlConfiguration::QMPXVideoPlaybackControlConfiguration( |
|
40 QMPXVideoPlaybackControlsController* controller) |
|
41 : mControlsController( controller ) |
|
42 { |
|
43 } |
|
44 |
|
45 // ------------------------------------------------------------------------------------------------- |
|
46 // QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration() |
|
47 // Destructor. |
|
48 // ------------------------------------------------------------------------------------------------- |
|
49 // |
|
50 QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration() |
|
51 { |
|
52 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration")); |
|
53 |
|
54 mControlsList.clear(); |
|
55 } |
|
56 |
|
57 // ------------------------------------------------------------------------------------------------- |
|
58 // QMPXVideoPlaybackControlConfiguration::createControlList() |
|
59 // ------------------------------------------------------------------------------------------------- |
|
60 // |
|
61 void QMPXVideoPlaybackControlConfiguration::createControlList() |
|
62 { |
|
63 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::createControlList()")); |
|
64 |
|
65 QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails(); |
|
66 |
|
67 addControlToList( EMPXStatusPane ); |
|
68 |
|
69 if ( fileDetails->mPlaybackMode == EMPXVideoStreaming || |
|
70 fileDetails->mPlaybackMode == EMPXVideoLiveStreaming ) |
|
71 { |
|
72 // |
|
73 // streaming, add branding animation control to show while initializing |
|
74 // |
|
75 addControlToList( EMPXBufferingAnimation ); |
|
76 } |
|
77 else if ( fileDetails->mRNFormat ) |
|
78 { |
|
79 addControlToList( EMPXRealLogoBitmap ); |
|
80 } |
|
81 |
|
82 emit controlListUpdated(); |
|
83 } |
|
84 |
|
85 // ------------------------------------------------------------------------------------------------- |
|
86 // QMPXVideoPlaybackControlConfiguration::controlList |
|
87 // ------------------------------------------------------------------------------------------------- |
|
88 // |
|
89 QList<TMPXVideoPlaybackControls>& QMPXVideoPlaybackControlConfiguration::controlList() |
|
90 { |
|
91 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::controlList()")); |
|
92 |
|
93 return mControlsList; |
|
94 } |
|
95 |
|
96 // ------------------------------------------------------------------------------------------------- |
|
97 // QMPXVideoPlaybackControlConfiguration::updateControlList |
|
98 // ------------------------------------------------------------------------------------------------- |
|
99 // |
|
100 void QMPXVideoPlaybackControlConfiguration::updateControlList( |
|
101 TMPXVideoPlaybackControlCommandIds event ) |
|
102 { |
|
103 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList(%d)"), event); |
|
104 |
|
105 QGraphicsWidget *widget = |
|
106 mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) ); |
|
107 |
|
108 switch ( event ) |
|
109 { |
|
110 case EMPXControlCmdFullScreenViewOpened: |
|
111 { |
|
112 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() full screen view")); |
|
113 |
|
114 widget->setVisible( true ); |
|
115 |
|
116 deleteControlFromList( EMPXDetailsViewPlaybackWindow ); |
|
117 deleteControlFromList( EMPXFileDetailsWidget ); |
|
118 deleteControlFromList( EMPXIndicatorBitmap ); |
|
119 |
|
120 break; |
|
121 } |
|
122 case EMPXControlCmdDetailsViewOpened: |
|
123 { |
|
124 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() details view")); |
|
125 |
|
126 widget->setVisible( false ); |
|
127 |
|
128 deleteControlFromList( EMPXIndicatorBitmap ); |
|
129 |
|
130 addControlToList( EMPXDetailsViewPlaybackWindow ); |
|
131 |
|
132 addControlToList( EMPXFileDetailsWidget ); |
|
133 |
|
134 break; |
|
135 } |
|
136 case EMPXControlCmdTvOutConnected: |
|
137 case EMPXControlCmdAudionOnlyViewOpened: |
|
138 { |
|
139 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() audio only view")); |
|
140 |
|
141 widget->setVisible( false ); |
|
142 |
|
143 deleteControlFromList( EMPXDetailsViewPlaybackWindow ); |
|
144 |
|
145 addControlToList( EMPXIndicatorBitmap ); |
|
146 addControlToList( EMPXFileDetailsWidget ); |
|
147 |
|
148 break; |
|
149 } |
|
150 case EMPXControlCmdRemoveRNLogo: |
|
151 { |
|
152 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() RN Logo removed")); |
|
153 |
|
154 deleteControlFromList( EMPXRealLogoBitmap ); |
|
155 |
|
156 break; |
|
157 } |
|
158 } |
|
159 |
|
160 emit controlListUpdated(); |
|
161 } |
|
162 |
|
163 // ------------------------------------------------------------------------------------------------- |
|
164 // QMPXVideoPlaybackControlConfiguration::deleteControlFromList |
|
165 // ------------------------------------------------------------------------------------------------- |
|
166 // |
|
167 void QMPXVideoPlaybackControlConfiguration::deleteControlFromList( |
|
168 TMPXVideoPlaybackControls control ) |
|
169 { |
|
170 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::deleteControlFromList(%d)"), control); |
|
171 |
|
172 mControlsList.removeAll( control ); |
|
173 } |
|
174 |
|
175 // ------------------------------------------------------------------------------------------------- |
|
176 // QMPXVideoPlaybackControlConfiguration::addControlToList |
|
177 // ------------------------------------------------------------------------------------------------- |
|
178 // |
|
179 void QMPXVideoPlaybackControlConfiguration::addControlToList( |
|
180 TMPXVideoPlaybackControls control ) |
|
181 { |
|
182 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::addControlToList(%d)"), control); |
|
183 |
|
184 if ( ! mControlsList.contains( control ) ) |
|
185 { |
|
186 mControlsList.append( control ); |
|
187 } |
|
188 } |
|
189 |
|
190 // ------------------------------------------------------------------------------------------------- |
|
191 // QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails |
|
192 // ------------------------------------------------------------------------------------------------- |
|
193 // |
|
194 void QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails() |
|
195 { |
|
196 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails()")); |
|
197 |
|
198 addControlToList( EMPXControlBar ); |
|
199 |
|
200 if ( mControlsController->fileDetails()->mVideoEnabled ) |
|
201 { |
|
202 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails() video enabled")); |
|
203 |
|
204 QGraphicsWidget *widget = |
|
205 mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) ); |
|
206 widget->setVisible( true ); |
|
207 } |
|
208 |
|
209 emit controlListUpdated(); |
|
210 } |
|
211 |
|
212 // End of File |
|