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 QMPXVideoPlaybackControlConfiguration |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 2 % |
|
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 const TInt KControlListUpdated = 12; // additional extension of TMPXPlaybackState |
|
33 |
|
34 // ================= MEMBER FUNCTIONS ============================================================== |
|
35 |
|
36 // ------------------------------------------------------------------------------------------------- |
|
37 // CMPXVideoPlaybackControlConfiguration::CMPXVideoPlaybackControlConfiguration() |
|
38 // ------------------------------------------------------------------------------------------------- |
|
39 // |
|
40 QMPXVideoPlaybackControlConfiguration::QMPXVideoPlaybackControlConfiguration( |
|
41 QMPXVideoPlaybackControlsController* controller) |
|
42 : mControlsController( controller ) |
|
43 { |
|
44 } |
|
45 |
|
46 // ------------------------------------------------------------------------------------------------- |
|
47 // QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration() |
|
48 // Destructor. |
|
49 // ------------------------------------------------------------------------------------------------- |
|
50 // |
|
51 QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration() |
|
52 { |
|
53 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration")); |
|
54 |
|
55 mControlsList.clear(); |
|
56 } |
|
57 |
|
58 // ------------------------------------------------------------------------------------------------- |
|
59 // QMPXVideoPlaybackControlConfiguration::createControlList() |
|
60 // ------------------------------------------------------------------------------------------------- |
|
61 // |
|
62 void QMPXVideoPlaybackControlConfiguration::createControlList() |
|
63 { |
|
64 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::createControlList()")); |
|
65 |
|
66 addControlToList( EMPXBufferingAnimation ); |
|
67 addControlToList( EMPXStatusPane ); |
|
68 addControlToList( EMPXRealLogoBitmap ); |
|
69 |
|
70 emit controlListUpdated(); |
|
71 } |
|
72 |
|
73 // ------------------------------------------------------------------------------------------------- |
|
74 // QMPXVideoPlaybackControlConfiguration::controlList |
|
75 // ------------------------------------------------------------------------------------------------- |
|
76 // |
|
77 QList<TMPXVideoPlaybackControls>& QMPXVideoPlaybackControlConfiguration::controlList() |
|
78 { |
|
79 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::controlList()")); |
|
80 |
|
81 return mControlsList; |
|
82 } |
|
83 |
|
84 // ------------------------------------------------------------------------------------------------- |
|
85 // QMPXVideoPlaybackControlConfiguration::updateControlList |
|
86 // ------------------------------------------------------------------------------------------------- |
|
87 // |
|
88 void QMPXVideoPlaybackControlConfiguration::updateControlList( |
|
89 TMPXVideoPlaybackControlCommandIds event ) |
|
90 { |
|
91 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList(%d)"), event); |
|
92 |
|
93 if ( event == EMPXControlCmdFullScreenViewOpened || |
|
94 event == EMPXControlCmdDetailsViewOpened || |
|
95 event == EMPXControlCmdPluginInitialized ) |
|
96 { |
|
97 mState = event; |
|
98 } |
|
99 else if ( event == EMPXControlCmdTvOutConnected || |
|
100 event == EMPXControlCmdAudionOnlyViewOpened ) |
|
101 { |
|
102 mState = EMPXControlCmdTvOutConnected; |
|
103 } |
|
104 else |
|
105 { |
|
106 mState = KControlListUpdated; |
|
107 } |
|
108 |
|
109 emit controlListUpdated(); |
|
110 } |
|
111 |
|
112 // ------------------------------------------------------------------------------------------------- |
|
113 // QMPXVideoPlaybackControlConfiguration::deleteControlFromList |
|
114 // ------------------------------------------------------------------------------------------------- |
|
115 // |
|
116 void QMPXVideoPlaybackControlConfiguration::deleteControlFromList( |
|
117 TMPXVideoPlaybackControls control ) |
|
118 { |
|
119 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::deleteControlFromList(%d)"), control); |
|
120 |
|
121 mControlsList.removeAll( control ); |
|
122 } |
|
123 |
|
124 // ------------------------------------------------------------------------------------------------- |
|
125 // QMPXVideoPlaybackControlConfiguration::addControlToList |
|
126 // ------------------------------------------------------------------------------------------------- |
|
127 // |
|
128 void QMPXVideoPlaybackControlConfiguration::addControlToList( |
|
129 TMPXVideoPlaybackControls control ) |
|
130 { |
|
131 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::addControlToList(%d)"), control); |
|
132 |
|
133 if ( ! mControlsList.contains( control ) ) |
|
134 { |
|
135 mControlsList.append( control ); |
|
136 } |
|
137 } |
|
138 |
|
139 // ------------------------------------------------------------------------------------------------- |
|
140 // QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails |
|
141 // ------------------------------------------------------------------------------------------------- |
|
142 // |
|
143 void QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails() |
|
144 { |
|
145 MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails()")); |
|
146 |
|
147 mUpdateControlsWithFileDetails = true; |
|
148 } |
|
149 |
|
150 // End of File |
|