44
|
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 VideoPlaybackControlConfiguration
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
63
|
18 |
// Version : %version: da1mmcf#25 %
|
44
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
// INCLUDE FILES
|
|
23 |
|
|
24 |
#include <QGraphicsWidget>
|
|
25 |
|
|
26 |
#include "mpxvideo_debug.h"
|
|
27 |
#include "videoplaybackdocumentloader.h"
|
|
28 |
#include "videoplaybackviewfiledetails.h"
|
|
29 |
#include "videoplaybackcontrolconfiguration.h"
|
|
30 |
#include "videoplaybackcontrolscontroller.h"
|
|
31 |
|
|
32 |
|
|
33 |
// ================= MEMBER FUNCTIONS ==============================================================
|
|
34 |
|
|
35 |
// -------------------------------------------------------------------------------------------------
|
|
36 |
// VideoPlaybackControlConfiguration::VideoPlaybackControlConfiguration()
|
|
37 |
// -------------------------------------------------------------------------------------------------
|
|
38 |
//
|
|
39 |
VideoPlaybackControlConfiguration::VideoPlaybackControlConfiguration(
|
|
40 |
VideoPlaybackControlsController* controller)
|
|
41 |
: mControlsController( controller )
|
50
|
42 |
, mSurfaceAttached( false )
|
44
|
43 |
{
|
|
44 |
}
|
|
45 |
|
|
46 |
// -------------------------------------------------------------------------------------------------
|
|
47 |
// VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration()
|
|
48 |
// Destructor.
|
|
49 |
// -------------------------------------------------------------------------------------------------
|
|
50 |
//
|
|
51 |
VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration()
|
|
52 |
{
|
|
53 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration"));
|
|
54 |
|
|
55 |
mControlsList.clear();
|
|
56 |
}
|
|
57 |
|
|
58 |
// -------------------------------------------------------------------------------------------------
|
|
59 |
// VideoPlaybackControlConfiguration::createControlList()
|
|
60 |
// -------------------------------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
void VideoPlaybackControlConfiguration::createControlList()
|
|
63 |
{
|
|
64 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::createControlList()"));
|
|
65 |
|
|
66 |
VideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails();
|
|
67 |
|
|
68 |
addControlToList( EStatusPane );
|
|
69 |
|
|
70 |
if ( fileDetails->mPlaybackMode == EMPXVideoStreaming ||
|
|
71 |
fileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
|
|
72 |
{
|
|
73 |
//
|
|
74 |
// streaming, add branding animation control to show while initializing
|
|
75 |
//
|
|
76 |
addControlToList( EBufferingAnimation );
|
63
|
77 |
|
|
78 |
emit controlListUpdated();
|
44
|
79 |
}
|
|
80 |
else if ( mControlsController->shouldShowRNLogo() )
|
|
81 |
{
|
|
82 |
addControlToList( ERealLogoBitmap );
|
63
|
83 |
|
|
84 |
emit controlListUpdated();
|
44
|
85 |
}
|
|
86 |
}
|
|
87 |
|
|
88 |
// -------------------------------------------------------------------------------------------------
|
|
89 |
// VideoPlaybackControlConfiguration::controlList
|
|
90 |
// -------------------------------------------------------------------------------------------------
|
|
91 |
//
|
|
92 |
QList<TVideoPlaybackControls>& VideoPlaybackControlConfiguration::controlList()
|
|
93 |
{
|
|
94 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::controlList()"));
|
|
95 |
|
|
96 |
return mControlsList;
|
|
97 |
}
|
|
98 |
|
|
99 |
// -------------------------------------------------------------------------------------------------
|
|
100 |
// VideoPlaybackControlConfiguration::updateControlList
|
|
101 |
// -------------------------------------------------------------------------------------------------
|
|
102 |
//
|
|
103 |
void VideoPlaybackControlConfiguration::updateControlList(
|
|
104 |
TVideoPlaybackControlCommandIds event )
|
|
105 |
{
|
|
106 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList(%d)"), event);
|
|
107 |
|
50
|
108 |
QGraphicsWidget *widget =
|
44
|
109 |
mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
|
|
110 |
|
|
111 |
switch ( event )
|
|
112 |
{
|
|
113 |
case EControlCmdFullScreenViewOpened:
|
|
114 |
{
|
|
115 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() full screen view"));
|
|
116 |
|
50
|
117 |
if ( mSurfaceAttached )
|
|
118 |
{
|
|
119 |
widget->setVisible( true );
|
|
120 |
}
|
44
|
121 |
|
|
122 |
deleteControlFromList( EDetailsViewPlaybackWindow );
|
|
123 |
deleteControlFromList( EFileDetailsWidget );
|
|
124 |
deleteControlFromList( EIndicatorBitmap );
|
|
125 |
|
63
|
126 |
emit controlListUpdated();
|
|
127 |
|
44
|
128 |
break;
|
|
129 |
}
|
|
130 |
case EControlCmdDetailsViewOpened:
|
|
131 |
{
|
|
132 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() details view"));
|
|
133 |
|
|
134 |
widget->setVisible( false );
|
|
135 |
|
|
136 |
deleteControlFromList( EIndicatorBitmap );
|
|
137 |
|
|
138 |
addControlToList( EDetailsViewPlaybackWindow );
|
63
|
139 |
addControlToList( EFileDetailsWidget );
|
44
|
140 |
|
63
|
141 |
emit controlListUpdated();
|
44
|
142 |
|
|
143 |
break;
|
|
144 |
}
|
|
145 |
case EControlCmdTvOutConnected:
|
|
146 |
case EControlCmdAudionOnlyViewOpened:
|
|
147 |
{
|
|
148 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() audio only view"));
|
|
149 |
|
|
150 |
widget->setVisible( false );
|
|
151 |
|
|
152 |
deleteControlFromList( EDetailsViewPlaybackWindow );
|
|
153 |
|
|
154 |
addControlToList( EIndicatorBitmap );
|
|
155 |
addControlToList( EFileDetailsWidget );
|
|
156 |
|
63
|
157 |
emit controlListUpdated();
|
|
158 |
|
44
|
159 |
break;
|
|
160 |
}
|
|
161 |
case EControlCmdRemoveRNLogo:
|
|
162 |
{
|
|
163 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() RN Logo removed"));
|
|
164 |
|
|
165 |
deleteControlFromList( ERealLogoBitmap );
|
|
166 |
|
63
|
167 |
emit controlListUpdated();
|
|
168 |
|
44
|
169 |
break;
|
|
170 |
}
|
50
|
171 |
case EControlCmdSurfaceAttached:
|
|
172 |
{
|
|
173 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() surface added"));
|
|
174 |
|
|
175 |
mSurfaceAttached = true;
|
|
176 |
|
|
177 |
widget->setVisible( true );
|
|
178 |
|
|
179 |
break;
|
|
180 |
}
|
|
181 |
case EControlCmdSurfaceDetached:
|
|
182 |
{
|
|
183 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() surface removed"));
|
|
184 |
|
|
185 |
mSurfaceAttached = false;
|
|
186 |
|
|
187 |
widget->setVisible( false );
|
|
188 |
|
|
189 |
break;
|
|
190 |
}
|
44
|
191 |
default:
|
|
192 |
{
|
|
193 |
break;
|
|
194 |
}
|
|
195 |
}
|
|
196 |
}
|
|
197 |
|
|
198 |
// -------------------------------------------------------------------------------------------------
|
|
199 |
// VideoPlaybackControlConfiguration::deleteControlFromList
|
|
200 |
// -------------------------------------------------------------------------------------------------
|
|
201 |
//
|
|
202 |
void VideoPlaybackControlConfiguration::deleteControlFromList( TVideoPlaybackControls control )
|
|
203 |
{
|
|
204 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::deleteControlFromList(%d)"), control);
|
|
205 |
|
|
206 |
mControlsList.removeAll( control );
|
|
207 |
}
|
|
208 |
|
|
209 |
// -------------------------------------------------------------------------------------------------
|
|
210 |
// VideoPlaybackControlConfiguration::addControlToList
|
|
211 |
// -------------------------------------------------------------------------------------------------
|
|
212 |
//
|
|
213 |
void VideoPlaybackControlConfiguration::addControlToList(
|
|
214 |
TVideoPlaybackControls control )
|
|
215 |
{
|
|
216 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::addControlToList(%d)"), control);
|
|
217 |
|
|
218 |
if ( ! mControlsList.contains( control ) )
|
|
219 |
{
|
|
220 |
mControlsList.append( control );
|
|
221 |
}
|
|
222 |
}
|
|
223 |
|
|
224 |
// -------------------------------------------------------------------------------------------------
|
|
225 |
// VideoPlaybackControlConfiguration::updateControlsWithFileDetails
|
|
226 |
// -------------------------------------------------------------------------------------------------
|
|
227 |
//
|
|
228 |
void VideoPlaybackControlConfiguration::updateControlsWithFileDetails()
|
|
229 |
{
|
|
230 |
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlsWithFileDetails()"));
|
|
231 |
|
|
232 |
addControlToList( EControlBar );
|
|
233 |
|
|
234 |
emit controlListUpdated();
|
|
235 |
}
|
|
236 |
|
|
237 |
// End of File
|