57 // Symbian 2nd phase constructor can leave. |
58 // Symbian 2nd phase constructor can leave. |
58 // ----------------------------------------------------------------------------- |
59 // ----------------------------------------------------------------------------- |
59 // |
60 // |
60 void TMSGlobalEffectsSettings::ConstructL() |
61 void TMSGlobalEffectsSettings::ConstructL() |
61 { |
62 { |
|
63 TRACE_PRN_FN_ENT; |
62 // Create repository instance |
64 // Create repository instance |
63 iRepository = CRepository::NewL(KCRUidTmseffects); |
65 iRepository = CRepository::NewL(KCRUidTmseffects); |
64 if (iRepository) |
66 if (iRepository) |
65 { |
67 { |
66 iRepository->Get(KTmsLoudSpkrVolume, iLoudSpkrVolume); |
68 iRepository->Get(KTmsLoudSpkrVolume, iLoudSpkrVolume); |
67 iRepository->Get(KTmsEarPieceVolume, iEarVolume); |
69 iRepository->Get(KTmsEarPieceVolume, iEarVolume); |
68 } |
70 TRACE_PRN_N1(_L("loud spkr vol %d"),iLoudSpkrVolume); |
|
71 TRACE_PRN_N1(_L("ear piece vol %d"),iEarVolume); |
|
72 } |
|
73 TRACE_PRN_FN_EXT; |
69 } |
74 } |
70 |
75 |
71 // ----------------------------------------------------------------------------- |
76 // ----------------------------------------------------------------------------- |
72 // TMSGlobalEffectsSettings::NewL |
77 // TMSGlobalEffectsSettings::NewL |
73 // Two-phased constructor. |
78 // Two-phased constructor. |
92 // TMSGlobalEffectsSettings::SetLoudSpkrVolume |
97 // TMSGlobalEffectsSettings::SetLoudSpkrVolume |
93 // ----------------------------------------------------------------------------- |
98 // ----------------------------------------------------------------------------- |
94 // |
99 // |
95 void TMSGlobalEffectsSettings::SetLoudSpkrVolume(TInt aVolume) |
100 void TMSGlobalEffectsSettings::SetLoudSpkrVolume(TInt aVolume) |
96 { |
101 { |
|
102 TRACE_PRN_FN_ENT; |
97 TInt status(KErrNone); |
103 TInt status(KErrNone); |
98 if (iRepository) |
104 if (iRepository) |
99 { |
105 { |
100 status = iRepository->Set(KTmsLoudSpkrVolume, aVolume); |
106 if (aVolume > 0) |
|
107 { |
|
108 status = iRepository->Set(KTmsLoudSpkrVolume, aVolume); |
|
109 TRACE_PRN_N2(_L("status %d loud spkr vol %d"),status,aVolume); |
|
110 } |
|
111 else |
|
112 { |
|
113 status = iRepository->Set(KTmsLoudSpkrVolume, KDefaultVolume); |
|
114 TRACE_PRN_N(_L("loud spkr level 0 store default")); |
|
115 } |
101 if (status == KErrNone) |
116 if (status == KErrNone) |
102 { |
117 { |
103 iLoudSpkrVolume = aVolume; |
118 iLoudSpkrVolume = aVolume; |
104 } |
119 TRACE_PRN_N1(_L("cached loud spkr vol %d"),iLoudSpkrVolume); |
105 } |
120 } |
|
121 } |
|
122 TRACE_PRN_FN_EXT; |
106 } |
123 } |
107 |
124 |
108 // ----------------------------------------------------------------------------- |
125 // ----------------------------------------------------------------------------- |
109 // TMSGlobalEffectsSettings::SetEarPieceVolume |
126 // TMSGlobalEffectsSettings::SetEarPieceVolume |
110 // ----------------------------------------------------------------------------- |
127 // ----------------------------------------------------------------------------- |
111 // |
128 // |
112 void TMSGlobalEffectsSettings::SetEarPieceVolume(TInt aVolume) |
129 void TMSGlobalEffectsSettings::SetEarPieceVolume(TInt aVolume) |
113 { |
130 { |
|
131 TRACE_PRN_FN_ENT; |
114 TInt status(KErrNone); |
132 TInt status(KErrNone); |
115 if (iRepository) |
133 if (iRepository) |
116 { |
134 { |
117 status = iRepository->Set(KTmsEarPieceVolume, aVolume); |
135 if (aVolume > 0) |
|
136 { |
|
137 status = iRepository->Set(KTmsEarPieceVolume, aVolume); |
|
138 TRACE_PRN_N2(_L("status %d ear vol %d"),status,aVolume); |
|
139 } |
|
140 else |
|
141 { |
|
142 status = iRepository->Set(KTmsEarPieceVolume, KDefaultVolume); |
|
143 TRACE_PRN_N(_L("ear piece vol level 0 store default")); |
|
144 } |
118 if (status == KErrNone) |
145 if (status == KErrNone) |
119 { |
146 { |
120 iEarVolume = aVolume; |
147 iEarVolume = aVolume; |
121 } |
148 TRACE_PRN_N1(_L("cached ear piece vol %d"),iEarVolume); |
122 } |
149 } |
|
150 } |
|
151 TRACE_PRN_FN_EXT; |
123 } |
152 } |
124 |
153 |
125 // ----------------------------------------------------------------------------- |
154 // ----------------------------------------------------------------------------- |
126 // TMSGlobalEffectsSettings::GetLoudSpkrVolume |
155 // TMSGlobalEffectsSettings::GetLoudSpkrVolume |
127 // ----------------------------------------------------------------------------- |
156 // ----------------------------------------------------------------------------- |
128 // |
157 // |
129 void TMSGlobalEffectsSettings::GetLoudSpkrVolume(TInt& aVolume) |
158 void TMSGlobalEffectsSettings::GetLoudSpkrVolume(TInt& aVolume) |
130 { |
159 { |
131 aVolume = iLoudSpkrVolume; |
160 aVolume = iLoudSpkrVolume; |
|
161 TRACE_PRN_N1(_L("TMSGlobalEffectsSettings GetLoudSpkrVolume %d"),aVolume); |
132 } |
162 } |
133 |
163 |
134 // ----------------------------------------------------------------------------- |
164 // ----------------------------------------------------------------------------- |
135 // TMSGlobalEffectsSettings::GetEarPieceVolume |
165 // TMSGlobalEffectsSettings::GetEarPieceVolume |
136 // ----------------------------------------------------------------------------- |
166 // ----------------------------------------------------------------------------- |
137 // |
167 // |
138 void TMSGlobalEffectsSettings::GetEarPieceVolume(TInt& aVolume) |
168 void TMSGlobalEffectsSettings::GetEarPieceVolume(TInt& aVolume) |
139 { |
169 { |
140 aVolume = iEarVolume; |
170 aVolume = iEarVolume; |
|
171 TRACE_PRN_N1(_L("TMSGlobalEffectsSettings GetEarPieceVolume %d"),aVolume); |
141 } |
172 } |
142 |
173 |
143 // ----------------------------------------------------------------------------- |
174 // ----------------------------------------------------------------------------- |
144 // TMSGlobalEffectsSettings::MaxVolume |
175 // TMSGlobalEffectsSettings::MaxVolume |
145 // ----------------------------------------------------------------------------- |
176 // ----------------------------------------------------------------------------- |