//-------------------------------------------------------------- void gamuzaMain::keyReleased(int key){ bool alt = gamuzaKmap.isAltDown(); // fullscreen toggle if(alt && (key == 'f' || key == 'F')){ gamuzaFullscreen(); } // LIVE CODING if(alt && (key == 'j' || key == 'J')){ liveCodingMode = !liveCodingMode; } // show/hide script code if(alt && (key == 'w' || key == 'W')){ viewCode = !viewCode; } // open file dialog if(alt && (key == 'd' || key == 'D')){ openFileDialog(); } // save frame if(alt && (key == 'o' || key == 'O')){ saveFrame(); } // print frame if(alt && (key == 'p' || key == 'P')){ printFrame(); } }
//-------------------------------------------------------------- void gamuzaMain::keyReleased(int key){ bool alt = gamuzaKmap.isAltDown(); ////////////////////////////////////////////////////////// // LIVE CODING if(alt && (key == 'j' || key == 'J')){ liveCodingMode = !liveCodingMode; if(liveCodingMode && isFullscreen){ scriptScroll.reset(lcPrevX-20,1,20,lcPrevH-1); }else if(liveCodingMode && !isFullscreen){ scriptScroll.reset(lcPrevX-20,1,20,lcPrevH-1); } } // show/hide script code if(alt && (key == 'w' || key == 'W')){ viewCode = !viewCode; } // LUA lua.scriptKeyReleased(key); ////////////////////////////////////////////////////////// // save frame if(alt && (key == 'o' || key == 'O')){ saveFrame(); } // print frame if(alt && (key == 'p' || key == 'P')){ printFrame(); } // switch between mouse/keyboard Mapping points control if(alt && (key == 'm' || key == 'M')){ activateMouseMapping = !activateMouseMapping; } // TIMELINE if(alt && (key == 't' || key == 'T')){ showTimeline = !showTimeline; if(showTimeline){ timeline.show(); timeline.enableMouse(); }else{ timeline.hide(); timeline.disableMouse(); } } // play/stop the timeline if(alt && (key == 'g' || key == 'G')){ timeline.togglePlay(); } // fullscreen toggle if(alt && (key == 'f' || key == 'F')){ gamuzaFullscreen(); } liveKey = key; }
//-------------------------------------------------------------- void gamuzaMain::setup(){ flagSystemLoaded = false; // first line of gamuza setup ////////////////////////////////////////////// // load settings from xml loadGamuzaSettings(); // automation isFullscreen = false; if(autoPilot){ gamuzaFullscreen(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // init general openframeworks settings ofSetEscapeQuitsApp(false); ofSetFrameRate(200); ofEnableSmoothing(); ofSetLogLevel(OF_LOG_VERBOSE); ////////////////////////////////////////////// ////////////////////////////////////////////// // OSC data sending @ host_number(IP),host_port gamuzaSetup.lock(); setupOSC(); gamuzaSetup.unlock(); ////////////////////////////////////////////// ////////////////////////////////////////////// // AUDIO if(audioActivated){ gamuzaSetup.lock(); setupAudio(); gamuzaSetup.unlock(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // MIDI gamuzaSetup.lock(); setupMidi(); gamuzaSetup.unlock(); ////////////////////////////////////////////// ////////////////////////////////////////////// // OPENNI if(openniActivated){ gamuzaSetup.lock(); sensorKinect.setupDevice(workingW,workingH,useKinectInfrared,sensorKinectLedState); gamuzaSetup.unlock(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // FBO second screen output texture gamuzaSetup.lock(); setupFBO(); gamuzaSetup.unlock(); ////////////////////////////////////////////// ////////////////////////////////////////////// // ARDUINO if(arduinoActivated){ gamuzaSetup.lock(); setupArduino(); gamuzaSetup.unlock(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // GUI // include setup of webcams & audio inputs gamuzaSetup.lock(); setupSettingPanel(); setupGui(); gamuzaSetup.unlock(); ////////////////////////////////////////////// ////////////////////////////////////////////// // SYSTEM currentSavedFrame = 0; gaFrameCounter = 0; ////////////////////////////////////////////// ////////////////////////////////////////////// // set log level to error only ofSetLogLevel(OF_LOG_ERROR); sendPrivateMessage(GAMUZA_CONSOLE_LOG, " "); ////////////////////////////////////////////// }
//-------------------------------------------------------------- void gamuzaMain::setup(){ flagSystemLoaded = false; // first line of gamuza setup ////////////////////////////////////////////// // load settings from xml loadGamuzaSettings(); if(START_WITH_FULLSCREEN){ isFullscreen = true; }else{ isFullscreen = false; } // automation if(autoPilot){ gamuzaFullscreen(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // init general openframeworks settings ofSetFrameRate(FPS); ofEnableSmoothing(); ofSetLogLevel(OF_LOG_VERBOSE); ////////////////////////////////////////////// ////////////////////////////////////////////// // AUDIO if(audioActivated){ gamuzaSetup.lock(); setupAudio(); gamuzaSetup.unlock(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // OPENNI if(openniActivated){ gamuzaSetup.lock(); sensorKinect.setupDevice(workingW,workingH,useKinectInfrared,sensorKinectLedState); gamuzaSetup.unlock(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // FBO second screen output texture gamuzaSetup.lock(); setupFBO(); gamuzaSetup.unlock(); ////////////////////////////////////////////// ////////////////////////////////////////////// // OSC data sending @ host_number(IP),host_port if(oscActivated){ gamuzaSetup.lock(); setupOSC(); gamuzaSetup.unlock(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // ARDUINO if(arduinoActivated){ gamuzaSetup.lock(); setupArduino(); gamuzaSetup.unlock(); } ////////////////////////////////////////////// ////////////////////////////////////////////// // GUI // include setup of webcams & audio inputs gamuzaSetup.lock(); setupGui(); gamuzaSetup.unlock(); ////////////////////////////////////////////// ////////////////////////////////////////////// // SYSTEM currentSavedFrame = 0; ////////////////////////////////////////////// ////////////////////////////////////////////// // set log level to error only ofSetLogLevel(OF_LOG_ERROR); ////////////////////////////////////////////// }