[Amis-vcs] SF.net SVN: amis: [2243] branches/amis3
Brought to you by:
julienq,
marisademeglio
From: <dan...@us...> - 2007-12-03 21:36:15
|
Revision: 2243 http://amis.svn.sourceforge.net/amis/?rev=2243&view=rev Author: daniel_weck Date: 2007-12-03 13:36:12 -0800 (Mon, 03 Dec 2007) Log Message: ----------- - Daniel WECK * Fixed bug: TTS speech rate was inverted. Modified Paths: -------------- branches/amis3/AmisAudio/AmisAudio.cpp branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.cpp branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp branches/amis3/AmisGuiMFC2/src/gui/dialogs/AmisDialogBase.cpp Modified: branches/amis3/AmisAudio/AmisAudio.cpp =================================================================== --- branches/amis3/AmisAudio/AmisAudio.cpp 2007-12-03 18:24:36 UTC (rev 2242) +++ branches/amis3/AmisAudio/AmisAudio.cpp 2007-12-03 21:36:12 UTC (rev 2243) @@ -473,14 +473,9 @@ void AmisAudio::adjustRate(double adjustment) { if (pDmpCtrl) { - if (adjustment < 0) {adjustment = 2;} else {adjustment = -2;} double value = mTau + adjustment; setRate(value); - return; } - double value = mTau + adjustment; - - setRate(value); } Modified: branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.cpp =================================================================== --- branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.cpp 2007-12-03 18:24:36 UTC (rev 2242) +++ branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.cpp 2007-12-03 21:36:12 UTC (rev 2243) @@ -1073,11 +1073,6 @@ } BOOL CDmpCtrl::setRate(double idRate) { - if (idRate != 1.0) { - int i = 1; //dsfds - } else { - int i = 1; //dsfds - } mRate = idRate; Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp 2007-12-03 18:24:36 UTC (rev 2242) +++ branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp 2007-12-03 21:36:12 UTC (rev 2243) @@ -57,6 +57,9 @@ #include "../../AmisSelfVoicing/TTSPlayer.h" //using namespace amis::tts; +#include "ambulant/gui/dx/dx_audio.h" +//#include "ambulant/gui/dx/dx_audio_player.h" + #ifdef _DEBUG #define new DEBUG_NEW #endif @@ -481,26 +484,27 @@ void CAmisGuiMFC2App::OnVolumeUp() { amis::audio::AmisAudio::Instance()->adjustVolume(10); - //TODO: where is Ambulant volume control ? - //ambulant::gui::dx::change_global_level(1.2); + ambulant::gui::dx::change_global_level(1.2); //amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_VOLUP, true, NULL); } void CAmisGuiMFC2App::OnVolumeDown() { amis::audio::AmisAudio::Instance()->adjustVolume(-10); - //TODO: where is Ambulant volume control ? - //ambulant::gui::dx::change_global_level(1.0/1.2); + ambulant::gui::dx::change_global_level(1.0/1.2); //amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_VOLDOWN, true, NULL); } void CAmisGuiMFC2App::OnSpeedUp() { - amis::audio::AmisAudio::Instance()->adjustRate(-0.2); + amis::audio::AmisAudio::Instance()->adjustRate(2); long currentRate = amis::tts::TTSPlayer::Instance()->GetSpeechRate(); amis::tts::TTSPlayer::Instance()->SetSpeechRate(currentRate+2); + + //TODO: Doesn't seem to affect the playback speed at all + double rate = ambulant::gui::dx::change_global_rate(-0.2); //amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_FASTER, true, NULL); } @@ -508,20 +512,27 @@ void CAmisGuiMFC2App::OnSpeedDown() { - amis::audio::AmisAudio::Instance()->adjustRate(0.2); + amis::audio::AmisAudio::Instance()->adjustRate(-2); long currentRate = amis::tts::TTSPlayer::Instance()->GetSpeechRate(); amis::tts::TTSPlayer::Instance()->SetSpeechRate(currentRate-2); + //TODO: Doesn't seem to affect the playback speed at all + double rate = ambulant::gui::dx::change_global_rate(0.2); + //amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_SLOWER, true, NULL); } void CAmisGuiMFC2App::OnSpeedNormal() { amis::audio::AmisAudio::Instance()->setRate(1.0); + amis::tts::TTSPlayer::Instance()->SetSpeechRate(0); + //TODO: this only works with my local hacked Ambulant API (addition of this setXX() function) + //ambulant::gui::dx::set_global_rate(1.0); + //amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_NORMALSPEED, true, NULL); } Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/AmisDialogBase.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/src/gui/dialogs/AmisDialogBase.cpp 2007-12-03 18:24:36 UTC (rev 2242) +++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/AmisDialogBase.cpp 2007-12-03 21:36:12 UTC (rev 2243) @@ -31,8 +31,10 @@ BOOL AmisDialogBase::PreTranslateMessage(MSG* pMsg) { - if (Preferences::Instance()->mbIsSelfVoicing == false) + if (Preferences::Instance()->mbIsSelfVoicing == false) { return CDialog::PreTranslateMessage(pMsg); + } + if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP) { CWnd* cwnd = this->GetFocus(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |