Mercurial > hg > easaier-soundaccess
view widgets/SpeechFileHandler.cpp @ 268:ee047fc1a552
if no title is present in the results list, it is replace by "unknown"
when a new TIMELINE INFORMATION layer is loaded the sample rate is set up to the main model (WaveFileModel) sample rate.
author | lbajardsilogic |
---|---|
date | Wed, 25 Jun 2008 09:47:11 +0000 |
parents | 63a485275ed6 |
children | 96121bc067fb |
line wrap: on
line source
#include "SpeechFileHandler.h" SpeechFileHandler::SpeechFileHandler(){ _tag_vocal_query_result="vocal_query_result"; _tag_word="word"; _tag_confidence = "confidence"; _result = ""; } SpeechFileHandler::~SpeechFileHandler(){ } bool SpeechFileHandler::fatalError (const QXmlParseException & exception){ return false; } bool SpeechFileHandler::characters ( const QString &str){ return true; } bool SpeechFileHandler::endDocument (){ return true; } bool SpeechFileHandler::endElement (const QString &namespaceURI, const QString &localName, const QString &qName ){ _currentTag = ""; if(localName==_tag_vocal_query_result){ _result+="<br>"; } return true; } bool SpeechFileHandler::startDocument (){ return true; } bool SpeechFileHandler::startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &attribs ){ _currentTag = localName; if(localName == _tag_vocal_query_result){ for(int i = 0 ; i < attribs.length() ; i++){ QString aux = attribs.localName(i); if(aux==_tag_word){ _result+="<b>"; _result+=attribs.value(i); _result+="</b>"; }else if(aux == _tag_confidence){ _result+=" "; _result+=attribs.value(i); } } } return true; } QString SpeechFileHandler::getResult(){ return _result; }