diff options
Diffstat (limited to 'lasertext/src/ofApp.cpp')
| -rw-r--r-- | lasertext/src/ofApp.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lasertext/src/ofApp.cpp b/lasertext/src/ofApp.cpp index 636aaa0..52f6d57 100644 --- a/lasertext/src/ofApp.cpp +++ b/lasertext/src/ofApp.cpp @@ -27,7 +27,9 @@ void ofApp::setup(){ banner.loadFont("fonts/EMSQwandry.svg"); //2023 //banner.init("Everything Is Going To Be Alright"); //banner.init("No Pleasure is Too Guilty"); - banner.init("Éalú Le Grá"); + //banner.init("Éalú Le Grá"); + + banner.init("Casaimid lenár gcroíthe anoi"); override_banner.loadFont("fonts/EMSQwandry.svg"); @@ -164,6 +166,29 @@ void ofApp::save_settings(){ cout << "settings.xml saved!" <<std::endl; } +string runUnixCommandAndCaptureOutput(string cmd) { + char buffer[128]; + string result = ""; + FILE* pipe = popen(cmd.c_str(), "r"); + if (!pipe) throw std::runtime_error("popen() failed!"); + try { + while (!feof(pipe)) { + if (fgets(buffer, 128, pipe) != NULL) + result += buffer; + } + } catch (...) { + pclose(pipe); + throw; + } + pclose(pipe); + return result; +} + +void runUnixCommand(string cmd) { + system(cmd.c_str()); + return; +} + //-------------------------------------------------------------- void ofApp::update(){ banner.update(text_speed,true); @@ -336,6 +361,7 @@ void ofApp::keyReleased(int key){ case '1':{ ofLog()<<"sending test phrase 1"; override_banner.init("The latin quarter"); + runUnixCommand("say 'The latin quarter'"); break; } case 's':{ |
