[Amis-vcs] SF.net SVN: amis: [2212] branches/amis3
Brought to you by:
julienq,
marisademeglio
|
From: <dan...@us...> - 2007-10-18 22:27:14
|
Revision: 2212
http://amis.svn.sourceforge.net/amis/?rev=2212&view=rev
Author: daniel_weck
Date: 2007-10-18 15:27:17 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
- Daniel WECK
* Re-organization of code (took lots of time to fix the windows.h versus afxwin.h includes !)
Modified Paths:
--------------
branches/amis3/AmisAudio/AmisAudio.cpp
branches/amis3/AmisAudio/AmisAudio.h
branches/amis3/AmisAudio/TPBReader2/dmp/DmpPpg.h
branches/amis3/AmisAudio/TPBReader2/dmp/dmp.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/TTSPlayer.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/TTSPlayer.h
branches/amis3/AmisGuiMFC2/include/gui/AmisGuiMFC2.h
branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h
branches/amis3/AmisGuiMFC2/include/gui/MainWndParts.h
branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp
branches/amis3/AmisGuiMFC2/src/gui/HtmlView.cpp
branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp
Added Paths:
-----------
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequence.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequence.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequenceComponent.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequenceComponent.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/PreTranslateMessageHandler.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/PreTranslateMessageHandler.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/Prompt.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/Prompt.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/PromptResolver.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/PromptResolver.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/UiMediaTypes.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/UiMediaTypes.h
Removed Paths:
-------------
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/StdAfx.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/StdAfx.h
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.cpp
branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.h
branches/amis3/AmisGuiMFC2/PreTranslateMessageHandler.cpp
branches/amis3/AmisGuiMFC2/PreTranslateMessageHandler.h
Modified: branches/amis3/AmisAudio/AmisAudio.cpp
===================================================================
--- branches/amis3/AmisAudio/AmisAudio.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisAudio/AmisAudio.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -21,11 +21,7 @@
*/
// AmisAudio.cpp : Defines the entry point for the DLL application.
-//#include "StdAfx.h"
-//#include "TPBReader2\dmp\StdAfxFIX.h"
-
-
#include <stdlib.h>
#include <iostream>
#include <string>
Modified: branches/amis3/AmisAudio/AmisAudio.h
===================================================================
--- branches/amis3/AmisAudio/AmisAudio.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisAudio/AmisAudio.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -42,10 +42,8 @@
#include "TPBReader2\dmp\DmpCtl.h"
#include "TPBReader2\dmp\Dmp.h"
+//#include <windows.h>
-//#include "StdAfx.h"
-#include <windows.h>
-
#include "./mffmTimeCode/smilTimeCode.H"
//for message sending ...
Modified: branches/amis3/AmisAudio/TPBReader2/dmp/DmpPpg.h
===================================================================
--- branches/amis3/AmisAudio/TPBReader2/dmp/DmpPpg.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisAudio/TPBReader2/dmp/DmpPpg.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -5,7 +5,6 @@
#pragma once
#endif // _MSC_VER > 1000
-//#include "stdafx.h"
#include "resource.h" // main symbols
Modified: branches/amis3/AmisAudio/TPBReader2/dmp/dmp.cpp
===================================================================
--- branches/amis3/AmisAudio/TPBReader2/dmp/dmp.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisAudio/TPBReader2/dmp/dmp.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -3,8 +3,6 @@
#include "StdAfxFIX.h"
-//#include "stdafx.h"
-
//#include <dshow.h>
#include "dmp.h"
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,7 +1,7 @@
#ifndef ACTION_H
#define ACTION_H
-#include "UiMediaTypes.h"
+#include "../UiMediaTypes.h"
#include "UiItem.h"
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,7 +1,5 @@
//amis menu data
-// DanToDo: The following includes did not survive the Amis3 architecture, so I must find equivalent functions/utilities elsewhere now.
-//#include "../stdafx.h"
#include "Container.h"
#include "Switch.h"
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -2,7 +2,7 @@
#define DIALOG_H
#include "UiItem.h"
-#include "Prompt.h"
+#include "../Prompt.h"
#include "DialogControl.h"
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,8 +1,8 @@
#ifndef DIALOGCONTROL_H
#define DIALOGCONTROL_H
-#include "UiMediaTypes.h"
-#include "Prompt.h"
+#include "../UiMediaTypes.h"
+#include "../Prompt.h"
#include "UiItem.h"
#include "LabelList.h"
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,7 +1,5 @@
-// DanToDo: The following includes did not survive the Amis3 architecture, so I must find equivalent functions/utilities elsewhere now.
-//#include "StdAfx.h"
#include ".\inifile.h"
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,7 +1,7 @@
#ifndef LABEL_H
#define LABEL_H
-#include "Prompt.h"
+#include "../Prompt.h"
namespace amis
Deleted: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,427 +0,0 @@
-
-#include "Prompt.h"
-#include <fstream>
-
-using namespace amis::gui::spoken;
-
-//**
-//PromptItemBase
-PromptItemBase::PromptItemBase()
-{
- mpContents = NULL;
-}
-PromptItemBase::~PromptItemBase()
-{
- if (mpContents != NULL) {
- delete mpContents;
- }
-}
-TextAudioPair* PromptItemBase::getContents()
-{
- return mpContents;
-}
-
-PromptItemType PromptItemBase::getPromptItemType()
-{
- return mType;
-}
-void PromptItemBase::setPromptItemType(PromptItemType type)
-{
- mType = type;
-}
-
-void PromptItemBase::setContents(TextAudioPair* pContents)
-{
- mpContents = pContents;
-}
-
-void PromptItemBase::setContents(std::wstring textString, amis::AudioNode* p_audio)
-{
- if (mpContents != NULL)
- delete mpContents;
-
- TextAudioPair* p_pair = new TextAudioPair();
-
- TextNode* p_text = NULL;
- if (!textString.empty()) {
- p_text = new TextNode();
- p_text->setTextString(textString);
- p_pair->setText(p_text);
- }
-
- p_pair->setAudio(p_audio);
-
- this->mpContents = p_pair;
-
-}
-void PromptItemBase::setContents(std::wstring textString, std::string audioSrc)
-{
- if (mpContents != NULL)
- delete mpContents;
-
- TextAudioPair* p_pair = new TextAudioPair();
-
- TextNode* p_text = NULL;
- if (!textString.empty()) {
- p_text = new TextNode();
- p_text->setTextString(textString);
- p_pair->setText(p_text);
- }
-
- amis::AudioNode* p_audio = new amis::AudioNode();
- if (!audioSrc.empty()) {
- p_audio = new amis::AudioNode();
- p_audio->setSrc(audioSrc);
- p_pair->setAudio(p_audio);
- }
-
- this->mpContents = p_pair;
-
-}
-
-void PromptItemBase::setContents(amis::MediaGroup* pMediaGroup)
-{
- if (mpContents != NULL)
- delete mpContents;
-
- mpContents = new TextAudioPair();
-
- if (pMediaGroup->hasText() == true)
- {
- TextNode* p_text = new TextNode();
- p_text->setTextString(pMediaGroup->getText()->getTextString());
- mpContents->setText(p_text);
- }
-
- if (pMediaGroup->hasAudio() == true)
- {
- amis::AudioNode* p_audio = new amis::AudioNode();
- p_audio->setSrc(pMediaGroup->getAudio(0)->getSrc());
- p_audio->setClipBegin(pMediaGroup->getAudio(0)->getClipBegin());
- p_audio->setClipEnd(pMediaGroup->getAudio(0)->getClipEnd());
-
- mpContents->setAudio(p_audio);
- }
-
-
-}
-
-//**
-//PromptItem
-PromptItem::PromptItem()
-{
- mRefId="";
- mId = "";
- setPromptItemType(PROMPT_ITEM);
-}
-PromptItem::~PromptItem()
-{
-}
-
-std::string PromptItem::getRefId()
-{
- return mRefId;
-}
-std::string PromptItem::getId()
-{
- return mId;
-}
-void PromptItem::setRefId(std::string refId)
-{
- mRefId.assign(refId);
-}
-void PromptItem::setId(std::string id)
-{
- mId.assign(id);
-}
-
-//make a hardcopy of the contents pointed to by refid
-void PromptItem::setReferenceContents(PromptItem* pItem)
-{
- if (pItem != NULL)
- {
- TextAudioPair* p_pair = NULL;
- p_pair = pItem->getContents();
- if (p_pair != NULL)
- {
-
- TextAudioPair* p_these_contents = new TextAudioPair();
-
- if (p_pair->getText() != NULL)
- {
- p_these_contents->setText(p_pair->getText()->clone());
- }
- if (p_pair->getAudio() != NULL)
- {
- p_these_contents->setAudio((amis::AudioNode*)p_pair->getAudio()->clone());
- }
-
- this->setContents(p_these_contents);
-
- }
- }
-
-}
-PromptItem* PromptItem::clone()
-{
- PromptItem* p_new = new PromptItem();
- p_new->setPromptItemType(this->getPromptItemType());
- p_new->setRefId(this->mRefId);
-
- TextAudioPair* p_pair = this->getContents()->clone();
-
- p_new->setContents(p_pair);
-
- return p_new;
-
-}
-void PromptItem::testPrint(std::string outfile, int numTabs)
-{
- fstream out;
- out.open(outfile.c_str(), ios::app | ios::out);
-
- int i=0;
-
- for (i=0; i<numTabs; i++){out<<"\t";}
- out<<"Prompt Item"<<endl;
-
- if (mRefId.size() > 0)
- {
- for (i=0; i<numTabs + 1; i++){out<<"\t";}
- out<<"ref id = "<<mRefId<<endl;
- }
- out.close();
- this->getContents()->testPrint(outfile, numTabs + 1);
-
-}
-
-//**
-//PromptVar
-PromptVar::PromptVar()
-{
- mParam = "";
- mName = "";
-
- setPromptItemType(PROMPT_VARIABLE);
-}
-PromptVar::~PromptVar()
-{
-}
-
-std::string PromptVar::getParam()
-{
- return mParam;
-}
-
-std::string PromptVar::getName()
-{
- return mName;
-}
-void PromptVar::setParam(std::string param)
-{
- mParam.assign(param);
-}
-void PromptVar::setName(std::string name)
-{
- mName.assign(name);
-}
-
-//prompt variables don't copy their contents
-//since that changes so often
-PromptVar* PromptVar::clone()
-{
- PromptVar* p_new = new PromptVar();
- p_new->setName (this->mName);
- p_new->setParam (this->mParam);
- p_new->setPromptItemType(this->getPromptItemType());
-
- return p_new;
-
-}
-void PromptVar::testPrint(std::string outfile, int numTabs)
-{
- fstream out;
- out.open(outfile.c_str(), ios::app | ios::out);
-
- int i=0;
-
- for (i=0; i<numTabs; i++){out<<"\t";}
- out<<"Prompt Variable"<<endl;
-
- if (mName.size() > 0)
- {
- for (i=0; i<numTabs + 1; i++){out<<"\t";}
- out<<"Name = "<<mName<<endl;
- }
-
- if (mParam.size() > 0)
- {
- for (i=0; i<numTabs + 1; i++){out<<"\t";}
- out<<"Param = "<<mParam<<endl;
- }
-
- if (this->getContents() != NULL)
- {
- this->getContents()->testPrint(outfile, numTabs + 1);
- }
-
- out.close();
-
-
-}
-
-//**
-//Prompt
-Prompt::Prompt()
-{
- mItems.empty();
-}
-Prompt::~Prompt()
-{
- PromptItemBase* p_item = NULL;
-
- for (int i=0; i<mItems.size()-1; i--)
- {
- p_item = mItems[i];
- mItems.pop_back();
- if (p_item != NULL)
- delete p_item;
-
- p_item = NULL;
- }
-}
-int Prompt::getNumberOfItems()
-{
- return mItems.size();
-}
-PromptItemBase* Prompt::getItem(int idx)
-{
- if (idx >=0 && idx < mItems.size())
- {
- return mItems[idx];
- }
- else
- {
- return NULL;
- }
-}
-
-void Prompt::addItem(PromptItemBase* pItem)
-{
- mItems.push_back(pItem);
-}
-std::string Prompt::getType()
-{
- return mType;
-}
-void Prompt::setType(std::string type)
-{
- mType.assign(type);
-}
-
-std::string Prompt::getId()
-{
- return mId;
-}
-void Prompt::setId(std::string id)
-{
- mId.assign(id);
-}
-
-//return a string containing all the promptItem texts
-//if the prompt has unresolved variables, insert them as the variable name
-//(good for testing)
-std::wstring Prompt::concatAllText()
-{
- std::wstring ret_string;
- ret_string.erase();
-
- PromptVar* p_var = NULL;
- TextAudioPair* p_contents = NULL;
- PromptItemBase* p_base = NULL;
-
- int sz = mItems.size();
- for (int i=0; i<sz; i++)
- {
- p_base = mItems[i];
-
- if (p_base->getPromptItemType() == PROMPT_VARIABLE &&
- p_base->getContents() == NULL)
- {
- p_var = (PromptVar*)p_base;
- //@todo
- //this variable was not resolved, so append its name to the list
- //convert std::string to std::wstring: can we do this here with no MFC dependencies?
- //ret_string.append(p_var->getName());
- }
- else
- {
- p_contents = p_base->getContents();
- if (p_contents != NULL)
- {
- if (p_contents->getText() != NULL)
- {
- ret_string.append(p_contents->getText()->getTextString());
- }
- }
- else
- {
- std::string sz_err = " #ERROR# ";
- //@todo
- //convert std::string to std::wstring: can we do this here with no MFC dependencies?
- //ret_string.append(sz_err.c_str());
- }
- }
- }
-
- return ret_string;
-}
-
-Prompt* Prompt::clone()
-{
- Prompt* p_new = new Prompt();
- p_new->setId(this->mId);
- p_new->setType(this->mType);
-
- PromptItem* p_item;
- PromptVar* p_var;
-
- for (int i=0; i<this->mItems.size(); i++)
- {
- if (mItems[i]->getPromptItemType() == PROMPT_ITEM)
- {
- p_item = (PromptItem*)mItems[i];
- p_new->addItem(p_item->clone());
- }
- else if (mItems[i]->getPromptItemType() == PROMPT_VARIABLE)
- {
- p_var = (PromptVar*)mItems[i];
- p_new->addItem(p_var->clone());
- }
- }
-
- return p_new;
-}
-void Prompt::testPrint(std::string outfile, int numTabs)
-{
- fstream out;
- out.open(outfile.c_str(), ios::app | ios::out);
-
- int i=0;
-
- for (i=0; i<numTabs; i++){out<<"\t";}
- out<<"Prompt"<<endl;
-
- for (i=0; i<numTabs + 1; i++){out<<"\t";}
- out<<"id = "<<mId<<endl;
-
- for (i=0; i<numTabs + 1; i++){out<<"\t";}
- out<<"type = "<<mType<<endl;
-
- out.close();
-
- for(int j=0; j<mItems.size(); j++)
- {
- mItems[j]->testPrint(outfile, numTabs + 1);
- }
-}
Deleted: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,125 +0,0 @@
-#ifndef PROMPT_H
-#define PROMPT_H
-
-
-#include "UiMediaTypes.h"
-
-
-
-namespace amis
-{
-namespace gui
-{
-namespace spoken
-{
-enum PromptItemType {PROMPT_VARIABLE, PROMPT_ITEM};
-
-class PromptItemBase
-{
-public:
- PromptItemBase();
- ~PromptItemBase();
-
- PromptItemType getPromptItemType();
- TextAudioPair* getContents();
-
- virtual void testPrint(std::string, int) = 0;
- void setContents(std::wstring, std::string);
- void setContents(std::wstring textString, amis::AudioNode* p_audio);
-
- void setPromptItemType(PromptItemType);
- void setContents(TextAudioPair*);
- void setContents(amis::MediaGroup*);
-
-private:
- PromptItemType mType;
- TextAudioPair* mpContents;
-
-};
-
-//both promptItems and promptVars should resolve to a PromptItemBase
-class PromptItem : public PromptItemBase
-{
-public:
- PromptItem();
- ~PromptItem();
-
- std::string getRefId();
- std::string getId();
- void testPrint(std::string, int);
- PromptItem* clone();
- void setReferenceContents(PromptItem*);
-
-protected:
- void setRefId(std::string);
- void setId(std::string);
-
-private:
- std::string mRefId;
- std::string mId;
-
- friend class DataReader;
-};
-
-class PromptVar : public PromptItemBase
-{
-public:
- PromptVar();
- ~PromptVar();
-
- //the variable parameter
- std::string getParam();
-
- //the variable name
- std::string getName();
-
- void testPrint(std::string, int);
-
- PromptVar* clone();
-
-protected:
- void setParam(std::string);
- void setName(std::string);
-
-private:
- std::string mParam;
- std::string mName;
-
- friend class DataReader;
-};
-
-
-
-class Prompt
-{
-public:
- Prompt();
- ~Prompt();
-
- int getNumberOfItems();
- PromptItemBase* getItem(int);
-
- std::string getType();
- std::string getId();
-
- void testPrint(std::string, int);
- std::wstring concatAllText();
- Prompt* clone();
-
-
-protected:
- void addItem(PromptItemBase*);
- void setType(std::string);
- void setId(std::string);
-
-private:
- vector <PromptItemBase*> mItems;
- std::string mType;
- std::string mId;
-
- friend class DataReader;
-};
-
-
-}}}
-#endif
\ No newline at end of file
Deleted: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,13 +0,0 @@
-//#include "stdafx.h"
-#include ".\promptresolver.h"
-
-using namespace amis::gui::spoken;
-
- /*
-PromptResolver::PromptResolver(void)
-{
-}
-
-PromptResolver::~PromptResolver(void)
-{
-}*/
Deleted: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,24 +0,0 @@
-#pragma once
-
-#include "Prompt.h"
-
-#ifndef PROMPTRESOLVER_H
-#define PROMPTRESOLVER_H
-
-
-namespace amis
-{
-namespace gui
-{
-namespace spoken
-{
- class PromptResolver
-{
-public:
- //PromptResolver(void);
- //virtual ~PromptResolver = 0;
-
- virtual void resolvePromptVariables(Prompt*) = 0;
-};
-}}}
-#endif
\ No newline at end of file
Deleted: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/StdAfx.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/StdAfx.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/StdAfx.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// AmisGuiMFC.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-
-
Deleted: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/StdAfx.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/StdAfx.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/StdAfx.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,33 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__DE447A84_1CA9_4A55_9A4A_D91FCE1DB1CB__INCLUDED_)
-#define AFX_STDAFX_H__DE447A84_1CA9_4A55_9A4A_D91FCE1DB1CB__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#pragma warning(disable : 4786)
-#pragma warning(disable : 4251)
-
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h> // MFC core and standard components
-#include <afxext.h> // MFC extensions
-#include <afxdisp.h> // MFC Automation classes
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#include <afxctl.h> //for CPictureHolder support
-#endif // _AFX_NO_AFXCMN_SUPPORT
-//#include <afxhtml.h>
-
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-#define _SCB_REPLACE_MINIFRAME
-
-#endif // !defined(AFX_STDAFX_H__DE447A84_1CA9_4A55_9A4A_D91FCE1DB1CB__INCLUDED_)
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,7 +1,7 @@
#ifndef UIITEM_H
#define UIITEM_H
-#include "UiMediaTypes.h"
+#include "../UiMediaTypes.h"
#include "Label.h"
#include "LabelList.h"
Deleted: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,159 +0,0 @@
-
-#include "UiMediaTypes.h"
-#include <fstream>
-
-using namespace amis::gui::spoken;
-
-//***********
-//TextNode
-TextNode::TextNode()
-{
- mMnemonic = "";
-}
-
-TextNode::~TextNode()
-{
-}
-
-std::string TextNode::getMnemonic()
-{
- return mMnemonic;
-}
-void TextNode::setMnemonic(std::string mnemonic)
-{
- mMnemonic.assign(mnemonic);
-}
-
-//just copy over the text string and the mnemonic
-//not complete but will do for now
-TextNode* TextNode::clone()
-{
- TextNode* p_new = new TextNode();
- p_new->setTextString(this->getTextString());
- p_new->setMnemonic(this->getMnemonic());
-
- return p_new;
-
-}
-
-//***********
-//ImageNode
-ImageNode::ImageNode()
-{
- mImageType = SMALL_ICON;
-}
-ImageNode::~ImageNode()
-{
-}
-ImageType ImageNode::getImageType()
-{
- return mImageType;
-}
-void ImageNode::setImageType(ImageType imgType)
-{
- mImageType = imgType;
-}
-
-//******************
-//TextAudioPair
-
-TextAudioPair::TextAudioPair()
-{
- mpText = NULL;
- mpAudio = NULL;
- mpMediaGroupVersion = NULL;
-}
-TextAudioPair::~TextAudioPair()
-{
- if (mpMediaGroupVersion != NULL)
- delete mpMediaGroupVersion;
- if (mpText != NULL)
- delete mpText;
- if (mpAudio != NULL)
- delete mpAudio;
-
-}
-
-TextNode* TextAudioPair::getText()
-{
- return mpText;
-}
-
-amis::AudioNode* TextAudioPair::getAudio()
-{
- return mpAudio;
-}
-
-void TextAudioPair::setText(TextNode* pNode)
-{
- this->mpText = pNode;
-}
-void TextAudioPair::setAudio(amis::AudioNode* pNode)
-{
- this->mpAudio = pNode;
-}
-TextAudioPair* TextAudioPair::clone()
-{
- TextAudioPair* p_new = new TextAudioPair();
-
- amis::AudioNode* p_audio = (amis::AudioNode*)this->getAudio()->clone();
- TextNode* p_text = this->getText()->clone();
-
- p_new->setAudio(p_audio);
- p_new->setText(p_text);
-
- return p_new;
-}
-amis::MediaGroup* TextAudioPair::getAsAmisMediaGroup()
-{
- if (mpMediaGroupVersion != NULL)
- delete mpMediaGroupVersion;
-
- mpMediaGroupVersion = new amis::MediaGroup();
-
- mpMediaGroupVersion->setText(this->mpText);
- mpMediaGroupVersion->addAudioClip(this->mpAudio);
-
- return mpMediaGroupVersion;
-}
-void TextAudioPair::testPrint(std::string outfile, int numTabs)
-{
- fstream out;
- out.open(outfile.c_str(), ios::app | ios::out);
-
- int i=0;
-
- for (i=0; i<numTabs; i++){out<<"\t";}
- out<<"text = ";
-
- out.close();
-
- //reopen in widechar mode to write the text string
- wfstream wout;
- wout.open(outfile.c_str(), ios::app | ios::out);
-
- if (mpText != NULL)
- {
- wout.write(this->mpText->getTextString().c_str(),
- this->mpText->getTextString().size());
- }
-
- wout.close();
- //done with widechar mode
-
- out.open(outfile.c_str(), ios::app | ios::out);
-
- out<<endl;
-
- if (mpAudio != NULL)
- {
- for (i=0; i<numTabs; i++){out<<"\t";}
- std::string audio_src = mpAudio->getSrc();
-
- out<<"audio src = ";
- out<<audio_src<<endl;
- }
-
- out.close();
-
-}
Deleted: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,74 +0,0 @@
-
-#ifndef UIMEDIATYPES_H
-#define UIMEDIATYPES_H
-
-
-#include "../AmisCore/include/Media.h"
-
-
-
-namespace amis
-{
-namespace gui
-{
-namespace spoken
-{
-class TextNode : public amis::TextNode
-{
-public:
- TextNode();
- ~TextNode();
-
- std::string getMnemonic();
- void setMnemonic(std::string);
-
- TextNode* clone();
-
-private:
- std::string mMnemonic;
-
-};
-
-enum ImageType {SMALL_ICON, LARGE_ICON};
-
-class ImageNode : public amis::ImageNode
-{
-public:
- ImageNode();
- ~ImageNode();
-
- ImageType getImageType();
-
- void setImageType(ImageType);
-
-private:
- ImageType mImageType;
-
-};
-
-class TextAudioPair
-{
-public:
- TextAudioPair();
- ~TextAudioPair();
-
- TextNode* getText();
- amis::AudioNode* getAudio();
-
- void testPrint(std::string, int);
-
- void setText(TextNode*);
- void setAudio(amis::AudioNode*);
- TextAudioPair* clone();
- amis::MediaGroup* getAsAmisMediaGroup();
-
-
-private:
- TextNode* mpText;
- amis::AudioNode* mpAudio;
- amis::MediaGroup* mpMediaGroupVersion;
-
-
-};
-}}}
-#endif
\ No newline at end of file
Added: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequence.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequence.cpp (rev 0)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequence.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -0,0 +1,73 @@
+#include "AudioSequence.h"
+
+using namespace amis::gui::spoken;
+
+AudioSequence::AudioSequence(){}
+
+AudioSequence::~AudioSequence(){
+ if (m_AudioSequence.GetCount() > 0)
+ {
+ for (size_t i = 0; i < m_AudioSequence.GetCount(); i++) {
+ AudioSequenceComponent* comp = m_AudioSequence.GetAt(m_AudioSequence.FindIndex(i));
+ delete comp;
+ }
+
+ m_AudioSequence.RemoveAll();
+ }
+ }
+
+UINT AudioSequence::GetCount() {
+ return m_AudioSequence.GetCount();
+ }
+bool AudioSequence::IsEmpty() {
+ return m_AudioSequence.GetCount() == 0;
+ }
+AudioSequenceComponent* AudioSequence::RemoveTail() {
+ return m_AudioSequence.RemoveTail();
+ };
+void AudioSequence::AddTail(AudioSequenceComponent* comp) {
+ m_AudioSequence.AddTail(comp);
+ }
+ void AudioSequence::append(CString strTTS) {
+ if (strTTS.IsEmpty()) {
+ TRACE(L"???????????????????????????");
+ }
+ AudioSequenceComponent* comp = new AudioSequenceComponent;
+ comp->m_isAudioClip = false;
+ comp->m_AudioClip = 0;
+ comp->m_String = strTTS;
+ m_AudioSequence.AddHead(comp);
+ }
+void AudioSequence::append(amis::AudioNode* audioClip) {
+ AudioSequenceComponent* comp = new AudioSequenceComponent;
+ comp->m_isAudioClip = TRUE;
+ comp->m_AudioClip = audioClip;
+ comp->m_String = L"";
+ m_AudioSequence.AddHead(comp);
+ }
+ void AudioSequence::prepend(CString strTTS) {
+ if (strTTS.IsEmpty()) {
+ TRACE(L"???????????????????????????");
+ }
+ AudioSequenceComponent* comp = new AudioSequenceComponent;
+ comp->m_isAudioClip = false;
+ comp->m_AudioClip = 0;
+ comp->m_String = strTTS;
+ m_AudioSequence.AddTail(comp);
+ }
+ void AudioSequence::prepend(amis::AudioNode* audioClip) {
+ AudioSequenceComponent* comp = new AudioSequenceComponent;
+ comp->m_isAudioClip = TRUE;
+ comp->m_AudioClip = audioClip;
+ comp->m_String = L"";
+ m_AudioSequence.AddTail(comp);
+ }
+ AudioSequence* AudioSequence::clone() {
+ AudioSequence* seq = new AudioSequence;
+ for (size_t i = 0; i < m_AudioSequence.GetCount(); i++) {
+ AudioSequenceComponent* comp = m_AudioSequence.GetAt(m_AudioSequence.FindIndex(i))->clone();
+ seq->AddTail(comp);
+ }
+
+ return seq;
+ }
\ No newline at end of file
Added: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequence.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequence.h (rev 0)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequence.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -0,0 +1,45 @@
+#ifndef AudioSequence_H
+#define AudioSequence_H
+
+#pragma once
+
+#include "AudioSequenceComponent.h"
+
+
+//#include <atlstr.h>
+#include <atlcoll.h>
+
+
+#include "../AmisCore/include/Media.h"
+
+
+namespace amis
+{
+namespace gui
+{
+namespace spoken
+{
+
+class AudioSequence
+{
+public:
+ AudioSequence();
+ ~AudioSequence();
+ UINT GetCount();
+ bool IsEmpty();
+ AudioSequenceComponent* RemoveTail();
+ void AddTail(AudioSequenceComponent* comp);
+ void append(CString strTTS);
+ void append(amis::AudioNode* audioClip);
+ void prepend(CString strTTS);
+ void prepend(amis::AudioNode* audioClip);
+ AudioSequence* clone();
+private:
+ CAtlList<AudioSequenceComponent*> m_AudioSequence;
+};
+
+
+}
+}
+}
+#endif
\ No newline at end of file
Added: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequenceComponent.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequenceComponent.cpp (rev 0)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequenceComponent.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -0,0 +1,29 @@
+#include "AudioSequenceComponent.h"
+
+using namespace amis::gui::spoken;
+
+AudioSequenceComponent::AudioSequenceComponent(){
+ mWasCloned = false;
+ }
+AudioSequenceComponent::~AudioSequenceComponent(){
+#ifdef XUSE_WSTRING
+ m_String = "";
+#else
+ m_String.Empty();
+#endif
+
+ if (mWasCloned) {
+ delete m_AudioClip;
+ }
+ m_AudioClip = NULL;
+ }
+
+AudioSequenceComponent* AudioSequenceComponent::clone() {
+ AudioSequenceComponent* comp = new AudioSequenceComponent;
+ comp->m_AudioClip = (m_AudioClip ? (amis::AudioNode*)m_AudioClip->clone() : NULL);
+ comp->m_String = m_String;
+ comp->m_isAudioClip = m_isAudioClip;
+ comp->mWasCloned = true;
+
+ return comp;
+}
\ No newline at end of file
Added: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequenceComponent.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequenceComponent.h (rev 0)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequenceComponent.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -0,0 +1,48 @@
+#ifndef AudioSequenceComponent_H
+#define AudioSequenceComponent_H
+
+#pragma once
+
+//#define XUSE_WSTRING
+
+#ifdef XUSE_WSTRING
+#include <string>
+#else
+#ifndef __AFXWIN_H__
+#include <afxwin.h>
+#endif
+#endif
+
+#include "../AmisCore/include/Media.h"
+
+
+namespace amis
+{
+namespace gui
+{
+namespace spoken
+{
+
+// --------------------------------
+class AudioSequenceComponent
+{
+public:
+ AudioSequenceComponent();
+ ~AudioSequenceComponent();
+ AudioSequenceComponent* clone();
+ BOOL m_isAudioClip;
+ bool mWasCloned;
+
+#ifdef XUSE_WSTRING
+ std::wstring m_String;
+#else
+ CString m_String;
+#endif
+ amis::AudioNode* m_AudioClip;
+};
+
+
+}
+}
+}
+#endif
\ No newline at end of file
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.cpp 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -1,5 +1,6 @@
+#include "AudioSequencePlayer.h"
#include "TTSPlayer.h"
@@ -9,23 +10,20 @@
#include "../AmisAudio/AmisAudio.h"
+
#include "../AmisGuiMFC2/include/Preferences.h"
+
#include <gui/MainWndParts.h>
+#include "../AmisCore/include/Media.h"
-#include <process.h>
-#include <stdlib.h>
+#include "gui/MmView.h"
-#include "AudioSequencePlayer.h"
-
-#ifndef TRACE
-#define TRACE ATLTRACE
-#endif
-
-
using namespace amis::audio;
using namespace amis::tts;
+using namespace amis::gui::spoken;
+
AudioSequencePlayer* AudioSequencePlayer::pinstance = 0;
@@ -92,6 +90,7 @@
unsigned int threadID;
+ AmisAudio::Instance()->enable();
AmisAudio::Instance()->setCallback((sendMessageCallbackFn)clipFinishedCallback);
TTSPlayer::Instance()->setCallback((sendMessageCallbackFn)ttsFinishedCallback);
@@ -111,6 +110,9 @@
{
Stop();
delete pinstance;
+
+ AmisAudio::Instance()->DestroyInstance();
+ TTSPlayer::Instance()->DestroyInstance();
}
AudioSequencePlayer::~AudioSequencePlayer(void)
@@ -497,3 +499,575 @@
return 0;
}
+
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+// This works for Containers (menus).
+AudioSequence* AudioSequencePlayer::playPromptFromUiId(int nItemID, bool playImmediately, AudioSequence* seq)
+{
+//amis::Preferences::Instance()->mbUseTTSNotAudio == true)
+ if (nItemID != -1)
+ {
+ amis::RecentBooks* books = theApp.getRecentBooks();
+
+ int nRecentBooks = (books ? books->getNumberOfEntries() : 0);
+ string strCondition;
+
+ if (ID_MENU_PLAYPAUSE == nItemID) {
+
+ MmView *view = MainWndParts::Instance()->mpMmView;
+ bool b_BookIsPlaying = MainWndParts::Instance()->mpMainFrame->mbWasPlayingWhenLostFocus || view->isPlaying(); // BOOK Audio Player
+
+ strCondition = (b_BookIsPlaying ? "canPause" : "canPlay");
+
+ } else if (ID_FILE_RECENT_EMPTY == nItemID || (nItemID >= BOOK_BASE_ID && nItemID < BOOK_BASE_ID + nRecentBooks)) {
+ if (nRecentBooks > 0) {
+ strCondition = "BOOK_BASE_ID";
+ } else {
+ strCondition = "ID_FILE_RECENT_EMPTY";
+ }
+ }
+
+ if (seq == NULL) {
+ seq = new AudioSequence;
+ }
+ //AppendAudioSequenceStringResource(seq, nItemID);
+
+ UiItem* p_uiItem = DataTree::Instance()->findUiItemInContainers(nItemID, strCondition);
+ if (p_uiItem != NULL) {
+
+ Label* keyboardShortcutAccelerator = NULL;
+ Label* mnemonic = NULL;
+ if (p_uiItem->getUiItemType() == ACTION) {
+ Action* action = (Action*)p_uiItem;
+ keyboardShortcutAccelerator = action->getKeyboardAccelerator();
+ mnemonic = action->getMnemonic();
+ }
+ else if (p_uiItem->getUiItemType() == CONTAINER) {
+ Container* container = (Container*)p_uiItem;
+ keyboardShortcutAccelerator = container->getKeyboardAccelerator();
+ }
+ //fillSequenceCaptionAndDescription(seq, p_uiItem);
+
+ Label* label = p_uiItem->getCaption();
+ if (label != NULL) {
+ fillSequenceContentAndPrompt(seq, label);
+ }
+ if (mnemonic != NULL) {
+ fillSequenceContentAndPrompt(seq, mnemonic);
+ }
+ if (keyboardShortcutAccelerator != NULL) {
+ fillSequenceContentAndPrompt(seq, keyboardShortcutAccelerator);
+ }
+ label = p_uiItem->getDescription();
+ if (label != NULL) {
+ fillSequenceContentAndPrompt(seq, label);
+ }
+
+ }
+ else if (nItemID > SECTION_DEPTH_BASE_ID && nItemID <= (SECTION_DEPTH_BASE_ID + MAX_ANYTHING))
+ {
+ string strPrompt;
+ switch (nItemID) {
+ case (SECTION_DEPTH_BASE_ID+1): {
+ strPrompt = "numeric_one";
+ break;
+ }
+ case (SECTION_DEPTH_BASE_ID+2): {
+ strPrompt = "numeric_two";
+ break;
+ }
+ case (SECTION_DEPTH_BASE_ID+3): {
+ strPrompt = "numeric_three";
+ break;
+ }
+ case (SECTION_DEPTH_BASE_ID+4): {
+ strPrompt = "numeric_four";
+ break;
+ }
+ case (SECTION_DEPTH_BASE_ID+5): {
+ strPrompt = "numeric_five";
+ break;
+ }
+ case (SECTION_DEPTH_BASE_ID+6): {
+ strPrompt = "numeric_six";
+ break;
+ }
+ case (SECTION_DEPTH_BASE_ID+7): {
+ strPrompt = "numeric_seven";
+ break;
+ }
+ case (SECTION_DEPTH_BASE_ID+8): {
+ strPrompt = "numeric_eight";
+ break;
+ }
+ case (SECTION_DEPTH_BASE_ID+9): {
+ strPrompt = "numeric_nine";
+ break;
+ }
+ }
+ if (!strPrompt.empty()) {
+ //seq->append(strPrompt.c_str()); TEST ONLY
+
+ delete seq;
+ seq = playPromptItemFromStringId(strPrompt, false, NULL);
+ }
+
+ } else {
+
+ // Called for Show Section Depth (1, 2, 3, etc.)
+ // and for Recent-Files "Empty".
+ HWND hWnd = MainWndParts::Instance()->mpMainFrame->GetSafeHwnd();
+ HMENU hMenu = ::GetMenu(hWnd);
+
+ int nLen = ::GetMenuString(hMenu, nItemID, NULL, 0, MF_BYCOMMAND);
+
+ if (nLen > 0) {
+
+ LPTSTR lpszText = (LPTSTR)_alloca((nLen + 1) * sizeof(TCHAR));
+ if (::GetMenuString(hMenu, nItemID, lpszText, nLen + 1, MF_BYCOMMAND) == nLen) {
+
+ CString str;
+ str.Append(lpszText);
+ str.Replace(L"&", L"");
+
+ CString strDebug;
+ strDebug.Format(_T("+++ 1 --%s--\n"), str); //DAN_MENU_DEBUG
+ TRACE(strDebug);
+
+ if (! str.IsEmpty()) {
+ seq->append(str);
+ }
+
+ //str.Empty();
+ }
+ }
+ CString strText;
+ strText.LoadString( nItemID );
+
+ CString strDebug;
+ strDebug.Format(_T("+++ 2 --%s--\n"), strText); //DAN_MENU_DEBUG
+ TRACE(strDebug);
+
+ if (! strText.IsEmpty()) {
+ seq->append(strText);
+ }
+ //strText.Empty();
+ }
+ if (playImmediately) AudioSequencePlayer::Instance()->Play(seq);
+ return seq;
+ }
+
+ return NULL;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+// This works for Containers (menus).
+AudioSequence* AudioSequencePlayer::playContainerPromptFromId(string id, bool playImmediately, AudioSequence* seq) {
+
+
+ if (!id.empty()) {
+ Container* p_container = DataTree::Instance()->findContainer(id);
+ if (p_container != NULL) {
+ if (seq == NULL) {
+ seq = new AudioSequence;
+ }
+
+ Label* keyboardShortcutAccelerator = p_container->getKeyboardAccelerator();
+
+ fillSequenceCaptionAndDescription(seq, p_container);
+
+ if (keyboardShortcutAccelerator != NULL) {
+ fillSequenceContentAndPrompt(seq, keyboardShortcutAccelerator);
+ }
+
+ if (playImmediately) AudioSequencePlayer::Instance()->Play(seq);
+ return seq;
+ }
+ }
+ return NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+// This works for Prompts.
+AudioSequence* AudioSequencePlayer::playPromptFromStringId(string promptId, bool playImmediately, AudioSequence* seq, PromptResolver* pResolver)
+{
+
+
+ if (seq == NULL) {
+ seq = new AudioSequence;
+ }
+ //AppendAudioSequenceStringID(seq, promptId);
+
+
+ Prompt* p_prompt_ = DataTree::Instance()->findPrompt(promptId);
+
+ if (p_prompt_ != NULL)
+ {
+ fillSequencePrompt(seq, p_prompt_, pResolver);
+ }
+
+
+ if (playImmediately) AudioSequencePlayer::Instance()->Play(seq);
+ return seq;
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+// This works for Prompts.
+AudioSequence* AudioSequencePlayer::playPromptItemFromStringId(string promptId, bool playImmediately, AudioSequence* seq, PromptResolver* pResolver)
+{
+
+
+
+ if (seq == NULL) {
+ seq = new AudioSequence;
+ }
+
+ PromptItem* p_prompt_ = DataTree::Instance()->findPromptItem(promptId);
+
+ if (p_prompt_ != NULL)
+ {
+ fillSequenceContents(seq, p_prompt_);
+ }
+ if (playImmediately) AudioSequencePlayer::Instance()->Play(seq);
+ return seq;
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+// This works for Dialogs, plays the instructions.
+AudioSequence* AudioSequencePlayer::playDialogInstructionsFromUiId(int nItemID, bool playImmediately, AudioSequence* seq) {
+
+ if (nItemID != -1) {
+
+
+ if (seq == NULL) {
+ seq = new AudioSequence;
+ }
+ //AppendAudioSequenceStringResource(seq, nItemID);
+
+ Dialog* p_dialog = DataTree::Instance()->findDialog(nItemID);
+ if (p_dialog != NULL) {
+ Prompt* prompt = p_dialog->getPrompt("instructions");
+ if (prompt != NULL) {
+ fillSequencePrompt(seq, prompt);
+ }
+ }
+ if (playImmediately) AudioSequencePlayer::Instance()->Play(seq, true);
+ return seq;
+ }
+ return NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+// This works for Dialogs
+AudioSequence* AudioSequencePlayer::playDialogTextControlsFromUiId(int nItemID, bool playImmediately, AudioSequence* seq, string switchCondition) {
+
+ if (nItemID != -1) {
+
+
+ if (seq == NULL) {
+ seq = new AudioSequence;
+ }
+ //AppendAudioSequenceStringResource(seq, nItemID);
+
+ Dialog* p_dialog = DataTree::Instance()->findDialog(nItemID);
+ if (p_dialog != NULL) {
+ fillSequenceCaptionAndDescription(seq, p_dialog);
+ fillSequenceSwitch(seq, p_dialog, switchCondition);
+
+ int count = p_dialog->getNumChildControls();
+ for (int i = 0 ; i < count; i++) {
+ DialogControl* control = p_dialog->getChildControl(i);
+ string strCat = control->getWidgetCategories();
+ int find = strCat.find("button");
+ if (-1 == find) {
+ fillSequenceCaptionAndDescription(seq, control);
+ }
+ }
+ }
+
+ if (playImmediately) AudioSequencePlayer::Instance()->Play(seq);
+ return seq;
+ }
+ return NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+// This works for Dialogs
+AudioSequence* AudioSequencePlayer::playDialogControlFromUiIds(int dlgID, int ctrlId, bool playImmediately, AudioSequence* seq, string switchCondition) {
+
+ if (
+ (dlgID != -1 && ctrlId != -1)
+ || (dlgID == -1 && (ctrlId == IDOK || ctrlId == IDCANCEL))
+ ) {
+
+
+ if (seq == NULL) {
+ seq = new AudioSequence;
+ }
+
+ if (dlgID == -1) {
+ if (ctrlId == IDCANCEL) {
+ PromptItem* p_prompt = DataTree::Instance()->findPromptItem("cancel_button_caption");
+ if (p_prompt != NULL)
+ {
+ fillSequenceContents(seq, p_prompt);
+ //CString text = p_prompt->concatAllText().c_str();
+ //seq->append(text);
+ }
+ p_prompt = DataTree::Instance()->findPromptItem("cancel_button_description");
+ if (p_prompt != NULL)
+ {
+ fillSequenceContents(seq, p_prompt);
+ //CString text = p_prompt->concatAllText().c_str();
+ //seq->append(text);
+ }
+
+ } else if (ctrlId == IDOK) {
+ PromptItem* p_prompt = DataTree::Instance()->findPromptItem("ok_button_caption");
+ if (p_prompt != NULL)
+ {
+ fillSequenceContents(seq, p_prompt);
+ //CString text = p_prompt->concatAllText().c_str();
+ //seq->append(text);
+ }
+ p_prompt = DataTree::Instance()->findPromptItem("ok_button_description");
+ if (p_prompt != NULL)
+ {
+ fillSequenceContents(seq, p_prompt);
+ //CString text = p_prompt->concatAllText().c_str();
+ //seq->append(text);
+ }
+
+
+ /* Dialog* p_dialog = DataTree::Instance()->findDialog(IDD_ABOUTBOX);
+ if (p_dialog != NULL) {
+ DialogControl* control = p_dialog->findControl(IDOK);
+
+ if (control != NULL) {
+ fillSequenceCaptionAndDescription(seq, control);
+ }
+ }*/
+ }
+
+
+
+
+
+
+ } else {
+ Dialog* p_dialog = DataTree::Instance()->findDialog(dlgID);
+ if (p_dialog != NULL) {
+ DialogControl* control = p_dialog->findControl(ctrlId);
+
+ if (control != NULL) {
+ fillSequenceCaptionAndDescription(seq, control);
+ }
+ }
+ }
+
+ if (playImmediately) AudioSequencePlayer::Instance()->Play(seq);
+ return seq;
+ }
+ return NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+void AudioSequencePlayer::fillSequencePrompt(AudioSequence* seq, Prompt* prompt, PromptResolver* pResolver) {
+
+ resolvePromptVariables(prompt);
+ if (pResolver != NULL) {
+ pResolver->resolvePromptVariables(prompt);
+ }
+
+ int sz = prompt->getNumberOfItems();
+ for (int i=0; i<sz; i++)
+ {
+ PromptItemBase* pib = prompt->getItem(i);
+ switch(pib->getPromptItemType()) {
+ case PROMPT_ITEM: {
+ PromptItem* pi = (PromptItem*) pib;
+ fillSequenceContents(seq, pi);
+ break;
+ }
+ case PROMPT_VARIABLE: {
+ PromptVar* pv = (PromptVar*) pib;
+ //seq->append(pv->getName().c_str());
+ fillSequenceContents(seq, pv);
+ break;
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+void AudioSequencePlayer::fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem) {
+
+ Label* label = uiItem->getCaption();
+ if (label != NULL) {
+ fillSequenceContentAndPrompt(seq, label);
+ }
+
+ label = uiItem->getDescription();
+ if (label != NULL) {
+ fillSequenceContentAndPrompt(seq, label);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+void AudioSequencePlayer::fillSequenceSwitch(AudioSequence* seq, UiItem* uiItem, string switchCondition) {
+
+ Switch* zwitch;
+ if ((zwitch = uiItem->getSwitch()) != NULL) {
+
+ switch(zwitch->getSwitchType()) {
+ case ACTIONSWITCH: {
+ Action* action = zwitch->getAction(switchCondition);
+ if (action != NULL) {
+ fillSequenceCaptionAndDescription(seq, action);
+ }
+ break;
+ }
+ case CAPTIONSWITCH: {}
+ case DESCRIPTIONSWITCH: {
+ Label* label = zwitch->getLabel(switchCondition);
+ if (label != NULL) {
+ fillSequenceContentAndPrompt(seq, label);
+ }
+ break;
+ }
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+void AudioSequencePlayer::fillSequenceContentAndPrompt(AudioSequence* seq, Label* label)
+{
+ TextAudioPair* pair = label->getContents();
+ if (pair != NULL) {
+ amis::AudioNode* audio = pair->getAudio();
+ if (!Preferences::Instance()->mbUseTTSNotAudio && audio != NULL) {
+ seq->append(audio);
+ } else {
+ TextNode* textN = pair->getText();
+ if (textN != NULL) {
+ seq->append(textN->getTextString().c_str());
+ }
+ }
+ }
+
+ Prompt* prompt = label->getPrompt();
+ if (prompt != NULL)
+ {
+ int count = prompt->getNumberOfItems();
+ for (int i=0; i<count; i++)
+ {
+ PromptItemBase* pib = prompt->getItem(i);
+ switch(pib->getPromptItemType())
+ {
+ case PROMPT_ITEM:
+ {
+ PromptItem* pi = (PromptItem*) pib;
+
+ pair = pi->getContents();
+ if (pair != NULL)
+ {
+ amis::AudioNode* audio = pair->getAudio();
+ if (!Preferences::Instance()->mbUseTTSNotAudio && audio != NULL)
+ {
+ seq->append(audio);
+ } else
+ {
+ TextNode * textN = pair->getText();
+ if (textN != NULL)
+ {
+ seq->append(textN->getTextString().c_str());
+ }
+ }
+ }
+ break;
+ }
+ case PROMPT_VARIABLE: {
+ PromptVar* pv = (PromptVar*) pib;
+
+ //We assume variable value resolution happened before.
+
+ pair = pv->getContents();
+ if (pair != NULL)
+ {
+ amis::AudioNode* audio = pair->getAudio();
+ if (!Preferences::Instance()->mbUseTTSNotAudio && audio != NULL)
+ {
+ seq->append(audio);
+ } else
+ {
+ TextNode * textN = pair->getText();
+ if (textN != NULL)
+ {
+ seq->append(textN->getTextString().c_str());
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+void AudioSequencePlayer::fillSequenceContents(AudioSequence* seq, PromptItemBase* pi) {
+
+ TextAudioPair* pair = pi->getContents();
+ if (pair != NULL) {
+ amis::AudioNode* audio = pair->getAudio();
+ if (!Preferences::Instance()->mbUseTTSNotAudio && audio != NULL) {
+ seq->append(audio);
+ } else {
+ TextNode * textN = pair->getText();
+ if (textN != NULL) {
+ seq->append(textN->getTextString().c_str());
+ }
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+//the new one
+void AudioSequencePlayer::resolvePromptVariables(Prompt* pPrompt)
+{
+ USES_CONVERSION;
+
+ PromptVar* p_var = NULL;
+
+ for (int i=0; i<pPrompt->getNumberOfItems(); i++)
+ {
+ if (pPrompt->getItem(i)->getPromptItemType() == PROMPT_VARIABLE)
+ {
+ p_var = (PromptVar*)pPrompt->getItem(i);
+
+ if (p_var->getName() == "BOOK_PATH")
+ {
+ //CString file_path = A2CW(mFilePath.c_str());
+ //p_var->setContents(LPCTSTR(file_path), "");
+ //DanToDo: is this variable actually used anywhere ? If yes, where do I get the current book path from ?
+ //amis::dtb::DtbWithHooks::Instance()->
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.h
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.h 2007-10-18 18:33:06 UTC (rev 2211)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.h 2007-10-18 22:27:17 UTC (rev 2212)
@@ -3,14 +3,19 @@
#pragma once
-#include <atlstr.h>
-#include <atlcoll.h>
+#include <process.h>
+#include <stdlib.h>
-#include <afxwin.h>
-#include <afxext.h>
+#ifndef TRACE
+#define TRACE ATLTRACE
+#endif
-#include "../AmisCore/include/Media.h"
+#include "./AccessibleUI/UiItem.h"
+#include "./promptresolver.h"
+//#include "AudioSequenceComponent.h"
+#include "AudioSequence.h"
+using namespace amis::gui::spoken;
namespace amis
{
@@ -20,111 +25,27 @@
{
// --------------------------------
-class AudioSequenceComponent
+class CCS
{
+private:
+ LPCRITICAL_SECTION m_lpCS;
+
public:
- __inline AudioSequenceComponent(){
- mWasCloned = false;
- };
- __inline ~AudioSequenceComponent(){
- m_String.Empty();
- if (mWasCloned) {
- delete m_AudioClip;
- }
- m_AudioClip = NULL;
- };
+ __inline CCS(LPCRITICAL_SECTION lpCS): m_lpCS(NULL)
+ {
+ _ASSERT(lpCS != NULL);
- __inline AudioSequenceComponent* clone() {
- AudioSequenceComponent* comp = new AudioSequenceComponent;
- comp->m_AudioClip = (m_AudioClip ? (amis::AudioNode*)m_AudioClip->clone() : NULL);
- comp->m_String = m_String;
- comp->m_isAudioClip = m_isAudioClip;
- comp->mWasCloned = true;
-
- return comp;
- };
- BOOL m_isAudioClip;
- bool mWasCloned;
- CString m_String;
- amis::AudioNode* m_AudioClip;
-};
+ m_lpCS = lpCS; // Save
+ EnterCriticalSection(lpCS);
+ }
-// --------------------------------
-class AudioSequence
-{
-public:
- __inline AudioSequence(){};
- __inline ~AudioSequence(){
- if (m_AudioSequence.GetCount() > 0)
- {
- for (size_t i = 0; i < m_AudioSequence.GetCount(); i++) {
- AudioSequenceComponent* comp = m_AudioSequence.GetAt(m_AudioSequence.FindIndex(i));
- delete comp;
- }
-
- m_AudioSequence.RemoveAll();
- }
- };
- __inline UINT GetCount() {
- return m_AudioSequence.GetCount();
- };
- __inline bool IsEmpty() {
- return m_AudioSequence.GetCount() == 0;
- };
- __inline AudioSequenceComponent* RemoveTail() {
- return m_AudioSequence.RemoveTail();
- };
- __inline void AddTail(AudioSequenceComponent* comp) {
- m_AudioSequence.AddTail(comp);
- };
- __inline void append(CString strTTS) {
- if (strTTS.IsEmpty()) {
- TRACE(L"???????????????????????????");
- }
- AudioSequenceComponent* comp = new AudioSequenceComponent;
- comp->m_isAudioClip = false;
- comp->m_AudioClip = 0;
- comp->m_String = strTTS;
- m_AudioSequence.AddHead(comp);
- };
- __inline void append(amis::AudioNode* audioClip) {
- AudioSequenceComponent* comp = new AudioSequenceComponent;
- comp->m_isAudioClip = TRUE;
- comp->m_AudioClip = audioClip;
- comp->m_String = L"";
- m_AudioSequence.AddHead(comp);
- };
- __inline void prepend(CString strTTS) {
- if (strTTS.IsEmpty()) {
- TRACE(L"???????????????????????????");
- }
- AudioSequenceComponent* comp = new AudioSequenceComponent;
- comp->m_isAudioClip = false;
- comp->m_AudioClip = 0;
- comp->m_String = strTTS;
- m_AudioSequence.AddTail(comp);
- };
- __inline void prepend(amis::AudioNode* audioClip) {
- AudioSequenceComponent* comp = new AudioSequenceComponent;
- comp->m_isAudioClip = TRUE;
- comp->m_AudioClip = audioClip;
- comp->m_String = L"";
- m_AudioSequence.AddTail(comp);
- };
- __inline AudioSequence* clone() {
- AudioSequence* seq = new AudioSequence;
- for (size_t i = 0; i < m_AudioSequence.GetCount(); i++) {
- AudioSequenceComponent* comp = m_AudioSequence.GetAt(m_AudioSequence.FindIndex(i))->clone();
- seq->AddTail(comp);
- }
-
- return seq;
- };
-private:
- CAtlList<AudioSequenceComponent*> m_AudioSequence;
+ __inline ~CCS()
+ {
+ if (m_lpCS != NULL)
+ LeaveCriticalSection(m_lpCS);
+ }
};
-// --------------------------------
class AudioSequencePlayer
{
@@ -157,28 +78,27 @@
HANDLE m_hEventWakeup;
CRITICAL_SECTION m_csSequence;
bool m_bAbort;
-};
-// --------------------------------
-class CCS
-{
-private:
- LPCRITICAL_SECTION m_lpCS;
-
public:
- __inline CCS(LPCRITICAL_SECTION lpCS): m_lpCS(NULL)
- {
- _ASSERT(lpCS != NULL);
- m_lpCS = lpCS; // Save
- EnterCriticalSection(lpCS);
- }
+ //static void AppendAudioSequenceStringResource(AudioSequence* seq, int nItemID);
+ //static void AppendAudioSequenceStringID(AudioSequence* seq, string);
- __inline ~CCS()
- {
- if (m_lpCS != NULL)
- LeaveCriticalSection(m_lpCS);
- }
+ static AudioSequence* playPromptFromUiId(int nItemID, bool playImmediately = true, AudioSequence* seq = NULL);
+ static AudioSequence* playContainerPromptFromId(string id, bool playImmediately, AudioSequence* seq = NULL);
+ static AudioSequence* playPromptFromStringId(string, bool playImmediately = true, AudioSequence* seq = NULL, PromptResolver* pResolver = NULL);
+ static AudioSequence* playPromptItemFromStringId(string, bool playImmediately = true, AudioSequence* seq = NULL, PromptResolver* pResolver = NULL);
+ static AudioSequence* playDialogInstructionsFromUiId(int nItemID, bool playImmediately = true, AudioSequence* seq = NULL);
+ static AudioSequence* playDialogTextControlsFromUiId(int nItemID, bool playImmediately = true, AudioSequence* seq = NULL, string switchCondition = "");
+ static AudioSequence* playDialogControlFromUiIds(int dlgID, int ctrlId, bool playImmediately = true, AudioSequence* seq = NULL, string switchCondition = "");
+
+ static void fillSequencePrompt(AudioSequence* seq, Prompt* prompt, PromptResolver* pResolver = NULL);
+ static void fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem);
+ static void fillSequenceSwitch(AudioSequence* seq, UiItem* uiItem, string switchCondition = "");
+ static void fillSequenceContentAndPrompt(AudioSequence* seq, Label* label);
+ static void fillSequenceContents(AudioSequence* seq, PromptItemBase* pi);
+
+ static void resolvePromptVariables(Prompt*);
};
}
Added: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/PreTranslateMessageHandler.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/PreTranslateMessageHandler.cpp (rev 0)
+++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/PreTranslateMessageHandler.cpp 2007-10-18 22:27:17 UTC (rev 2212)
@@ -0,0 +1,409 @@
+
+#include ".\pretranslatemessagehandler.h"
+//#include "gui/AmisGuiMFC2.h"
+
+PreTranslateMessageHandler::PreTranslateMessageHandler(int idUiDialog)
+{
+ m_instructionsDialogID = idUiDialog;
+ mbKeyControl = false;
+ mLastKeyDown = -1;
+ mSeq = NULL;
+}
+
+PreTranslateMessageHandler::~PreTranslateMessageHandler(void)
+{
+}
+
+bool PreTranslateMessageHandler::isControlPressed() {
+ return mbKeyControl;
+}
+
+CString PreTranslateMessageHandler::normalizeTextEntry(CString str, int nStartChar, int nEndChar) {
+
+ CString strNew = str;
+ if (nStartChar == nEndChar && nStartChar != -1) {
+ if (nStartChar >= str.GetLength()) {
+ //str = L"";
+ } else {
+ strNew = str.Mid(nStartChar, 1);
+ }
+ } else if (nStartChar != -1 && nEndChar != -1) {
+ strNew = str.Mid(nStartChar, nEndChar-nStartChar);
+ }
+ return strNew;
+}
+
+CString PreTranslateMessageHandler::convertKeystrokeToSpeakableString(WPARAM ch, bool ignoreSpaceKey, bool ignoreArrowKeys, bool ignoreCharKeys)
+{
+
+ CString cstr;
+ if (!ignoreCharKeys)
+ {
+ switch (ch)
+ {
+ case 0x08:
+
+ // Process a backspace.
+
+ break;
+
+ case 0x0A:
+
+ // Process a linefeed.
+
+ break;
+
+ case 0x1B:
+
+ // Process an escape.
+
+ break;
+
+ case 0x09:
+
+ // Process a tab.
+
+ break;
+
+ case 0x0D:
+
+ // Process a carriage return.
+
+ break;
+
+ default:
+
+ // Process displayable characters.
+
+ //echo keystrokes
+ cstr.AppendChar(ch);
+ /*if (cstr == L".") {
+ cstr = L"dot";
+ } else if (cstr == L"-") {
+ cstr = L"minus";
+...
[truncated message content] |