1 /* |
|
2 * Copyright (c) 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: Audio Player Controller |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAM_AUDIOPLAYERCONTROLLER_H |
|
20 #define CAM_AUDIOPLAYERCONTROLLER_H |
|
21 |
|
22 // =========================================================================== |
|
23 // Includes |
|
24 #include <e32base.h> |
|
25 #include "CamControllerObservers.h" |
|
26 #include "mcamsettingsmodelobserver.h" |
|
27 |
|
28 // =========================================================================== |
|
29 // Forward declarations |
|
30 class CAknKeySoundSystem; |
|
31 class CCamAppController; |
|
32 class MCamAudioPlayerObserver; |
|
33 class CCamPlayerWrapperBase; |
|
34 |
|
35 // =========================================================================== |
|
36 // Class definitions |
|
37 |
|
38 /** |
|
39 * Audio Player Controller class |
|
40 * |
|
41 * Controls tone and audio players and caches needed |
|
42 * players based on Camera capture mode to enable |
|
43 * fast playing of needed sounds/tones. |
|
44 * |
|
45 */ |
|
46 class CCamAudioPlayerController : public CBase, |
|
47 public MCamControllerObserver, |
|
48 public MCamSettingsModelObserver |
|
49 { |
|
50 // ======================================================= |
|
51 // Methods |
|
52 |
|
53 // ------------------------------------------------------- |
|
54 // constructors and destructor |
|
55 public: |
|
56 |
|
57 static CCamAudioPlayerController* NewL( CCamAppController& aController, |
|
58 MCamPlayerObserver& aObserver ); |
|
59 virtual ~CCamAudioPlayerController(); |
|
60 |
|
61 // ------------------------------------------------------- |
|
62 // from MCamControllerObserver |
|
63 public: |
|
64 |
|
65 virtual void HandleControllerEventL( TCamControllerEvent aEvent, TInt aStatus ); |
|
66 |
|
67 // ------------------------------------------------------- |
|
68 // from MCamSettingsModelObserver |
|
69 public: |
|
70 |
|
71 virtual void IntSettingChangedL ( TCamSettingItemIds aSettingItem, TInt aSettingValue ); |
|
72 virtual void TextSettingChangedL( TCamSettingItemIds aSettingItem, const TDesC& aSettingValue ); |
|
73 |
|
74 // ------------------------------------------------------- |
|
75 // new public |
|
76 public: |
|
77 |
|
78 /** |
|
79 * @param aCallback If set ETrue, calling method this results in one |
|
80 * callback to MCamAudioPlayerObserver::PlayComplete |
|
81 */ |
|
82 void PlaySound( TInt aSoundId, |
|
83 TBool aCallback ); |
|
84 |
|
85 /** |
|
86 * Cancel all ongoing playing activity. |
|
87 */ |
|
88 void CancelAllPlaying(); |
|
89 |
|
90 /** |
|
91 * Cancel given sound playing, if ongoing. |
|
92 * @aSoundId Id of the sound to be cancelled. |
|
93 */ |
|
94 void CancelPlaying( TInt aSoundId ); |
|
95 |
|
96 void InitKeySoundSystem(); |
|
97 void EnableAllKeySounds(); |
|
98 void DisableAllKeySoundsL(); |
|
99 |
|
100 |
|
101 // ------------------------------------------------------- |
|
102 // new private |
|
103 private: |
|
104 |
|
105 TInt FindPlayerIndex( TInt aSoundId ) const; |
|
106 CCamPlayerWrapperBase* GetPlayerL ( TInt aSoundId ); |
|
107 void RemovePlayer ( TInt aSoundId ); |
|
108 |
|
109 void Setup( TCamCameraMode aCameraMode ); |
|
110 void SetupForVideoL(); |
|
111 void SetupForImageL(); |
|
112 void SetupCaptureSoundPlayerL( TInt aNewSoundId ); |
|
113 void Reset(); |
|
114 |
|
115 // ------------------------------------------------------- |
|
116 // private constructors |
|
117 private: |
|
118 |
|
119 void ConstructL(); |
|
120 |
|
121 CCamAudioPlayerController( CCamAppController& aController, |
|
122 MCamPlayerObserver& aObserver ); |
|
123 |
|
124 // ======================================================= |
|
125 // Data |
|
126 private: |
|
127 |
|
128 CCamAppController& iController; |
|
129 MCamPlayerObserver& iObserver; |
|
130 |
|
131 RPointerArray<CCamPlayerWrapperBase> iPlayers; |
|
132 |
|
133 TInt iCameraMode; // TCamCameraMode value |
|
134 TInt iCaptureSoundId; // Sound id or -1 if not set |
|
135 |
|
136 CAknKeySoundSystem* iKeySoundSystem; // not own |
|
137 TBool iKeySoundsDisabled; |
|
138 |
|
139 // ======================================================= |
|
140 }; |
|
141 |
|
142 #endif // CAM_AUDIOPLAYERCONTROLLER_H |
|
143 |
|
144 // =========================================================================== |
|
145 // end of file |
|
146 |
|
147 |
|