[Amis-vcs] SF.net SVN: amis: [2211] branches/amis3
Brought to you by:
julienq,
marisademeglio
From: <dan...@us...> - 2007-10-18 18:33:03
|
Revision: 2211 http://amis.svn.sourceforge.net/amis/?rev=2211&view=rev Author: daniel_weck Date: 2007-10-18 11:33:06 -0700 (Thu, 18 Oct 2007) Log Message: ----------- - Daniel WECK * Added new namespaces: amis::gui::spoken amis::audio amis::tts * Harmonized callback functions for TTS and AmisAudio Modified Paths: -------------- branches/amis3/AmisAudio/AmisAudio.cpp branches/amis3/AmisAudio/AmisAudio.h branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.cpp branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AccessibleUIDataReader.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AccessibleUiDataReader.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPrompt.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPrompt.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPromptReader.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPromptReader.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DataTree.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DataTree.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/LabelList.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/LabelList.h 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/Switch.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Switch.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.h branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.cpp branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.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/PreTranslateMessageHandler.h branches/amis3/AmisGuiMFC2/include/gui/AmisGuiMFC2.h branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp Modified: branches/amis3/AmisAudio/AmisAudio.cpp =================================================================== --- branches/amis3/AmisAudio/AmisAudio.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisAudio/AmisAudio.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -32,6 +32,8 @@ #include "AmisAudio.h" #include <process.h> + +using namespace amis::audio; //#include "win32Fix.H" Modified: branches/amis3/AmisAudio/AmisAudio.h =================================================================== --- branches/amis3/AmisAudio/AmisAudio.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisAudio/AmisAudio.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -49,7 +49,7 @@ #include "./mffmTimeCode/smilTimeCode.H" //for message sending ... -typedef void (*sendMessageCallbackFn)(void *); +typedef void (*sendMessageCallbackFn)(); //using namespace std; @@ -62,6 +62,10 @@ /** This class is exported from the AmisAudio.dll*/ +namespace amis +{ +namespace audio +{ class AMISAUDIO_API AmisAudio { protected: @@ -117,8 +121,9 @@ void adjustVolume(int); void adjustRate(double); - typedef void (*sendMessageCallbackFn)(void *); + typedef void (*sendMessageCallbackFn)(void); void setCallback(sendMessageCallbackFn pFunction); + private: void ShowStatePrompt(); @@ -140,5 +145,7 @@ //CDmpApp* pDmpApp; }; +} +} #endif \ No newline at end of file Modified: branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.cpp =================================================================== --- branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -1163,7 +1163,7 @@ stopPosition = 0; //AudioSequencePlayer::Instance()->ClipAudioEndNotify(); - sendMessageCallback(0); + sendMessageCallback(); //SetEndOfStream(true); // pause(); Modified: branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.h =================================================================== --- branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisAudio/TPBReader2/dmp/DmpCtl.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -56,7 +56,7 @@ public: CDmpCtrl(); - typedef void (*sendMessageCallbackFn)(void *); + typedef void (*sendMessageCallbackFn)(void); sendMessageCallbackFn sendMessageCallback; void setCallback(sendMessageCallbackFn pFunction); Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AccessibleUIDataReader.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AccessibleUIDataReader.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AccessibleUIDataReader.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -29,8 +29,8 @@ //#include "../../AmisCommon/AmisCommon.h" //#include "../Brain/trim.h" -namespace AccessibleUi -{ +using namespace amis::gui::spoken; + DataReader::DataReader() { mUiItems.empty(); @@ -63,7 +63,7 @@ //-------------- //start parsing the file and filling in the data model (passed in as pData) -amis::Error DataReader::readFile(string inputFilepath, AccessibleUi::DataTree* pData) +amis::Error DataReader::readFile(string inputFilepath, DataTree* pData) { amis::Error err; @@ -1218,5 +1218,3 @@ return p_item; } - -} \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AccessibleUiDataReader.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AccessibleUiDataReader.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AccessibleUiDataReader.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -43,8 +43,13 @@ using namespace std; -namespace AccessibleUi + +namespace amis { +namespace gui +{ +namespace spoken +{ class DataReader: public DefaultHandler { public: @@ -109,5 +114,6 @@ }; -}//end namespace AccessibleUi +}}} + #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -1,8 +1,8 @@ #include "Action.h" #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; + Action::Action() { this->setUiItemType(ACTION); @@ -25,7 +25,7 @@ } -AccessibleUi::ImageNode* Action::getImage(ImageType type) +ImageNode* Action::getImage(ImageType type) { ImageNode* p_node = NULL; @@ -54,7 +54,7 @@ return mMnemonic; } -void Action::addImage(AccessibleUi::ImageNode* pNode) +void Action::addImage(ImageNode* pNode) { mImages.push_back(pNode); } @@ -150,5 +150,3 @@ p_list->testPrint(outfile, numTabs + 1); } - -} //end namespace AccessibleUi \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Action.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -4,14 +4,19 @@ #include "UiMediaTypes.h" #include "UiItem.h" -namespace AccessibleUi + +namespace amis { +namespace gui +{ +namespace spoken +{ class Action : public UiItem { public: Action(); ~Action(); - AccessibleUi::ImageNode* getImage(ImageType); + ImageNode* getImage(ImageType); std::string getWidgetCategories(); @@ -24,7 +29,7 @@ void testPrint(std::string, int); protected: - void addImage(AccessibleUi::ImageNode*); + void addImage(ImageNode*); void setWidgetCategories(std::string); void setKeyboardAccelerator(Label*); @@ -33,7 +38,7 @@ void setCondition(std::string); private: - std::vector<AccessibleUi::ImageNode*> mImages; + std::vector<ImageNode*> mImages; std::string mWidgetCategories; Label* mAccelerator; @@ -46,5 +51,5 @@ }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPrompt.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPrompt.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPrompt.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -1,5 +1,6 @@ #include "AudioPrompt.h" +using namespace amis::gui::spoken; //************ // audio prompt component Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPrompt.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPrompt.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPrompt.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -11,6 +11,13 @@ a runtime value, like "yellow" or "c:\file" */ +namespace amis +{ +namespace gui +{ +namespace spoken +{ + class AudioPromptComponent { public: @@ -91,5 +98,6 @@ }; +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPromptReader.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPromptReader.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPromptReader.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -44,8 +44,8 @@ #include "AudioPromptReader.h" using namespace std; +using namespace amis::gui::spoken; - AudioPromptReader::AudioPromptReader() { Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPromptReader.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPromptReader.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/AudioPromptReader.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -41,6 +41,12 @@ using namespace std; +namespace amis +{ +namespace gui +{ +namespace spoken +{ //!Get an action list from a prompts XML file @@ -86,5 +92,5 @@ }; - +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -7,8 +7,7 @@ #include "Switch.h" #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; Container::Container() { @@ -191,5 +190,3 @@ } } - -} //end namespace AccessibleUi \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Container.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -5,9 +5,13 @@ #include "UiItem.h" #include "Action.h" -namespace AccessibleUi + +namespace amis { - +namespace gui +{ +namespace spoken +{ class Container : public UiItem { public: @@ -34,5 +38,5 @@ friend class DataReader; }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DataTree.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DataTree.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DataTree.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -1,8 +1,7 @@ #include "DataTree.h" #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; DataTree* DataTree::pinstance = 0; @@ -330,5 +329,3 @@ } } - -} \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DataTree.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DataTree.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DataTree.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -5,8 +5,13 @@ #include "Dialog.h" #include "Switch.h" -namespace AccessibleUi + +namespace amis { +namespace gui +{ +namespace spoken +{ class DataTree { protected: @@ -63,5 +68,5 @@ friend class DataReader; }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -2,8 +2,8 @@ #include "Dialog.h" #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; + Dialog::Dialog() { mChildControls.empty(); @@ -159,5 +159,3 @@ { mPrompts.push_back(pPrompt); } - -} Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Dialog.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -5,9 +5,13 @@ #include "Prompt.h" #include "DialogControl.h" -namespace AccessibleUi + +namespace amis { - +namespace gui +{ +namespace spoken +{ class Dialog : public UiItem { public: @@ -34,5 +38,5 @@ friend class DataReader; }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -2,8 +2,8 @@ #include "Switch.h" #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; + DialogControl::DialogControl() { setUiItemType(CONTROL); @@ -68,4 +68,3 @@ mWidgetCategories.assign(widgetCategories); } -} Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/DialogControl.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -6,8 +6,13 @@ #include "UiItem.h" #include "LabelList.h" -namespace AccessibleUi + +namespace amis { +namespace gui +{ +namespace spoken +{ class DialogControl : public UiItem { public: @@ -27,5 +32,5 @@ friend class DataReader; }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -5,6 +5,8 @@ #include ".\inifile.h" +using namespace amis::gui::spoken; + CIniFile::CIniFile(void) // Default constructor { } Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/IniFile.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -7,6 +7,14 @@ #include <functional> using namespace std; + +namespace amis +{ +namespace gui +{ +namespace spoken +{ + class CIniFile { public: @@ -112,4 +120,5 @@ return Start.Key > End.Key; } }; -}; \ No newline at end of file +}; +}}} \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -1,8 +1,7 @@ #include "Label.h" #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; Label::Label() { @@ -131,6 +130,4 @@ return p_new; } - - -} \ No newline at end of file + \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Label.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -3,8 +3,13 @@ #include "Prompt.h" -namespace AccessibleUi + +namespace amis { +namespace gui +{ +namespace spoken +{ enum LabelType {CAPTION, DESCRIPTION, ACCELERATOR, MNEMONIC}; class Label @@ -46,5 +51,5 @@ friend class DataReader; }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/LabelList.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/LabelList.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/LabelList.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -1,8 +1,7 @@ #include "LabelList.h" #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; LabelList::LabelList() { @@ -79,5 +78,3 @@ { mLabels.push_back(pLabel); } - -} Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/LabelList.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/LabelList.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/LabelList.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -3,8 +3,13 @@ #include "Label.h" -namespace AccessibleUi + +namespace amis { +namespace gui +{ +namespace spoken +{ class LabelList { public: @@ -26,6 +31,6 @@ friend class DataReader; }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -2,10 +2,8 @@ #include "Prompt.h" #include <fstream> +using namespace amis::gui::spoken; -namespace AccessibleUi -{ - //** //PromptItemBase PromptItemBase::PromptItemBase() @@ -427,5 +425,3 @@ mItems[j]->testPrint(outfile, numTabs + 1); } } - -}//end namespace AccessibleUi \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Prompt.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -5,9 +5,13 @@ #include "UiMediaTypes.h" -namespace AccessibleUi + +namespace amis { - +namespace gui +{ +namespace spoken +{ enum PromptItemType {PROMPT_VARIABLE, PROMPT_ITEM}; class PromptItemBase @@ -117,5 +121,5 @@ }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -1,8 +1,8 @@ //#include "stdafx.h" #include ".\promptresolver.h" -namespace AccessibleUi -{ +using namespace amis::gui::spoken; + /* PromptResolver::PromptResolver(void) { @@ -11,4 +11,3 @@ PromptResolver::~PromptResolver(void) { }*/ -} \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/PromptResolver.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -5,15 +5,20 @@ #ifndef PROMPTRESOLVER_H #define PROMPTRESOLVER_H -namespace AccessibleUi + +namespace amis { -class PromptResolver +namespace gui { +namespace spoken +{ + class PromptResolver +{ public: //PromptResolver(void); //virtual ~PromptResolver = 0; - virtual void resolvePromptVariables(AccessibleUi::Prompt*) = 0; + virtual void resolvePromptVariables(Prompt*) = 0; }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Switch.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Switch.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Switch.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -5,8 +5,7 @@ #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; Switch::Switch() { @@ -181,5 +180,3 @@ } } } - -} \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Switch.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Switch.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/Switch.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -4,8 +4,13 @@ #include "Action.h" #include "Label.h" -namespace AccessibleUi + +namespace amis { +namespace gui +{ +namespace spoken +{ enum SwitchType {ACTIONSWITCH, CAPTIONSWITCH, DESCRIPTIONSWITCH}; class Switch @@ -38,6 +43,6 @@ friend class DataReader; }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -1,8 +1,8 @@ #include "UiItem.h" #include "Switch.h" -namespace AccessibleUi -{ +using namespace amis::gui::spoken; + UiItem::UiItem() { mpDescription = NULL; @@ -101,6 +101,3 @@ mpLabelList = pList; } - -}//end namespace AccessibleUi - Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiItem.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -5,9 +5,13 @@ #include "Label.h" #include "LabelList.h" -namespace AccessibleUi + +namespace amis { - +namespace gui +{ +namespace spoken +{ enum UiItemType {NONE, CONTAINER, ACTION, DIALOG, CONTROL}; class Switch; @@ -62,5 +66,5 @@ friend class DataReader; }; -} +}}} #endif Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -2,8 +2,7 @@ #include "UiMediaTypes.h" #include <fstream> -namespace AccessibleUi -{ +using namespace amis::gui::spoken; //*********** //TextNode @@ -158,6 +157,3 @@ out.close(); } - - -}//end namespace AccessibleUi Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AccessibleUI/UiMediaTypes.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -6,9 +6,13 @@ #include "../AmisCore/include/Media.h" -namespace AccessibleUi + +namespace amis { - +namespace gui +{ +namespace spoken +{ class TextNode : public amis::TextNode { public: @@ -66,5 +70,5 @@ }; -} +}}} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -23,14 +23,50 @@ #endif +using namespace amis::audio; +using namespace amis::tts; +AudioSequencePlayer* AudioSequencePlayer::pinstance = 0; -AudioSequencePlayer* AudioSequencePlayer::pinstance = 0; +void AudioSequencePlayer::TTSAudioEndNotify() { + TRACE(L"####### END TTS"); + m_wakeUpOriginator = 2; // TTS END + SetEvent(m_hEventWakeup); + /* + if (m_wakeUpAction != 0) { + SetEvent(m_hEventWakeup); + } else { + m_nEndEventsToExpect--; + if (m_nEndEventsToExpect <= 0) { + SetEvent(m_hEventWakeup); + } + }*/ +} +void AudioSequencePlayer::ClipAudioEndNotify() { + TRACE(L"####### END AUDIO"); + m_wakeUpOriginator = 3; // AUDIO CLIP END + SetEvent(m_hEventWakeup); + /* + if (m_wakeUpAction != 0) { + SetEvent(m_hEventWakeup); + } else { + m_nEndEventsToExpect--; + if (m_nEndEventsToExpect <= 0) { + SetEvent(m_hEventWakeup); + } + }*/ +} + +//The message callback function ... signals end of the tts +static void ttsFinishedCallback() +{ + AudioSequencePlayer::Instance()->ClipAudioEndNotify(); +} //The message callback function ... signals end of the clip -static void clipFinishedCallback(void *wind) +static void clipFinishedCallback() { AudioSequencePlayer::Instance()->ClipAudioEndNotify(); } @@ -57,6 +93,7 @@ unsigned int threadID; AmisAudio::Instance()->setCallback((sendMessageCallbackFn)clipFinishedCallback); + TTSPlayer::Instance()->setCallback((sendMessageCallbackFn)ttsFinishedCallback); InitializeCriticalSection(&m_csSequence); @@ -218,35 +255,7 @@ } } -void AudioSequencePlayer::TTSAudioEndNotify() { - TRACE(L"####### END TTS"); - m_wakeUpOriginator = 2; // TTS END - SetEvent(m_hEventWakeup); - /* - if (m_wakeUpAction != 0) { - SetEvent(m_hEventWakeup); - } else { - m_nEndEventsToExpect--; - if (m_nEndEventsToExpect <= 0) { - SetEvent(m_hEventWakeup); - } - }*/ -} -void AudioSequencePlayer::ClipAudioEndNotify() { - TRACE(L"####### END AUDIO"); - m_wakeUpOriginator = 3; // AUDIO CLIP END - SetEvent(m_hEventWakeup); - /* - if (m_wakeUpAction != 0) { - SetEvent(m_hEventWakeup); - } else { - m_nEndEventsToExpect--; - if (m_nEndEventsToExpect <= 0) { - SetEvent(m_hEventWakeup); - } - }*/ -} // DanToDo: this string function should move to utilities. string AudioSequencePlayer::stringReplaceAll(string sourceStr, string searchStr, string replaceStr) Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/AudioSequencePlayer.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -11,6 +11,14 @@ #include "../AmisCore/include/Media.h" + +namespace amis +{ +namespace gui +{ +namespace spoken +{ + // -------------------------------- class AudioSequenceComponent { @@ -173,4 +181,7 @@ } }; +} +} +} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/TTSPlayer.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/TTSPlayer.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/TTSPlayer.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -9,8 +9,6 @@ #include <spuihelp.h> #include <sphelper.h> -#include "AudioSequencePlayer.h" - #ifndef TRACE #define TRACE ATLTRACE #endif @@ -21,6 +19,14 @@ #include "../AmisGuiMFC2/include/Preferences.h" #include "../AmisGuiMFC2/resource.h" +using namespace amis::tts; + + +void TTSPlayer::setCallback(sendMessageCallbackFn pFunction) +{ + sendMessageCallback = pFunction; +} + TTSPlayer* TTSPlayer::pinstance = 0; TTSPlayer* TTSPlayer::Instance() @@ -36,7 +42,6 @@ // Error value is LONG_MAX. long TTSPlayer::GetSpeechRate() { -#ifdef COMPILE_WITH_SAPI long pRate; HRESULT hr = 0; hr = m_iV->GetRate(&pRate); @@ -48,15 +53,12 @@ _ASSERT(0); return LONG_MAX; // Should never happen ! } -#else - return LONG_MAX; -#endif } // between -10 and 10. 0 is default rate (engine dependant). BOOL TTSPlayer::SetSpeechRate(long newRate) { -#ifdef COMPILE_WITH_SAPI + HRESULT hr = 0; hr = m_iV->SetRate(newRate); if (SUCCEEDED(hr)) { @@ -67,43 +69,37 @@ _ASSERT(0); return FALSE; // Should never happen ! } -#else - return FALSE; -#endif } void TTSPlayer::Play(CString str) { TRACE(L"******"); TRACE(str); -#ifdef COMPILE_WITH_SAPI if (IsSpeaking()) { TRACE("????????"); } m_iV->Speak(str, SPF_ASYNC | SPF_PURGEBEFORESPEAK, NULL); -#endif } void TTSPlayer::Stop() { -#ifdef COMPILE_WITH_SAPI m_iV->Speak(NULL, SPF_ASYNC | SPF_PURGEBEFORESPEAK, NULL); m_isSpeaking = FALSE; //m_iV->Speak(L"", SPF_ASYNC | SPF_PURGEBEFORESPEAK, NULL); -#endif + } void TTSPlayer::WaitUntilDone() { -#ifdef COMPILE_WITH_SAPI + m_iV->WaitUntilDone(INFINITE); -#endif + } -#ifdef COMPILE_WITH_SAPI + void __stdcall TTSPlayer::SpkCallback(WPARAM wParam, LPARAM lParam) { @@ -133,7 +129,8 @@ ((TTSPlayer *)lParam)->m_isSpeaking = FALSE; - AudioSequencePlayer::Instance()->TTSAudioEndNotify(); + ((TTSPlayer *)lParam)->sendMessageCallback(); + break; case SPEI_VOICE_CHANGE: @@ -194,16 +191,15 @@ CoUninitialize(); } -#endif int TTSPlayer::initVoiceList(HWND hWnd) { -#ifdef COMPILE_WITH_SAPI + HRESULT hr = SpInitTokenComboBox( GetDlgItem( hWnd, IDC_TTSVOICE ), SPCAT_VOICES ); //HRESULT hr = SpInitTokenComboBox( GetDlgItem( IDC_TTSVOICE )->GetSafeHwnd(), SPCAT_VOICES ); if ( SUCCEEDED( hr ) ) {return m_currentVoiceNumber;} else {return -1;} -#endif + } void TTSPlayer::ChangeVoice(int index) { @@ -214,7 +210,6 @@ void TTSPlayer::ChangeVoice(bool speakNotify) { - #ifdef COMPILE_WITH_SAPI HRESULT hr = S_OK; CComPtr<ISpObjectToken> cpVoiceToken; @@ -254,7 +249,4 @@ if(SUCCEEDED(hr) && speakNotify) Play( L"This is my new voice !"); -#else - return; -#endif } \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/AmisSelfVoicing/TTSPlayer.h =================================================================== --- branches/amis3/AmisGuiMFC2/AmisSelfVoicing/TTSPlayer.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/AmisSelfVoicing/TTSPlayer.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -3,17 +3,11 @@ #pragma once -#ifndef COMPILE_WITH_SAPI -#define COMPILE_WITH_SAPI // Comment this line if you want to compile AMIS without SAPI support -#endif // ! COMPILE_WITH_SAPI - #include <afxwin.h> #include <afxext.h> -#ifdef COMPILE_WITH_SAPI #include <sapi.h> #include <sphelper.h> -#endif //COMPILE_WITH_SAPI @@ -21,9 +15,20 @@ //#include "../AmisCore/include/Media.h" +namespace amis +{ +namespace tts +{ + class TTSPlayer { public: + + typedef void (*sendMessageCallbackFn)(void); + + sendMessageCallbackFn sendMessageCallback; + void setCallback(sendMessageCallbackFn pFunction); + static void DestroyInstance(); static TTSPlayer* Instance(); @@ -46,7 +51,6 @@ static TTSPlayer* pinstance; -#ifdef COMPILE_WITH_SAPI private: static void __stdcall SpkCallback(WPARAM wParam, LPARAM lParam); @@ -58,7 +62,7 @@ ISpVoice* m_iV; // Voice Interface -#endif //COMPILE_WITH_SAPI }; - +} +} #endif \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/PreTranslateMessageHandler.h =================================================================== --- branches/amis3/AmisGuiMFC2/PreTranslateMessageHandler.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/PreTranslateMessageHandler.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -2,6 +2,14 @@ #include "../AmisSelfVoicing/AudioSequencePlayer.h" + +namespace amis +{ +namespace gui +{ +namespace spoken +{ + class PreTranslateMessageHandler { public: @@ -35,3 +43,6 @@ //bool processGeneralDialogFeedback(bool playNow, AudioSequence*, MSG* pMsg, int idUiFocus, bool ignoreSpaceKey, bool ignoreArrowKeys, CString strTextField); //void processGeneralKeyPressFeedback(bool playNow, AudioSequence* ,MSG* pMsg, bool ignoreSpaceKey, bool ignoreArrowKeys); }; +} +} +} \ No newline at end of file Modified: branches/amis3/AmisGuiMFC2/include/gui/AmisGuiMFC2.h =================================================================== --- branches/amis3/AmisGuiMFC2/include/gui/AmisGuiMFC2.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/include/gui/AmisGuiMFC2.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -103,19 +103,19 @@ AudioSequence* playPromptFromUiId(int nItemID, bool playImmediately = true, AudioSequence* seq = NULL); AudioSequence* playContainerPromptFromId(string id, bool playImmediately, AudioSequence* seq = NULL); - AudioSequence* playPromptFromStringId(string, bool playImmediately = true, AudioSequence* seq = NULL, AccessibleUi::PromptResolver* pResolver = NULL); - AudioSequence* playPromptItemFromStringId(string, bool playImmediately = true, AudioSequence* seq = NULL, AccessibleUi::PromptResolver* pResolver = NULL); + AudioSequence* playPromptFromStringId(string, bool playImmediately = true, AudioSequence* seq = NULL, PromptResolver* pResolver = NULL); + AudioSequence* playPromptItemFromStringId(string, bool playImmediately = true, AudioSequence* seq = NULL, PromptResolver* pResolver = NULL); AudioSequence* playDialogInstructionsFromUiId(int nItemID, bool playImmediately = true, AudioSequence* seq = NULL); AudioSequence* playDialogTextControlsFromUiId(int nItemID, bool playImmediately = true, AudioSequence* seq = NULL, string switchCondition = ""); AudioSequence* playDialogControlFromUiIds(int dlgID, int ctrlId, bool playImmediately = true, AudioSequence* seq = NULL, string switchCondition = ""); - void fillSequencePrompt(AudioSequence* seq, AccessibleUi::Prompt* prompt, AccessibleUi::PromptResolver* pResolver = NULL); - void fillSequenceCaptionAndDescription(AudioSequence* seq, AccessibleUi::UiItem* uiItem); - void fillSequenceSwitch(AudioSequence* seq, AccessibleUi::UiItem* uiItem, string switchCondition = ""); - void fillSequenceContentAndPrompt(AudioSequence* seq, AccessibleUi::Label* label); - void fillSequenceContents(AudioSequence* seq, AccessibleUi::PromptItemBase* pi); + void fillSequencePrompt(AudioSequence* seq, Prompt* prompt, PromptResolver* pResolver = NULL); + void fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem); + void fillSequenceSwitch(AudioSequence* seq, UiItem* uiItem, string switchCondition = ""); + void fillSequenceContentAndPrompt(AudioSequence* seq, Label* label); + void fillSequenceContents(AudioSequence* seq, PromptItemBase* pi); - void resolvePromptVariables(AccessibleUi::Prompt*); + void resolvePromptVariables(Prompt*); private: void initPathsAndFiles(); Modified: branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h =================================================================== --- branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h 2007-10-18 18:33:06 UTC (rev 2211) @@ -27,6 +27,10 @@ #include "../../PreTranslateMessageHandler.h" #pragma once + +using namespace amis::gui::spoken; + + namespace amis { namespace gui Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/src/gui/AmisGuiMFC2.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -63,6 +63,8 @@ #define MAX_ANYTHING 49 using namespace amis::gui; +using namespace amis::audio; +using namespace amis::tts; // CAmisGuiMFC2App @@ -186,9 +188,9 @@ if (amis::Preferences::Instance()->mbIsSelfVoicing == true) { //read in the new self-voicing/accessible UI data - AccessibleUi::DataReader new_data_reader; - AccessibleUi::DataTree* p_new_data_tree; - p_new_data_tree = AccessibleUi::DataTree::Instance(); + DataReader new_data_reader; + DataTree* p_new_data_tree; + p_new_data_tree = DataTree::Instance(); string tmpStr = amis::Preferences::Instance()->mUiLang; @@ -266,7 +268,7 @@ TTSPlayer::Instance()->DestroyInstance(); AudioSequencePlayer::Instance()->DestroyInstance(); - AccessibleUi::DataTree::Instance()->DestroyInstance(); + DataTree::Instance()->DestroyInstance(); } if (mpRecentBooks) delete mpRecentBooks; @@ -631,23 +633,23 @@ } //AppendAudioSequenceStringResource(seq, nItemID); - AccessibleUi::UiItem* p_uiItem = AccessibleUi::DataTree::Instance()->findUiItemInContainers(nItemID, strCondition); + UiItem* p_uiItem = DataTree::Instance()->findUiItemInContainers(nItemID, strCondition); if (p_uiItem != NULL) { - AccessibleUi::Label* keyboardShortcutAccelerator = NULL; - AccessibleUi::Label* mnemonic = NULL; - if (p_uiItem->getUiItemType() == AccessibleUi::ACTION) { - AccessibleUi::Action* action = (AccessibleUi::Action*)p_uiItem; + 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() == AccessibleUi::CONTAINER) { - AccessibleUi::Container* container = (AccessibleUi::Container*)p_uiItem; + else if (p_uiItem->getUiItemType() == CONTAINER) { + Container* container = (Container*)p_uiItem; keyboardShortcutAccelerator = container->getKeyboardAccelerator(); } //fillSequenceCaptionAndDescription(seq, p_uiItem); - AccessibleUi::Label* label = p_uiItem->getCaption(); + Label* label = p_uiItem->getCaption(); if (label != NULL) { fillSequenceContentAndPrompt(seq, label); } @@ -767,13 +769,13 @@ if (!id.empty()) { - AccessibleUi::Container* p_container = AccessibleUi::DataTree::Instance()->findContainer(id); + Container* p_container = DataTree::Instance()->findContainer(id); if (p_container != NULL) { if (seq == NULL) { seq = new AudioSequence; } - AccessibleUi::Label* keyboardShortcutAccelerator = p_container->getKeyboardAccelerator(); + Label* keyboardShortcutAccelerator = p_container->getKeyboardAccelerator(); fillSequenceCaptionAndDescription(seq, p_container); @@ -791,7 +793,7 @@ //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // This works for Prompts. -AudioSequence* CAmisGuiMFC2App::playPromptFromStringId(string promptId, bool playImmediately, AudioSequence* seq, AccessibleUi::PromptResolver* pResolver) +AudioSequence* CAmisGuiMFC2App::playPromptFromStringId(string promptId, bool playImmediately, AudioSequence* seq, PromptResolver* pResolver) { @@ -801,7 +803,7 @@ //AppendAudioSequenceStringID(seq, promptId); - AccessibleUi::Prompt* p_prompt_ = AccessibleUi::DataTree::Instance()->findPrompt(promptId); + Prompt* p_prompt_ = DataTree::Instance()->findPrompt(promptId); if (p_prompt_ != NULL) { @@ -816,7 +818,7 @@ //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // This works for Prompts. -AudioSequence* CAmisGuiMFC2App::playPromptItemFromStringId(string promptId, bool playImmediately, AudioSequence* seq, AccessibleUi::PromptResolver* pResolver) +AudioSequence* CAmisGuiMFC2App::playPromptItemFromStringId(string promptId, bool playImmediately, AudioSequence* seq, PromptResolver* pResolver) { @@ -825,7 +827,7 @@ seq = new AudioSequence; } - AccessibleUi::PromptItem* p_prompt_ = AccessibleUi::DataTree::Instance()->findPromptItem(promptId); + PromptItem* p_prompt_ = DataTree::Instance()->findPromptItem(promptId); if (p_prompt_ != NULL) { @@ -848,9 +850,9 @@ } //AppendAudioSequenceStringResource(seq, nItemID); - AccessibleUi::Dialog* p_dialog = AccessibleUi::DataTree::Instance()->findDialog(nItemID); + Dialog* p_dialog = DataTree::Instance()->findDialog(nItemID); if (p_dialog != NULL) { - AccessibleUi::Prompt* prompt = p_dialog->getPrompt("instructions"); + Prompt* prompt = p_dialog->getPrompt("instructions"); if (prompt != NULL) { fillSequencePrompt(seq, prompt); } @@ -874,14 +876,14 @@ } //AppendAudioSequenceStringResource(seq, nItemID); - AccessibleUi::Dialog* p_dialog = AccessibleUi::DataTree::Instance()->findDialog(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++) { - AccessibleUi::DialogControl* control = p_dialog->getChildControl(i); + DialogControl* control = p_dialog->getChildControl(i); string strCat = control->getWidgetCategories(); int find = strCat.find("button"); if (-1 == find) { @@ -913,14 +915,14 @@ if (dlgID == -1) { if (ctrlId == IDCANCEL) { - AccessibleUi::PromptItem* p_prompt = AccessibleUi::DataTree::Instance()->findPromptItem("cancel_button_caption"); + 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 = AccessibleUi::DataTree::Instance()->findPromptItem("cancel_button_description"); + p_prompt = DataTree::Instance()->findPromptItem("cancel_button_description"); if (p_prompt != NULL) { fillSequenceContents(seq, p_prompt); @@ -929,14 +931,14 @@ } } else if (ctrlId == IDOK) { - AccessibleUi::PromptItem* p_prompt = AccessibleUi::DataTree::Instance()->findPromptItem("ok_button_caption"); + 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 = AccessibleUi::DataTree::Instance()->findPromptItem("ok_button_description"); + p_prompt = DataTree::Instance()->findPromptItem("ok_button_description"); if (p_prompt != NULL) { fillSequenceContents(seq, p_prompt); @@ -945,9 +947,9 @@ } - /* AccessibleUi::Dialog* p_dialog = AccessibleUi::DataTree::Instance()->findDialog(IDD_ABOUTBOX); + /* Dialog* p_dialog = DataTree::Instance()->findDialog(IDD_ABOUTBOX); if (p_dialog != NULL) { - AccessibleUi::DialogControl* control = p_dialog->findControl(IDOK); + DialogControl* control = p_dialog->findControl(IDOK); if (control != NULL) { fillSequenceCaptionAndDescription(seq, control); @@ -961,9 +963,9 @@ } else { - AccessibleUi::Dialog* p_dialog = AccessibleUi::DataTree::Instance()->findDialog(dlgID); + Dialog* p_dialog = DataTree::Instance()->findDialog(dlgID); if (p_dialog != NULL) { - AccessibleUi::DialogControl* control = p_dialog->findControl(ctrlId); + DialogControl* control = p_dialog->findControl(ctrlId); if (control != NULL) { fillSequenceCaptionAndDescription(seq, control); @@ -979,7 +981,7 @@ //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// -void CAmisGuiMFC2App::fillSequencePrompt(AudioSequence* seq, AccessibleUi::Prompt* prompt, AccessibleUi::PromptResolver* pResolver) { +void CAmisGuiMFC2App::fillSequencePrompt(AudioSequence* seq, Prompt* prompt, PromptResolver* pResolver) { resolvePromptVariables(prompt); if (pResolver != NULL) { @@ -989,15 +991,15 @@ int sz = prompt->getNumberOfItems(); for (int i=0; i<sz; i++) { - AccessibleUi::PromptItemBase* pib = prompt->getItem(i); + PromptItemBase* pib = prompt->getItem(i); switch(pib->getPromptItemType()) { - case AccessibleUi::PROMPT_ITEM: { - AccessibleUi::PromptItem* pi = (AccessibleUi::PromptItem*) pib; + case PROMPT_ITEM: { + PromptItem* pi = (PromptItem*) pib; fillSequenceContents(seq, pi); break; } - case AccessibleUi::PROMPT_VARIABLE: { - AccessibleUi::PromptVar* pv = (AccessibleUi::PromptVar*) pib; + case PROMPT_VARIABLE: { + PromptVar* pv = (PromptVar*) pib; //seq->append(pv->getName().c_str()); fillSequenceContents(seq, pv); break; @@ -1009,9 +1011,9 @@ //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// -void CAmisGuiMFC2App::fillSequenceCaptionAndDescription(AudioSequence* seq, AccessibleUi::UiItem* uiItem) { +void CAmisGuiMFC2App::fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem) { - AccessibleUi::Label* label = uiItem->getCaption(); + Label* label = uiItem->getCaption(); if (label != NULL) { fillSequenceContentAndPrompt(seq, label); } @@ -1024,22 +1026,22 @@ //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// -void CAmisGuiMFC2App::fillSequenceSwitch(AudioSequence* seq, AccessibleUi::UiItem* uiItem, string switchCondition) { +void CAmisGuiMFC2App::fillSequenceSwitch(AudioSequence* seq, UiItem* uiItem, string switchCondition) { - AccessibleUi::Switch* zwitch; + Switch* zwitch; if ((zwitch = uiItem->getSwitch()) != NULL) { switch(zwitch->getSwitchType()) { - case AccessibleUi::ACTIONSWITCH: { - AccessibleUi::Action* action = zwitch->getAction(switchCondition); + case ACTIONSWITCH: { + Action* action = zwitch->getAction(switchCondition); if (action != NULL) { fillSequenceCaptionAndDescription(seq, action); } break; } - case AccessibleUi::CAPTIONSWITCH: {} - case AccessibleUi::DESCRIPTIONSWITCH: { - AccessibleUi::Label* label = zwitch->getLabel(switchCondition); + case CAPTIONSWITCH: {} + case DESCRIPTIONSWITCH: { + Label* label = zwitch->getLabel(switchCondition); if (label != NULL) { fillSequenceContentAndPrompt(seq, label); } @@ -1051,33 +1053,33 @@ //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// -void CAmisGuiMFC2App::fillSequenceContentAndPrompt(AudioSequence* seq, AccessibleUi::Label* label) +void CAmisGuiMFC2App::fillSequenceContentAndPrompt(AudioSequence* seq, Label* label) { - AccessibleUi::TextAudioPair* pair = label->getContents(); + TextAudioPair* pair = label->getContents(); if (pair != NULL) { amis::AudioNode* audio = pair->getAudio(); if (!Preferences::Instance()->mbUseTTSNotAudio && audio != NULL) { seq->append(audio); } else { - AccessibleUi::TextNode* textN = pair->getText(); + TextNode* textN = pair->getText(); if (textN != NULL) { seq->append(textN->getTextString().c_str()); } } } - AccessibleUi::Prompt* prompt = label->getPrompt(); + Prompt* prompt = label->getPrompt(); if (prompt != NULL) { int count = prompt->getNumberOfItems(); for (int i=0; i<count; i++) { - AccessibleUi::PromptItemBase* pib = prompt->getItem(i); + PromptItemBase* pib = prompt->getItem(i); switch(pib->getPromptItemType()) { - case AccessibleUi::PROMPT_ITEM: + case PROMPT_ITEM: { - AccessibleUi::PromptItem* pi = (AccessibleUi::PromptItem*) pib; + PromptItem* pi = (PromptItem*) pib; pair = pi->getContents(); if (pair != NULL) @@ -1088,7 +1090,7 @@ seq->append(audio); } else { - AccessibleUi::TextNode * textN = pair->getText(); + TextNode * textN = pair->getText(); if (textN != NULL) { seq->append(textN->getTextString().c_str()); @@ -1097,8 +1099,8 @@ } break; } - case AccessibleUi::PROMPT_VARIABLE: { - AccessibleUi::PromptVar* pv = (AccessibleUi::PromptVar*) pib; + case PROMPT_VARIABLE: { + PromptVar* pv = (PromptVar*) pib; //We assume variable value resolution happened before. @@ -1111,7 +1113,7 @@ seq->append(audio); } else { - AccessibleUi::TextNode * textN = pair->getText(); + TextNode * textN = pair->getText(); if (textN != NULL) { seq->append(textN->getTextString().c_str()); @@ -1127,15 +1129,15 @@ //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// -void CAmisGuiMFC2App::fillSequenceContents(AudioSequence* seq, AccessibleUi::PromptItemBase* pi) { +void CAmisGuiMFC2App::fillSequenceContents(AudioSequence* seq, PromptItemBase* pi) { - AccessibleUi::TextAudioPair* pair = pi->getContents(); + TextAudioPair* pair = pi->getContents(); if (pair != NULL) { amis::AudioNode* audio = pair->getAudio(); if (!Preferences::Instance()->mbUseTTSNotAudio && audio != NULL) { seq->append(audio); } else { - AccessibleUi::TextNode * textN = pair->getText(); + TextNode * textN = pair->getText(); if (textN != NULL) { seq->append(textN->getTextString().c_str()); } @@ -1146,17 +1148,17 @@ //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// //the new one -void CAmisGuiMFC2App::resolvePromptVariables(AccessibleUi::Prompt* pPrompt) +void CAmisGuiMFC2App::resolvePromptVariables(Prompt* pPrompt) { USES_CONVERSION; - AccessibleUi::PromptVar* p_var = NULL; + PromptVar* p_var = NULL; for (int i=0; i<pPrompt->getNumberOfItems(); i++) { - if (pPrompt->getItem(i)->getPromptItemType() == AccessibleUi::PROMPT_VARIABLE) + if (pPrompt->getItem(i)->getPromptItemType() == PROMPT_VARIABLE) { - p_var = (AccessibleUi::PromptVar*)pPrompt->getItem(i); + p_var = (PromptVar*)pPrompt->getItem(i); if (p_var->getName() == "BOOK_PATH") { Modified: branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -34,7 +34,7 @@ static char THIS_FILE[] = __FILE__; #endif - +using namespace amis::audio; using namespace amis::gui; // CMainFrame @@ -218,7 +218,7 @@ if ( nFlags & MF_GRAYED ) { - AccessibleUi::PromptItem* promptNotAvailable = AccessibleUi::DataTree::Instance()->findPromptItem("not_available"); + PromptItem* promptNotAvailable = DataTree::Instance()->findPromptItem("not_available"); if (promptNotAvailable != NULL) { @@ -248,7 +248,7 @@ if (prompt.compare("file") == 0 || prompt.compare("recentBooksList") == 0) { seq = theApp.playContainerPromptFromId("recentBooksList", false, seq); - AccessibleUi::PromptItem* p_prompt_ = AccessibleUi::DataTree::Instance()->findPromptItem("menu"); + PromptItem* p_prompt_ = DataTree::Instance()->findPromptItem("menu"); if (p_prompt_ != NULL) { @@ -262,7 +262,7 @@ } else if (prompt.compare("navigate") == 0 || prompt.compare("sectiondepth") == 0) { seq = theApp.playContainerPromptFromId("sectiondepth", false, seq); - AccessibleUi::PromptItem* p_prompt_ = AccessibleUi::DataTree::Instance()->findPromptItem("menu"); + PromptItem* p_prompt_ = DataTree::Instance()->findPromptItem("menu"); if (p_prompt_ != NULL) { @@ -299,7 +299,7 @@ break; //default: seq = new AudioSequence(); } - AccessibleUi::PromptItem* p_prompt_ = AccessibleUi::DataTree::Instance()->findPromptItem("menu"); + PromptItem* p_prompt_ = DataTree::Instance()->findPromptItem("menu"); if (p_prompt_ != NULL) { @@ -644,7 +644,7 @@ } //todo: replace this by something like: -// Container* container = AccessibleUi::DataTree::Instance()->findContainerWhichHasFirstItem(id) +// Container* container = DataTree::Instance()->findContainerWhichHasFirstItem(id) // container.id std::string CMainFrame::computeRootMenuFromFirstChildID(unsigned int firstItemId, bool playPrompt) { @@ -703,7 +703,7 @@ if (playPrompt) { AudioSequence* seq = theApp.playContainerPromptFromId(str_id, false); - AccessibleUi::PromptItem* p_prompt_ = AccessibleUi::DataTree::Instance()->findPromptItem("menu"); + PromptItem* p_prompt_ = DataTree::Instance()->findPromptItem("menu"); if (p_prompt_ != NULL) { Modified: branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp 2007-10-18 16:39:59 UTC (rev 2210) +++ branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp 2007-10-18 18:33:06 UTC (rev 2211) @@ -329,28 +329,28 @@ bool b_BookIsPlaying = MainWndParts::Instance()->mpMainFrame->mbWasPlayingWhenLostFocus || !pauseState; - AccessibleUi::UiItem* p_uiItem = AccessibleUi::DataTree::Instance()->findUiItemInContainers(ID_MENU_PLAYPAUSE, (b_BookIsPlaying ? "canPause" : "canPlay")); + UiItem* p_uiItem = DataTree::Instance()->findUiItemInContainers(ID_MENU_PLAYPAUSE, (b_BookIsPlaying ? "canPause" : "canPlay")); if (p_uiItem != NULL) { - AccessibleUi::Label* accelerator = NULL; - if (p_uiItem->getUiItemType() == AccessibleUi::ACTION) { - accelerator = ((AccessibleUi::Action*)p_uiItem)->getKeyboardAccelerator(); + Label* accelerator = NULL; + if (p_uiItem->getUiItemType() == ACTION) { + accelerator = ((Action*)p_uiItem)->getKeyboardAccelerator(); } - AccessibleUi::Label* mnemonic = NULL; - if (p_uiItem->getUiItemType() == AccessibleUi::ACTION) { - mnemonic = ((AccessibleUi::Action*)p_uiItem)->getMnemonic(); + Label* mnemonic = NULL; + if (p_uiItem->getUiItemType() == ACTION) { + mnemonic = ((Action*)p_uiItem)->getMnemonic(); } - AccessibleUi::Label* p_caption = p_uiItem->getCaption(); + Label* p_caption = p_uiItem->getCaption(); if (p_caption != NULL) { - AccessibleUi::TextAudioPair* pair = p_caption->getContents(); + TextAudioPair* pair = p_caption->getContents(); if (pair != NULL) { amis::TextNode* textNode = pair->getText(); if (textNode != NULL) { wstring str = textNode->getTextString(); if (mnemonic != NULL) { - AccessibleUi::TextAudioPair* pair = mnemonic->getContents(); + TextAudioPair* pair = mnemonic->getContents(); if (pair != NULL) { - AccessibleUi::TextNode* node = pair->getText(); + TextNode* node = pair->getText(); if (node != NULL) { wstring strMnemonic = node->getTextString(); int index = str.find_first_of(strMnemonic, 0); @@ -365,9 +365,9 @@ str.append(_T("\t")); //char* text = accelerator.c_str(); //str.append(accelerator.c_str()); - AccessibleUi::TextAudioPair* pair = accelerator->getContents(); + TextAudioPair* pair = accelerator->getContents(); if (pair != NULL) { - AccessibleUi::TextNode* node = pair->getText(); + TextNode* node = pair->getText(); if (node != NULL) { str.append(node->getTextString()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |