29 TUid KCRUidTmseffects = {0x10207C80}; |
29 TUid KCRUidTmseffects = {0x10207C80}; |
30 const TUint32 KTmsEarPieceVolume = 0x00000001; |
30 const TUint32 KTmsEarPieceVolume = 0x00000001; |
31 const TUint32 KTmsLoudSpkrVolume = 0x00000002; |
31 const TUint32 KTmsLoudSpkrVolume = 0x00000002; |
32 |
32 |
33 // ----------------------------------------------------------------------------- |
33 // ----------------------------------------------------------------------------- |
34 // GlobalEffectsSettings::GlobalEffectsSettings |
34 // TMSGlobalEffectsSettings::TMSGlobalEffectsSettings |
35 // C++ default constructor can NOT contain any code, that |
35 // C++ default constructor can NOT contain any code, that |
36 // might leave. |
36 // might leave. |
37 // ----------------------------------------------------------------------------- |
37 // ----------------------------------------------------------------------------- |
38 // |
38 // |
39 GlobalEffectsSettings::GlobalEffectsSettings() : |
39 TMSGlobalEffectsSettings::TMSGlobalEffectsSettings() : |
40 iGain(KDefaultGain), |
40 iGain(KDefaultGain), |
41 iMaxVolume(KDefaultMaxVolume), |
41 iMaxVolume(KDefaultMaxVolume), |
42 iMaxGain(KDefaultMaxGain), |
42 iMaxGain(KDefaultMaxGain), |
43 iEarVolume(KDefaultVolume), |
43 iEarVolume(KDefaultVolume), |
44 iLoudSpkrVolume(KDefaultVolume) |
44 iLoudSpkrVolume(KDefaultVolume) |
45 { |
45 { |
46 } |
46 } |
47 |
47 |
48 // ----------------------------------------------------------------------------- |
48 // ----------------------------------------------------------------------------- |
49 // GlobalEffectsSettings::ConstructL |
49 // TMSGlobalEffectsSettings::ConstructL |
50 // Symbian 2nd phase constructor can leave. |
50 // Symbian 2nd phase constructor can leave. |
51 // ----------------------------------------------------------------------------- |
51 // ----------------------------------------------------------------------------- |
52 // |
52 // |
53 void GlobalEffectsSettings::ConstructL() |
53 void TMSGlobalEffectsSettings::ConstructL() |
54 { |
54 { |
55 // Create repository instance |
55 // Create repository instance |
56 iRepository = CRepository::NewL(KCRUidTmseffects); |
56 iRepository = CRepository::NewL(KCRUidTmseffects); |
57 if (iRepository) |
57 if (iRepository) |
58 { |
58 { |
60 iRepository->Get(KTmsEarPieceVolume, iEarVolume); |
60 iRepository->Get(KTmsEarPieceVolume, iEarVolume); |
61 } |
61 } |
62 } |
62 } |
63 |
63 |
64 // ----------------------------------------------------------------------------- |
64 // ----------------------------------------------------------------------------- |
65 // GlobalEffectsSettings::NewL |
65 // TMSGlobalEffectsSettings::NewL |
66 // Two-phased constructor. |
66 // Two-phased constructor. |
67 // ----------------------------------------------------------------------------- |
67 // ----------------------------------------------------------------------------- |
68 // |
68 // |
69 GlobalEffectsSettings* GlobalEffectsSettings::NewL() |
69 TMSGlobalEffectsSettings* TMSGlobalEffectsSettings::NewL() |
70 { |
70 { |
71 GlobalEffectsSettings* self = new (ELeave) GlobalEffectsSettings(); |
71 TMSGlobalEffectsSettings* self = new (ELeave) TMSGlobalEffectsSettings(); |
72 CleanupStack::PushL(self); |
72 CleanupStack::PushL(self); |
73 self->ConstructL(); |
73 self->ConstructL(); |
74 CleanupStack::Pop(self); |
74 CleanupStack::Pop(self); |
75 return self; |
75 return self; |
76 } |
76 } |
77 |
77 |
78 // Destructor |
78 // Destructor |
79 GlobalEffectsSettings::~GlobalEffectsSettings() |
79 TMSGlobalEffectsSettings::~TMSGlobalEffectsSettings() |
80 { |
80 { |
81 delete iRepository; |
81 delete iRepository; |
82 } |
82 } |
83 |
83 |
84 // ----------------------------------------------------------------------------- |
84 // ----------------------------------------------------------------------------- |
85 // GlobalEffectsSettings::SetLoudSpkrVolume |
85 // TMSGlobalEffectsSettings::SetLoudSpkrVolume |
86 // ----------------------------------------------------------------------------- |
86 // ----------------------------------------------------------------------------- |
87 // |
87 // |
88 void GlobalEffectsSettings::SetLoudSpkrVolume(TInt aVolume) |
88 void TMSGlobalEffectsSettings::SetLoudSpkrVolume(TInt aVolume) |
89 { |
89 { |
90 TInt status(KErrNone); |
90 TInt status(KErrNone); |
91 if (iRepository) |
91 if (iRepository) |
92 { |
92 { |
93 status = iRepository->Set(KTmsLoudSpkrVolume, aVolume); |
93 status = iRepository->Set(KTmsLoudSpkrVolume, aVolume); |
97 } |
97 } |
98 } |
98 } |
99 } |
99 } |
100 |
100 |
101 // ----------------------------------------------------------------------------- |
101 // ----------------------------------------------------------------------------- |
102 // GlobalEffectsSettings::SetEarPieceVolume |
102 // TMSGlobalEffectsSettings::SetEarPieceVolume |
103 // ----------------------------------------------------------------------------- |
103 // ----------------------------------------------------------------------------- |
104 // |
104 // |
105 void GlobalEffectsSettings::SetEarPieceVolume(TInt aVolume) |
105 void TMSGlobalEffectsSettings::SetEarPieceVolume(TInt aVolume) |
106 { |
106 { |
107 TInt status(KErrNone); |
107 TInt status(KErrNone); |
108 if (iRepository) |
108 if (iRepository) |
109 { |
109 { |
110 status = iRepository->Set(KTmsEarPieceVolume, aVolume); |
110 status = iRepository->Set(KTmsEarPieceVolume, aVolume); |
114 } |
114 } |
115 } |
115 } |
116 } |
116 } |
117 |
117 |
118 // ----------------------------------------------------------------------------- |
118 // ----------------------------------------------------------------------------- |
119 // GlobalEffectsSettings::GetLoudSpkrVolume |
119 // TMSGlobalEffectsSettings::GetLoudSpkrVolume |
120 // ----------------------------------------------------------------------------- |
120 // ----------------------------------------------------------------------------- |
121 // |
121 // |
122 void GlobalEffectsSettings::GetLoudSpkrVolume(TInt& aVolume) |
122 void TMSGlobalEffectsSettings::GetLoudSpkrVolume(TInt& aVolume) |
123 { |
123 { |
124 aVolume = iLoudSpkrVolume; |
124 aVolume = iLoudSpkrVolume; |
125 } |
125 } |
126 |
126 |
127 // ----------------------------------------------------------------------------- |
127 // ----------------------------------------------------------------------------- |
128 // GlobalEffectsSettings::GetEarPieceVolume |
128 // TMSGlobalEffectsSettings::GetEarPieceVolume |
129 // ----------------------------------------------------------------------------- |
129 // ----------------------------------------------------------------------------- |
130 // |
130 // |
131 void GlobalEffectsSettings::GetEarPieceVolume(TInt& aVolume) |
131 void TMSGlobalEffectsSettings::GetEarPieceVolume(TInt& aVolume) |
132 { |
132 { |
133 aVolume = iEarVolume; |
133 aVolume = iEarVolume; |
134 } |
134 } |
135 |
135 |
136 // ----------------------------------------------------------------------------- |
136 // ----------------------------------------------------------------------------- |
137 // GlobalEffectsSettings::MaxVolume |
137 // TMSGlobalEffectsSettings::MaxVolume |
138 // ----------------------------------------------------------------------------- |
138 // ----------------------------------------------------------------------------- |
139 // |
139 // |
140 TInt GlobalEffectsSettings::MaxVolume() const |
140 TInt TMSGlobalEffectsSettings::MaxVolume() const |
141 { |
141 { |
142 return iMaxVolume; |
142 return iMaxVolume; |
143 } |
143 } |
144 |
144 |
145 // ----------------------------------------------------------------------------- |
145 // ----------------------------------------------------------------------------- |
146 // GlobalEffectsSettings::SetGain |
146 // TMSGlobalEffectsSettings::SetGain |
147 // ----------------------------------------------------------------------------- |
147 // ----------------------------------------------------------------------------- |
148 // |
148 // |
149 void GlobalEffectsSettings::SetGain(TInt aGain) |
149 void TMSGlobalEffectsSettings::SetGain(TInt aGain) |
150 { |
150 { |
151 iGain = aGain; |
151 iGain = aGain; |
152 } |
152 } |
153 |
153 |
154 // ----------------------------------------------------------------------------- |
154 // ----------------------------------------------------------------------------- |
155 // GlobalEffectsSettings::Gain |
155 // TMSGlobalEffectsSettings::Gain |
156 // ----------------------------------------------------------------------------- |
156 // ----------------------------------------------------------------------------- |
157 // |
157 // |
158 TInt GlobalEffectsSettings::Gain() const |
158 TInt TMSGlobalEffectsSettings::Gain() const |
159 { |
159 { |
160 return iGain; |
160 return iGain; |
161 } |
161 } |
162 |
162 |
163 // ----------------------------------------------------------------------------- |
163 // ----------------------------------------------------------------------------- |
164 // GlobalEffectsSettings::MaxGain |
164 // TMSGlobalEffectsSettings::MaxGain |
165 // ----------------------------------------------------------------------------- |
165 // ----------------------------------------------------------------------------- |
166 // |
166 // |
167 TInt GlobalEffectsSettings::MaxGain() const |
167 TInt TMSGlobalEffectsSettings::MaxGain() const |
168 { |
168 { |
169 return iMaxGain; |
169 return iMaxGain; |
170 } |
170 } |
171 |
171 |
172 // End of File |
172 // End of File |