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