1 /* |
|
2 * Copyright (c) 2006-2007 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: Send update duration event if needed when player state changes |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMMADURATIONUPDATER_H |
|
20 #define CMMADURATIONUPDATER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "mmmaplayerstatelistener.h" |
|
24 #include "cmmaplayer.h" |
|
25 |
|
26 // CLASS DECLARATION |
|
27 /** |
|
28 * Checks if media duration has changed when player state changes and sends |
|
29 * DURATION_UPDATED event to Java. |
|
30 * |
|
31 */ |
|
32 NONSHARABLE_CLASS(CMMADurationUpdater): |
|
33 public CBase, public MMMAPlayerStateListener |
|
34 { |
|
35 public: // Construction |
|
36 static CMMADurationUpdater* NewL(CMMAPlayer& aPlayer); |
|
37 ~CMMADurationUpdater(); |
|
38 |
|
39 private: // Construction |
|
40 CMMADurationUpdater(CMMAPlayer& aPlayer); |
|
41 void ConstructL(); |
|
42 |
|
43 public: // from MMMAPlayerStateListener |
|
44 virtual void StateChanged(TInt aState); |
|
45 |
|
46 private: // Data |
|
47 |
|
48 /* The player which is monitored for duration changes */ |
|
49 CMMAPlayer& iPlayer; |
|
50 |
|
51 /* Last obtained duration value */ |
|
52 TInt iDuration; |
|
53 |
|
54 // to avoid event posting with streamable medias after first start |
|
55 TBool iSecondStart; |
|
56 }; |
|
57 |
|
58 #endif // CMMADURATIONUPDATER_H |
|