|
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: Playback Data stub for testing mpmpxframeworkwrapper |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <qstring> |
|
20 |
|
21 #include "stub/inc/mpplaybackdata.h" |
|
22 #include "mptrace.h" |
|
23 |
|
24 |
|
25 /*! |
|
26 Stub function. |
|
27 */ |
|
28 MpPlaybackData::MpPlaybackData() |
|
29 : mDuration( 0 ), |
|
30 mPosition( 0 ), |
|
31 mTitle(""), |
|
32 mAlbum(""), |
|
33 mArtist("Unknown"), |
|
34 mMediaReady(EFalse), |
|
35 mPlaybackState(MpPlaybackData::Stopped) |
|
36 { |
|
37 } |
|
38 |
|
39 /*! |
|
40 Stub function. |
|
41 */ |
|
42 MpPlaybackData::~MpPlaybackData() |
|
43 { |
|
44 } |
|
45 |
|
46 /*! |
|
47 Stub function. |
|
48 */ |
|
49 int MpPlaybackData::duration() const |
|
50 { |
|
51 TX_LOG |
|
52 return mDuration; |
|
53 } |
|
54 |
|
55 /*! |
|
56 Stub function. |
|
57 */ |
|
58 int MpPlaybackData::position() const |
|
59 { |
|
60 TX_LOG |
|
61 return mPosition; |
|
62 } |
|
63 |
|
64 /*! |
|
65 Stub function. |
|
66 */ |
|
67 const QString& MpPlaybackData::title() const |
|
68 { |
|
69 TX_LOG |
|
70 return mTitle; |
|
71 } |
|
72 |
|
73 /*! |
|
74 Stub function. |
|
75 */ |
|
76 const QString& MpPlaybackData::album() const |
|
77 { |
|
78 TX_LOG |
|
79 return mAlbum; |
|
80 } |
|
81 |
|
82 /*! |
|
83 Stub function. |
|
84 */ |
|
85 const QString& MpPlaybackData::artist() const |
|
86 { |
|
87 TX_LOG |
|
88 return mArtist; |
|
89 } |
|
90 |
|
91 /*! |
|
92 Stub function. |
|
93 */ |
|
94 MpPlaybackData::SimplifiedPlaybackState MpPlaybackData::playbackState() |
|
95 { |
|
96 TX_LOG_ARGS("mPlaybackState=" << mPlaybackState) |
|
97 return mPlaybackState; |
|
98 } |
|
99 |
|
100 /*! |
|
101 Stub function. |
|
102 */ |
|
103 void MpPlaybackData::setDuration( int duration ) |
|
104 { |
|
105 TX_ENTRY_ARGS( "duration =" << duration ) |
|
106 mDuration = duration; |
|
107 TX_EXIT |
|
108 } |
|
109 |
|
110 /*! |
|
111 Stub function. |
|
112 */ |
|
113 void MpPlaybackData::setPosition( int position ) |
|
114 { |
|
115 TX_ENTRY_ARGS( "position =" << position ) |
|
116 mPosition = position; |
|
117 TX_EXIT |
|
118 } |
|
119 |
|
120 /*! |
|
121 Stub function. |
|
122 */ |
|
123 bool MpPlaybackData::setTitle( const QString& title ) |
|
124 { |
|
125 TX_ENTRY_ARGS( "title =" << title ) |
|
126 bool change = false; |
|
127 if ( title != mTitle ) { |
|
128 change = true; |
|
129 mTitle = title; |
|
130 } |
|
131 TX_EXIT |
|
132 return change; |
|
133 } |
|
134 |
|
135 /*! |
|
136 Stub function. |
|
137 */ |
|
138 bool MpPlaybackData::setAlbum( const QString& album ) |
|
139 { |
|
140 TX_ENTRY_ARGS( "album =" << album ) |
|
141 bool change = false; |
|
142 if ( album != mAlbum ) { |
|
143 change = true; |
|
144 mAlbum = album; |
|
145 } |
|
146 TX_EXIT |
|
147 return change; |
|
148 } |
|
149 |
|
150 /*! |
|
151 Stub function. |
|
152 */ |
|
153 bool MpPlaybackData::setArtist( const QString& artist ) |
|
154 { |
|
155 TX_ENTRY_ARGS( "artist =" << artist ) |
|
156 bool change = false; |
|
157 if ( artist != mArtist ) { |
|
158 change = true; |
|
159 mArtist = artist; |
|
160 } |
|
161 TX_EXIT |
|
162 return change; |
|
163 } |
|
164 |
|
165 |
|
166 /*! |
|
167 Stub function. |
|
168 */ |
|
169 void MpPlaybackData::setAlbumArtUri( const QString& albumArtUri) |
|
170 { |
|
171 TX_ENTRY_ARGS( "albumArtUri =" << albumArtUri ) |
|
172 if ( !albumArtUri.isEmpty() ) { |
|
173 if ( albumArtUri != currentAAUri ) { |
|
174 currentAAUri = albumArtUri; |
|
175 } |
|
176 } |
|
177 TX_EXIT |
|
178 } |
|
179 |
|
180 /*! |
|
181 Stub function. |
|
182 */ |
|
183 void MpPlaybackData::setUri( const QString& aUri) |
|
184 { |
|
185 TX_ENTRY_ARGS( "aUri =" << aUri ) |
|
186 if ( !aUri.isEmpty() ) { |
|
187 if ( aUri != currentUri ) { |
|
188 currentUri = aUri; |
|
189 } |
|
190 } |
|
191 TX_EXIT |
|
192 } |
|
193 |
|
194 /*! |
|
195 Stub function. |
|
196 */ |
|
197 void MpPlaybackData::setPlaybackState(const SimplifiedPlaybackState state ) |
|
198 { |
|
199 TX_ENTRY_ARGS( "state =" << state ) |
|
200 mPlaybackState = state; |
|
201 TX_EXIT |
|
202 } |
|
203 |
|
204 /*! |
|
205 Stub function. |
|
206 */ |
|
207 void MpPlaybackData::commitPlaybackInfo() |
|
208 { |
|
209 TX_ENTRY |
|
210 mMediaReady = ETrue; |
|
211 TX_EXIT |
|
212 } |
|
213 |
|
214 /*! |
|
215 Stub function. |
|
216 */ |
|
217 void MpPlaybackData::handleMediaReady() |
|
218 { |
|
219 mMediaReady = ETrue; |
|
220 } |
|
221 |
|
222 //end of file |