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 VideoPlaybackToolBar
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
66
|
18 |
// Version : %version: 6 %
|
44
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef VIDEOPLAYBACKTOOLBAR_H_
|
|
23 |
#define VIDEOPLAYBACKTOOLBAR_H_
|
|
24 |
|
|
25 |
#include <QObject>
|
|
26 |
|
|
27 |
#include <MMFScalingCustomCommandConstants.h>
|
|
28 |
#include <mpxplaybackframeworkdefs.h>
|
|
29 |
|
|
30 |
|
|
31 |
class QTimer;
|
|
32 |
class HbIcon;
|
|
33 |
class HbAction;
|
|
34 |
class HbToolBar;
|
|
35 |
class HbToolButton;
|
|
36 |
class VideoPlaybackViewFileDetails;
|
|
37 |
class VideoPlaybackControlsController;
|
|
38 |
|
|
39 |
// DATA TYPES
|
|
40 |
|
|
41 |
enum TButton
|
|
42 |
{
|
|
43 |
E1stButton,
|
|
44 |
E2ndButton,
|
|
45 |
E3rdButton,
|
|
46 |
E4thButton,
|
|
47 |
E5thButton,
|
|
48 |
EButtonCount // Should always be the last value
|
|
49 |
};
|
|
50 |
|
|
51 |
enum TButtonIcon
|
|
52 |
{
|
|
53 |
ERWIcon,
|
|
54 |
EPlayIcon,
|
|
55 |
EPauseIcon,
|
|
56 |
EFFIcon,
|
|
57 |
ENaturalIcon,
|
|
58 |
EStretchIcon,
|
|
59 |
EZoomIcon,
|
|
60 |
EDetailsIcon,
|
|
61 |
EAttachIcon,
|
|
62 |
EShareIcon,
|
|
63 |
EIconCount // Should always be the last value
|
|
64 |
};
|
|
65 |
|
|
66 |
enum TSeekingState
|
|
67 |
{
|
|
68 |
ENotSeeking,
|
|
69 |
EFastForwarding,
|
|
70 |
ERewinding
|
|
71 |
};
|
|
72 |
|
|
73 |
const int KMPXFastForward = 30;
|
|
74 |
const int KMPXRewind = -10;
|
|
75 |
|
|
76 |
class VideoPlaybackToolBar : public QObject
|
|
77 |
{
|
|
78 |
Q_OBJECT
|
|
79 |
|
|
80 |
public:
|
|
81 |
VideoPlaybackToolBar( VideoPlaybackControlsController* controller );
|
|
82 |
virtual ~VideoPlaybackToolBar();
|
58
|
83 |
|
|
84 |
public:
|
44
|
85 |
void updateState( TMPXPlaybackState state );
|
|
86 |
void aspectRatioChanged( int aspectRatio );
|
|
87 |
void initialize();
|
|
88 |
void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
|
|
89 |
void positionChanged( int position );
|
|
90 |
void durationChanged( int duration );
|
|
91 |
void setVisible( bool visible );
|
58
|
92 |
void resetControl();
|
44
|
93 |
|
|
94 |
private slots:
|
|
95 |
void playPause();
|
|
96 |
void changeAspectRatio();
|
|
97 |
void handleButtonPressed();
|
|
98 |
void handleRWButtonPressed();
|
|
99 |
void handleFFButtonPressed();
|
|
100 |
void ffPressing();
|
|
101 |
void rwPressing();
|
|
102 |
void ffReleased();
|
|
103 |
void rwReleased();
|
|
104 |
void openDetailsView();
|
|
105 |
void retrieveButtons();
|
|
106 |
|
|
107 |
private:
|
66
|
108 |
void setAspectRatioButton();
|
|
109 |
|
|
110 |
private:
|
44
|
111 |
VideoPlaybackControlsController *mController;
|
|
112 |
HbToolBar *mToolBar;
|
|
113 |
QTimer *mSeekStartTimer;
|
|
114 |
QTimer *mRetrieveButtonTimer;
|
|
115 |
|
|
116 |
QList<HbIcon*> mButtonIcons;
|
|
117 |
QList<HbAction*> mButtonActions;
|
|
118 |
QList<HbToolButton*> mButtons;
|
|
119 |
|
|
120 |
TSeekingState mSeekingState;
|
|
121 |
|
|
122 |
bool mInitialized;
|
|
123 |
int mPosition;
|
|
124 |
int mDuration;
|
|
125 |
int mAspectRatio;
|
|
126 |
};
|
|
127 |
|
|
128 |
#endif /*VIDEOPLAYBACKTOOLBAR_H_*/
|