|
1 /* |
|
2 * Copyright (c) 2004 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 Stubs - Implementation of the bassboost effect Custom Interface class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifdef _DEBUG |
|
20 #include <e32svr.h> // Needed for RDebug Prints |
|
21 #endif |
|
22 |
|
23 #include "ListenerOrientationCI.h" |
|
24 #include <sounddevice.h> |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CListenerOrientation::NewL |
|
28 // Static function for creating an instance of the CListenerOrientationCI object. |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 |
|
32 EXPORT_C CListenerOrientationCI* CListenerOrientationCI::NewL( |
|
33 CMMFDevSound& aDevSound ) |
|
34 { |
|
35 CListenerOrientationCI* self = new(ELeave) CListenerOrientationCI(aDevSound); |
|
36 return self; |
|
37 } |
|
38 |
|
39 CListenerOrientationCI::CListenerOrientationCI( |
|
40 CMMFDevSound& aDevSound ) |
|
41 : iDevSound(&aDevSound) |
|
42 { |
|
43 iOrientationData.iHeading = 10; |
|
44 iOrientationData.iPitch = 10; |
|
45 iOrientationData.iRoll = 10; |
|
46 iOrientationData.iFrontX = 10; |
|
47 iOrientationData.iFrontY = 10; |
|
48 iOrientationData.iFrontZ = 10; |
|
49 iOrientationData.iAboveX = 10; |
|
50 iOrientationData.iAboveY = 10; |
|
51 iOrientationData.iAboveZ = 10; |
|
52 |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CListenerOrientation::NewL |
|
57 // Static function for creating an instance of the CListenerOrientationCI object. |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 |
|
61 EXPORT_C CListenerOrientationCI* CListenerOrientationCI::NewL() |
|
62 { |
|
63 CListenerOrientationCI* self = new(ELeave) CListenerOrientationCI(); |
|
64 return self; |
|
65 } |
|
66 |
|
67 CListenerOrientationCI::CListenerOrientationCI() |
|
68 { |
|
69 iOrientationData.iHeading = 10; |
|
70 iOrientationData.iPitch = 10; |
|
71 iOrientationData.iRoll = 10; |
|
72 iOrientationData.iFrontX = 10; |
|
73 iOrientationData.iFrontY = 10; |
|
74 iOrientationData.iFrontZ = 10; |
|
75 iOrientationData.iAboveX = 10; |
|
76 iOrientationData.iAboveY = 10; |
|
77 iOrientationData.iAboveZ = 10; |
|
78 |
|
79 } |
|
80 |
|
81 // Destructor |
|
82 |
|
83 CListenerOrientationCI::~CListenerOrientationCI() |
|
84 { |
|
85 #ifdef _DEBUG |
|
86 RDebug::Print(_L("CListenerOrientationCI::~CListenerOrientationCI")); |
|
87 #endif |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CListenerOrientationCI::ApplyL |
|
92 // |
|
93 // Applies the bassboost settings. |
|
94 // Adaptation must check each settings and take appropriate actions since |
|
95 // this method might be called after several settings have been made. |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 void CListenerOrientationCI::ApplyL() |
|
99 { |
|
100 #ifdef _DEBUG |
|
101 RDebug::Print(_L("CListenerOrientationCI::ApplyL")); |
|
102 #endif |
|
103 |
|
104 if ( !HaveUpdateRights() ) |
|
105 { |
|
106 User::Leave(KErrAccessDenied); |
|
107 } |
|
108 |
|
109 if ( IsEnabled() ) |
|
110 { |
|
111 } |
|
112 |
|
113 // The effect change event is simulated by changing the bassboost and |
|
114 // sending the observer a message indicating bassboost has changed. |
|
115 // This is done for testing only. |
|
116 |
|
117 // The intention of this callback is to notify the observer when the bassboost |
|
118 // object changes spontaneously. ie the user did not change the settings but |
|
119 // event somewhere in the system causes the bassboost object to change state. |
|
120 |
|
121 if (iObservers.Count() > 0) |
|
122 { |
|
123 iObservers[0]->EffectChanged(this, (TUint8)MListenerOrientationObserver::KSpecificEffectBase); |
|
124 } |
|
125 } |
|
126 |
|
127 |
|
128 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
129 |
|
130 |
|
131 // End of File |