|
@ -21,7 +21,7 @@ void ofTeleprompter::update() { |
|
|
// set labels
|
|
|
// set labels
|
|
|
currentSpeaker = script[currentLine].speaker; |
|
|
currentSpeaker = script[currentLine].speaker; |
|
|
currentEmotion = script[currentLine].emotion; |
|
|
currentEmotion = script[currentLine].emotion; |
|
|
currentLineIndex = ofToString(currentLine); |
|
|
currentLineIndex = ofToString(currentLine + 1) + " / " + ofToString(script.size() + 1); |
|
|
|
|
|
|
|
|
// Teleprompter logic (letter by letter)
|
|
|
// Teleprompter logic (letter by letter)
|
|
|
if (currentLetterIndex < currentSentence.size()) { |
|
|
if (currentLetterIndex < currentSentence.size()) { |
|
@ -42,6 +42,7 @@ void ofTeleprompter::draw() { |
|
|
|
|
|
|
|
|
void ofTeleprompter::setupGUI() { |
|
|
void ofTeleprompter::setupGUI() { |
|
|
nextLine.addListener(this, &ofTeleprompter::nextLinePressed); |
|
|
nextLine.addListener(this, &ofTeleprompter::nextLinePressed); |
|
|
|
|
|
reset.addListener(this, &ofTeleprompter::resetScript); |
|
|
|
|
|
|
|
|
gui.setDefaultWidth(400); |
|
|
gui.setDefaultWidth(400); |
|
|
gui.setup(); |
|
|
gui.setup(); |
|
@ -55,17 +56,7 @@ void ofTeleprompter::setupGUI() { |
|
|
gui.add(useLLMOnly.setup("Use LLM Only", false)); |
|
|
gui.add(useLLMOnly.setup("Use LLM Only", false)); |
|
|
gui.add(useTextOnly.setup("Use Text Only", false)); |
|
|
gui.add(useTextOnly.setup("Use Text Only", false)); |
|
|
gui.add(nextLine.setup("Next Line")); |
|
|
gui.add(nextLine.setup("Next Line")); |
|
|
} |
|
|
gui.add(reset.setup("Reset Script")); |
|
|
|
|
|
|
|
|
void ofTeleprompter::nextLinePressed() { |
|
|
|
|
|
ofLog() << "Next Line!"; |
|
|
|
|
|
currentLine++; |
|
|
|
|
|
|
|
|
|
|
|
// Prepare teleprompter effect for letter-by-letter
|
|
|
|
|
|
currentSentence = script[currentLine].sentence; |
|
|
|
|
|
displayedSentence.clear(); |
|
|
|
|
|
currentLetterIndex = 0; |
|
|
|
|
|
lastWordTime = ofGetElapsedTimeMillis(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void ofTeleprompter::loadText() { |
|
|
void ofTeleprompter::loadText() { |
|
@ -165,6 +156,35 @@ std::string ofTeleprompter::wrapStringToWidth(const std::string& text, float max |
|
|
return wrapped; |
|
|
return wrapped; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void ofTeleprompter::updateCVData(int numOfFacesDetected) { |
|
|
void ofTeleprompter::updateCVData(int numOfFacesDetected, std::string emotion, float intensity) { |
|
|
facesDetected = ofToString(numOfFacesDetected); |
|
|
facesDetected = ofToString(numOfFacesDetected); |
|
|
|
|
|
emotionDetected = emotion; |
|
|
|
|
|
emotionIntensity = ofToString(intensity); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ofTeleprompter::nextLinePressed() { |
|
|
|
|
|
ofLog() << "Next Line!"; |
|
|
|
|
|
|
|
|
|
|
|
// Check if it exceeds the length of the script
|
|
|
|
|
|
if (currentLine < script.size()){ |
|
|
|
|
|
currentLine++; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Prepare teleprompter effect for letter-by-letter
|
|
|
|
|
|
currentSentence = script[currentLine].sentence; |
|
|
|
|
|
displayedSentence.clear(); |
|
|
|
|
|
currentLetterIndex = 0; |
|
|
|
|
|
lastWordTime = ofGetElapsedTimeMillis(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ofTeleprompter::resetScript() { |
|
|
|
|
|
// Need to reset the text, id, etc.
|
|
|
|
|
|
ofLog() << "Reset script."; |
|
|
|
|
|
currentLine = 0; |
|
|
|
|
|
|
|
|
|
|
|
// Prepare teleprompter effect for letter-by-letter
|
|
|
|
|
|
currentSentence = script[currentLine].sentence; |
|
|
|
|
|
displayedSentence.clear(); |
|
|
|
|
|
currentLetterIndex = 0; |
|
|
|
|
|
lastWordTime = ofGetElapsedTimeMillis(); |
|
|
} |
|
|
} |