Update of /cvsroot/amis/amis/AmisGuiMFC
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19132/AmisGuiMFC
Modified Files:
Tag: v20-PreRelease
MainFrm.cpp MainFrm.h SearchDaisy.cpp
Log Message:
Fixed book search dialog bug (used to crash if a malformed book was found, because the title object was null and so it had no valid data to display in the results list).
Took out some unused audio prompt handler functions from MainFrm (this handling was moved to AmisBrain).
Index: SearchDaisy.cpp
===================================================================
RCS file: /cvsroot/amis/amis/AmisGuiMFC/SearchDaisy.cpp,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.2
diff -C2 -d -r1.12.2.1 -r1.12.2.2
*** SearchDaisy.cpp 10 Aug 2005 06:12:46 -0000 1.12.2.1
--- SearchDaisy.cpp 11 Aug 2005 17:27:41 -0000 1.12.2.2
***************
*** 505,525 ****
if (p_book != NULL)
{
! if (p_book->mpTitle->hasAudio() == true)
{
! amis::AudioNode* p_audio = p_book->mpTitle->getAudio(0);
! this->GetParent()->SendMessage(WM_MESSAGEPROMPT,
! amis::PLAY_MEDIANODE, (LPARAM)p_audio);
! }
! else if (p_book->mpTitle->hasText() == true)
! {
! amis::TextNode* p_text = p_book->mpTitle->getText();
!
! this->GetParent()->SendMessage(WM_MESSAGEPROMPT,
! amis::PLAY_MEDIANODE, (LPARAM)p_text);
}
else
{
! //empty
}
}
--- 505,531 ----
if (p_book != NULL)
{
! if (p_book->mpTitle != NULL)
{
! if (p_book->mpTitle->hasAudio() == true)
! {
! amis::AudioNode* p_audio = p_book->mpTitle->getAudio(0);
! AmisBrain::Instance()->playAudioPrompt(p_audio);
! }
! else if (p_book->mpTitle->hasText() == true)
! {
! amis::TextNode* p_text = p_book->mpTitle->getText();
!
! //@todo
! //speak TTS title
! }
! else
! {
! //empty
! }
}
else
{
! //title is null; probably a parsing error
}
}
Index: MainFrm.cpp
===================================================================
RCS file: /cvsroot/amis/amis/AmisGuiMFC/MainFrm.cpp,v
retrieving revision 1.27
retrieving revision 1.27.2.1
diff -C2 -d -r1.27 -r1.27.2.1
*** MainFrm.cpp 14 Jul 2005 06:23:48 -0000 1.27
--- MainFrm.cpp 11 Aug 2005 17:27:41 -0000 1.27.2.1
***************
*** 43,48 ****
ON_MESSAGE(WM_MESSAGETOAMIS, OnMessageFromPlugin)
ON_WM_INITMENUPOPUP()
- ON_MESSAGE(WM_MESSAGEPROMPT, OnMessageAboutPrompt)
- ON_MESSAGE(WM_MESSAGEMEDIANODE, OnMessageAboutMediaNode)
//ON_MESSAGE(WM_MENUSELECT, OnMenuSelect)
//}}AFX_MSG_MAP
--- 43,46 ----
***************
*** 387,444 ****
}
- LRESULT CMainFrame::OnMessageAboutPrompt(WPARAM wParam, LPARAM lParam)
- {
- /*if (wParam == amis::PLAY_PROMPT)
- {
- AudioPrompt* p_prompt = (AudioPrompt*)lParam;
- mBrain.playPrompt(p_prompt);
- return 0;
- }
-
- //objects may request a pointer to a prompt so that they can fill in the variables
- //before requesting prompt playback
- else if (wParam == amis::GET_PROMPT)
- {
- char* c_prompt_id = (char*)lParam;
-
- string prompt_id = c_prompt_id;
-
- AudioPrompt* p_prompt = mBrain.getPrompt(prompt_id);
-
- return (DWORD)p_prompt;
- }
- else
- {
- return 0;
- }*/
- return 0;
- }
-
- //this function is for dialogs to play their prompts
- LRESULT CMainFrame::OnMessageAboutMediaNode(WPARAM wParam, LPARAM lParam)
- {
-
- amis::MediaNode* p_media;
- p_media = (amis::MediaNode*)lParam;
-
- if (wParam == amis::PLAY_MEDIANODE)
- {
- //find out the media node type
-
- if (p_media->getMediaNodeType() == amis::AUDIO)
- {
- AmisBrain::Instance()->playAudioPrompt((amis::AudioNode*)p_media);
- }
- else if (p_media->getMediaNodeType() == amis::TEXT)
- {
- // this->mBrain.playTTSPrompt((amis::TextNode*)p_media);
- }
- else
- {
- //empty
- }
- }
- return 0;
- }
--- 385,388 ----
Index: MainFrm.h
===================================================================
RCS file: /cvsroot/amis/amis/AmisGuiMFC/MainFrm.h,v
retrieving revision 1.19
retrieving revision 1.19.4.1
diff -C2 -d -r1.19 -r1.19.4.1
*** MainFrm.h 10 Jun 2005 23:59:35 -0000 1.19
--- MainFrm.h 11 Aug 2005 17:27:41 -0000 1.19.4.1
***************
*** 82,87 ****
afx_msg LRESULT OnMessageFromPlugin(WPARAM wParam, LPARAM lParam);
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
- afx_msg LRESULT OnMessageAboutPrompt(WPARAM wParam, LPARAM lParam);
- afx_msg LRESULT OnMessageAboutMediaNode(WPARAM wParam, LPARAM lParam);
afx_msg void OnMenuSelect( UINT nItemID, UINT nFlags, HMENU hSysMenu );
//}}AFX_MSG
--- 82,85 ----
|