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