Permalink
Browse files

Now prints whole line at once, on different lines. Does not split wor…

…ds; splits only on space.
  • Loading branch information...
1 parent 90fcd3d commit a868994145969d7825fad718ff9be6e654bf5788 @RachelJMorris committed Mar 3, 2013
Showing with 8 additions and 7 deletions.
  1. +8 −7 main.cpp
View
@@ -113,12 +113,10 @@ int main(int argc, char **argv)
myProgram.Draw( progressBar );
// Write text
- int yPos = fontSize;
+ int yPos = 0;
for ( int i = 0; i < readLines.size(); i++ )
{
- cout << endl;
- cout << "Length: " << readLines[i].length() << endl;
- cout << "Max size: " << drawnLineMaxSize << endl;
+ yPos += fontSize;
int lineCount;
if ( (readLines[i].length() % drawnLineMaxSize) == 0 )
@@ -138,6 +136,11 @@ int main(int argc, char **argv)
{
yPos += fontSize;
lineEnd = lineBegin + drawnLineMaxSize;
+ while ( readLines[i][lineEnd] != ' ' )
+ {
+ lineEnd++;
+ }
+
if ( lineEnd > length ) {
lineEnd = lineBegin + length;
}
@@ -167,10 +170,8 @@ int main(int argc, char **argv)
myProgram.Display();
// Play audio
- //flite_text_to_speech( lstLines[lineIndex].c_str(), voice, "play" );
+ flite_text_to_speech( lstLines[lineIndex].c_str(), voice, "play" );
lineIndex++;
- int bob;
- cin >> bob;
}
return 0;

0 comments on commit a868994

Please sign in to comment.