81 // Receives event on accessory mode change. |
81 // Receives event on accessory mode change. |
82 // |
82 // |
83 // ----------------------------------------------------------------------------- |
83 // ----------------------------------------------------------------------------- |
84 // |
84 // |
85 void CTelDMAudioAccessoryListener::AvailableOutputsChanged( CTelephonyAudioRouting& |
85 void CTelDMAudioAccessoryListener::AvailableOutputsChanged( CTelephonyAudioRouting& |
86 aTelephonyAudioRouting ) |
86 aTelephonyAudioRouting ) |
87 { |
87 { |
88 FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged<" ) ) |
88 FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged<" ) ) |
89 iOutputArray.Reset(); |
89 iOutputArray.Reset(); |
90 |
90 |
91 TArray<CTelephonyAudioRouting::TAudioOutput> availableOutputs |
91 TArray<CTelephonyAudioRouting::TAudioOutput> availableOutputs |
92 = aTelephonyAudioRouting.AvailableOutputs(); |
92 = aTelephonyAudioRouting.AvailableOutputs(); |
93 |
93 |
94 // Stores available output |
94 // Stores available output |
95 for ( TInt i=0; i< availableOutputs.Count();i++ ) |
95 for ( TInt i=0; i< availableOutputs.Count();i++ ) |
96 { |
96 { |
97 iOutputArray.Append( availableOutputs[i] ); |
97 iOutputArray.Append( availableOutputs[i] ); |
98 } |
98 } |
99 |
99 |
100 FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged>" ) ) |
100 FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged>" ) ) |
101 } |
101 } |
102 // ----------------------------------------------------------------------------- |
102 // ----------------------------------------------------------------------------- |
103 // CTelDMAudioAccessoryListener::OutputChanged |
103 // CTelDMAudioAccessoryListener::OutputChanged |
104 // |
104 // |
105 // ----------------------------------------------------------------------------- |
105 // ----------------------------------------------------------------------------- |
106 // |
106 // |
107 void CTelDMAudioAccessoryListener::OutputChanged( CTelephonyAudioRouting& |
107 void CTelDMAudioAccessoryListener::OutputChanged( CTelephonyAudioRouting& |
108 aTelephonyAudioRouting) |
108 aTelephonyAudioRouting) |
109 { |
109 { |
110 FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged<" ) ) |
110 FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged<" ) ) |
111 CTelephonyAudioRouting::TAudioOutput output = aTelephonyAudioRouting.Output(); |
111 CTelephonyAudioRouting::TAudioOutput output = aTelephonyAudioRouting.Output(); |
112 |
112 |
113 switch ( output ) |
113 switch ( output ) |
114 { |
114 { |
115 // No active outputs available |
115 // No active outputs available |
116 case CTelephonyAudioRouting::ENone: |
116 case CTelephonyAudioRouting::ENone: |
117 iIsActiveAccessory = EFalse; |
117 iIsActiveAccessory = EFalse; |
118 break; |
118 break; |
119 case CTelephonyAudioRouting::EHandset: |
119 case CTelephonyAudioRouting::EHandset: |
120 iIsActiveAccessory = EFalse; |
120 iIsActiveAccessory = EFalse; |
121 break; |
121 break; |
122 case CTelephonyAudioRouting::ELoudspeaker: |
122 case CTelephonyAudioRouting::ELoudspeaker: |
123 iIsActiveAccessory = EFalse; |
123 iIsActiveAccessory = EFalse; |
124 break; |
124 break; |
125 // Active outputs available |
125 // Active outputs available |
126 case CTelephonyAudioRouting::EWiredAudioAccessory: |
126 case CTelephonyAudioRouting::EWiredAudioAccessory: |
127 iIsActiveAccessory = ETrue; |
127 iIsActiveAccessory = ETrue; |
128 break; |
128 break; |
129 case CTelephonyAudioRouting::EBTAudioAccessory: |
129 case CTelephonyAudioRouting::EBTAudioAccessory: |
130 iIsActiveAccessory = ETrue; |
130 iIsActiveAccessory = ETrue; |
131 break; |
131 break; |
132 case CTelephonyAudioRouting::ETTY: |
132 case CTelephonyAudioRouting::ETTY: |
133 iIsActiveAccessory = ETrue; |
133 iIsActiveAccessory = ETrue; |
134 break; |
134 break; |
135 default: |
135 default: |
136 break; |
136 break; |
137 } |
137 } |
138 FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged =%d"), |
138 FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged =%d"), |
139 iIsActiveAccessory )) |
139 iIsActiveAccessory )) |
140 FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged>" ) ) |
140 FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged>" ) ) |
141 } |
141 } |
142 // ----------------------------------------------------------------------------- |
142 // ----------------------------------------------------------------------------- |
143 // CTelDMAudioAccessoryListener::SetOutputComplete |
143 // CTelDMAudioAccessoryListener::SetOutputComplete |
144 // |
144 // |
145 // ----------------------------------------------------------------------------- |
145 // ----------------------------------------------------------------------------- |
146 // |
146 // |
147 void CTelDMAudioAccessoryListener::SetOutputComplete( CTelephonyAudioRouting& |
147 void CTelDMAudioAccessoryListener::SetOutputComplete( CTelephonyAudioRouting& |
148 /*aTelephonyAudioRouting*/, |
148 /*aTelephonyAudioRouting*/, |
149 TInt /*aError*/) |
149 TInt /*aError*/) |
150 { |
150 { |
151 |
151 |
152 } |
152 } |
153 |
153 |
154 // ----------------------------------------------------------------------------- |
154 // ----------------------------------------------------------------------------- |
155 // CTelDMAudioAccessoryListener::IsAnyActiveAccessory |
155 // CTelDMAudioAccessoryListener::IsAnyActiveAccessory |
156 // |
156 // |
157 // ----------------------------------------------------------------------------- |
157 // ----------------------------------------------------------------------------- |
158 // |
158 // |
159 TBool CTelDMAudioAccessoryListener::IsAnyActiveAccessory() |
159 TBool CTelDMAudioAccessoryListener::IsAnyActiveAccessory() |
160 { |
160 { |
161 FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::IsAnyActiveAccessory =%d"), |
161 FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::IsAnyActiveAccessory =%d"), |
162 iIsActiveAccessory )) |
162 iIsActiveAccessory )) |
163 return iIsActiveAccessory; |
163 return iIsActiveAccessory; |
164 } |
164 } |
165 |
165 |
166 // ----------------------------------------------------------------------------- |
166 // ----------------------------------------------------------------------------- |
167 // CTelDMAudioAccessoryListener::IsAccessoryAttached |
167 // CTelDMAudioAccessoryListener::IsAccessoryAttached |
168 // |
168 // |
169 // ----------------------------------------------------------------------------- |
169 // ----------------------------------------------------------------------------- |
170 // |
170 // |
171 TBool CTelDMAudioAccessoryListener::IsAccessoryAttached() |
171 TBool CTelDMAudioAccessoryListener::IsAccessoryAttached() |
172 { |
172 { |
173 |
173 |
174 TBool accessroryAttached = EFalse; |
174 TBool accessroryAttached = EFalse; |
175 |
175 |
176 for ( TInt i=0; i < iOutputArray.Count();i++ ) |
176 for ( TInt i=0; i < iOutputArray.Count();i++ ) |
177 { |
177 { |
178 if ( iOutputArray[i] == CTelephonyAudioRouting::EWiredAudioAccessory || |
178 if ( iOutputArray[i] == CTelephonyAudioRouting::EWiredAudioAccessory || |
179 iOutputArray[i] == CTelephonyAudioRouting::EBTAudioAccessory || |
179 iOutputArray[i] == CTelephonyAudioRouting::EBTAudioAccessory || |
180 iOutputArray[i] == CTelephonyAudioRouting::ETTY ) |
180 iOutputArray[i] == CTelephonyAudioRouting::ETTY ) |
181 { |
181 { |
182 accessroryAttached = ETrue; |
182 accessroryAttached = ETrue; |
183 break; |
183 break; |
184 } |
184 } |
185 } |
185 } |
186 FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::IsAccessoryAttached =%d"), |
186 FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::IsAccessoryAttached =%d"), |
187 accessroryAttached )) |
187 accessroryAttached )) |
188 return accessroryAttached; |
188 return accessroryAttached; |
189 } |
189 } |
190 |
190 |
191 // End of file |
191 // End of file |