|
1 /* |
|
2 * Copyright (c) 2005 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: Definition of the S60 Audio Player event monitor |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPLAYEREVENTDISPATCHER_H__ |
|
19 #define __CPLAYEREVENTDISPATCHER_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32std.h> |
|
23 |
|
24 #include "MS60AudioPlayerObserver.h" |
|
25 #include "S60AudioPlayer.h" |
|
26 |
|
27 |
|
28 /** |
|
29 Active object utility class to allow the callback to be called asynchronously. |
|
30 This should help prevent re-entrant code in clients of the mediaframework. |
|
31 */ |
|
32 class CPlayerEventDispatcher : public CActive |
|
33 |
|
34 { |
|
35 |
|
36 enum TPlayerEvent |
|
37 { |
|
38 EAddSourceComplete = 1, |
|
39 EStateChanged, |
|
40 EFastForwardSupportChanged, |
|
41 ERewindSupportChanged, |
|
42 EDurationChanged, |
|
43 }; |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CPlayerEventDispatcher* NewL(MS60AudioPlayerObserver& aObserver); |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 virtual ~CPlayerEventDispatcher(); |
|
55 |
|
56 /** |
|
57 * Callback for the App that AddSource is complete |
|
58 * @since Series 60 3.1 |
|
59 * @param aError One of the Standard Error Codes |
|
60 */ |
|
61 void AddSourceComplete(TInt aError); |
|
62 |
|
63 /** |
|
64 * Callback for the App that the Player State Changed |
|
65 * @since Series 60 3.1 |
|
66 * @param aState Resulting State after the change |
|
67 * @param aError One of the Standard Error Codes |
|
68 */ |
|
69 void StateChanged(TPlayerState aState, TInt aError); |
|
70 |
|
71 /** |
|
72 * Used to Indiacate the FastForward Support change |
|
73 * @since Series 60 3.1 |
|
74 */ |
|
75 void FastForwardSupportChanged(); |
|
76 |
|
77 /** |
|
78 * Used to Indiacate the Rewind Support change |
|
79 * @since Series 60 3.1 |
|
80 */ |
|
81 void RewindSupportChanged(); |
|
82 |
|
83 /** |
|
84 * Callback for the App that the Duration changed |
|
85 * @since Series 60 3.1 |
|
86 * @param aDuration The New Duration After the Change |
|
87 */ |
|
88 void DurationChanged(const TTimeIntervalMicroSeconds& aDuration); |
|
89 |
|
90 private: |
|
91 CPlayerEventDispatcher(MS60AudioPlayerObserver& aObserver); |
|
92 void ConstructL(); |
|
93 void RunL(); |
|
94 void DoCancel(); |
|
95 |
|
96 private: |
|
97 |
|
98 MS60AudioPlayerObserver* iObserver; |
|
99 TInt iError; |
|
100 TTimeIntervalMicroSeconds iDuration; |
|
101 TPlayerEvent iPlayerEvent; |
|
102 TPlayerState iPlayerState; |
|
103 }; |
|
104 |
|
105 #endif //__CPLAYEREVENTDISPATCHER_H__ |
|
106 |
|
107 // End of File |