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