Changeset 545:69f705dbe971 in qutecom-2.2
- Timestamp:
- Feb 27, 2010 4:51:52 PM (3 years ago)
- Branch:
- default
- Children:
- 546:1da8a70fd465, 558:30b0989e5b4e
- Files:
-
- 11 edited
-
libs/sound/src/win32/SoundThread.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCall.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallState.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallState.h (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallStateClosed.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallStateError.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallStateIncoming.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallStateResumed.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallStateRingingStart.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallStateRingingStop.cpp (modified) (1 diff)
-
wengophone/src/model/phonecall/PhoneCallStateTalking.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libs/sound/src/win32/SoundThread.cpp
r0 r545 58 58 59 59 int i = 0; 60 while ((i < _loops || _loops == -1) && !_stop) { 60 while ((i < _loops || _loops == -1) && !_stop) 61 { 61 62 if (!_soundFile.play(_filename)) { 62 63 //If the file cannot be played, stop the thread 63 64 _stop = true; 64 65 } 66 _soundFile.stop(); 65 67 i++; 66 68 } -
wengophone/src/model/phonecall/PhoneCall.cpp
r522 r545 109 109 110 110 void PhoneCall::accept() { 111 PhoneCallState::stopSound IncomingCall();111 PhoneCallState::stopSound(); 112 112 _phoneLine.acceptCall(_callId); 113 113 } -
wengophone/src/model/phonecall/PhoneCallState.cpp
r328 r545 27 27 #include <util/Logger.h> 28 28 29 Sound * PhoneCallState::_sound IncomingCall= NULL;30 Sound * PhoneCallState::_soundCallClosed = NULL;29 Sound * PhoneCallState::_sound = NULL; 30 static RecursiveMutex _mutexSound; 31 31 32 32 PhoneCallState::PhoneCallState() { 33 33 } 34 34 35 void PhoneCallState::stopSoundIncomingCall() { 36 if (_soundIncomingCall) { 37 _soundIncomingCall->stop(); 38 delete _soundIncomingCall; 39 _soundIncomingCall = NULL; 35 void PhoneCallState::stopSound() { 36 RecursiveMutex::ScopedLock scopedLock(_mutexSound); 37 if (_sound) { 38 _sound->stop(); 39 delete _sound; 40 _sound = NULL; 40 41 } 41 42 } 42 43 43 void PhoneCallState::stopSoundCallClosed() { 44 if (_soundCallClosed) { 45 _soundCallClosed->stop(); 46 delete _soundCallClosed; 47 _soundCallClosed = NULL; 44 void PhoneCallState::playSoundIncomingCall() { 45 RecursiveMutex::ScopedLock scopedLock(_mutexSound); 46 Config & config = ConfigManager::getInstance().getCurrentConfig(); 47 stopSound(); 48 49 if (config.getAudioRingingEnable()) 50 { 51 _sound = new Sound(config.getAudioIncomingCallFile()); 52 _sound->setWaveOutDevice(getRingerAudioDevice()); 53 _sound->setLoops(-1); 54 _sound->play(); 48 55 } 49 56 } 50 57 51 std::string PhoneCallState::getSoundIncomingCallFile() { 58 void PhoneCallState::playSoundOutgoingCall() { 59 RecursiveMutex::ScopedLock scopedLock(_mutexSound); 52 60 Config & config = ConfigManager::getInstance().getCurrentConfig(); 53 return config.getAudioIncomingCallFile(); 61 62 stopSound(); 63 if (config.getAudioRingingEnable()) 64 { 65 _sound = new Sound(config.getAudioOutgoingCallFile()); 66 _sound->setWaveOutDevice(getRingerAudioDevice()); 67 _sound->setLoops(-1); 68 _sound->play(); 69 } 54 70 } 55 71 56 std::string PhoneCallState::getSoundOutgoingCallFile() { 72 void PhoneCallState::playSoundDoubleCall() { 73 RecursiveMutex::ScopedLock scopedLock(_mutexSound); 57 74 Config & config = ConfigManager::getInstance().getCurrentConfig(); 58 return config.getAudioOutgoingCallFile(); 75 76 stopSound(); 77 if (config.getAudioRingingEnable()) 78 { 79 _sound = new Sound(config.getAudioDoubleCallFile()); 80 _sound->setWaveOutDevice(getRingerAudioDevice()); 81 _sound->setLoops(1); 82 _sound->play(); 83 } 59 84 } 60 85 61 std::string PhoneCallState::getSoundDoubleCallFile() { 86 void PhoneCallState::playSoundCallClosed() { 87 RecursiveMutex::ScopedLock scopedLock(_mutexSound); 62 88 Config & config = ConfigManager::getInstance().getCurrentConfig(); 63 return config.getAudioDoubleCallFile();64 }65 89 66 std::string PhoneCallState::getSoundCallClosedFile() { 67 Config & config = ConfigManager::getInstance().getCurrentConfig(); 68 return config.getAudioCallClosedFile(); 90 stopSound(); 91 if (config.getAudioRingingEnable()) 92 { 93 _sound = new Sound(config.getAudioCallClosedFile()); 94 _sound->setWaveOutDevice(getRingerAudioDevice()); 95 _sound->setLoops(4); 96 _sound->play(); 97 } 69 98 } 70 99 -
wengophone/src/model/phonecall/PhoneCallState.h
r328 r545 55 55 * Stops the incoming phone call ringtone. 56 56 */ 57 static void stopSoundIncomingCall(); 58 59 protected: 57 //static void stopSoundIncomingCall(); 60 58 61 59 static AudioDevice getRingerAudioDevice(); 62 60 63 static std::string getSoundIncomingCallFile();61 static void playSoundIncomingCall(); 64 62 65 static std::string getSoundOutgoingCallFile();63 static void playSoundOutgoingCall(); 66 64 67 static std::string getSoundDoubleCallFile();65 static void playSoundDoubleCall(); 68 66 69 static std::string getSoundCallClosedFile();67 static void playSoundCallClosed(); 70 68 71 static void stopSound CallClosed();69 static void stopSound(); 72 70 73 static Sound * _soundIncomingCall; 74 75 static Sound * _soundCallClosed; 71 protected: 72 static Sound * _sound; 76 73 }; 77 74 -
wengophone/src/model/phonecall/PhoneCallStateClosed.cpp
r522 r545 25 25 26 26 void PhoneCallStateClosed::execute(PhoneCall & phoneCall,bool) { 27 stopSoundIncomingCall(); 28 29 //Call closed tonality 30 _soundCallClosed = new Sound(getSoundCallClosedFile()); 31 _soundCallClosed->setWaveOutDevice(getRingerAudioDevice()); 32 //Play the sound 4 times 33 _soundCallClosed->setLoops(4); 34 _soundCallClosed->play(); 27 playSoundCallClosed(); 35 28 } -
wengophone/src/model/phonecall/PhoneCallStateError.cpp
r522 r545 23 23 24 24 void PhoneCallStateError::execute(PhoneCall & phoneCall,bool) { 25 stopSound IncomingCall();25 stopSound(); 26 26 } -
wengophone/src/model/phonecall/PhoneCallStateIncoming.cpp
r522 r545 34 34 //Ringin tonality 35 35 if(doublecall) 36 _soundIncomingCall = new Sound(getSoundDoubleCallFile());36 playSoundDoubleCall(); 37 37 else 38 _soundIncomingCall = new Sound(getSoundIncomingCallFile()); 39 40 _soundIncomingCall->setWaveOutDevice(getRingerAudioDevice()); 41 //Play the sound indefinitely 42 _soundIncomingCall->setLoops(-1); 43 _soundIncomingCall->play(); 38 playSoundIncomingCall(); 44 39 } 45 40 } -
wengophone/src/model/phonecall/PhoneCallStateResumed.cpp
r10 r545 23 23 24 24 void PhoneCallStateResumed::execute(PhoneCall & phoneCall,bool) { 25 stopSound IncomingCall();25 stopSound(); 26 26 } -
wengophone/src/model/phonecall/PhoneCallStateRingingStart.cpp
r522 r545 28 28 29 29 void PhoneCallStateRingingStart::execute(PhoneCall & phoneCall,bool) { 30 31 Config & config = ConfigManager::getInstance().getCurrentConfig(); 32 if (config.getAudioRingingEnable()) { 33 //Ringin tonality 34 _soundIncomingCall = new Sound(getSoundOutgoingCallFile()); 35 36 _soundIncomingCall->setWaveOutDevice(getRingerAudioDevice()); 37 //Play the sound indefinitely 38 _soundIncomingCall->setLoops(-1); 39 _soundIncomingCall->play(); 40 } 30 playSoundOutgoingCall(); 41 31 } -
wengophone/src/model/phonecall/PhoneCallStateRingingStop.cpp
r522 r545 29 29 void PhoneCallStateRingingStop::execute(PhoneCall & phoneCall,bool) { 30 30 31 stopSound IncomingCall();31 stopSound(); 32 32 } -
wengophone/src/model/phonecall/PhoneCallStateTalking.cpp
r522 r545 23 23 24 24 void PhoneCallStateTalking::execute(PhoneCall & phoneCall,bool) { 25 stopSound IncomingCall();25 stopSound(); 26 26 }
Note: See TracChangeset
for help on using the changeset viewer.
