905 // This base class method should never be called. |
905 // This base class method should never be called. |
906 } |
906 } |
907 |
907 |
908 void CAknSynthSoundInfo::InitL() |
908 void CAknSynthSoundInfo::InitL() |
909 { |
909 { |
910 // Keyclicks are played with a statically reserved CMdaAudioToneUtility. |
910 #if 0 |
|
911 // Keyclicks are played with a statically reserved CMdaAudioToneUtility. |
911 // Same concerns also error tones (this is a hack to avoid an endless error dialog |
912 // Same concerns also error tones (this is a hack to avoid an endless error dialog |
912 // loop because of audio server crash). |
913 // loop because of audio server crash). |
913 if ((iPriority == EAvkonKeyClickPriority && iPreference == KKeyClickPreference) || |
914 if ((iPriority == EAvkonKeyClickPriority && iPreference == KKeyClickPreference) || |
914 (iPriority == EAvkonErrorNotePriority && iPreference == EAvkonErrorNotePreference)) |
915 (iPriority == EAvkonErrorNotePriority && iPreference == EAvkonErrorNotePreference)) |
915 { |
916 { |
917 |
918 |
918 iPlayedStatically = ETrue; |
919 iPlayedStatically = ETrue; |
919 iToneObserver = CAknEikAudioToneObserver::NewL(*this); |
920 iToneObserver = CAknEikAudioToneObserver::NewL(*this); |
920 iTonePlayer = CMdaAudioToneUtility::NewL(*iToneObserver, NULL); // Synchronous |
921 iTonePlayer = CMdaAudioToneUtility::NewL(*iToneObserver, NULL); // Synchronous |
921 } |
922 } |
|
923 #endif |
922 } |
924 } |
923 |
925 |
924 void CAknSynthSoundInfo::PlayL() |
926 void CAknSynthSoundInfo::PlayL() |
925 { |
927 { |
926 LOGTEXT(_L("CAknSynthSoundInfo::PlayL().")); |
928 LOGTEXT(_L("CAknSynthSoundInfo::PlayL().")); |
927 LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference); |
929 LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference); |
928 |
930 #if 0 |
929 // Stops playing and deletes instances if they exist. |
931 // Stops playing and deletes instances if they exist. |
930 Stop(); |
932 Stop(); |
931 |
933 |
932 if (!iPlayedStatically) |
934 if (!iPlayedStatically) |
933 { |
935 { |
936 iTonePlayer = CMdaAudioToneUtility::NewL(*iToneObserver, NULL); // Synchronous |
938 iTonePlayer = CMdaAudioToneUtility::NewL(*iToneObserver, NULL); // Synchronous |
937 } |
939 } |
938 |
940 |
939 // Prepare to play either a tone or a sequence depending on subclass. |
941 // Prepare to play either a tone or a sequence depending on subclass. |
940 Prepare(); |
942 Prepare(); |
|
943 #endif |
941 } |
944 } |
942 |
945 |
943 void CAknSynthSoundInfo::DoPlay() |
946 void CAknSynthSoundInfo::DoPlay() |
944 { |
947 { |
945 LOGTEXT(_L("CAknSynthSoundInfo::DoPlay().")); |
948 LOGTEXT(_L("CAknSynthSoundInfo::DoPlay().")); |
946 LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference); |
949 LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference); |
947 |
950 #if 0 |
948 if (iTonePlayer->State() == EMdaAudioToneUtilityPrepared) |
951 if (iTonePlayer->State() == EMdaAudioToneUtilityPrepared) |
949 { |
952 { |
950 LOGTEXT(_L(" CAknSynthSoundInfo::DoPlay(). Prepare successful, play.")); |
953 LOGTEXT(_L(" CAknSynthSoundInfo::DoPlay(). Prepare successful, play.")); |
951 |
954 |
952 iTonePlayer->SetPriority(iPriority,(TMdaPriorityPreference)iPreference); |
955 iTonePlayer->SetPriority(iPriority,(TMdaPriorityPreference)iPreference); |
969 iTonePlayer = NULL; |
972 iTonePlayer = NULL; |
970 delete iToneObserver; |
973 delete iToneObserver; |
971 iToneObserver = NULL; |
974 iToneObserver = NULL; |
972 } |
975 } |
973 } |
976 } |
|
977 #endif |
974 } |
978 } |
975 |
979 |
976 void CAknSynthSoundInfo::Stop() |
980 void CAknSynthSoundInfo::Stop() |
977 { |
981 { |
978 LOGTEXT(_L("CAknSynthSoundInfo::Stop().")); |
982 LOGTEXT(_L("CAknSynthSoundInfo::Stop().")); |
979 LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference); |
983 LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference); |
980 |
984 #if 0 |
981 // Stop playing and delete tone player if it exists. |
985 // Stop playing and delete tone player if it exists. |
982 if (iTonePlayer) |
986 if (iTonePlayer) |
983 { |
987 { |
984 LOGTEXT(_L(" CAknSynthSoundInfo::Stop(). iTonePlayer exists.")); |
988 LOGTEXT(_L(" CAknSynthSoundInfo::Stop(). iTonePlayer exists.")); |
985 |
989 |
1070 } |
1076 } |
1071 |
1077 |
1072 void CAknToneSoundInfo::Prepare() |
1078 void CAknToneSoundInfo::Prepare() |
1073 { |
1079 { |
1074 LOGTEXT(_L("CAknToneSoundInfo::Prepare().")); |
1080 LOGTEXT(_L("CAknToneSoundInfo::Prepare().")); |
1075 |
1081 #if 0 |
1076 // Prepare |
1082 // Prepare |
1077 iTonePlayer->PrepareToPlayTone(iFrequency, iMs); |
1083 iTonePlayer->PrepareToPlayTone(iFrequency, iMs); |
|
1084 #endif |
1078 } |
1085 } |
1079 |
1086 |
1080 |
1087 |
1081 // ===================================== |
1088 // ===================================== |
1082 // CAknSequenceSoundInfo implementation. |
1089 // CAknSequenceSoundInfo implementation. |
1140 |
1148 |
1141 void CAknFileSoundInfo::PlayL() |
1149 void CAknFileSoundInfo::PlayL() |
1142 { |
1150 { |
1143 LOGTEXT(_L("CAknFileSoundInfo::PlayL().")); |
1151 LOGTEXT(_L("CAknFileSoundInfo::PlayL().")); |
1144 LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference); |
1152 LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference); |
1145 |
1153 #if 0 |
1146 // Stops playing and deletes audio player instance if it exist. |
1154 // Stops playing and deletes audio player instance if it exist. |
1147 Stop(); |
1155 Stop(); |
1148 |
1156 |
1149 // Create audio player. DoPlay() will be called in all circumstances. |
1157 // Create audio player. DoPlay() will be called in all circumstances. |
1150 iAudioPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this, iPriority,(TMdaPriorityPreference)iPreference ); |
1158 iAudioPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this, iPriority,(TMdaPriorityPreference)iPreference ); |
|
1159 #endif |
1151 LOGTEXT(_L(" CAknFileSoundInfo::PlayL() - Exit")); |
1160 LOGTEXT(_L(" CAknFileSoundInfo::PlayL() - Exit")); |
1152 } |
1161 } |
1153 |
1162 |
1154 |
1163 |
1155 void CAknFileSoundInfo::DoPlay() |
1164 void CAknFileSoundInfo::DoPlay() |
1156 { |
1165 { |
1157 LOGTEXT(_L("CAknFileSoundInfo::DoPlay().")); |
1166 LOGTEXT(_L("CAknFileSoundInfo::DoPlay().")); |
1158 |
1167 #if 0 |
1159 if (iPrepared) |
1168 if (iPrepared) |
1160 { |
1169 { |
1161 LOGTEXT(_L(" CAknFileSoundInfo::DoPlay(). Prepared succesfull, play.")); |
1170 LOGTEXT(_L(" CAknFileSoundInfo::DoPlay(). Prepared succesfull, play.")); |
1162 |
1171 |
1163 // No need to set priority. It is already set in NewDesPlayerReadOnlyL(). |
1172 // No need to set priority. It is already set in NewDesPlayerReadOnlyL(). |
1176 LOGTEXT(_L(" CAknFileSoundInfo::DoPlay(). Deleting iAudioPlayer.")); |
1185 LOGTEXT(_L(" CAknFileSoundInfo::DoPlay(). Deleting iAudioPlayer.")); |
1177 |
1186 |
1178 delete iAudioPlayer; |
1187 delete iAudioPlayer; |
1179 iAudioPlayer = NULL; |
1188 iAudioPlayer = NULL; |
1180 } |
1189 } |
|
1190 #endif |
1181 } |
1191 } |
1182 |
1192 |
1183 |
1193 |
1184 void CAknFileSoundInfo::Stop() |
1194 void CAknFileSoundInfo::Stop() |
1185 { |
1195 { |
1186 LOGTEXT(_L("CAknFileSoundInfo::Stop().")); |
1196 LOGTEXT(_L("CAknFileSoundInfo::Stop().")); |
1187 |
1197 #if 0 |
1188 // Stop playing and delete audio player if it exists. |
1198 // Stop playing and delete audio player if it exists. |
1189 if (iAudioPlayer) |
1199 if (iAudioPlayer) |
1190 { |
1200 { |
1191 LOGTEXT(_L(" CAknFileSoundInfo::Stop(). iAudioPlayer exists.")); |
1201 LOGTEXT(_L(" CAknFileSoundInfo::Stop(). iAudioPlayer exists.")); |
1192 |
1202 |
1202 |
1212 |
1203 delete iAudioPlayer; |
1213 delete iAudioPlayer; |
1204 iAudioPlayer = NULL; |
1214 iAudioPlayer = NULL; |
1205 iPrepared = EFalse; |
1215 iPrepared = EFalse; |
1206 } |
1216 } |
|
1217 #endif |
1207 } |
1218 } |
1208 |
1219 |
1209 void CAknFileSoundInfo::MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, |
1220 void CAknFileSoundInfo::MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, |
1210 TInt /*aCurrentState*/, TInt /*aErrorCode*/) |
1221 TInt /*aCurrentState*/, TInt /*aErrorCode*/) |
1211 { |
1222 { |
1247 default: //case EKeypadVolumeLoud: |
1258 default: //case EKeypadVolumeLoud: |
1248 volume = max; |
1259 volume = max; |
1249 break; |
1260 break; |
1250 } |
1261 } |
1251 aAudioPlayer->SetVolume(volume); |
1262 aAudioPlayer->SetVolume(volume); |
|
1263 #endif |
1252 } |
1264 } |
1253 |
1265 |
1254 void CAknFileSoundInfo::MapcInitComplete(TInt aError, |
1266 void CAknFileSoundInfo::MapcInitComplete(TInt aError, |
1255 const TTimeIntervalMicroSeconds& /*aDuration*/) |
1267 const TTimeIntervalMicroSeconds& /*aDuration*/) |
1256 { |
1268 { |
1257 LOGTEXT(_L("CAknFileSoundInfo::MapcInitComplete().")); |
1269 LOGTEXT(_L("CAknFileSoundInfo::MapcInitComplete().")); |
1258 LOGTEXT1(_L(" aError:%d"), aError); |
1270 LOGTEXT1(_L(" aError:%d"), aError); |
1259 |
|
1260 if (aError == KErrNone) |
1271 if (aError == KErrNone) |
1261 { |
1272 { |
1262 iPrepared = ETrue; |
1273 iPrepared = ETrue; |
1263 SetVolume(iVolume); |
1274 SetVolume(iVolume); |
1264 } |
1275 } |