summaryrefslogtreecommitdiff
path: root/lasertext/src/ofApp.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2023-09-14 17:26:17 +0100
committerTim Redfern <tim@getdrop.com>2023-09-14 17:26:17 +0100
commit3e0265e632a8428db6c8d48ae273b0ee5bee3f36 (patch)
tree774ef19329bf05d3ff56ba312330b95130ee20f5 /lasertext/src/ofApp.cpp
parent4d2fda8f0807957b9fbcf77656aa361c5954db9f (diff)
works with unicode
Diffstat (limited to 'lasertext/src/ofApp.cpp')
-rw-r--r--lasertext/src/ofApp.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/lasertext/src/ofApp.cpp b/lasertext/src/ofApp.cpp
index b0442bb..050b913 100644
--- a/lasertext/src/ofApp.cpp
+++ b/lasertext/src/ofApp.cpp
@@ -26,7 +26,8 @@ void ofApp::setup(){
//banner.loadFont("fonts/EMSDecorousScript.svg"); //2022
banner.loadFont("fonts/EMSQwandry.svg"); //2023
//banner.init("Everything Is Going To Be Alright");
- banner.init("No Pleasure is Too Guilty");
+ //banner.init("No Pleasure is Too Guilty");
+ banner.init("Casaimid lenár gcroíthe anoi");
override_banner.loadFont("fonts/EMSQwandry.svg");
@@ -159,6 +160,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);
@@ -311,6 +335,7 @@ void ofApp::keyReleased(int key){
case '1':{
ofLog()<<"sending test phrase 1";
override_banner.init("This is my new phrase");
+ runUnixCommand("say 'This is my new phrase'");
break;
}
case 's':{