35
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 QMPXVideoPlaybackControlBar
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
41
|
18 |
// Version : %version: 7 %
|
35
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#include "mpxvideo_debug.h"
|
37
|
23 |
#include "mpxvideoplaybacktoolbar.h"
|
35
|
24 |
#include "mpxvideoplaybackcontrolbar.h"
|
|
25 |
#include "mpxvideoplaybackprogressbar.h"
|
|
26 |
#include "mpxcommonvideoplaybackview.hrh"
|
|
27 |
#include "mpxvideoplaybackcontrolscontroller.h"
|
|
28 |
|
|
29 |
|
|
30 |
// -------------------------------------------------------------------------------------------------
|
|
31 |
// QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar()
|
|
32 |
// -------------------------------------------------------------------------------------------------
|
|
33 |
//
|
41
|
34 |
QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar(
|
35
|
35 |
QMPXVideoPlaybackControlsController* controller )
|
|
36 |
: mController( controller )
|
|
37 |
{
|
|
38 |
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar"));
|
|
39 |
|
37
|
40 |
//
|
41
|
41 |
// create toolbar handler
|
37
|
42 |
//
|
|
43 |
mToolBar = new QMPXVideoPlaybackToolBar( mController );
|
41
|
44 |
|
|
45 |
//
|
|
46 |
// create progressbar handler
|
|
47 |
//
|
|
48 |
mProgressBar = new QMPXVideoPlaybackProgressBar( mController );
|
35
|
49 |
}
|
|
50 |
|
|
51 |
// -------------------------------------------------------------------------------------------------
|
|
52 |
// QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
|
|
53 |
// -------------------------------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
|
|
56 |
{
|
|
57 |
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()"));
|
|
58 |
|
41
|
59 |
if ( mProgressBar )
|
|
60 |
{
|
|
61 |
delete mProgressBar;
|
|
62 |
mProgressBar = NULL;
|
|
63 |
}
|
|
64 |
|
37
|
65 |
if ( mToolBar )
|
|
66 |
{
|
|
67 |
delete mToolBar;
|
|
68 |
mToolBar = NULL;
|
|
69 |
}
|
35
|
70 |
}
|
|
71 |
|
|
72 |
// -------------------------------------------------------------------------------------------------
|
|
73 |
// QMPXVideoPlaybackControlBar::initialize()
|
|
74 |
// -------------------------------------------------------------------------------------------------
|
|
75 |
//
|
|
76 |
void QMPXVideoPlaybackControlBar::initialize()
|
|
77 |
{
|
|
78 |
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::initialize()"));
|
|
79 |
|
41
|
80 |
if ( mProgressBar )
|
35
|
81 |
{
|
41
|
82 |
mProgressBar->initialize();
|
35
|
83 |
}
|
|
84 |
}
|
|
85 |
|
|
86 |
// -------------------------------------------------------------------------------------------------
|
|
87 |
// QMPXVideoPlaybackControlBar::updateState()
|
|
88 |
// -------------------------------------------------------------------------------------------------
|
|
89 |
//
|
|
90 |
void QMPXVideoPlaybackControlBar::updateState( TMPXPlaybackState state )
|
|
91 |
{
|
|
92 |
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::updateState() state = %d"), state );
|
|
93 |
|
37
|
94 |
if ( mToolBar )
|
35
|
95 |
{
|
37
|
96 |
mToolBar->updateState( state );
|
35
|
97 |
}
|
|
98 |
|
|
99 |
if ( mProgressBar )
|
|
100 |
{
|
|
101 |
mProgressBar->updateState( state );
|
|
102 |
}
|
|
103 |
}
|
|
104 |
|
|
105 |
// -------------------------------------------------------------------------------------------------
|
|
106 |
// QMPXVideoPlaybackControlBar::aspectRatioChanged()
|
|
107 |
// -------------------------------------------------------------------------------------------------
|
|
108 |
//
|
|
109 |
void QMPXVideoPlaybackControlBar::aspectRatioChanged( int aspectRatio )
|
|
110 |
{
|
|
111 |
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
|
|
112 |
|
37
|
113 |
if ( mToolBar )
|
35
|
114 |
{
|
37
|
115 |
mToolBar->aspectRatioChanged( aspectRatio );
|
35
|
116 |
}
|
|
117 |
}
|
|
118 |
|
|
119 |
// -------------------------------------------------------------------------------------------------
|
|
120 |
// QMPXVideoPlaybackControlBar::updateWithFileDetails()
|
|
121 |
// -------------------------------------------------------------------------------------------------
|
|
122 |
//
|
|
123 |
void QMPXVideoPlaybackControlBar::updateWithFileDetails(
|
|
124 |
QMPXVideoPlaybackViewFileDetails* details )
|
|
125 |
{
|
|
126 |
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::updateWithFileDetails()"));
|
|
127 |
|
37
|
128 |
if ( mToolBar )
|
35
|
129 |
{
|
37
|
130 |
mToolBar->updateWithFileDetails( details );
|
35
|
131 |
}
|
|
132 |
|
|
133 |
if ( mProgressBar )
|
|
134 |
{
|
|
135 |
mProgressBar->updateWithFileDetails( details );
|
|
136 |
}
|
|
137 |
}
|
|
138 |
|
|
139 |
// -------------------------------------------------------------------------------------------------
|
|
140 |
// QMPXVideoPlaybackControlBar::setVisibleToControlBar()
|
|
141 |
// -------------------------------------------------------------------------------------------------
|
|
142 |
//
|
|
143 |
void QMPXVideoPlaybackControlBar::setVisibleToControlBar( bool visible )
|
|
144 |
{
|
36
|
145 |
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::setVisibleToControlBar()"),
|
|
146 |
_L("visible = %d, current visibility = %d"), visible, isVisible() );
|
35
|
147 |
|
37
|
148 |
if ( visible != isVisible() )
|
35
|
149 |
{
|
37
|
150 |
setVisible( visible );
|
|
151 |
mToolBar->setVisible( visible );
|
35
|
152 |
}
|
|
153 |
}
|
|
154 |
|
|
155 |
|
|
156 |
// -------------------------------------------------------------------------------------------------
|
|
157 |
// QMPXVideoPlaybackControlBar::durationChanged()
|
|
158 |
// -------------------------------------------------------------------------------------------------
|
|
159 |
//
|
|
160 |
void QMPXVideoPlaybackControlBar::durationChanged( int duration )
|
|
161 |
{
|
|
162 |
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::durationChanged()"));
|
|
163 |
|
|
164 |
if ( mProgressBar )
|
|
165 |
{
|
|
166 |
mProgressBar->durationChanged( duration );
|
|
167 |
}
|
36
|
168 |
|
37
|
169 |
if ( mToolBar )
|
36
|
170 |
{
|
37
|
171 |
mToolBar->durationChanged( duration );
|
36
|
172 |
}
|
35
|
173 |
}
|
|
174 |
|
|
175 |
// -------------------------------------------------------------------------------------------------
|
|
176 |
// QMPXVideoPlaybackControlBar::positionChanged()
|
|
177 |
// -------------------------------------------------------------------------------------------------
|
|
178 |
//
|
|
179 |
void QMPXVideoPlaybackControlBar::positionChanged( int position )
|
|
180 |
{
|
|
181 |
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::positionChanged()"));
|
|
182 |
|
|
183 |
if ( mProgressBar )
|
|
184 |
{
|
|
185 |
mProgressBar->positionChanged( position );
|
|
186 |
}
|
41
|
187 |
|
37
|
188 |
if ( mToolBar )
|
36
|
189 |
{
|
37
|
190 |
mToolBar->positionChanged( position );
|
36
|
191 |
}
|
35
|
192 |
}
|
|
193 |
|
|
194 |
//End of file
|