#pragma once #include "ofMain.h" #include "ofxGui.h" #include "LLMRequestThread.h" struct Line { int idx; std::string sentence; std::string speaker; std::string emotion; }; class ofTeleprompter: public ofBaseApp{ public: void setup(); void update(); void draw(); void setupGUI(); void nextLinePressed(); void resetScript(); void sendLLMRequest(); void loadText(); void drawText(); void updateCVData(int numOfFacesDetected, std::string emotion, float intensity); void toggleOffLLM(bool & val); void toggleOffText(bool & val); std::string wrapStringToWidth(const std::string& text, float maxWidth); ofxPanel gui; /* paramters */ ofxFloatSlider temperature; ofxButton nextLine; ofxToggle useLLMOnly; ofxToggle useTextOnly; ofxButton reset; ofxLabel currentLineIndex; ofxLabel currentSpeaker; ofxLabel currentEmotion; ofxLabel facesDetected; ofxLabel emotionIntensity; ofxLabel emotionDetected; /* script */ std::vector script; std::string filePath = "text/Macbeth.json"; int currentLine = 0; std::string currentLineString = "N/A"; const char* emotions[7] = {"anger", "disgust", "fear", "happiness", "neutral", "sadness", "surprise"}; /* scrolling text */ int currentLetterIndex = 0; std::string currentSentence; uint64_t lastWordTime = 0; uint64_t wordDelay = 10; std::string displayedSentence; ofTrueTypeFont textFont; ofTrueTypeFont detailsFont; /* llm stuff */ LLMRequestThread llmThread; std::string llmResponse; float currentEmotionIntensity = 0; std::string currentEmotionDetetced = "neutral"; bool waitingForLLM = false; private: };