├── .gitignore ├── example-scene ├── bin │ └── data │ │ └── .gitignore ├── .gitignore ├── src │ ├── main.cpp │ ├── testApp.h │ └── testApp.cpp ├── Project.xcconfig └── openFrameworks-Info.plist ├── example-timer ├── bin │ └── data │ │ └── .gitignore ├── .gitignore ├── src │ ├── main.cpp │ ├── testApp.h │ └── testApp.cpp ├── Project.xcconfig └── openFrameworks-Info.plist ├── example-sequence ├── bin │ └── data │ │ └── .gitignore ├── .gitignore ├── src │ ├── main.cpp │ ├── testApp.h │ └── testApp.cpp ├── Project.xcconfig └── openFrameworks-Info.plist ├── example-composition ├── bin │ └── data │ │ └── .gitignore ├── .gitignore ├── src │ ├── main.cpp │ ├── testApp.h │ └── testApp.cpp ├── Project.xcconfig ├── openFrameworks-Info.plist └── example-composition.xcodeproj │ └── project.pbxproj ├── example-instance-manager ├── bin │ └── data │ │ └── .gitignore ├── .gitignore ├── src │ ├── main.cpp │ ├── testApp.h │ └── testApp.cpp ├── Project.xcconfig ├── openFrameworks-Info.plist └── example-instance-manager.xcodeproj │ └── project.pbxproj └── src ├── ofxAnimationPrimitives.h └── ofxAnimationPrimitives ├── Generator.h ├── Timer.cpp ├── Constants.h ├── detail ├── coroutine.hpp └── Composition.inc.h ├── Timer.h ├── Lerp.h ├── Sequence.h ├── Replicator.h ├── Easing.h ├── CommandQueue.h ├── Composition.h ├── Pattern.h ├── InstanceManager.h └── SceneManager.h /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | -------------------------------------------------------------------------------- /example-scene/bin/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in here apart from the .gitignore file 2 | * 3 | !.gitignore -------------------------------------------------------------------------------- /example-timer/bin/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in here apart from the .gitignore file 2 | * 3 | !.gitignore -------------------------------------------------------------------------------- /example-sequence/bin/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in here apart from the .gitignore file 2 | * 3 | !.gitignore -------------------------------------------------------------------------------- /example-composition/bin/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in here apart from the .gitignore file 2 | * 3 | !.gitignore -------------------------------------------------------------------------------- /example-instance-manager/bin/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in here apart from the .gitignore file 2 | * 3 | !.gitignore -------------------------------------------------------------------------------- /example-scene/.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | .hg 3 | .cvs 4 | 5 | # osx 6 | *.app 7 | *.mode1v3 8 | *.pbxuser 9 | .DS_Store 10 | build/ 11 | xcuserdata/ 12 | DerivedData/ 13 | project.xcworkspace 14 | 15 | # vs2010 16 | ipch/ 17 | obj/ 18 | *.sdf 19 | -------------------------------------------------------------------------------- /example-timer/.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | .hg 3 | .cvs 4 | 5 | # osx 6 | *.app 7 | *.mode1v3 8 | *.pbxuser 9 | .DS_Store 10 | build/ 11 | xcuserdata/ 12 | DerivedData/ 13 | project.xcworkspace 14 | 15 | # vs2010 16 | ipch/ 17 | obj/ 18 | *.sdf 19 | -------------------------------------------------------------------------------- /example-composition/.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | .hg 3 | .cvs 4 | 5 | # osx 6 | *.app 7 | *.mode1v3 8 | *.pbxuser 9 | .DS_Store 10 | build/ 11 | xcuserdata/ 12 | DerivedData/ 13 | project.xcworkspace 14 | 15 | # vs2010 16 | ipch/ 17 | obj/ 18 | *.sdf 19 | -------------------------------------------------------------------------------- /example-sequence/.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | .hg 3 | .cvs 4 | 5 | # osx 6 | *.app 7 | *.mode1v3 8 | *.pbxuser 9 | .DS_Store 10 | build/ 11 | xcuserdata/ 12 | DerivedData/ 13 | project.xcworkspace 14 | 15 | # vs2010 16 | ipch/ 17 | obj/ 18 | *.sdf 19 | -------------------------------------------------------------------------------- /example-instance-manager/.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | .hg 3 | .cvs 4 | 5 | # osx 6 | *.app 7 | *.mode1v3 8 | *.pbxuser 9 | .DS_Store 10 | build/ 11 | xcuserdata/ 12 | DerivedData/ 13 | project.xcworkspace 14 | 15 | # vs2010 16 | ipch/ 17 | obj/ 18 | *.sdf 19 | -------------------------------------------------------------------------------- /example-scene/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | #include "ofAppGlutWindow.h" 3 | 4 | //-------------------------------------------------------------- 5 | int main() 6 | { 7 | ofAppGlutWindow window; // create a window 8 | // set width, height, mode (OF_WINDOW or OF_FULLSCREEN) 9 | ofSetupOpenGL(&window, 1024, 768, OF_WINDOW); 10 | ofRunApp(new testApp()); // start the app 11 | } -------------------------------------------------------------------------------- /example-timer/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | #include "ofAppGlutWindow.h" 3 | 4 | //-------------------------------------------------------------- 5 | int main() 6 | { 7 | ofAppGlutWindow window; // create a window 8 | // set width, height, mode (OF_WINDOW or OF_FULLSCREEN) 9 | ofSetupOpenGL(&window, 1024, 768, OF_WINDOW); 10 | ofRunApp(new testApp()); // start the app 11 | } -------------------------------------------------------------------------------- /example-sequence/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | #include "ofAppGlutWindow.h" 3 | 4 | //-------------------------------------------------------------- 5 | int main() 6 | { 7 | ofAppGlutWindow window; // create a window 8 | // set width, height, mode (OF_WINDOW or OF_FULLSCREEN) 9 | ofSetupOpenGL(&window, 1024, 768, OF_WINDOW); 10 | ofRunApp(new testApp()); // start the app 11 | } -------------------------------------------------------------------------------- /example-composition/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | #include "ofAppGlutWindow.h" 3 | 4 | //-------------------------------------------------------------- 5 | int main() 6 | { 7 | ofAppGlutWindow window; // create a window 8 | // set width, height, mode (OF_WINDOW or OF_FULLSCREEN) 9 | ofSetupOpenGL(&window, 1024, 768, OF_WINDOW); 10 | ofRunApp(new testApp()); // start the app 11 | } -------------------------------------------------------------------------------- /example-instance-manager/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | #include "ofAppGlutWindow.h" 3 | 4 | //-------------------------------------------------------------- 5 | int main() 6 | { 7 | ofAppGlutWindow window; // create a window 8 | // set width, height, mode (OF_WINDOW or OF_FULLSCREEN) 9 | ofSetupOpenGL(&window, 1024, 768, OF_WINDOW); 10 | ofRunApp(new testApp()); // start the app 11 | } -------------------------------------------------------------------------------- /example-scene/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | OTHER_LDFLAGS = $(OF_CORE_LIBS) 9 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 10 | -------------------------------------------------------------------------------- /example-sequence/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | OTHER_LDFLAGS = $(OF_CORE_LIBS) 9 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 10 | -------------------------------------------------------------------------------- /example-timer/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | OTHER_LDFLAGS = $(OF_CORE_LIBS) 9 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 10 | -------------------------------------------------------------------------------- /example-composition/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | OTHER_LDFLAGS = $(OF_CORE_LIBS) 9 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 10 | -------------------------------------------------------------------------------- /example-instance-manager/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | OTHER_LDFLAGS = $(OF_CORE_LIBS) 9 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 10 | -------------------------------------------------------------------------------- /example-instance-manager/src/testApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class testApp : public ofBaseApp 6 | { 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void windowResized(int w, int h); 19 | void dragEvent(ofDragInfo dragInfo); 20 | void gotMessage(ofMessage msg); 21 | }; -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofxAnimationPrimitives/Constants.h" 4 | #include "ofxAnimationPrimitives/Timer.h" 5 | #include "ofxAnimationPrimitives/Pattern.h" 6 | #include "ofxAnimationPrimitives/Replicator.h" 7 | #include "ofxAnimationPrimitives/Generator.h" 8 | #include "ofxAnimationPrimitives/Easing.h" 9 | #include "ofxAnimationPrimitives/InstanceManager.h" 10 | #include "ofxAnimationPrimitives/Lerp.h" 11 | #include "ofxAnimationPrimitives/Composition.h" 12 | #include "ofxAnimationPrimitives/Sequence.h" 13 | #include "ofxAnimationPrimitives/SceneManager.h" 14 | #include "ofxAnimationPrimitives/CommandQueue.h" -------------------------------------------------------------------------------- /example-scene/src/testApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class testApp : public ofBaseApp 6 | { 7 | public: 8 | 9 | void onOneshotTimerEvent(int&); 10 | void onRepeatTimerEvent(int&); 11 | 12 | void setup(); 13 | void update(); 14 | void draw(); 15 | 16 | void keyPressed(int key); 17 | void keyReleased(int key); 18 | void mouseMoved(int x, int y); 19 | void mouseDragged(int x, int y, int button); 20 | void mousePressed(int x, int y, int button); 21 | void mouseReleased(int x, int y, int button); 22 | void windowResized(int w, int h); 23 | void dragEvent(ofDragInfo dragInfo); 24 | void gotMessage(ofMessage msg); 25 | }; -------------------------------------------------------------------------------- /example-sequence/src/testApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class testApp : public ofBaseApp 6 | { 7 | public: 8 | 9 | void onOneshotTimerEvent(int&); 10 | void onRepeatTimerEvent(int&); 11 | 12 | void setup(); 13 | void update(); 14 | void draw(); 15 | 16 | void keyPressed(int key); 17 | void keyReleased(int key); 18 | void mouseMoved(int x, int y); 19 | void mouseDragged(int x, int y, int button); 20 | void mousePressed(int x, int y, int button); 21 | void mouseReleased(int x, int y, int button); 22 | void windowResized(int w, int h); 23 | void dragEvent(ofDragInfo dragInfo); 24 | void gotMessage(ofMessage msg); 25 | }; -------------------------------------------------------------------------------- /example-timer/src/testApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class testApp : public ofBaseApp 6 | { 7 | public: 8 | 9 | void onOneshotTimerEvent(int&); 10 | void onRepeatTimerEvent(int&); 11 | 12 | void setup(); 13 | void update(); 14 | void draw(); 15 | 16 | void keyPressed(int key); 17 | void keyReleased(int key); 18 | void mouseMoved(int x, int y); 19 | void mouseDragged(int x, int y, int button); 20 | void mousePressed(int x, int y, int button); 21 | void mouseReleased(int x, int y, int button); 22 | void windowResized(int w, int h); 23 | void dragEvent(ofDragInfo dragInfo); 24 | void gotMessage(ofMessage msg); 25 | }; -------------------------------------------------------------------------------- /example-composition/src/testApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class testApp : public ofBaseApp 6 | { 7 | public: 8 | 9 | void onOneshotTimerEvent(ofEventArgs&); 10 | void onRepeatTimerEvent(ofEventArgs&); 11 | 12 | void setup(); 13 | void update(); 14 | void draw(); 15 | 16 | void keyPressed(int key); 17 | void keyReleased(int key); 18 | void mouseMoved(int x, int y); 19 | void mouseDragged(int x, int y, int button); 20 | void mousePressed(int x, int y, int button); 21 | void mouseReleased(int x, int y, int button); 22 | void windowResized(int w, int h); 23 | void dragEvent(ofDragInfo dragInfo); 24 | void gotMessage(ofMessage msg); 25 | }; -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Generator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | #include "Constants.h" 6 | 7 | #include "detail/coroutine.hpp" 8 | // more info about boost::coroutine => http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/coroutine.html 9 | 10 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 11 | 12 | typedef coroutine Generator; 13 | 14 | #ifndef $seq 15 | # define $seq(c) CORO_REENTER(c) 16 | #endif 17 | 18 | #ifndef $inf 19 | # define $inf(c) CORO_REENTER(c) for(;;) 20 | #endif 21 | 22 | #ifndef yield 23 | # define yield CORO_YIELD 24 | #endif 25 | 26 | #ifndef fork 27 | # define fork CORO_FORK 28 | #endif 29 | 30 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE -------------------------------------------------------------------------------- /example-scene/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.openFrameworks 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /example-timer/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.openFrameworks 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Timer.cpp: -------------------------------------------------------------------------------- 1 | #include "Timer.h" 2 | 3 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 4 | 5 | Clock* Clock::system_clock = NULL; 6 | 7 | struct DefaultClock 8 | { 9 | Clock clock; 10 | 11 | void setup() 12 | { 13 | clock.makeSystemClock(); 14 | ofAddListener(ofEvents().update, this, &DefaultClock::onUpdate); 15 | } 16 | 17 | void onUpdate(ofEventArgs &e) 18 | { 19 | Clock::getClock()->update(); 20 | } 21 | }; 22 | 23 | static DefaultClock default_clock; 24 | 25 | void Ticker::play() 26 | { 27 | Clock::regist(this); 28 | } 29 | 30 | void Ticker::stop() 31 | { 32 | Clock::unregist(this); 33 | } 34 | 35 | void initTimer() 36 | { 37 | default_clock.setup(); 38 | } 39 | 40 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE -------------------------------------------------------------------------------- /example-composition/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.openFrameworks 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /example-sequence/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.openFrameworks 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /example-instance-manager/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.openFrameworks 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Constants.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | #define OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE namespace ofx { namespace AnimationPrimitives { 6 | #define OFX_ANIMATION_PRIMITIVES_END_NAMESPACE } } 7 | 8 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 9 | 10 | #pragma mark - Vector Helper 11 | 12 | template 13 | struct _$ : public vector 14 | { 15 | _$& operator,(const T& t) 16 | { 17 | this->push_back(t); 18 | return *this; 19 | } 20 | }; 21 | 22 | #define $(type, ...) (_$(), __VA_ARGS__) 23 | #define $f(...) $(float, __VA_ARGS__) 24 | #define $i(...) $(int, __VA_ARGS__) 25 | #define $ui(...) $(unsigned int, __VA_ARGS__) 26 | #define $v2(...) $(ofVec2f, __VA_ARGS__) 27 | #define $v3(...) $(ofVec3f, __VA_ARGS__) 28 | #define $v4(...) $(ofVec4f, __VA_ARGS__) 29 | 30 | #pragma mark - misc 31 | 32 | namespace RTTI 33 | { 34 | typedef void* TypeID; 35 | 36 | template 37 | static TypeID getTypeID() { 38 | static size_t m = 0; 39 | return &m; 40 | } 41 | }; 42 | 43 | template 44 | struct Ref_ : public ofPtr 45 | { 46 | Ref_() : ofPtr() {} 47 | Ref_(T *t) : ofPtr(t) {} 48 | Ref_(const ofPtr& o) : ofPtr(o) {} 49 | }; 50 | 51 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE 52 | 53 | namespace ofxAnimationPrimitives = ofx::AnimationPrimitives; 54 | 55 | #ifdef _WIN32 56 | #define isnormal(x) (_fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN) 57 | #define isinf(x) (!_finite(x)) 58 | #endif -------------------------------------------------------------------------------- /example-timer/src/testApp.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | 3 | #include "ofxAnimationPrimitives.h" 4 | 5 | ofxAnimationPrimitives::Timer oneshot; 6 | ofxAnimationPrimitives::Timer repeat; 7 | 8 | void testApp::onOneshotTimerEvent(int&) 9 | { 10 | ofBackground(255, 0, 0); 11 | cout << "oneshot: " << ofGetElapsedTimef() << endl; 12 | } 13 | 14 | void testApp::onRepeatTimerEvent(int&) 15 | { 16 | ofBackground(255); 17 | cout << "repeat: " << ofGetElapsedTimef() << endl; 18 | } 19 | 20 | //-------------------------------------------------------------- 21 | void testApp::setup() 22 | { 23 | ofSetVerticalSync(true); 24 | ofSetFrameRate(60); 25 | ofBackground(0); 26 | 27 | ofAddListener(oneshot.timerEvent, this, &testApp::onOneshotTimerEvent); 28 | ofAddListener(repeat.timerEvent, this, &testApp::onRepeatTimerEvent); 29 | 30 | repeat.start(1, ofxAnimationPrimitives::Timer::FOREVER); 31 | oneshot.start(0.5, 1); 32 | } 33 | 34 | //-------------------------------------------------------------- 35 | void testApp::update() 36 | { 37 | ofBackground(0); 38 | } 39 | 40 | //-------------------------------------------------------------- 41 | void testApp::draw() 42 | { 43 | } 44 | 45 | //-------------------------------------------------------------- 46 | void testApp::keyPressed(int key) 47 | { 48 | } 49 | 50 | //-------------------------------------------------------------- 51 | void testApp::keyReleased(int key) 52 | { 53 | 54 | } 55 | 56 | //-------------------------------------------------------------- 57 | void testApp::mouseMoved(int x, int y) 58 | { 59 | } 60 | 61 | //-------------------------------------------------------------- 62 | void testApp::mouseDragged(int x, int y, int button) 63 | { 64 | 65 | } 66 | 67 | //-------------------------------------------------------------- 68 | void testApp::mousePressed(int x, int y, int button) 69 | { 70 | oneshot.start(1, false); 71 | } 72 | 73 | //-------------------------------------------------------------- 74 | void testApp::mouseReleased(int x, int y, int button) 75 | { 76 | 77 | } 78 | 79 | //-------------------------------------------------------------- 80 | void testApp::windowResized(int w, int h) 81 | { 82 | 83 | } 84 | 85 | //-------------------------------------------------------------- 86 | void testApp::gotMessage(ofMessage msg) 87 | { 88 | 89 | } 90 | 91 | //-------------------------------------------------------------- 92 | void testApp::dragEvent(ofDragInfo dragInfo) 93 | { 94 | 95 | } -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/detail/coroutine.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // coroutine.hpp 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef COROUTINE_HPP 12 | #define COROUTINE_HPP 13 | 14 | class coroutine 15 | { 16 | public: 17 | coroutine() : value_(0) {} 18 | bool is_child() const { return value_ < 0; } 19 | bool is_parent() const { return !is_child(); } 20 | bool is_complete() const { return value_ == -1; } 21 | private: 22 | friend class coroutine_ref; 23 | int value_; 24 | }; 25 | 26 | class coroutine_ref 27 | { 28 | public: 29 | coroutine_ref(coroutine& c) : value_(c.value_), modified_(false) {} 30 | coroutine_ref(coroutine* c) : value_(c->value_), modified_(false) {} 31 | ~coroutine_ref() { if (!modified_) value_ = -1; } 32 | operator int() const { return value_; } 33 | int& operator=(int v) { modified_ = true; return value_ = v; } 34 | private: 35 | void operator=(const coroutine_ref&); 36 | int& value_; 37 | bool modified_; 38 | }; 39 | 40 | #define CORO_REENTER(c) \ 41 | switch (coroutine_ref _coro_value = c) \ 42 | case -1: if (_coro_value) \ 43 | { \ 44 | goto terminate_coroutine; \ 45 | terminate_coroutine: \ 46 | _coro_value = -1; \ 47 | goto bail_out_of_coroutine; \ 48 | bail_out_of_coroutine: \ 49 | break; \ 50 | } \ 51 | else case 0: 52 | 53 | #define CORO_YIELD_IMPL(n) \ 54 | for (_coro_value = (n);;) \ 55 | if (_coro_value == 0) \ 56 | { \ 57 | case (n): ; \ 58 | break; \ 59 | } \ 60 | else \ 61 | switch (_coro_value ? 0 : 1) \ 62 | for (;;) \ 63 | case -1: if (_coro_value) \ 64 | goto terminate_coroutine; \ 65 | else for (;;) \ 66 | case 1: if (_coro_value) \ 67 | goto bail_out_of_coroutine; \ 68 | else case 0: 69 | 70 | #define CORO_FORK_IMPL(n) \ 71 | for (_coro_value = -(n);; _coro_value = (n)) \ 72 | if (_coro_value == (n)) \ 73 | { \ 74 | case -(n): ; \ 75 | break; \ 76 | } \ 77 | else 78 | 79 | #if defined(_MSC_VER) 80 | # define CORO_YIELD CORO_YIELD_IMPL(__COUNTER__ + 1) 81 | # define CORO_FORK CORO_FORK_IMPL(__COUNTER__ + 1) 82 | #else // defined(_MSC_VER) 83 | # define CORO_YIELD CORO_YIELD_IMPL(__LINE__) 84 | # define CORO_FORK CORO_FORK_IMPL(__LINE__) 85 | #endif // defined(_MSC_VER) 86 | 87 | #endif // COROUTINE_HPP -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | #include "Constants.h" 6 | 7 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 8 | 9 | void initTimer(); 10 | 11 | struct Ticker 12 | { 13 | virtual ~Ticker() { stop(); } 14 | virtual void tick(float delta) {} 15 | 16 | void play(); 17 | void stop(); 18 | }; 19 | 20 | class Timer : protected Ticker 21 | { 22 | public: 23 | 24 | enum { 25 | FOREVER = -1 26 | }; 27 | 28 | ofEvent timerEvent; 29 | 30 | Timer() : remain(0), duration(0), repeat(0) {} 31 | 32 | void start(float duration, int repeat = FOREVER) 33 | { 34 | this->duration = duration; 35 | this->remain = duration; 36 | this->repeat = repeat; 37 | 38 | count = 0; 39 | 40 | Ticker::play(); 41 | } 42 | 43 | void stop() 44 | { 45 | Ticker::stop(); 46 | } 47 | 48 | int getCount() const { return count; } 49 | 50 | protected: 51 | 52 | float remain, duration; 53 | int repeat, count; 54 | 55 | void tick(float delta) 56 | { 57 | remain -= delta; 58 | 59 | if (remain > 0) return; 60 | 61 | int N = count; 62 | ofNotifyEvent(timerEvent, N, this); 63 | 64 | count++; 65 | 66 | if (repeat < 0 67 | || count < repeat) 68 | { 69 | remain += duration; 70 | } 71 | else 72 | { 73 | stop(); 74 | } 75 | } 76 | }; 77 | 78 | #pragma mark - 79 | 80 | class Clock 81 | { 82 | public: 83 | 84 | virtual float getTime() const { return ofGetLastFrameTime(); } 85 | 86 | void update() 87 | { 88 | float dt = getTime(); 89 | for (int i = 0; i < time_related().size(); i++) 90 | time_related()[i]->tick(dt); 91 | } 92 | 93 | void makeSystemClock() { system_clock = this; } 94 | 95 | public: 96 | 97 | static Clock* getClock() { return system_clock; } 98 | 99 | static void regist(Ticker *o) 100 | { 101 | if (find(time_related().begin(), time_related().end(), o) != time_related().end()) return; 102 | time_related().push_back(o); 103 | } 104 | 105 | static void unregist(Ticker *o) 106 | { 107 | vector::iterator it = remove(time_related().begin(), time_related().end(), o); 108 | time_related().erase(it, time_related().end()); 109 | } 110 | 111 | protected: 112 | 113 | static Clock *system_clock; 114 | static vector& time_related() 115 | { 116 | static vector *p = new vector; 117 | return *p; 118 | } 119 | }; 120 | 121 | class Tempo : public Clock 122 | { 123 | public: 124 | 125 | Tempo() : bpm(120) {} 126 | 127 | void setBpm(float v) { bpm = v; } 128 | float getBpm() const { return bpm; } 129 | 130 | float getTime() const 131 | { 132 | return ofGetLastFrameTime() * (bpm / 60); 133 | } 134 | 135 | protected: 136 | 137 | float bpm; 138 | }; 139 | 140 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE 141 | -------------------------------------------------------------------------------- /example-composition/src/testApp.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | 3 | #include "ofxAnimationPrimitives.h" 4 | 5 | class SubTopComposition : public ofxAnimationPrimitives::Composition 6 | { 7 | public: 8 | 9 | void draw() 10 | { 11 | ofSetColor(255, 0, 0, 255 * getAlpha()); 12 | ofRect(0, 0, ofGetWidth(), ofGetHeight() / 2); 13 | } 14 | }; 15 | 16 | class SubBottomComposition : public ofxAnimationPrimitives::Composition 17 | { 18 | public: 19 | 20 | void draw() 21 | { 22 | ofSetColor(0, 255, 0, 255 * getAlpha()); 23 | ofRect(0, ofGetHeight() / 2, ofGetWidth(), ofGetHeight() / 2); 24 | } 25 | }; 26 | 27 | class MainComposition : public ofxAnimationPrimitives::Composition 28 | { 29 | public: 30 | 31 | MainComposition() 32 | { 33 | // show SubTopComposition after MainComposition apper 34 | on(DID_APPEAR, New(), Duration(1, 3, 1)); 35 | 36 | // show SubBottomComposition after 3 sec 37 | at(3, New(), Duration(1, 3, 1)); 38 | } 39 | 40 | void draw() 41 | { 42 | ofSetColor(255 * getAlpha()); 43 | ofRect(0, 0, ofGetWidth(), ofGetHeight()); 44 | } 45 | }; 46 | 47 | MainComposition::Ref comp; 48 | 49 | //-------------------------------------------------------------- 50 | void testApp::setup() 51 | { 52 | ofSetVerticalSync(true); 53 | ofSetFrameRate(60); 54 | ofBackground(0); 55 | 56 | // create new composition 57 | comp = ofxAnimationPrimitives::Composition::New(); 58 | 59 | // start MainComposition, fadein in 5sec, total duration in 10 sec, fadeout in 3 sec. 60 | comp->play(5, 10, 3); 61 | } 62 | 63 | //-------------------------------------------------------------- 64 | void testApp::update() 65 | { 66 | ofxAnimationPrimitives::CompositionRunner::defaultRunner().update(); 67 | } 68 | 69 | //-------------------------------------------------------------- 70 | void testApp::draw() 71 | { 72 | ofxAnimationPrimitives::CompositionRunner::defaultRunner().draw(); 73 | } 74 | 75 | //-------------------------------------------------------------- 76 | void testApp::keyPressed(int key) 77 | { 78 | // replay MainComposition 79 | comp->reset(); 80 | comp->play(); 81 | } 82 | 83 | //-------------------------------------------------------------- 84 | void testApp::keyReleased(int key) 85 | { 86 | 87 | } 88 | 89 | //-------------------------------------------------------------- 90 | void testApp::mouseMoved(int x, int y) 91 | { 92 | } 93 | 94 | //-------------------------------------------------------------- 95 | void testApp::mouseDragged(int x, int y, int button) 96 | { 97 | 98 | } 99 | 100 | //-------------------------------------------------------------- 101 | void testApp::mousePressed(int x, int y, int button) 102 | { 103 | } 104 | 105 | //-------------------------------------------------------------- 106 | void testApp::mouseReleased(int x, int y, int button) 107 | { 108 | } 109 | 110 | //-------------------------------------------------------------- 111 | void testApp::windowResized(int w, int h) 112 | { 113 | } 114 | 115 | //-------------------------------------------------------------- 116 | void testApp::gotMessage(ofMessage msg) 117 | { 118 | } 119 | 120 | //-------------------------------------------------------------- 121 | void testApp::dragEvent(ofDragInfo dragInfo) 122 | { 123 | } -------------------------------------------------------------------------------- /example-instance-manager/src/testApp.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | 3 | #include "ofxAnimationPrimitives.h" 4 | 5 | int num_instance = 0; 6 | 7 | class MyInstance : public ofxAnimationPrimitives::Instance 8 | { 9 | public: 10 | 11 | ofVec2f pos; 12 | ofColor color; 13 | float phase; 14 | 15 | MyInstance(float x, float y) 16 | { 17 | pos.set(x, y); 18 | color = ofColor::fromHsb(ofRandom(255), 255, 255); 19 | phase = 0; 20 | 21 | cout << "created: " << ++num_instance << endl; 22 | } 23 | 24 | ~MyInstance() 25 | { 26 | cout << "deleted: " << --num_instance << endl; 27 | } 28 | 29 | void update() 30 | { 31 | phase += 0.05; 32 | } 33 | 34 | void draw() 35 | { 36 | ofFill(); 37 | ofSetColor(color); 38 | ofCircle(pos, (30 + sin(phase * PI) * 10) * getLife()); 39 | } 40 | }; 41 | 42 | class MyInfinityInstance : public ofxAnimationPrimitives::Instance 43 | { 44 | public: 45 | 46 | ofVec2f pos; 47 | ofColor color; 48 | float phase; 49 | float mass; 50 | 51 | MyInfinityInstance(float x, float y) 52 | { 53 | pos.set(x, y); 54 | color = ofColor::fromHsb(ofRandom(255), 255, 255); 55 | phase = 0; 56 | mass = ofRandom(0.01, 0.1); 57 | 58 | cout << "created: " << ++num_instance << endl; 59 | } 60 | 61 | ~MyInfinityInstance() 62 | { 63 | cout << "deleted: " << --num_instance << endl; 64 | } 65 | 66 | void update() 67 | { 68 | phase += 0.01; 69 | pos += (ofVec2f(ofGetMouseX(), ofGetMouseY()) - pos) * mass; 70 | } 71 | 72 | void draw() 73 | { 74 | ofNoFill(); 75 | ofSetColor(color); 76 | ofCircle(pos, (100 + sin(phase * PI) * 30) * getLife()); 77 | } 78 | }; 79 | 80 | 81 | ofxAnimationPrimitives::InstanceManager manager; 82 | 83 | //-------------------------------------------------------------- 84 | void testApp::setup() 85 | { 86 | ofSetVerticalSync(true); 87 | ofSetFrameRate(60); 88 | ofBackground(0); 89 | } 90 | 91 | //-------------------------------------------------------------- 92 | void testApp::update() 93 | { 94 | manager.update(); 95 | } 96 | 97 | //-------------------------------------------------------------- 98 | void testApp::draw() 99 | { 100 | manager.draw(); 101 | } 102 | 103 | //-------------------------------------------------------------- 104 | void testApp::keyPressed(int key) 105 | { 106 | manager.release(3); 107 | } 108 | 109 | //-------------------------------------------------------------- 110 | void testApp::keyReleased(int key) 111 | { 112 | 113 | } 114 | 115 | //-------------------------------------------------------------- 116 | void testApp::mouseMoved(int x, int y) 117 | { 118 | manager.createInstance(x, y)->play(4); 119 | } 120 | 121 | //-------------------------------------------------------------- 122 | void testApp::mouseDragged(int x, int y, int button) 123 | { 124 | 125 | } 126 | 127 | //-------------------------------------------------------------- 128 | void testApp::mousePressed(int x, int y, int button) 129 | { 130 | manager.createInstance(x, y)->playInfinity(); 131 | } 132 | 133 | //-------------------------------------------------------------- 134 | void testApp::mouseReleased(int x, int y, int button) 135 | { 136 | 137 | } 138 | 139 | //-------------------------------------------------------------- 140 | void testApp::windowResized(int w, int h) 141 | { 142 | 143 | } 144 | 145 | //-------------------------------------------------------------- 146 | void testApp::gotMessage(ofMessage msg) 147 | { 148 | 149 | } 150 | 151 | //-------------------------------------------------------------- 152 | void testApp::dragEvent(ofDragInfo dragInfo) 153 | { 154 | 155 | } -------------------------------------------------------------------------------- /example-sequence/src/testApp.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | 3 | #include "ofxAnimationPrimitives.h" 4 | 5 | ofxAnimationPrimitives::Sequence seq; 6 | 7 | class MyClip : public ofxAnimationPrimitives::Sequence::Clip 8 | { 9 | public: 10 | 11 | string name; 12 | float start_time; 13 | float duration; 14 | 15 | ofVec2f pos; 16 | 17 | MyClip(string name, float start_time, float duration) 18 | : name(name), start_time(start_time), duration(duration) {} 19 | 20 | float getStartTime() const { return start_time; } 21 | float getDuration() const { return duration; } 22 | 23 | 24 | 25 | void onStart() 26 | { 27 | cout << "start: " << name << endl; 28 | 29 | pos.x = ofRandomWidth(); 30 | pos.y = ofRandomHeight(); 31 | } 32 | 33 | void onEnd() 34 | { 35 | cout << "end: " << name << endl; 36 | } 37 | 38 | void draw() 39 | { 40 | ofSetColor(255); 41 | ofDrawBitmapString(name, pos); 42 | ofRect(pos.x, pos.y, 100, 100); 43 | } 44 | 45 | }; 46 | 47 | class MyRedClip : public MyClip 48 | { 49 | public: 50 | 51 | MyRedClip(string name, float start_time, float duration) : MyClip(name, start_time, duration) {} 52 | 53 | void onStart() 54 | { 55 | cout << "red start: " << name << endl; 56 | 57 | pos.x = ofRandomWidth(); 58 | pos.y = ofRandomHeight(); 59 | } 60 | 61 | void onEnd() 62 | { 63 | cout << "red end: " << name << endl; 64 | } 65 | 66 | void draw() 67 | { 68 | ofSetColor(255, 0, 0); 69 | ofDrawBitmapString(name, pos); 70 | ofRect(pos.x, pos.y, 100, 100); 71 | } 72 | }; 73 | 74 | //-------------------------------------------------------------- 75 | void testApp::setup() 76 | { 77 | ofSetVerticalSync(true); 78 | ofSetFrameRate(60); 79 | ofBackground(0); 80 | 81 | seq.addClip(new MyClip("clip0", 1, 1)); 82 | seq.addClip(new MyClip("clip1", 1.5, 1)); 83 | seq.addClip(new MyClip("clip2", 2, 1)); 84 | 85 | seq.addClip(new MyRedClip("clip3", 3, 2)); 86 | } 87 | 88 | //-------------------------------------------------------------- 89 | void testApp::update() 90 | { 91 | seq.setTime(fmodf(ofGetElapsedTimef(), 4)); 92 | } 93 | 94 | //-------------------------------------------------------------- 95 | void testApp::draw() 96 | { 97 | ofSetColor(255); 98 | ofDrawBitmapString(ofToString(fmodf(ofGetElapsedTimef(), 4), 1), 10, 20); 99 | 100 | const vector& clips = seq.getActiveClips(); 101 | for (int i = 0; i < clips.size(); i++) 102 | { 103 | clips[i]->draw(); 104 | } 105 | } 106 | 107 | //-------------------------------------------------------------- 108 | void testApp::keyPressed(int key) 109 | { 110 | seq.setTime(0); 111 | } 112 | 113 | //-------------------------------------------------------------- 114 | void testApp::keyReleased(int key) 115 | { 116 | 117 | } 118 | 119 | //-------------------------------------------------------------- 120 | void testApp::mouseMoved(int x, int y) 121 | { 122 | } 123 | 124 | //-------------------------------------------------------------- 125 | void testApp::mouseDragged(int x, int y, int button) 126 | { 127 | 128 | } 129 | 130 | //-------------------------------------------------------------- 131 | void testApp::mousePressed(int x, int y, int button) 132 | { 133 | } 134 | 135 | //-------------------------------------------------------------- 136 | void testApp::mouseReleased(int x, int y, int button) 137 | { 138 | 139 | } 140 | 141 | //-------------------------------------------------------------- 142 | void testApp::windowResized(int w, int h) 143 | { 144 | 145 | } 146 | 147 | //-------------------------------------------------------------- 148 | void testApp::gotMessage(ofMessage msg) 149 | { 150 | 151 | } 152 | 153 | //-------------------------------------------------------------- 154 | void testApp::dragEvent(ofDragInfo dragInfo) 155 | { 156 | 157 | } -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Lerp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Timer.h" 4 | 5 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 6 | 7 | template 8 | class Lerp : public Ticker 9 | { 10 | public: 11 | 12 | Lerp() : value(0), target(0), speed(0.05) { play(); } 13 | Lerp(const T& v) : value(v), target(v), speed(0.05) { play(); } 14 | ~Lerp() { stop(); } 15 | Lerp(const Lerp& copy) { *this = copy; play(); } 16 | 17 | Lerp& operator=(const Lerp& copy) 18 | { 19 | value = copy.value; 20 | target = copy.target; 21 | speed = copy.speed; 22 | return *this; 23 | } 24 | 25 | inline Lerp& operator=(const T& v) { target = v; } 26 | inline operator const T&() const { return value; } 27 | 28 | inline void setValue(const T& v, bool override = false) { override ? value = v : target = v; } 29 | inline const T& getValue() const { return value; } 30 | 31 | inline void setSpeed(float v) { speed = ofClamp(v, 0, 1); } 32 | inline float getSpeed() const { return speed; } 33 | 34 | inline Lerp& operator+=(const T& v) { target += v; return *this; } 35 | inline Lerp& operator-=(const T& v) { target -= v; return *this; } 36 | inline Lerp& operator*=(const T& v) { target *= v; return *this; } 37 | inline Lerp& operator/=(const T& v) { target /= v; return *this; } 38 | 39 | protected: 40 | 41 | T value, target; 42 | float speed; 43 | 44 | void tick(float delta) 45 | { 46 | value += (target - value) * speed; 47 | } 48 | }; 49 | 50 | class Line : public Ticker 51 | { 52 | public: 53 | 54 | Line() 55 | :value(0) 56 | ,value_delta(0) 57 | ,curtime(0) 58 | {} 59 | 60 | /* 61 | Max/MSP style lamp generator 62 | 63 | line.set("100 1 0 1"); // Value changes to 100 in 1 sec, then to 0 in 1 sec 64 | line.play(); 65 | 66 | // or 67 | 68 | line.play("0, 1000 0.5 -1000 0.5"); // Initialize value with comma and play immediately 69 | */ 70 | bool setup(const string& line_string) 71 | { 72 | string s = line_string; 73 | 74 | string::size_type n = s.find(","); 75 | if (n != string::npos) 76 | { 77 | value = ofToFloat(s.substr(0, n)); 78 | s = s.substr(n + 1); 79 | } 80 | 81 | vector e = ofSplitString(s, " ", true, true); 82 | if ((e.size() % 2) != 0) return false; 83 | 84 | arr.clear(); 85 | 86 | for (int i = 0; i < e.size(); i += 2) 87 | { 88 | TimeValue TV; 89 | TV.value = ofToFloat(e[i]); 90 | TV.time = ofToFloat(e[i + 1]); 91 | arr.push_back(TV); 92 | } 93 | 94 | return true; 95 | } 96 | 97 | void play() 98 | { 99 | if (arr.empty()) 100 | { 101 | ofLogError("Line") << "setup first"; 102 | return; 103 | } 104 | 105 | curtime = 0; 106 | 107 | iter = arr.begin(); 108 | updateDelta(); 109 | 110 | Ticker::play(); 111 | } 112 | 113 | void play(const string& line_string) 114 | { 115 | if (setup(line_string)) 116 | play(); 117 | } 118 | 119 | inline operator float() const { return value; } 120 | inline float getValue() const { return value; } 121 | 122 | protected: 123 | 124 | float value; 125 | float value_delta; 126 | 127 | float curtime; 128 | 129 | struct TimeValue { 130 | float time; 131 | float value; 132 | }; 133 | 134 | vector arr; 135 | vector::iterator iter; 136 | 137 | void updateDelta() 138 | { 139 | value_delta = (iter->value - value) / (iter->time - curtime); 140 | } 141 | 142 | void tick(float delta) 143 | { 144 | if (iter == arr.end()) return; 145 | 146 | value += value_delta * delta; 147 | 148 | if (curtime + delta < iter->time) 149 | { 150 | curtime += delta; 151 | } 152 | else 153 | { 154 | curtime = 0; 155 | value = iter->value; 156 | 157 | iter++; 158 | updateDelta(); 159 | } 160 | } 161 | }; 162 | 163 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE 164 | -------------------------------------------------------------------------------- /example-scene/src/testApp.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | 3 | #include "ofxAnimationPrimitives.h" 4 | 5 | ofxAnimationPrimitives::SceneManager SM; 6 | 7 | class Scene0 : public ofxAnimationPrimitives::Scene 8 | { 9 | public: 10 | 11 | OFX_ANIMATION_PRIMITIVES_DEFINE_SCENE(Scene0); 12 | 13 | Scene0(const int arg0) 14 | { 15 | cout << "Scene0: " << arg0 << endl; 16 | } 17 | 18 | void update() 19 | { 20 | cout << __PRETTY_FUNCTION__ << endl; 21 | } 22 | 23 | void draw() 24 | { 25 | ofSetColor(100, 0, 0, 255 * getAlpha()); 26 | ofRect(0, 0, ofGetWidth() / 2, ofGetHeight()); 27 | 28 | ofSetColor(255); 29 | ofDrawBitmapString("SCENE0 alpha:" + ofToString(getAlpha(), 3), 10, 20); 30 | } 31 | 32 | void viewWillAppear() { cout << __PRETTY_FUNCTION__ << endl; } 33 | void viewDidAppear() { cout << __PRETTY_FUNCTION__ << endl; } 34 | void viewWillDisappear() { cout << __PRETTY_FUNCTION__ << endl; } 35 | void viewDidDisappear() { cout << __PRETTY_FUNCTION__ << endl; } 36 | }; 37 | 38 | class Scene1 : public ofxAnimationPrimitives::Scene 39 | { 40 | public: 41 | 42 | OFX_ANIMATION_PRIMITIVES_DEFINE_SCENE(Scene1); 43 | 44 | Scene1(const string& arg0, float arg1) 45 | { 46 | cout << "Scene1: " << arg0 << " " << arg1 << endl; 47 | } 48 | 49 | void update() 50 | { 51 | cout << __PRETTY_FUNCTION__ << endl; 52 | } 53 | 54 | void draw() 55 | { 56 | ofSetColor(0, 100, 0, 255 * getAlpha()); 57 | ofRect(ofGetWidth() / 2, 0, ofGetWidth() / 2, ofGetHeight()); 58 | 59 | ofSetColor(255); 60 | ofDrawBitmapString("SCENE1 alpha:" + ofToString(getAlpha(), 3), ofGetWidth() / 2 + 10, 20); 61 | } 62 | 63 | void viewWillAppear() { cout << __PRETTY_FUNCTION__ << endl; } 64 | void viewDidAppear() { cout << __PRETTY_FUNCTION__ << endl; } 65 | void viewWillDisappear() { cout << __PRETTY_FUNCTION__ << endl; } 66 | void viewDidDisappear() { cout << __PRETTY_FUNCTION__ << endl; } 67 | }; 68 | 69 | //-------------------------------------------------------------- 70 | void testApp::setup() 71 | { 72 | ofSetVerticalSync(true); 73 | ofSetFrameRate(60); 74 | ofBackground(0); 75 | 76 | SM.addScene(42); 77 | SM.addScene("'arg0 string'", PI); 78 | 79 | SM.changeScene("Scene0"); 80 | } 81 | 82 | //-------------------------------------------------------------- 83 | void testApp::update() 84 | { 85 | ofBackground(0); 86 | 87 | SM.update(); 88 | } 89 | 90 | //-------------------------------------------------------------- 91 | void testApp::draw() 92 | { 93 | SM.draw(); 94 | } 95 | 96 | //-------------------------------------------------------------- 97 | void testApp::keyPressed(int key) 98 | { 99 | if (key == '1') SM.changeScene(0.1); 100 | if (key == '2') SM.changeScene(); 101 | } 102 | 103 | //-------------------------------------------------------------- 104 | void testApp::keyReleased(int key) 105 | { 106 | 107 | } 108 | 109 | //-------------------------------------------------------------- 110 | void testApp::mouseMoved(int x, int y) 111 | { 112 | } 113 | 114 | //-------------------------------------------------------------- 115 | void testApp::mouseDragged(int x, int y, int button) 116 | { 117 | 118 | } 119 | 120 | //-------------------------------------------------------------- 121 | void testApp::mousePressed(int x, int y, int button) 122 | { 123 | } 124 | 125 | //-------------------------------------------------------------- 126 | void testApp::mouseReleased(int x, int y, int button) 127 | { 128 | 129 | } 130 | 131 | //-------------------------------------------------------------- 132 | void testApp::windowResized(int w, int h) 133 | { 134 | 135 | } 136 | 137 | //-------------------------------------------------------------- 138 | void testApp::gotMessage(ofMessage msg) 139 | { 140 | 141 | } 142 | 143 | //-------------------------------------------------------------- 144 | void testApp::dragEvent(ofDragInfo dragInfo) 145 | { 146 | 147 | } -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Sequence.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Constants.h" 4 | 5 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 6 | 7 | template 8 | class Sequence_ 9 | { 10 | public: 11 | 12 | class Clip 13 | { 14 | public: 15 | 16 | typedef Ref_ Ref; 17 | 18 | Clip() {} 19 | virtual ~Clip() {} 20 | 21 | virtual timestamp_t getStartTime() const { return 0; } 22 | virtual timestamp_t getDuration() const { return 0; } 23 | 24 | virtual void update() {} 25 | virtual void draw() {} 26 | 27 | public: 28 | 29 | virtual void onStart() {} 30 | virtual void onEnd() {} 31 | }; 32 | 33 | public: 34 | 35 | Sequence_() : last_time(0) {} 36 | ~Sequence_() { clear(); } 37 | 38 | inline bool hasClip(typename Clip::Ref o) 39 | { 40 | return find(clips.begin(), clips.end(), o) != clips.end(); 41 | } 42 | 43 | void addClip(typename Clip::Ref o) 44 | { 45 | if (hasClip(o)) return; 46 | clips.push_back(o); 47 | 48 | clip_map.insert(make_pair(o->getStartTime(), o)); 49 | } 50 | 51 | void removeClip(typename Clip::Ref o) 52 | { 53 | if (!hasClip(o)) return; 54 | clips.erase(remove(clips.begin(), clips.end(), o), clips.end()); 55 | 56 | // remove from clip_map 57 | int n = clip_map.count(o->getStartTime()); 58 | if (n == 0) return; 59 | 60 | typename ClipMap::iterator it = clip_map.find(o->getStartTime()); 61 | for (int i = 0; i < n; i++) 62 | { 63 | if (it->second == o) 64 | { 65 | clip_map.erase(it); 66 | break; 67 | } 68 | it++; 69 | } 70 | } 71 | 72 | void setTime(timestamp_t t) 73 | { 74 | timestamp_t begin = last_time; 75 | timestamp_t end = t; 76 | 77 | if (begin != end) 78 | updateInRange(begin, end); 79 | 80 | last_time = t; 81 | } 82 | 83 | const vector& getActiveClips() const { return active_clips_arr; } 84 | const vector& getAllClips() const { return clips; } 85 | 86 | void clear() 87 | { 88 | clips.clear(); 89 | active_clips.clear(); 90 | clip_map.clear(); 91 | } 92 | 93 | protected: 94 | 95 | timestamp_t last_time; 96 | 97 | vector clips; 98 | set active_clips; 99 | vector active_clips_arr; 100 | 101 | typedef multimap ClipMap; 102 | ClipMap clip_map; 103 | 104 | void updateInRange(timestamp_t start, timestamp_t end) 105 | { 106 | if (start > end) 107 | { 108 | // remove future clip if play backwards 109 | 110 | typename set::iterator it = active_clips.begin(); 111 | while (it != active_clips.end()) 112 | { 113 | typename Clip::Ref o = *it; 114 | 115 | if (o->getStartTime() >= end) 116 | { 117 | o->onEnd(); 118 | active_clips.erase(it++); 119 | } 120 | else it++; 121 | } 122 | 123 | return; 124 | } 125 | 126 | // Remove Pass 1: Find and remove out range clips 127 | { 128 | typename set::iterator it = active_clips.begin(); 129 | while (it != active_clips.end()) 130 | { 131 | typename Clip::Ref o = *it; 132 | 133 | if ((o->getStartTime() + o->getDuration()) <= end) 134 | { 135 | o->onEnd(); 136 | active_clips.erase(it++); 137 | } 138 | else it++; 139 | } 140 | } 141 | 142 | // Find new in range clips 143 | { 144 | typename ClipMap::iterator it = clip_map.lower_bound(start); 145 | typename ClipMap::iterator end_it = clip_map.lower_bound(end); 146 | 147 | while (it != end_it) 148 | { 149 | typename Clip::Ref o = it->second; 150 | o->onStart(); 151 | 152 | if (o->getDuration() > 0) 153 | { 154 | active_clips.insert(o); 155 | } 156 | else 157 | { 158 | o->onEnd(); 159 | } 160 | 161 | it++; 162 | } 163 | } 164 | 165 | // Remove Pass 2: Find and remove in new clips 166 | { 167 | typename set::iterator it = active_clips.begin(); 168 | while (it != active_clips.end()) 169 | { 170 | typename Clip::Ref o = *it; 171 | 172 | if ((o->getStartTime() + o->getDuration()) <= end) 173 | { 174 | o->onEnd(); 175 | active_clips.erase(it++); 176 | } 177 | else it++; 178 | } 179 | } 180 | 181 | active_clips_arr.assign(active_clips.begin(), active_clips.end()); 182 | } 183 | }; 184 | 185 | typedef Sequence_ Sequence; 186 | 187 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE 188 | -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Replicator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | #include "Constants.h" 6 | 7 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 8 | 9 | template 10 | struct Replicator_ 11 | { 12 | typedef Replicator_ Replicator; 13 | 14 | // base classes 15 | class Node; 16 | class Operator; 17 | class Layout; 18 | 19 | // layout 20 | class Linear; 21 | class Fill2D; 22 | class Grid2D; 23 | class Grid3D; 24 | 25 | inline size_t size() const { return children.size(); } 26 | inline Node& get(size_t i) { return children[i]; } 27 | inline Node& operator[](size_t i) { return children[i]; } 28 | 29 | void resize(size_t num) 30 | { 31 | children.resize(num); 32 | for (int i = 0; i < children.size(); i++) 33 | { 34 | children[i].id = i; 35 | } 36 | } 37 | 38 | protected: 39 | 40 | vector children; 41 | }; 42 | 43 | #pragma mark - Base Classes 44 | 45 | template 46 | class Replicator_::Operator 47 | { 48 | public: 49 | 50 | virtual void operator()(Replicator &repl) {} 51 | 52 | Replicator& apply(Replicator &repl) 53 | { 54 | this->operator()(repl); 55 | return repl; 56 | } 57 | }; 58 | 59 | template 60 | struct Replicator_::Node 61 | { 62 | friend struct Replicator_; 63 | 64 | public: 65 | 66 | struct Operator; 67 | 68 | T param; 69 | 70 | ofMatrix4x4 m; 71 | 72 | inline int getID() const { return id; } 73 | inline void beginTransform() 74 | { 75 | ofPushMatrix(); 76 | ofMultMatrix(m); 77 | } 78 | 79 | inline void endTransform() 80 | { 81 | ofPopMatrix(); 82 | } 83 | 84 | private: 85 | 86 | int id; 87 | 88 | }; 89 | 90 | template 91 | class Replicator_::Node::Operator 92 | { 93 | public: 94 | 95 | virtual void operator()(Node &node) {} 96 | 97 | Replicator& apply(Replicator &repl) 98 | { 99 | for (int i = 0; i < repl.size(); i++) 100 | this->operator()(repl[i]); 101 | 102 | return repl; 103 | } 104 | }; 105 | 106 | #pragma mark - Layout 107 | 108 | template 109 | struct Replicator_::Linear : public Operator 110 | { 111 | int count; 112 | ofVec3f offset; 113 | 114 | Linear(int count, ofVec3f offset) : count(count), offset(offset) {} 115 | 116 | void operator()(Replicator &repl) 117 | { 118 | repl.resize(count); 119 | 120 | float d = 0; 121 | for (int i = 0; i < repl.size(); i++) 122 | { 123 | repl[i].m.setTranslation(i * offset); 124 | } 125 | } 126 | }; 127 | 128 | template 129 | struct Replicator_::Fill2D : public Operator 130 | { 131 | int offsetX, offsetY; 132 | float sizeX, sizeY; 133 | 134 | Fill2D(int offsetX, int offsetY, float sizeX, float sizeY) : offsetX(offsetX), offsetY(offsetY), sizeX(sizeX), sizeY(sizeY) {} 135 | 136 | void operator()(Replicator &repl) 137 | { 138 | const int nX = sizeX / offsetX + 1; 139 | const int nY = sizeY / offsetY + 1; 140 | 141 | const int num = nX * nY; 142 | repl.resize(num); 143 | 144 | int idx = 0; 145 | for (int y = 0; y < nY; y++) 146 | { 147 | for (int x = 0; x < nX; x++) 148 | { 149 | repl[idx].m.setTranslation(x * offsetX, y * offsetY, 0); 150 | repl[idx].param.x = x; 151 | repl[idx].param.y = y; 152 | 153 | idx++; 154 | } 155 | } 156 | } 157 | }; 158 | 159 | template 160 | struct Replicator_::Grid2D : public Operator 161 | { 162 | int X, Y; 163 | float sizeX, sizeY; 164 | 165 | Grid2D(int X, int Y, float sizeX, float sizeY) : X(X), Y(Y), sizeX(sizeX), sizeY(sizeY) {} 166 | 167 | void operator()(Replicator &repl) 168 | { 169 | const int X_minus_one = X - 1; 170 | const int Y_minus_one = Y - 1; 171 | 172 | const int num = X * Y; 173 | repl.resize(num); 174 | 175 | int idx = 0; 176 | for (int y = 0; y < Y; y++) 177 | { 178 | for (int x = 0; x < X; x++) 179 | { 180 | float xx = ofMap(x, 0, X_minus_one, 0, 1) * sizeX; 181 | float yy = ofMap(y, 0, Y_minus_one, 0, 1) * sizeY; 182 | 183 | repl[idx].m.setTranslation(xx, yy, 0); 184 | repl[idx].param.x = x; 185 | repl[idx].param.y = y; 186 | 187 | idx++; 188 | } 189 | } 190 | } 191 | }; 192 | 193 | template 194 | struct Replicator_::Grid3D : public Operator 195 | { 196 | int X, Y, Z; 197 | float sizeX, sizeY, sizeZ; 198 | 199 | Grid3D(int X, int Y, int Z, float sizeX, float sizeY, float sizeZ) : X(X), Y(Y), Z(Z), sizeX(sizeX), sizeY(sizeY), sizeZ(sizeZ) {} 200 | 201 | void operator()(Replicator &repl) 202 | { 203 | const int X_minus_one = X - 1; 204 | const int Y_minus_one = Y - 1; 205 | const int Z_minus_one = Z - 1; 206 | 207 | const int num = X * Y * Z; 208 | repl.resize(num); 209 | 210 | int idx = 0; 211 | 212 | for (int z = 0; z < Z; z++) 213 | { 214 | for (int y = 0; y < Y; y++) 215 | { 216 | for (int x = 0; x < X; x++) 217 | { 218 | float xx = ofMap(x, 0, X_minus_one, 0, 1) * sizeX; 219 | float yy = ofMap(y, 0, Y_minus_one, 0, 1) * sizeY; 220 | float zz = ofMap(z, 0, Z_minus_one, 0, 1) * sizeZ; 221 | 222 | repl[idx].m.setTranslation(xx, yy, zz); 223 | repl[idx].param.x = x; 224 | repl[idx].param.y = y; 225 | repl[idx].param.z = z; 226 | 227 | idx++; 228 | } 229 | } 230 | } 231 | } 232 | }; 233 | 234 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Easing.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Constants.h" 4 | 5 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 6 | 7 | namespace Easing { 8 | 9 | struct Back 10 | { 11 | inline static float easeIn(const float t) 12 | { 13 | return 3 * t * t * t - 2 * t * t; 14 | } 15 | 16 | inline static float easeOut(const float t) 17 | { 18 | return 1. - easeIn(1. - t); 19 | } 20 | 21 | inline static float easeInOut(const float t) 22 | { 23 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 24 | } 25 | }; 26 | 27 | struct Bounce 28 | { 29 | 30 | inline static float easeIn(const float t) 31 | { 32 | static const float DH = 1. / 22.; 33 | static const float D1 = 1. / 11.; 34 | static const float D2 = 2. / 11.; 35 | static const float D3 = 3. / 11.; 36 | static const float D4 = 4. / 11.; 37 | static const float D5 = 5. / 11.; 38 | static const float D7 = 7. / 11.; 39 | static const float IH = 1. / DH; 40 | static const float I1 = 1. / D1; 41 | static const float I2 = 1. / D2; 42 | static const float I4D = 1. / D4 / D4; 43 | 44 | float s; 45 | if (t < D1) 46 | { 47 | s = t - DH; 48 | s = DH - s * s * IH; 49 | } 50 | else if (t < D3) 51 | { 52 | s = t - D2; 53 | s = D1 - s * s * I1; 54 | } 55 | else if (t < D7) 56 | { 57 | s = t - D5; 58 | s = D2 - s * s * I2; 59 | } 60 | else 61 | { 62 | s = t - 1; 63 | s = 1 - s * s * I4D; 64 | } 65 | return s; 66 | } 67 | 68 | inline static float easeOut(const float t) 69 | { 70 | return 1. - easeIn(1. - t); 71 | } 72 | 73 | inline static float easeInOut(const float t) 74 | { 75 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 76 | } 77 | 78 | }; 79 | 80 | struct Circ 81 | { 82 | inline static float easeIn(const float t) 83 | { 84 | return 1.0 - sqrtf(1.0 - t * t); 85 | } 86 | 87 | inline static float easeOut(const float t) 88 | { 89 | return 1. - easeIn(1. - t); 90 | } 91 | 92 | inline static float easeInOut(const float t) 93 | { 94 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 95 | } 96 | }; 97 | 98 | struct Cubic 99 | { 100 | inline static float easeIn(const float t) 101 | { 102 | return t * t * t; 103 | } 104 | 105 | inline static float easeOut(const float t) 106 | { 107 | return 1. - easeIn(1. - t); 108 | } 109 | 110 | inline static float easeInOut(const float t) 111 | { 112 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 113 | } 114 | }; 115 | 116 | struct Elastic 117 | { 118 | inline static float easeIn(const float t) 119 | { 120 | return 1.0 - easeOut(1.0 - t); 121 | } 122 | 123 | inline static float easeOut(const float t) 124 | { 125 | float s = 1 - t; 126 | return 1 - powf(s, 8) + sinf(t * t * 6 * PI) * s * s; 127 | } 128 | 129 | inline static float easeInOut(const float t) 130 | { 131 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 132 | } 133 | }; 134 | 135 | struct Expo 136 | { 137 | inline static float easeIn(const float t) 138 | { 139 | return powf(2, 10 * (t - 1)); 140 | } 141 | 142 | inline static float easeOut(const float t) 143 | { 144 | return 1.0 - powf(2, -10 * t); 145 | } 146 | 147 | inline static float easeInOut(const float t) 148 | { 149 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 150 | } 151 | }; 152 | 153 | struct Linear 154 | { 155 | inline static float easeIn(const float t) 156 | { 157 | return t; 158 | } 159 | 160 | inline static float easeOut(const float t) 161 | { 162 | return t; 163 | } 164 | 165 | inline static float easeInOut(const float t) 166 | { 167 | return t; 168 | } 169 | }; 170 | 171 | struct Quad 172 | { 173 | inline static float easeIn(const float t) 174 | { 175 | return t * t; 176 | } 177 | 178 | inline static float easeOut(const float t) 179 | { 180 | return 1. - easeIn(1. - t); 181 | } 182 | 183 | inline static float easeInOut(const float t) 184 | { 185 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 186 | } 187 | }; 188 | 189 | struct Quart 190 | { 191 | inline static float easeIn(const float t) 192 | { 193 | return t * t * t * t; 194 | } 195 | 196 | inline static float easeOut(const float t) 197 | { 198 | return 1. - easeIn(1. - t); 199 | } 200 | 201 | inline static float easeInOut(const float t) 202 | { 203 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 204 | } 205 | }; 206 | 207 | struct Quint 208 | { 209 | inline static float easeIn(const float t) 210 | { 211 | return t * t * t * t * t; 212 | } 213 | 214 | inline static float easeOut(const float t) 215 | { 216 | return 1. - easeIn(1. - t); 217 | } 218 | 219 | inline static float easeInOut(const float t) 220 | { 221 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 222 | } 223 | }; 224 | 225 | struct Sine 226 | { 227 | inline static float easeIn(const float t) 228 | { 229 | return 1.0 - cosf(t * HALF_PI); 230 | } 231 | 232 | inline static float easeOut(const float t) 233 | { 234 | return 1. - easeIn(1. - t); 235 | } 236 | 237 | inline static float easeInOut(const float t) 238 | { 239 | return (t < 0.5) ? easeIn(t * 2.0) * 0.5 : 1 - easeIn(2.0 - t * 2.0) * 0.5; 240 | } 241 | }; 242 | 243 | } 244 | 245 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/CommandQueue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Constants.h" 4 | 5 | #include 6 | 7 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 8 | 9 | struct CommandQueueCommand; 10 | struct JoinCommand; 11 | struct UntilCommand; 12 | 13 | struct Command { 14 | using Callback = std::function; 15 | static void Empty() {} 16 | static void EmptyUpdate(float) {} 17 | 18 | std::function start = Empty; 19 | std::function update = EmptyUpdate; 20 | std::function finish = Empty; 21 | 22 | bool is_async = false; 23 | 24 | virtual void reset() {} 25 | virtual bool updateTick(float tick) { return false; } 26 | }; 27 | 28 | struct LinearCommand : public Command { 29 | float current = 0, duration; 30 | 31 | LinearCommand() 32 | : current(0) 33 | , duration(0) 34 | {} 35 | 36 | LinearCommand(float duration) 37 | : duration(duration) 38 | {} 39 | 40 | void reset() override { 41 | current = 0; 42 | } 43 | 44 | bool updateTick(float tick) override { 45 | float pct = current / duration; 46 | 47 | update(pct); 48 | 49 | current += tick; 50 | 51 | if (current > duration) { 52 | current = duration; 53 | return false; 54 | } 55 | 56 | return true; 57 | } 58 | }; 59 | 60 | struct CallbackCommand : public Command { 61 | 62 | CallbackCommand(const std::function& fn) 63 | : fn(fn) 64 | { 65 | this->start = fn; 66 | } 67 | 68 | bool updateTick(float tick) override { 69 | return false; 70 | } 71 | 72 | std::function fn; 73 | }; 74 | 75 | class CommandQueue 76 | { 77 | public: 78 | 79 | CommandQueue& then(const std::function& fn) { 80 | auto o = std::make_shared(fn); 81 | queue.emplace_back(o); 82 | return *this; 83 | } 84 | 85 | CommandQueue& then(float duration, const std::function& update) { 86 | auto o = std::make_shared(duration); 87 | o->update = update; 88 | queue.emplace_back(o); 89 | return *this; 90 | } 91 | 92 | CommandQueue& then(CommandQueue& CQ) { 93 | auto o = std::make_shared(&CQ); 94 | CQ.parent = this; 95 | sub_commnad_queues.insert(&CQ); 96 | queue.emplace_back(o); 97 | return *this; 98 | } 99 | 100 | template 101 | CommandQueue& then(const std::function& fn) { 102 | auto o = std::make_shared(); 103 | fn(o.get()); 104 | queue.emplace_back(o); 105 | return *this; 106 | } 107 | 108 | CommandQueue& async(float duration, const std::function& update, const std::function& finish = Command::Empty) { 109 | auto o = std::make_shared(duration); 110 | o->is_async = true; 111 | o->update = update; 112 | o->finish = finish; 113 | queue.emplace_back(o); 114 | return *this; 115 | } 116 | 117 | CommandQueue& join() 118 | { 119 | auto o = std::make_shared(this); 120 | queue.emplace_back(o); 121 | return *this; 122 | } 123 | 124 | CommandQueue& wait(float duration = std::numeric_limits::infinity()) 125 | { 126 | auto o = std::make_shared(duration); 127 | queue.emplace_back(o); 128 | return *this; 129 | } 130 | 131 | CommandQueue& until(const std::function& update) 132 | { 133 | auto o = std::make_shared(update); 134 | queue.emplace_back(o); 135 | return *this; 136 | } 137 | 138 | void start() 139 | { 140 | reset(); 141 | startFrontQueue(); 142 | } 143 | 144 | void reset() 145 | { 146 | running_queue = queue; 147 | } 148 | 149 | void clear() 150 | { 151 | running_queue.clear(); 152 | queue.clear(); 153 | } 154 | 155 | void update(float tick) 156 | { 157 | // only root commandd queue 158 | if (this->parent == nullptr) 159 | { 160 | updateAsync(tick); 161 | } 162 | 163 | if (running_queue.empty()) return; 164 | 165 | if (running_queue.front()->updateTick(tick) == false) 166 | { 167 | next(); 168 | } 169 | } 170 | 171 | void next() 172 | { 173 | if (running_queue.empty()) return; 174 | 175 | auto front = running_queue.front(); 176 | front->update(1); 177 | front->finish(); 178 | running_queue.pop_front(); 179 | 180 | if (running_queue.empty()) return; 181 | 182 | startFrontQueue(); 183 | } 184 | 185 | bool isFinished() const { return running_queue.size() == 0 && !queue.empty(); } 186 | bool hasAsyncCommands() const { return !async_commands.empty(); } 187 | 188 | private: 189 | 190 | std::vector> async_commands; 191 | std::deque> running_queue; 192 | 193 | std::deque> queue; 194 | 195 | CommandQueue* parent = nullptr; 196 | std::unordered_set sub_commnad_queues; 197 | 198 | void startFrontQueue() 199 | { 200 | if (running_queue.empty()) return; 201 | 202 | while (!running_queue.empty()) 203 | { 204 | auto front = running_queue.front(); 205 | 206 | front->reset(); 207 | front->start(); 208 | 209 | // async command 210 | if (front->is_async) 211 | { 212 | async_commands.push_back(front); 213 | running_queue.pop_front(); 214 | continue; 215 | } 216 | 217 | // callback only command 218 | if (front->updateTick(0) == false) 219 | { 220 | front->update(1); 221 | front->finish(); 222 | running_queue.pop_front(); 223 | continue; 224 | } 225 | 226 | break; 227 | } 228 | } 229 | 230 | void updateAsync(float tick) 231 | { 232 | auto it = async_commands.begin(); 233 | while (it != async_commands.end()) 234 | { 235 | auto ptr = it->get(); 236 | if (ptr->updateTick(tick) == false) 237 | { 238 | ptr->update(1); 239 | ptr->finish(); 240 | 241 | it = async_commands.erase(it); 242 | } 243 | else 244 | it++; 245 | } 246 | 247 | for (auto& it : sub_commnad_queues) 248 | { 249 | it->updateAsync(tick); 250 | } 251 | } 252 | }; 253 | 254 | // 255 | 256 | struct CommandQueueCommand : public Command { 257 | 258 | CommandQueueCommand(CommandQueue* CQ) 259 | : CQ(CQ) 260 | { 261 | this->start = [this]() { 262 | this->CQ->start(); 263 | }; 264 | } 265 | 266 | bool updateTick(float tick) override { 267 | CQ->update(tick); 268 | return !CQ->isFinished(); 269 | } 270 | 271 | CommandQueue* CQ; 272 | }; 273 | 274 | struct JoinCommand : public Command { 275 | 276 | JoinCommand(CommandQueue* CQ) 277 | : CQ(CQ) 278 | {} 279 | 280 | bool updateTick(float tick) override { 281 | return CQ->hasAsyncCommands(); 282 | } 283 | 284 | CommandQueue* CQ; 285 | }; 286 | 287 | struct UntilCommand : public Command { 288 | 289 | std::function fn; 290 | float current = 0; 291 | 292 | UntilCommand(std::function fn) 293 | : fn(fn) 294 | {} 295 | 296 | void reset() override { 297 | current = 0; 298 | } 299 | 300 | bool updateTick(float tick) override { 301 | current += tick; 302 | return fn(current); 303 | } 304 | }; 305 | 306 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE 307 | -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Composition.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | #include "Constants.h" 6 | 7 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 8 | 9 | class Composition 10 | { 11 | public: 12 | 13 | typedef ofPtr Ref; 14 | 15 | virtual void update() {} 16 | virtual void draw() {} 17 | 18 | virtual void viewWillAppear() {} 19 | virtual void viewDidAppear() {} 20 | virtual void viewWillDisappear() {} 21 | virtual void viewDidDisappear() {} 22 | 23 | public: 24 | 25 | // property 26 | int getElapsedFrame() const; 27 | float getElapsedTime() const; 28 | 29 | float getDuration() const; 30 | float getPosition() const; 31 | 32 | float getAlpha() const; 33 | 34 | public: 35 | 36 | void play(); 37 | void play(float scene_total_duration); 38 | void play(float fadein_duration, float scene_total_duration, float fadeout_duration); 39 | void stop(float fadeout_duration = 0); 40 | 41 | bool isPlaying() const; 42 | bool isFinished() const; 43 | 44 | void reset(); 45 | 46 | public: 47 | 48 | // events 49 | 50 | enum Trigger { 51 | WILL_APPEAR, 52 | DID_APPEAR, 53 | WILL_DISAPPEAR, 54 | DID_DISAPPEAR 55 | }; 56 | 57 | ofEvent onTrigger; 58 | 59 | struct Duration { 60 | float fadein_duration; 61 | float total_duration; 62 | float fadeout_duration; 63 | 64 | Duration(float total_duration = std::numeric_limits::infinity()); 65 | Duration(float fadein_duration, float total_duration, float fadeout_duration); 66 | }; 67 | 68 | Composition::Ref on(Trigger event, Composition::Ref, Duration s = Duration()); 69 | Composition::Ref at(float time, Composition::Ref, Duration s = Duration()); 70 | 71 | public: 72 | 73 | // factory method 74 | 75 | template 76 | static Composition::Ref New(); 77 | 78 | /* 79 | http://nedbatchelder.com/code/cog/ 80 | $ cog.py -r SomoSourceCode.h 81 | 82 | [[[cog 83 | import cog 84 | 85 | tmpl = '''template 86 | static Composition::Ref New(%(B)s); 87 | ''' 88 | 89 | cog.outl('') 90 | for i in xrange(1, 18): 91 | a = ', '.join(['typename A%i' % x for x in range(i)]) 92 | b = ', '.join(['const A%i& a%i' % (x, x) for x in range(i)]) 93 | c = ', '.join(['a%i' % x for x in range(i)]) 94 | cog.outl(tmpl % {'A':a, 'B':b, 'C':c}) 95 | 96 | ]]]*/ 97 | 98 | template 99 | static Composition::Ref New(const A0& a0); 100 | 101 | template 102 | static Composition::Ref New(const A0& a0, const A1& a1); 103 | 104 | template 105 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2); 106 | 107 | template 108 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3); 109 | 110 | template 111 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4); 112 | 113 | template 114 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5); 115 | 116 | template 117 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6); 118 | 119 | template 120 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7); 121 | 122 | template 123 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8); 124 | 125 | template 126 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9); 127 | 128 | template 129 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10); 130 | 131 | template 132 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11); 133 | 134 | template 135 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12); 136 | 137 | template 138 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13); 139 | 140 | template 141 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14); 142 | 143 | template 144 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15); 145 | 146 | template 147 | static Composition::Ref New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15, const A16& a16); 148 | 149 | //[[[end]]] 150 | 151 | protected: 152 | 153 | Composition(); 154 | virtual ~Composition(); 155 | 156 | private: 157 | 158 | float alpha, alpha_delta; 159 | float elapsed_time; 160 | 161 | Duration duration; 162 | 163 | multimap trigger_event_map; 164 | multimap time_event_map; 165 | 166 | void procTimeEvent(float t0, float t1); 167 | void procTriggerEvent(Trigger trigger); 168 | 169 | enum CompositionState { 170 | PAUSED, 171 | STARTED, 172 | FADEIN, 173 | PLAYING, 174 | FADEOUT, 175 | FINISHED 176 | } state; 177 | 178 | friend class CompositionRunner; 179 | 180 | void updateState(); 181 | 182 | void _update(float tick); 183 | void _draw(); 184 | 185 | void _viewWillAppear(); 186 | void _viewDidAppear(); 187 | void _viewWillDisappear(); 188 | void _viewDidDisappear(); 189 | 190 | // noncopyable 191 | Composition(const Composition&) {} 192 | Composition& operator=(const Composition&) {} 193 | }; 194 | 195 | 196 | class CompositionRunner 197 | { 198 | public: 199 | 200 | static CompositionRunner& defaultRunner() 201 | { 202 | static CompositionRunner o; 203 | return o; 204 | } 205 | 206 | void update(float tick = ofGetLastFrameTime()) 207 | { 208 | for (int i = 0; i < comps.size(); i++) 209 | { 210 | comps[i]->_update(tick); 211 | } 212 | } 213 | 214 | void draw() 215 | { 216 | for (int i = 0; i < comps.size(); i++) 217 | { 218 | comps[i]->_draw(); 219 | } 220 | } 221 | 222 | public: // internal use 223 | 224 | void registerComposition(Composition* o) 225 | { 226 | if (find(comps.begin(), comps.end(), o) != comps.end()) return; 227 | comps.push_back(o); 228 | } 229 | 230 | void unregisterComposition(Composition* o) 231 | { 232 | if (find(comps.begin(), comps.end(), o) == comps.end()) return; 233 | comps.erase(remove(comps.begin(), comps.end(), o), comps.end()); 234 | } 235 | 236 | void clear() 237 | { 238 | comps.clear(); 239 | } 240 | 241 | private: 242 | 243 | vector comps; 244 | 245 | // noncopyable 246 | CompositionRunner() {} 247 | ~CompositionRunner() {} 248 | CompositionRunner(const CompositionRunner&) {} 249 | CompositionRunner& operator=(const CompositionRunner&) {} 250 | }; 251 | 252 | #include "detail/Composition.inc.h" 253 | 254 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/Pattern.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | #include "Constants.h" 6 | #include "Timer.h" 7 | 8 | // based SuperCollider sequence mechanism 9 | // see. http://doc.sccode.org/Tutorials/Getting-Started/16-Sequencing-with-Patterns.html 10 | 11 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 12 | 13 | class Pattern 14 | { 15 | public: 16 | 17 | typedef float value_type; 18 | typedef ofPtr Ref; 19 | 20 | Pattern() {} 21 | Pattern(const float& value) : value(value) {} 22 | 23 | virtual bool valid() const { return true; } 24 | virtual void next() { if (valid()) update(); } 25 | 26 | const value_type& get() const { return value; } 27 | 28 | protected: 29 | 30 | value_type value; 31 | virtual void update() {} 32 | }; 33 | 34 | class ListPattern : public Pattern 35 | { 36 | public: 37 | 38 | ListPattern() : num(0) {} 39 | ListPattern(int num) : num(num) {} 40 | 41 | bool valid() const { return num > 0 || num == -1; } 42 | 43 | protected: 44 | 45 | int num; 46 | void tick() { if (num > 0) num--; } 47 | 48 | }; 49 | 50 | class Rand : public ListPattern 51 | { 52 | vector elem; 53 | 54 | public: 55 | 56 | Rand() {} 57 | Rand(const vector& elem, int num = -1) : elem(elem), ListPattern(num) 58 | { 59 | this->value = this->elem[rand() % this->elem.size()]; 60 | } 61 | 62 | protected: 63 | 64 | void update() 65 | { 66 | ListPattern::tick(); 67 | this->value = this->elem[rand() % this->elem.size()]; 68 | } 69 | }; 70 | 71 | class Seq : public ListPattern 72 | { 73 | int count; 74 | vector elem; 75 | 76 | public: 77 | 78 | Seq() {} 79 | Seq(const vector& elem, int num = -1) : elem(elem), ListPattern(num), count(0) 80 | { 81 | this->value = this->elem[0]; 82 | } 83 | 84 | protected: 85 | 86 | void update() 87 | { 88 | ListPattern::tick(); 89 | this->value = this->elem[++count % this->elem.size()]; 90 | } 91 | }; 92 | 93 | class While : public ListPattern 94 | { 95 | int count; 96 | value_type min, max; 97 | 98 | public: 99 | 100 | While() {} 101 | While(const value_type& min, const value_type& max, int num = -1) : min(min), max(max), ListPattern(num), count(0) 102 | { 103 | this->value = ofLerp(min, max, ofRandom(1)); 104 | } 105 | 106 | protected: 107 | 108 | void update() 109 | { 110 | ListPattern::tick(); 111 | this->value = ofLerp(min, max, ofRandom(1)); 112 | } 113 | }; 114 | 115 | // time 116 | 117 | class TimePattern : public Pattern, public Ticker 118 | { 119 | public: 120 | 121 | TimePattern() :remain(0), playing(false), value_pattern(NULL), dur_pattern(NULL) {} 122 | 123 | virtual ~TimePattern() 124 | { 125 | stop(); 126 | 127 | if (value_pattern) 128 | delete value_pattern; 129 | 130 | if (dur_pattern) 131 | delete dur_pattern; 132 | } 133 | 134 | void play() 135 | { 136 | playing = true; 137 | Ticker::play(); 138 | } 139 | 140 | void pause() { playing = false; } 141 | 142 | void stop() 143 | { 144 | Ticker::stop(); 145 | remain = 0; 146 | playing = false; 147 | } 148 | 149 | void toggle() { isPlaying() ? stop() : play(); } 150 | 151 | bool isPlaying() { return playing; } 152 | 153 | bool valid() const 154 | { 155 | return value_pattern->valid() 156 | && dur_pattern->valid(); 157 | } 158 | 159 | protected: 160 | 161 | virtual void event() {} 162 | 163 | protected: 164 | 165 | float remain; 166 | bool playing; 167 | 168 | void setPattern(Pattern *value, Pattern *dur) 169 | { 170 | setValuePattern(value); 171 | setDurationPattern(dur); 172 | } 173 | 174 | void setValuePattern(Pattern *value) 175 | { 176 | if (value_pattern) 177 | delete value_pattern; 178 | value_pattern = value; 179 | } 180 | 181 | void setDurationPattern(Pattern *dur) 182 | { 183 | if (dur_pattern) 184 | delete dur_pattern; 185 | dur_pattern = dur; 186 | } 187 | 188 | void tick(float delta) 189 | { 190 | // must set value_pattern & dur_pattern 191 | assert(value_pattern); 192 | assert(dur_pattern); 193 | 194 | if (!valid()) stop(); 195 | 196 | if (!playing) return; 197 | 198 | bool fire = false; 199 | while (remain <= 0) 200 | { 201 | remain += dur_pattern->get(); 202 | dur_pattern->next(); 203 | fire = true; 204 | } 205 | 206 | if (fire) 207 | { 208 | this->value = value_pattern->get(); 209 | value_pattern->next(); 210 | 211 | this->event(); 212 | } 213 | 214 | remain -= delta; 215 | } 216 | 217 | private: 218 | 219 | Pattern *value_pattern; 220 | Pattern *dur_pattern; 221 | 222 | }; 223 | 224 | class Step : public TimePattern 225 | { 226 | public: 227 | 228 | Step() {} 229 | 230 | template 231 | Step(const T0& value, const T1& dur) 232 | { 233 | setValuePattern(new T0(value)); 234 | setDurationPattern(new T1(dur)); 235 | } 236 | 237 | }; 238 | 239 | // 240 | 241 | class Bind : public Pattern 242 | { 243 | map patterns; 244 | map value; 245 | 246 | public: 247 | 248 | typedef map value_type; 249 | 250 | Bind() {} 251 | 252 | template 253 | Bind(const string& key0, const T0& t0) 254 | { 255 | patterns[key0] = Pattern::Ref(new T0(t0)); 256 | } 257 | 258 | template 259 | Bind(const string& key0, const T0& t0, const string& key1, const T1& t1) 260 | { 261 | patterns[key0] = Pattern::Ref(new T0(t0)); 262 | patterns[key1] = Pattern::Ref(new T1(t1)); 263 | } 264 | 265 | template 266 | Bind(const string& key0, const T0& t0, const string& key1, const T1& t1, const string& key2, const T2& t2) 267 | { 268 | patterns[key0] = Pattern::Ref(new T0(t0)); 269 | patterns[key1] = Pattern::Ref(new T1(t1)); 270 | patterns[key2] = Pattern::Ref(new T2(t2)); 271 | } 272 | 273 | template 274 | Bind(const string& key0, const T0& t0, const string& key1, const T1& t1, const string& key2, const T2& t2, const string& key3, const T3& t3) 275 | { 276 | patterns[key0] = Pattern::Ref(new T0(t0)); 277 | patterns[key1] = Pattern::Ref(new T1(t1)); 278 | patterns[key2] = Pattern::Ref(new T2(t2)); 279 | patterns[key3] = Pattern::Ref(new T3(t3)); 280 | } 281 | 282 | template 283 | Bind(const string& key0, const T0& t0, const string& key1, const T1& t1, const string& key2, const T2& t2, const string& key3, const T3& t3, const string& key4, const T4& t4) 284 | { 285 | patterns[key0] = Pattern::Ref(new T0(t0)); 286 | patterns[key1] = Pattern::Ref(new T1(t1)); 287 | patterns[key2] = Pattern::Ref(new T2(t2)); 288 | patterns[key3] = Pattern::Ref(new T3(t3)); 289 | patterns[key4] = Pattern::Ref(new T4(t4)); 290 | } 291 | 292 | template 293 | Bind(const string& key0, const T0& t0, const string& key1, const T1& t1, const string& key2, const T2& t2, const string& key3, const T3& t3, const string& key4, const T4& t4, const string& key5, const T5& t5) 294 | { 295 | patterns[key0] = Pattern::Ref(new T0(t0)); 296 | patterns[key1] = Pattern::Ref(new T1(t1)); 297 | patterns[key2] = Pattern::Ref(new T2(t2)); 298 | patterns[key3] = Pattern::Ref(new T3(t3)); 299 | patterns[key4] = Pattern::Ref(new T4(t4)); 300 | patterns[key5] = Pattern::Ref(new T5(t5)); 301 | } 302 | 303 | template 304 | Bind(const string& key0, const T0& t0, const string& key1, const T1& t1, const string& key2, const T2& t2, const string& key3, const T3& t3, const string& key4, const T4& t4, const string& key5, const T5& t5, const string& key6, const T6& t6) 305 | { 306 | patterns[key0] = Pattern::Ref(new T0(t0)); 307 | patterns[key1] = Pattern::Ref(new T1(t1)); 308 | patterns[key2] = Pattern::Ref(new T2(t2)); 309 | patterns[key3] = Pattern::Ref(new T3(t3)); 310 | patterns[key4] = Pattern::Ref(new T4(t4)); 311 | patterns[key5] = Pattern::Ref(new T5(t5)); 312 | patterns[key6] = Pattern::Ref(new T6(t6)); 313 | } 314 | 315 | template 316 | Bind(const string& key0, const T0& t0, const string& key1, const T1& t1, const string& key2, const T2& t2, const string& key3, const T3& t3, const string& key4, const T4& t4, const string& key5, const T5& t5, const string& key6, const T6& t6, const string& key7, const T7& t7) 317 | { 318 | patterns[key0] = Pattern::Ref(new T0(t0)); 319 | patterns[key1] = Pattern::Ref(new T1(t1)); 320 | patterns[key2] = Pattern::Ref(new T2(t2)); 321 | patterns[key3] = Pattern::Ref(new T3(t3)); 322 | patterns[key4] = Pattern::Ref(new T4(t4)); 323 | patterns[key5] = Pattern::Ref(new T5(t5)); 324 | patterns[key6] = Pattern::Ref(new T6(t6)); 325 | patterns[key7] = Pattern::Ref(new T7(t7)); 326 | } 327 | 328 | template 329 | Bind(const string& key0, const T0& t0, const string& key1, const T1& t1, const string& key2, const T2& t2, const string& key3, const T3& t3, const string& key4, const T4& t4, const string& key5, const T5& t5, const string& key6, const T6& t6, const string& key7, const T7& t7, const string& key8, const T8& t8) 330 | { 331 | patterns[key0] = Pattern::Ref(new T0(t0)); 332 | patterns[key1] = Pattern::Ref(new T1(t1)); 333 | patterns[key2] = Pattern::Ref(new T2(t2)); 334 | patterns[key3] = Pattern::Ref(new T3(t3)); 335 | patterns[key4] = Pattern::Ref(new T4(t4)); 336 | patterns[key5] = Pattern::Ref(new T5(t5)); 337 | patterns[key6] = Pattern::Ref(new T6(t6)); 338 | patterns[key7] = Pattern::Ref(new T7(t7)); 339 | patterns[key8] = Pattern::Ref(new T8(t8)); 340 | } 341 | 342 | bool valid() const 343 | { 344 | map::const_iterator it = patterns.begin(); 345 | 346 | while (it != patterns.end()) 347 | { 348 | if (!it->second->valid()) return false; 349 | it++; 350 | } 351 | 352 | return true; 353 | } 354 | 355 | const Pattern::value_type& get(const string& key) { return value[key]; } 356 | 357 | void dump() const 358 | { 359 | map::const_iterator it = patterns.begin(); 360 | 361 | cout << "[" << endl; 362 | while (it != patterns.end()) 363 | { 364 | if (!it->second->valid()); 365 | cout << "\t" << it->first << ": " << it->second->get() << endl; 366 | it++; 367 | } 368 | cout << "]" << endl; 369 | } 370 | 371 | protected: 372 | 373 | void update() 374 | { 375 | map::const_iterator it = patterns.begin(); 376 | 377 | while (it != patterns.end()) 378 | { 379 | it->second->next(); 380 | value[it->first] = it->second->get(); 381 | it++; 382 | } 383 | } 384 | 385 | }; 386 | 387 | // SuperCollider like typename 388 | 389 | typedef Rand Prand; 390 | typedef Seq Pseq; 391 | typedef While Pwhile; 392 | typedef Step Pstep; 393 | typedef Bind Pbind; 394 | 395 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE 396 | -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/InstanceManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | #include "Constants.h" 6 | 7 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 8 | 9 | template 10 | class InstanceManager_; 11 | 12 | template 13 | class Instance_ 14 | { 15 | friend class InstanceManager_; 16 | 17 | public: 18 | 19 | Instance_() 20 | : class_id(0) 21 | , remain(0) 22 | , duration(0) 23 | , life(0) 24 | , one_minus_life(0) 25 | , after(0) 26 | , elapsed(0) 27 | , uniform(NULL) 28 | {} 29 | 30 | virtual ~Instance_() {} 31 | 32 | virtual void update() {} 33 | virtual void draw() {} 34 | 35 | inline void play(float duration, float after = 0) 36 | { 37 | if (duration < 0) duration = 0; 38 | this->duration = remain = duration; 39 | this->after = after; 40 | } 41 | 42 | inline void playInfinity() 43 | { 44 | this->duration = remain = std::numeric_limits::infinity(); 45 | } 46 | 47 | // use with playInfinity 48 | void release(float duration) 49 | { 50 | this->duration = remain = duration; 51 | } 52 | 53 | public: 54 | 55 | inline bool isAlive() const { return remain > 0; } 56 | 57 | inline float getLife() const { return life; } 58 | inline float getOneMinusLife() const { return one_minus_life; } 59 | inline float getInvLife() const { return getOneMinusLife(); } 60 | 61 | inline float getDuration() const { return duration; } 62 | 63 | inline bool isInfinity() const { return std::isinf(duration); } 64 | 65 | inline UniformData& getUniform() { return *uniform; } 66 | inline const UniformData& getUniform() const { return *uniform; } 67 | 68 | inline float getElapsed() const { return elapsed; } 69 | 70 | protected: 71 | 72 | virtual void willDelete() {} 73 | 74 | private: 75 | 76 | RTTI::TypeID class_id; 77 | 78 | float remain; 79 | float duration; 80 | float after; 81 | float elapsed; 82 | 83 | // cache 84 | float life; 85 | float one_minus_life; 86 | 87 | UniformData *uniform; 88 | }; 89 | 90 | template 91 | class InstanceManager_ 92 | { 93 | typedef Instance_ Instance; 94 | 95 | public: 96 | 97 | void update(float tick = ofGetLastFrameTime()) 98 | { 99 | for (int i = 0; i < instances.size(); i++) 100 | { 101 | Instance *o = instances[i]; 102 | 103 | if (o->after >= tick) 104 | { 105 | o->after -= tick; 106 | continue; 107 | } 108 | else o->after = 0; 109 | 110 | o->update(); 111 | o->remain -= tick; 112 | o->elapsed += tick; 113 | 114 | if (isnormal(o->duration)) 115 | o->life = o->remain / o->duration; 116 | else 117 | o->life = 1; 118 | 119 | o->one_minus_life = 1 - o->life; 120 | } 121 | 122 | typename vector::iterator it = instances.begin(); 123 | while (it != instances.end()) 124 | { 125 | Instance *o = *it; 126 | if (!o->isAlive()) 127 | { 128 | it = instances.erase(it); 129 | o->willDelete(); 130 | delete o; 131 | } 132 | else 133 | it++; 134 | } 135 | } 136 | 137 | void draw() 138 | { 139 | glPushAttrib(GL_ALL_ATTRIB_BITS); 140 | ofPushMatrix(); 141 | ofPushStyle(); 142 | 143 | typename vector::iterator it = instances.begin(); 144 | while (it != instances.end()) 145 | { 146 | Instance *o = *it; 147 | if (o->after == 0) 148 | o->draw(); 149 | it++; 150 | } 151 | 152 | ofPopStyle(); 153 | ofPopMatrix(); 154 | glPopAttrib(); 155 | } 156 | 157 | public: 158 | 159 | template 160 | T* createInstance() 161 | { 162 | return setupInstance(new T); 163 | } 164 | 165 | /* 166 | http://nedbatchelder.com/code/cog/ 167 | $ cog.py -r SomoSourceCode.h 168 | 169 | [[[cog 170 | import cog 171 | 172 | tmpl = '''template 173 | T* createInstance(%(B)s) 174 | { 175 | return setupInstance(new T(%(C)s)); 176 | } 177 | ''' 178 | 179 | cog.outl('') 180 | for i in xrange(1, 18): 181 | a = ', '.join(['typename A%i' % x for x in range(i)]) 182 | b = ', '.join(['const A%i& a%i' % (x, x) for x in range(i)]) 183 | c = ', '.join(['a%i' % x for x in range(i)]) 184 | cog.outl(tmpl % {'A':a, 'B':b, 'C':c}) 185 | 186 | ]]]*/ 187 | 188 | template 189 | T* createInstance(const A0& a0) 190 | { 191 | return setupInstance(new T(a0)); 192 | } 193 | 194 | template 195 | T* createInstance(const A0& a0, const A1& a1) 196 | { 197 | return setupInstance(new T(a0, a1)); 198 | } 199 | 200 | template 201 | T* createInstance(const A0& a0, const A1& a1, const A2& a2) 202 | { 203 | return setupInstance(new T(a0, a1, a2)); 204 | } 205 | 206 | template 207 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3) 208 | { 209 | return setupInstance(new T(a0, a1, a2, a3)); 210 | } 211 | 212 | template 213 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4) 214 | { 215 | return setupInstance(new T(a0, a1, a2, a3, a4)); 216 | } 217 | 218 | template 219 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) 220 | { 221 | return setupInstance(new T(a0, a1, a2, a3, a4, a5)); 222 | } 223 | 224 | template 225 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) 226 | { 227 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6)); 228 | } 229 | 230 | template 231 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) 232 | { 233 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7)); 234 | } 235 | 236 | template 237 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) 238 | { 239 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8)); 240 | } 241 | 242 | template 243 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) 244 | { 245 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); 246 | } 247 | 248 | template 249 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) 250 | { 251 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)); 252 | } 253 | 254 | template 255 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11) 256 | { 257 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11)); 258 | } 259 | 260 | template 261 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12) 262 | { 263 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12)); 264 | } 265 | 266 | template 267 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13) 268 | { 269 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13)); 270 | } 271 | 272 | template 273 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14) 274 | { 275 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14)); 276 | } 277 | 278 | template 279 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15) 280 | { 281 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)); 282 | } 283 | 284 | template 285 | T* createInstance(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15, const A16& a16) 286 | { 287 | return setupInstance(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16)); 288 | } 289 | 290 | //[[[end]]] 291 | 292 | void release() 293 | { 294 | typename vector::iterator it = instances.begin(); 295 | while (it != instances.end()) 296 | { 297 | Instance *o = *it; 298 | o->willDelete(); 299 | delete o; 300 | it++; 301 | } 302 | } 303 | 304 | void release(float duration) 305 | { 306 | typename vector::iterator it = instances.begin(); 307 | while (it != instances.end()) 308 | { 309 | Instance *o = *it; 310 | o->release(duration); 311 | it++; 312 | } 313 | } 314 | 315 | template 316 | void release() 317 | { 318 | typename vector::iterator it = instances.begin(); 319 | while (it != instances.end()) 320 | { 321 | Instance *o = *it; 322 | if (o->class_id == RTTI::getTypeID()) 323 | { 324 | it = instances.erase(it); 325 | o->willDelete(); 326 | delete o; 327 | } 328 | else 329 | it++; 330 | } 331 | } 332 | 333 | template 334 | void release(float duration) 335 | { 336 | typename vector::iterator it = instances.begin(); 337 | while (it != instances.end()) 338 | { 339 | Instance *o = *it; 340 | if (o->class_id == RTTI::getTypeID()) 341 | { 342 | o->release(duration); 343 | } 344 | it++; 345 | } 346 | } 347 | 348 | void clear() 349 | { 350 | typename vector::iterator it = instances.begin(); 351 | while (it != instances.end()) 352 | { 353 | Instance *o = *it; 354 | delete o; 355 | it++; 356 | } 357 | 358 | instances.clear(); 359 | } 360 | 361 | template 362 | vector getInstance() 363 | { 364 | vector result; 365 | 366 | typename vector::iterator it = instances.begin(); 367 | while (it != instances.end()) 368 | { 369 | Instance *o = *it; 370 | if (o->class_id == RTTI::getTypeID()) 371 | { 372 | result.push_back((T*)o); 373 | } 374 | it++; 375 | } 376 | 377 | return result; 378 | } 379 | 380 | const vector& getInstance() const { return instances; } 381 | 382 | size_t getNumInstances() const { return instances.size(); } 383 | 384 | UniformData& getUniform() { return uniform; } 385 | const UniformData& getUniform() const { return uniform; } 386 | 387 | protected: 388 | 389 | UniformData uniform; 390 | vector instances; 391 | 392 | template 393 | T* setupInstance(T* o) 394 | { 395 | o->class_id = RTTI::getTypeID(); 396 | o->uniform = &uniform; 397 | instances.push_back(o); 398 | return o; 399 | } 400 | }; 401 | 402 | struct EmptyData {}; 403 | 404 | typedef Instance_ Instance; 405 | typedef InstanceManager_ InstanceManager; 406 | 407 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/detail/Composition.inc.h: -------------------------------------------------------------------------------- 1 | 2 | inline Composition::Duration::Duration(float total_duration) 3 | : fadein_duration(0) 4 | , total_duration(total_duration) 5 | , fadeout_duration(0) 6 | { 7 | 8 | } 9 | 10 | inline Composition::Duration::Duration(float fadein_duration, float total_duration, float fadeout_duration) 11 | : fadein_duration(fadein_duration) 12 | , total_duration(total_duration) 13 | , fadeout_duration(fadeout_duration) 14 | { 15 | } 16 | 17 | 18 | #pragma mark - Composition 19 | 20 | inline Composition::Composition() 21 | : state(PAUSED) 22 | , alpha(0) 23 | , alpha_delta(0) 24 | , elapsed_time(0) 25 | , duration(0, 0, 0) 26 | { 27 | } 28 | 29 | inline Composition::~Composition() 30 | { 31 | if (isPlaying()) 32 | { 33 | _viewWillAppear(); 34 | _viewDidAppear(); 35 | } 36 | } 37 | 38 | template 39 | inline Composition::Ref Composition::New() 40 | { 41 | return Composition::Ref(new T); 42 | } 43 | 44 | /* 45 | http://nedbatchelder.com/code/cog/ 46 | $ cog.py -r SomoSourceCode.h 47 | 48 | [[[cog 49 | import cog 50 | 51 | tmpl = '''template 52 | inline Composition::Ref Composition::New(%(B)s) 53 | { 54 | return Composition::Ref(new T(%(C)s)); 55 | } 56 | ''' 57 | 58 | cog.outl('') 59 | for i in xrange(1, 18): 60 | a = ', '.join(['typename A%i' % x for x in range(i)]) 61 | b = ', '.join(['const A%i& a%i' % (x, x) for x in range(i)]) 62 | c = ', '.join(['a%i' % x for x in range(i)]) 63 | cog.outl(tmpl % {'A':a, 'B':b, 'C':c}) 64 | 65 | ]]]*/ 66 | 67 | template 68 | inline Composition::Ref Composition::New(const A0& a0) 69 | { 70 | return Composition::Ref(new T(a0)); 71 | } 72 | 73 | template 74 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1) 75 | { 76 | return Composition::Ref(new T(a0, a1)); 77 | } 78 | 79 | template 80 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2) 81 | { 82 | return Composition::Ref(new T(a0, a1, a2)); 83 | } 84 | 85 | template 86 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3) 87 | { 88 | return Composition::Ref(new T(a0, a1, a2, a3)); 89 | } 90 | 91 | template 92 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4) 93 | { 94 | return Composition::Ref(new T(a0, a1, a2, a3, a4)); 95 | } 96 | 97 | template 98 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) 99 | { 100 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5)); 101 | } 102 | 103 | template 104 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) 105 | { 106 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6)); 107 | } 108 | 109 | template 110 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) 111 | { 112 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7)); 113 | } 114 | 115 | template 116 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) 117 | { 118 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8)); 119 | } 120 | 121 | template 122 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) 123 | { 124 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); 125 | } 126 | 127 | template 128 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) 129 | { 130 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)); 131 | } 132 | 133 | template 134 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11) 135 | { 136 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11)); 137 | } 138 | 139 | template 140 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12) 141 | { 142 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12)); 143 | } 144 | 145 | template 146 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13) 147 | { 148 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13)); 149 | } 150 | 151 | template 152 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14) 153 | { 154 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14)); 155 | } 156 | 157 | template 158 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15) 159 | { 160 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)); 161 | } 162 | 163 | template 164 | inline Composition::Ref Composition::New(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15, const A16& a16) 165 | { 166 | return Composition::Ref(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16)); 167 | } 168 | 169 | //[[[end]]] 170 | 171 | inline float Composition::getElapsedTime() const { return elapsed_time; } 172 | inline float Composition::getDuration() const { return duration.total_duration; } 173 | inline float Composition::getPosition() const { return elapsed_time / (duration.total_duration + std::numeric_limits::denorm_min()); } 174 | inline float Composition::getAlpha() const { return alpha; } 175 | inline bool Composition::isPlaying() const { return state != PAUSED && state != FINISHED; } 176 | inline bool Composition::isFinished() const { return state == FINISHED; } 177 | 178 | inline void Composition::reset() 179 | { 180 | CompositionRunner::defaultRunner().unregisterComposition(this); 181 | 182 | state = PAUSED; 183 | elapsed_time = 0; 184 | alpha = 0; 185 | alpha_delta = 0; 186 | 187 | { 188 | multimap::iterator it = trigger_event_map.begin(); 189 | while (it != trigger_event_map.end()) 190 | { 191 | Composition::Ref &o = it->second; 192 | o->reset(); 193 | it++; 194 | } 195 | 196 | trigger_event_map.clear(); 197 | } 198 | 199 | { 200 | multimap::iterator it = time_event_map.begin(); 201 | while (it != time_event_map.end()) 202 | { 203 | Composition::Ref &o = it->second; 204 | o->reset(); 205 | it++; 206 | } 207 | 208 | time_event_map.clear(); 209 | } 210 | } 211 | 212 | inline void Composition::play() 213 | { 214 | if (isPlaying()) 215 | { 216 | ofLogWarning("Composition") << "play method called multiple times."; 217 | return; 218 | } 219 | 220 | if (duration.fadein_duration <= 0) 221 | { 222 | alpha_delta = 1.; 223 | alpha = 1; 224 | 225 | updateState(); 226 | } 227 | else 228 | { 229 | alpha_delta = 1. / duration.fadein_duration; 230 | } 231 | 232 | state = STARTED; 233 | 234 | CompositionRunner::defaultRunner().registerComposition(this); 235 | } 236 | 237 | inline void Composition::play(float scene_total_duration) 238 | { 239 | Composition::play(0, scene_total_duration, 0); 240 | } 241 | 242 | inline void Composition::play(float fadein_duration, float scene_total_duration, float fadeout_duration) 243 | { 244 | duration = Duration(fadein_duration, scene_total_duration, fadeout_duration); 245 | Composition::play(); 246 | } 247 | 248 | inline void Composition::stop(float fadeout_duration) 249 | { 250 | if (state == FADEOUT) 251 | { 252 | ofLogWarning("Composition") << "stop method called multiple times."; 253 | return; 254 | } 255 | 256 | if (fadeout_duration <= 0) 257 | { 258 | alpha_delta = -1; 259 | alpha = 0; 260 | 261 | updateState(); 262 | } 263 | else 264 | { 265 | alpha_delta = -alpha / fadeout_duration; 266 | } 267 | } 268 | 269 | inline void Composition::_update(float tick) 270 | { 271 | if (!isPlaying()) return; 272 | 273 | float last_elapsed_time = elapsed_time; 274 | elapsed_time += tick; 275 | alpha += alpha_delta * tick; 276 | 277 | if (state == PLAYING 278 | && !isinf(duration.total_duration)) 279 | { 280 | const float fadeout_time = duration.total_duration - duration.fadeout_duration; 281 | if (elapsed_time > fadeout_time) 282 | { 283 | stop(duration.fadeout_duration); 284 | } 285 | } 286 | 287 | updateState(); 288 | 289 | procTimeEvent(last_elapsed_time, elapsed_time); 290 | 291 | if (isPlaying()) 292 | update(); 293 | } 294 | 295 | inline void Composition::_draw() 296 | { 297 | if (!isPlaying()) return; 298 | 299 | glPushAttrib(GL_ALL_ATTRIB_BITS); 300 | ofPushStyle(); 301 | ofPushView(); 302 | draw(); 303 | ofPopView(); 304 | ofPopStyle(); 305 | glPopAttrib(); 306 | } 307 | 308 | inline void Composition::_viewWillAppear() 309 | { 310 | viewWillAppear(); 311 | 312 | procTriggerEvent(WILL_APPEAR); 313 | } 314 | 315 | inline void Composition::_viewDidAppear() 316 | { 317 | viewDidAppear(); 318 | 319 | procTriggerEvent(DID_APPEAR); 320 | } 321 | 322 | inline void Composition::_viewWillDisappear() 323 | { 324 | viewWillDisappear(); 325 | 326 | procTriggerEvent(WILL_DISAPPEAR); 327 | } 328 | 329 | inline void Composition::_viewDidDisappear() 330 | { 331 | viewDidDisappear(); 332 | 333 | procTriggerEvent(DID_DISAPPEAR); 334 | CompositionRunner::defaultRunner().unregisterComposition(this); 335 | } 336 | 337 | inline void Composition::updateState() 338 | { 339 | if (state == STARTED && alpha_delta > 0.) 340 | { 341 | state = FADEIN; 342 | 343 | _viewWillAppear(); 344 | } 345 | if (state == FADEIN && alpha >= 1.) 346 | { 347 | alpha = 1; 348 | alpha_delta = 0; 349 | state = PLAYING; 350 | 351 | _viewDidAppear(); 352 | } 353 | if (state == PLAYING && alpha_delta < 0.) 354 | { 355 | state = FADEOUT; 356 | 357 | _viewWillDisappear(); 358 | } 359 | if (state == FADEOUT && alpha <= 0.) 360 | { 361 | alpha = 0; 362 | alpha_delta = 0; 363 | state = FINISHED; 364 | 365 | _viewDidDisappear(); 366 | } 367 | } 368 | 369 | inline void Composition::procTimeEvent(float t0, float t1) 370 | { 371 | multimap::iterator begin = time_event_map.lower_bound(t0); 372 | multimap::iterator end = time_event_map.upper_bound(t1); 373 | 374 | if (begin == end) return; 375 | 376 | multimap::iterator it = begin; 377 | 378 | while (it != end) 379 | { 380 | Composition::Ref &o = it->second; 381 | o->play(); 382 | it++; 383 | } 384 | } 385 | 386 | inline void Composition::procTriggerEvent(Trigger trigger) 387 | { 388 | if (trigger_event_map.count(trigger)) 389 | { 390 | std::pair::iterator, 391 | multimap::iterator> range = trigger_event_map.equal_range(trigger); 392 | multimap::iterator it = range.first; 393 | while (it != range.second) 394 | { 395 | Composition::Ref &o = it->second; 396 | o->play(); 397 | it++; 398 | } 399 | 400 | ofNotifyEvent(onTrigger, trigger, this); 401 | } 402 | } 403 | 404 | inline Composition::Ref Composition::on(Trigger event, Composition::Ref o, Duration s) 405 | { 406 | if (o.get() == this) 407 | { 408 | throw; 409 | } 410 | 411 | trigger_event_map.insert(make_pair(event, o)); 412 | o->duration = s; 413 | 414 | return o; 415 | } 416 | 417 | inline Composition::Ref Composition::at(float time, Composition::Ref o, Duration s) 418 | { 419 | if (o.get() == this) 420 | { 421 | throw; 422 | } 423 | 424 | time_event_map.insert(make_pair(time, o)); 425 | o->duration = s; 426 | 427 | return o; 428 | } 429 | 430 | #pragma mark - CompositionRunner 431 | 432 | -------------------------------------------------------------------------------- /src/ofxAnimationPrimitives/SceneManager.h: -------------------------------------------------------------------------------- 1 | OFX_ANIMATION_PRIMITIVES_BEGIN_NAMESPACE 2 | 3 | class SceneManager; 4 | 5 | #define OFX_ANIMATION_PRIMITIVES_DEFINE_SCENE(CLASS) \ 6 | static const char* getSceneName() { return #CLASS; } 7 | 8 | class Scene 9 | { 10 | friend class SceneManager; 11 | 12 | public: 13 | 14 | Scene() 15 | : _alpha(0) 16 | {} 17 | 18 | virtual ~Scene() {} 19 | 20 | virtual void update() {} 21 | virtual void draw() {} 22 | 23 | float getAlpha() const { return _alpha; } 24 | 25 | virtual void viewWillAppear() {} 26 | virtual void viewDidAppear() {} 27 | virtual void viewWillDisappear() {} 28 | virtual void viewDidDisappear() {} 29 | 30 | private: 31 | 32 | float _alpha; 33 | }; 34 | 35 | class SceneManager 36 | { 37 | public: 38 | 39 | SceneManager() 40 | : default_fade_duration(1) 41 | {} 42 | 43 | void update(float tick = ofGetLastFrameTime()) 44 | { 45 | { 46 | map::iterator it = faders.begin(); 47 | while (it != faders.end()) 48 | { 49 | Fader& fader = it->second; 50 | fader.update(tick); 51 | it++; 52 | } 53 | } 54 | 55 | { 56 | map::iterator it = scenes.begin(); 57 | while (it != scenes.end()) 58 | { 59 | Scene* scene = it->second; 60 | if (scene->getAlpha() > 0) 61 | { 62 | scene->update(); 63 | } 64 | 65 | it++; 66 | } 67 | } 68 | } 69 | 70 | void draw() 71 | { 72 | map::iterator it = scenes.begin(); 73 | while (it != scenes.end()) 74 | { 75 | Scene* scene = it->second; 76 | if (scene->getAlpha() > 0) 77 | { 78 | ofPushMatrix(); 79 | ofPushStyle(); 80 | 81 | scene->draw(); 82 | 83 | ofPopStyle(); 84 | ofPopMatrix(); 85 | } 86 | 87 | it++; 88 | } 89 | } 90 | 91 | template 92 | void addScene(); 93 | 94 | /* 95 | http://nedbatchelder.com/code/cog/ 96 | $ cog.py -r SomoSourceCode.h 97 | 98 | [[[cog 99 | import cog 100 | 101 | tmpl = '''template 102 | void addScene(%(B)s); 103 | ''' 104 | 105 | cog.outl('') 106 | for i in xrange(1, 18): 107 | a = ', '.join(['typename A%i' % x for x in range(i)]) 108 | b = ', '.join(['const A%i& a%i' % (x, x) for x in range(i)]) 109 | cog.outl(tmpl % {'A':a, 'B':b}) 110 | 111 | ]]]*/ 112 | 113 | template 114 | void addScene(const A0& a0); 115 | 116 | template 117 | void addScene(const A0& a0, const A1& a1); 118 | 119 | template 120 | void addScene(const A0& a0, const A1& a1, const A2& a2); 121 | 122 | template 123 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3); 124 | 125 | template 126 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4); 127 | 128 | template 129 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5); 130 | 131 | template 132 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6); 133 | 134 | template 135 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7); 136 | 137 | template 138 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8); 139 | 140 | template 141 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9); 142 | 143 | template 144 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10); 145 | 146 | template 147 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11); 148 | 149 | template 150 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12); 151 | 152 | template 153 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13); 154 | 155 | template 156 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14); 157 | 158 | template 159 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15); 160 | 161 | template 162 | void addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15, const A16& a16); 163 | 164 | //[[[end]]] 165 | 166 | bool changeScene(const string& scene_name); 167 | bool changeScene(const string& scene_name, float fade_duration); 168 | 169 | template 170 | bool changeScene(); 171 | 172 | template 173 | bool changeScene(float fade_duration); 174 | 175 | size_t getNumScenes() const { return scenes.size(); } 176 | const vector& getSceneNames() const { return scene_names; } 177 | 178 | float setDefaultFadeDuration(float v) { default_fade_duration = v; } 179 | float getDefaultFadeDuration() const { return default_fade_duration; } 180 | 181 | protected: 182 | 183 | map scenes; 184 | vector scene_names; 185 | 186 | float default_fade_duration; 187 | 188 | class Fader 189 | { 190 | public: 191 | 192 | Fader() 193 | : scene(NULL) 194 | , time(0) 195 | , duration(0) 196 | , start_alpha(0) 197 | , target_alpha(0) 198 | {} 199 | 200 | Fader(Scene* scene) 201 | : scene(scene) 202 | , time(0) 203 | , duration(0) 204 | , start_alpha(0) 205 | , target_alpha(0) 206 | {} 207 | 208 | Fader(const Fader& copy) { *this = copy; } 209 | 210 | Fader& operator=(const Fader& copy) 211 | { 212 | scene = copy.scene; 213 | time = copy.time; 214 | duration = copy.duration; 215 | start_alpha = copy.start_alpha; 216 | target_alpha = copy.target_alpha; 217 | } 218 | 219 | void fade(float target, float duration) 220 | { 221 | if (fabs(target - scene->_alpha) < std::numeric_limits::epsilon()) 222 | { 223 | scene->_alpha = target; 224 | return; 225 | } 226 | 227 | if (duration <= 0) 228 | { 229 | this->duration = 0; 230 | this->target_alpha = target; 231 | this->start_alpha = scene->_alpha; 232 | 233 | scene->_alpha = target; 234 | 235 | time = std::numeric_limits::infinity(); 236 | 237 | if (target == 1) 238 | { 239 | scene->viewWillAppear(); 240 | scene->viewDidAppear(); 241 | } 242 | else 243 | { 244 | scene->viewWillDisappear(); 245 | scene->viewDidDisappear(); 246 | } 247 | } 248 | else 249 | { 250 | this->duration = duration; 251 | this->target_alpha = target; 252 | this->start_alpha = scene->_alpha; 253 | 254 | time = 0; 255 | 256 | if (target == 1) 257 | { 258 | scene->viewWillAppear(); 259 | } 260 | else 261 | { 262 | scene->viewWillDisappear(); 263 | } 264 | } 265 | } 266 | 267 | void update(float tick) 268 | { 269 | if (isActive() == false) return; 270 | 271 | time += tick; 272 | 273 | float d = ofMap(time, 0, duration, start_alpha, target_alpha, true); 274 | 275 | if (d == target_alpha) 276 | { 277 | if (target_alpha == 1) 278 | { 279 | scene->viewDidAppear(); 280 | } 281 | else 282 | { 283 | scene->viewDidDisappear(); 284 | } 285 | } 286 | 287 | scene->_alpha = d; 288 | } 289 | 290 | bool isActive() const 291 | { 292 | return time < duration; 293 | } 294 | 295 | private: 296 | 297 | Scene* scene; 298 | 299 | float time; 300 | float duration; 301 | 302 | float start_alpha; 303 | float target_alpha; 304 | }; 305 | 306 | map faders; 307 | 308 | bool registerScene(Scene* scene, const string& scene_name) 309 | { 310 | if (scenes.find(scene_name) != scenes.end()) 311 | { 312 | ofLogError("SceneManager") << "duplicated scene name"; 313 | delete scene; 314 | return false; 315 | } 316 | 317 | scenes[scene_name] = scene; 318 | faders[scene] = Fader(scene); 319 | 320 | scene_names.push_back(scene_name); 321 | 322 | return true; 323 | } 324 | }; 325 | 326 | // 327 | 328 | template 329 | inline void SceneManager::addScene() 330 | { 331 | Scene* s = new T; 332 | registerScene(s, T::getSceneName()); 333 | } 334 | 335 | /* 336 | http://nedbatchelder.com/code/cog/ 337 | $ cog.py -r SomoSourceCode.h 338 | 339 | [[[cog 340 | import cog 341 | 342 | tmpl = '''template 343 | inline void SceneManager::addScene(%(B)s) 344 | { 345 | Scene* s = new T(%(C)s); 346 | registerScene(s, T::getSceneName()); 347 | } 348 | ''' 349 | 350 | cog.outl('') 351 | for i in xrange(1, 18): 352 | a = ', '.join(['typename A%i' % x for x in range(i)]) 353 | b = ', '.join(['const A%i& a%i' % (x, x) for x in range(i)]) 354 | c = ', '.join(['a%i' % x for x in range(i)]) 355 | cog.outl(tmpl % {'A':a, 'B':b, 'C':c}) 356 | 357 | ]]]*/ 358 | 359 | template 360 | inline void SceneManager::addScene(const A0& a0) 361 | { 362 | Scene* s = new T(a0); 363 | registerScene(s, T::getSceneName()); 364 | } 365 | 366 | template 367 | inline void SceneManager::addScene(const A0& a0, const A1& a1) 368 | { 369 | Scene* s = new T(a0, a1); 370 | registerScene(s, T::getSceneName()); 371 | } 372 | 373 | template 374 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2) 375 | { 376 | Scene* s = new T(a0, a1, a2); 377 | registerScene(s, T::getSceneName()); 378 | } 379 | 380 | template 381 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3) 382 | { 383 | Scene* s = new T(a0, a1, a2, a3); 384 | registerScene(s, T::getSceneName()); 385 | } 386 | 387 | template 388 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4) 389 | { 390 | Scene* s = new T(a0, a1, a2, a3, a4); 391 | registerScene(s, T::getSceneName()); 392 | } 393 | 394 | template 395 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) 396 | { 397 | Scene* s = new T(a0, a1, a2, a3, a4, a5); 398 | registerScene(s, T::getSceneName()); 399 | } 400 | 401 | template 402 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) 403 | { 404 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6); 405 | registerScene(s, T::getSceneName()); 406 | } 407 | 408 | template 409 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) 410 | { 411 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7); 412 | registerScene(s, T::getSceneName()); 413 | } 414 | 415 | template 416 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) 417 | { 418 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8); 419 | registerScene(s, T::getSceneName()); 420 | } 421 | 422 | template 423 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) 424 | { 425 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); 426 | registerScene(s, T::getSceneName()); 427 | } 428 | 429 | template 430 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) 431 | { 432 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); 433 | registerScene(s, T::getSceneName()); 434 | } 435 | 436 | template 437 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11) 438 | { 439 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); 440 | registerScene(s, T::getSceneName()); 441 | } 442 | 443 | template 444 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12) 445 | { 446 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); 447 | registerScene(s, T::getSceneName()); 448 | } 449 | 450 | template 451 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13) 452 | { 453 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); 454 | registerScene(s, T::getSceneName()); 455 | } 456 | 457 | template 458 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14) 459 | { 460 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); 461 | registerScene(s, T::getSceneName()); 462 | } 463 | 464 | template 465 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15) 466 | { 467 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); 468 | registerScene(s, T::getSceneName()); 469 | } 470 | 471 | template 472 | inline void SceneManager::addScene(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10, const A11& a11, const A12& a12, const A13& a13, const A14& a14, const A15& a15, const A16& a16) 473 | { 474 | Scene* s = new T(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); 475 | registerScene(s, T::getSceneName()); 476 | } 477 | 478 | //[[[end]]] 479 | 480 | inline bool SceneManager::changeScene(const string& scene_name, float fade_duration) 481 | { 482 | map::iterator it = scenes.find(scene_name); 483 | if (it == scenes.end()) 484 | { 485 | ofLogError("SceneManager") << "unknown scene name"; 486 | return false; 487 | } 488 | 489 | Scene* scene = it->second; 490 | 491 | { 492 | map::iterator it = faders.begin(); 493 | while (it != faders.end()) 494 | { 495 | Fader& fader = it->second; 496 | 497 | if (it->first == scene) 498 | { 499 | fader.fade(1, fade_duration); 500 | } 501 | else 502 | { 503 | fader.fade(0, fade_duration); 504 | } 505 | 506 | it++; 507 | } 508 | } 509 | 510 | return true; 511 | } 512 | 513 | inline bool SceneManager::changeScene(const string& scene_name) 514 | { 515 | changeScene(scene_name, default_fade_duration); 516 | } 517 | 518 | template 519 | inline bool SceneManager::changeScene(float fade_duration) 520 | { 521 | changeScene(T::getSceneName(), fade_duration); 522 | } 523 | 524 | template 525 | inline bool SceneManager::changeScene() 526 | { 527 | changeScene(default_fade_duration); 528 | } 529 | 530 | OFX_ANIMATION_PRIMITIVES_END_NAMESPACE 531 | -------------------------------------------------------------------------------- /example-instance-manager/example-instance-manager.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 42; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 11 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; 12 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; 13 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; }; 14 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */; }; 15 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9740E8CC7DD009D7055 /* Carbon.framework */; }; 16 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */; }; 17 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */; }; 18 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9770E8CC7DD009D7055 /* CoreServices.framework */; }; 19 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9790E8CC7DD009D7055 /* OpenGL.framework */; }; 20 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */; }; 21 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; }; 22 | E4B69E210A3A1BDC003C02F2 /* testApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; }; 23 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424410CC5A17004149E2 /* AppKit.framework */; }; 24 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; }; 25 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; }; 26 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 27 | E734178918A357CA00411AEA /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E734178618A357CA00411AEA /* Timer.cpp */; }; 28 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */; }; 29 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E715D3B6510020DFD4 /* QTKit.framework */; }; 30 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7F985F515E0DE99003869B5 /* Accelerate.framework */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXContainerItemProxy section */ 34 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 37 | proxyType = 2; 38 | remoteGlobalIDString = E4B27C1510CBEB8E00536013; 39 | remoteInfo = openFrameworks; 40 | }; 41 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 44 | proxyType = 1; 45 | remoteGlobalIDString = E4B27C1410CBEB8E00536013; 46 | remoteInfo = openFrameworks; 47 | }; 48 | /* End PBXContainerItemProxy section */ 49 | 50 | /* Begin PBXCopyFilesBuildPhase section */ 51 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = { 52 | isa = PBXCopyFilesBuildPhase; 53 | buildActionMask = 2147483647; 54 | dstPath = ""; 55 | dstSubfolderSpec = 10; 56 | files = ( 57 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXCopyFilesBuildPhase section */ 62 | 63 | /* Begin PBXFileReference section */ 64 | BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = ""; }; 65 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; 66 | E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 67 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 68 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 69 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 70 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 71 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 72 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 73 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 74 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 75 | E4B69B5B0A3A1756003C02F2 /* example-instance-managerDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example-instance-managerDebug.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 76 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; }; 77 | E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = testApp.cpp; path = src/testApp.cpp; sourceTree = SOURCE_ROOT; }; 78 | E4B69E1F0A3A1BDC003C02F2 /* testApp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = testApp.h; path = src/testApp.h; sourceTree = SOURCE_ROOT; }; 79 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; 80 | E4C2424410CC5A17004149E2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 81 | E4C2424510CC5A17004149E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 82 | E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 83 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 84 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 85 | E734177F18A357CA00411AEA /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; 86 | E734178018A357CA00411AEA /* coroutine.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = coroutine.hpp; sourceTree = ""; }; 87 | E734178118A357CA00411AEA /* Easing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Easing.h; sourceTree = ""; }; 88 | E734178218A357CA00411AEA /* Generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Generator.h; sourceTree = ""; }; 89 | E734178318A357CA00411AEA /* InstanceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InstanceManager.h; sourceTree = ""; }; 90 | E734178418A357CA00411AEA /* Pattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pattern.h; sourceTree = ""; }; 91 | E734178518A357CA00411AEA /* Replicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Replicator.h; sourceTree = ""; }; 92 | E734178618A357CA00411AEA /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Timer.cpp; sourceTree = ""; }; 93 | E734178718A357CA00411AEA /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = ""; }; 94 | E734178818A357CA00411AEA /* ofxAnimationPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxAnimationPrimitives.h; sourceTree = ""; }; 95 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; 96 | E7E077E715D3B6510020DFD4 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 97 | E7F985F515E0DE99003869B5 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; 98 | /* End PBXFileReference section */ 99 | 100 | /* Begin PBXFrameworksBuildPhase section */ 101 | E4B69B590A3A1756003C02F2 /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */, 106 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */, 107 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */, 108 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, 109 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */, 110 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */, 111 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */, 112 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */, 113 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */, 114 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */, 115 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */, 116 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */, 117 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */, 118 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */, 119 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */, 120 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */, 121 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */, 122 | ); 123 | runOnlyForDeploymentPostprocessing = 0; 124 | }; 125 | /* End PBXFrameworksBuildPhase section */ 126 | 127 | /* Begin PBXGroup section */ 128 | 6019543717A02F4A00339273 /* ofxAnimationPrimitives */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 605ABC8717B65E9D0060099B /* src */, 132 | ); 133 | name = ofxAnimationPrimitives; 134 | sourceTree = ""; 135 | }; 136 | 605ABC8717B65E9D0060099B /* src */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | E734177E18A357CA00411AEA /* ofxAnimationPrimitives */, 140 | E734178818A357CA00411AEA /* ofxAnimationPrimitives.h */, 141 | ); 142 | name = src; 143 | path = ../src; 144 | sourceTree = ""; 145 | }; 146 | BB4B014C10F69532006C3DED /* addons */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 6019543717A02F4A00339273 /* ofxAnimationPrimitives */, 150 | ); 151 | name = addons; 152 | sourceTree = ""; 153 | }; 154 | BBAB23C913894ECA00AA2426 /* system frameworks */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | E7F985F515E0DE99003869B5 /* Accelerate.framework */, 158 | E4C2424410CC5A17004149E2 /* AppKit.framework */, 159 | E4C2424510CC5A17004149E2 /* Cocoa.framework */, 160 | E4C2424610CC5A17004149E2 /* IOKit.framework */, 161 | E45BE9710E8CC7DD009D7055 /* AGL.framework */, 162 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */, 163 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */, 164 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */, 165 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */, 166 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */, 167 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */, 168 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */, 169 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */, 170 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */, 171 | E7E077E715D3B6510020DFD4 /* QTKit.framework */, 172 | ); 173 | name = "system frameworks"; 174 | sourceTree = ""; 175 | }; 176 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | BBAB23BE13894E4700AA2426 /* GLUT.framework */, 180 | ); 181 | name = "3rd party frameworks"; 182 | sourceTree = ""; 183 | }; 184 | E4328144138ABC890047C5CB /* Products */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */, 188 | ); 189 | name = Products; 190 | sourceTree = ""; 191 | }; 192 | E45BE5980E8CC70C009D7055 /* frameworks */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */, 196 | BBAB23C913894ECA00AA2426 /* system frameworks */, 197 | ); 198 | name = frameworks; 199 | sourceTree = ""; 200 | }; 201 | E4B69B4A0A3A1720003C02F2 = { 202 | isa = PBXGroup; 203 | children = ( 204 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, 205 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, 206 | E4B69E1C0A3A1BDC003C02F2 /* src */, 207 | E4EEC9E9138DF44700A80321 /* openFrameworks */, 208 | BB4B014C10F69532006C3DED /* addons */, 209 | E45BE5980E8CC70C009D7055 /* frameworks */, 210 | E4B69B5B0A3A1756003C02F2 /* example-instance-managerDebug.app */, 211 | ); 212 | sourceTree = ""; 213 | }; 214 | E4B69E1C0A3A1BDC003C02F2 /* src */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */, 218 | E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */, 219 | E4B69E1F0A3A1BDC003C02F2 /* testApp.h */, 220 | ); 221 | path = src; 222 | sourceTree = SOURCE_ROOT; 223 | }; 224 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, 228 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, 229 | ); 230 | name = openFrameworks; 231 | sourceTree = ""; 232 | }; 233 | E734177E18A357CA00411AEA /* ofxAnimationPrimitives */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | E734177F18A357CA00411AEA /* Constants.h */, 237 | E734178018A357CA00411AEA /* coroutine.hpp */, 238 | E734178118A357CA00411AEA /* Easing.h */, 239 | E734178218A357CA00411AEA /* Generator.h */, 240 | E734178318A357CA00411AEA /* InstanceManager.h */, 241 | E734178418A357CA00411AEA /* Pattern.h */, 242 | E734178518A357CA00411AEA /* Replicator.h */, 243 | E734178618A357CA00411AEA /* Timer.cpp */, 244 | E734178718A357CA00411AEA /* Timer.h */, 245 | ); 246 | path = ofxAnimationPrimitives; 247 | sourceTree = ""; 248 | }; 249 | /* End PBXGroup section */ 250 | 251 | /* Begin PBXNativeTarget section */ 252 | E4B69B5A0A3A1756003C02F2 /* example-instance-manager */ = { 253 | isa = PBXNativeTarget; 254 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example-instance-manager" */; 255 | buildPhases = ( 256 | E4B69B580A3A1756003C02F2 /* Sources */, 257 | E4B69B590A3A1756003C02F2 /* Frameworks */, 258 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, 259 | E4C2427710CC5ABF004149E2 /* CopyFiles */, 260 | ); 261 | buildRules = ( 262 | ); 263 | dependencies = ( 264 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, 265 | ); 266 | name = "example-instance-manager"; 267 | productName = myOFApp; 268 | productReference = E4B69B5B0A3A1756003C02F2 /* example-instance-managerDebug.app */; 269 | productType = "com.apple.product-type.application"; 270 | }; 271 | /* End PBXNativeTarget section */ 272 | 273 | /* Begin PBXProject section */ 274 | E4B69B4C0A3A1720003C02F2 /* Project object */ = { 275 | isa = PBXProject; 276 | attributes = { 277 | }; 278 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example-instance-manager" */; 279 | compatibilityVersion = "Xcode 2.4"; 280 | developmentRegion = English; 281 | hasScannedForEncodings = 0; 282 | knownRegions = ( 283 | English, 284 | Japanese, 285 | French, 286 | German, 287 | ); 288 | mainGroup = E4B69B4A0A3A1720003C02F2; 289 | productRefGroup = E4B69B4A0A3A1720003C02F2; 290 | projectDirPath = ""; 291 | projectReferences = ( 292 | { 293 | ProductGroup = E4328144138ABC890047C5CB /* Products */; 294 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 295 | }, 296 | ); 297 | projectRoot = ""; 298 | targets = ( 299 | E4B69B5A0A3A1756003C02F2 /* example-instance-manager */, 300 | ); 301 | }; 302 | /* End PBXProject section */ 303 | 304 | /* Begin PBXReferenceProxy section */ 305 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { 306 | isa = PBXReferenceProxy; 307 | fileType = archive.ar; 308 | path = openFrameworksDebug.a; 309 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; 310 | sourceTree = BUILT_PRODUCTS_DIR; 311 | }; 312 | /* End PBXReferenceProxy section */ 313 | 314 | /* Begin PBXShellScriptBuildPhase section */ 315 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { 316 | isa = PBXShellScriptBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | ); 320 | inputPaths = ( 321 | ); 322 | outputPaths = ( 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | shellPath = /bin/sh; 326 | shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";"; 327 | }; 328 | /* End PBXShellScriptBuildPhase section */ 329 | 330 | /* Begin PBXSourcesBuildPhase section */ 331 | E4B69B580A3A1756003C02F2 /* Sources */ = { 332 | isa = PBXSourcesBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | E734178918A357CA00411AEA /* Timer.cpp in Sources */, 336 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */, 337 | E4B69E210A3A1BDC003C02F2 /* testApp.cpp in Sources */, 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | }; 341 | /* End PBXSourcesBuildPhase section */ 342 | 343 | /* Begin PBXTargetDependency section */ 344 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { 345 | isa = PBXTargetDependency; 346 | name = openFrameworks; 347 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; 348 | }; 349 | /* End PBXTargetDependency section */ 350 | 351 | /* Begin XCBuildConfiguration section */ 352 | E4B69B4E0A3A1720003C02F2 /* Debug */ = { 353 | isa = XCBuildConfiguration; 354 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 355 | buildSettings = { 356 | ARCHS = "$(NATIVE_ARCH)"; 357 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 358 | COPY_PHASE_STRIP = NO; 359 | DEAD_CODE_STRIPPING = YES; 360 | GCC_AUTO_VECTORIZATION = YES; 361 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 362 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 363 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 364 | GCC_OPTIMIZATION_LEVEL = 0; 365 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 366 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 367 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 368 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 369 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 370 | GCC_WARN_UNUSED_VALUE = NO; 371 | GCC_WARN_UNUSED_VARIABLE = NO; 372 | MACOSX_DEPLOYMENT_TARGET = 10.8; 373 | OTHER_CPLUSPLUSFLAGS = ( 374 | "-D__MACOSX_CORE__", 375 | "-lpthread", 376 | "-mtune=native", 377 | ); 378 | SDKROOT = macosx; 379 | }; 380 | name = Debug; 381 | }; 382 | E4B69B4F0A3A1720003C02F2 /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 385 | buildSettings = { 386 | ARCHS = "$(NATIVE_ARCH)"; 387 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 388 | COPY_PHASE_STRIP = YES; 389 | DEAD_CODE_STRIPPING = YES; 390 | GCC_AUTO_VECTORIZATION = YES; 391 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 392 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 393 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 394 | GCC_OPTIMIZATION_LEVEL = 3; 395 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 396 | GCC_UNROLL_LOOPS = YES; 397 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 398 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 399 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 400 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 401 | GCC_WARN_UNUSED_VALUE = NO; 402 | GCC_WARN_UNUSED_VARIABLE = NO; 403 | MACOSX_DEPLOYMENT_TARGET = 10.8; 404 | OTHER_CPLUSPLUSFLAGS = ( 405 | "-D__MACOSX_CORE__", 406 | "-lpthread", 407 | "-mtune=native", 408 | ); 409 | SDKROOT = macosx; 410 | }; 411 | name = Release; 412 | }; 413 | E4B69B600A3A1757003C02F2 /* Debug */ = { 414 | isa = XCBuildConfiguration; 415 | buildSettings = { 416 | COPY_PHASE_STRIP = NO; 417 | FRAMEWORK_SEARCH_PATHS = ( 418 | "$(inherited)", 419 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 420 | ); 421 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 422 | GCC_DYNAMIC_NO_PIC = NO; 423 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 424 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 425 | GCC_MODEL_TUNING = NONE; 426 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 427 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; 428 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 429 | INSTALL_PATH = "$(HOME)/Applications"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 433 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 434 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 435 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 436 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 437 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 438 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 439 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 440 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 441 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 442 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 443 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 444 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 445 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 446 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 447 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 448 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 449 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 450 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 451 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 452 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 453 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 454 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 455 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 456 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 457 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 458 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 459 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 460 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 461 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 462 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 463 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 464 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 465 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 466 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 467 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 468 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 469 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 470 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 471 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 472 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 473 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 474 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 475 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 476 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 477 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 478 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 479 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 480 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 481 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 482 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 483 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 484 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 485 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 486 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 487 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 488 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 489 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 490 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 491 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 492 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_52)", 493 | ); 494 | PREBINDING = NO; 495 | PRODUCT_NAME = "example-instance-managerDebug"; 496 | WRAPPER_EXTENSION = app; 497 | }; 498 | name = Debug; 499 | }; 500 | E4B69B610A3A1757003C02F2 /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | COPY_PHASE_STRIP = YES; 504 | FRAMEWORK_SEARCH_PATHS = ( 505 | "$(inherited)", 506 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 507 | ); 508 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 509 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 510 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 511 | GCC_MODEL_TUNING = NONE; 512 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 513 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; 514 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 515 | INSTALL_PATH = "$(HOME)/Applications"; 516 | LIBRARY_SEARCH_PATHS = ( 517 | "$(inherited)", 518 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 519 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 520 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 521 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 522 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 523 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 524 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 525 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 526 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 527 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 528 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 529 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 530 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 531 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 532 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 533 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 534 | "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 535 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 536 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 537 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 538 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 539 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 540 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 541 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 542 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 543 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 544 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 545 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 546 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 547 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 548 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 549 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 550 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 551 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 552 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 553 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 554 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 555 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 556 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 557 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 558 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 559 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 560 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 561 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 562 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 563 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 564 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 565 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 566 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 567 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 568 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 569 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 570 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 571 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 572 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 573 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 574 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 575 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 576 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 577 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 578 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 579 | ); 580 | PREBINDING = NO; 581 | PRODUCT_NAME = "example-instance-manager"; 582 | WRAPPER_EXTENSION = app; 583 | }; 584 | name = Release; 585 | }; 586 | /* End XCBuildConfiguration section */ 587 | 588 | /* Begin XCConfigurationList section */ 589 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example-instance-manager" */ = { 590 | isa = XCConfigurationList; 591 | buildConfigurations = ( 592 | E4B69B4E0A3A1720003C02F2 /* Debug */, 593 | E4B69B4F0A3A1720003C02F2 /* Release */, 594 | ); 595 | defaultConfigurationIsVisible = 0; 596 | defaultConfigurationName = Release; 597 | }; 598 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example-instance-manager" */ = { 599 | isa = XCConfigurationList; 600 | buildConfigurations = ( 601 | E4B69B600A3A1757003C02F2 /* Debug */, 602 | E4B69B610A3A1757003C02F2 /* Release */, 603 | ); 604 | defaultConfigurationIsVisible = 0; 605 | defaultConfigurationName = Release; 606 | }; 607 | /* End XCConfigurationList section */ 608 | }; 609 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; 610 | } 611 | -------------------------------------------------------------------------------- /example-composition/example-composition.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 42; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 11 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; 12 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; 13 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; }; 14 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */; }; 15 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9740E8CC7DD009D7055 /* Carbon.framework */; }; 16 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */; }; 17 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */; }; 18 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9770E8CC7DD009D7055 /* CoreServices.framework */; }; 19 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9790E8CC7DD009D7055 /* OpenGL.framework */; }; 20 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */; }; 21 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; }; 22 | E4B69E210A3A1BDC003C02F2 /* testApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; }; 23 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424410CC5A17004149E2 /* AppKit.framework */; }; 24 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; }; 25 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; }; 26 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 27 | E734178918A357CA00411AEA /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E734178618A357CA00411AEA /* Timer.cpp */; }; 28 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */; }; 29 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E715D3B6510020DFD4 /* QTKit.framework */; }; 30 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7F985F515E0DE99003869B5 /* Accelerate.framework */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXContainerItemProxy section */ 34 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 37 | proxyType = 2; 38 | remoteGlobalIDString = E4B27C1510CBEB8E00536013; 39 | remoteInfo = openFrameworks; 40 | }; 41 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 44 | proxyType = 1; 45 | remoteGlobalIDString = E4B27C1410CBEB8E00536013; 46 | remoteInfo = openFrameworks; 47 | }; 48 | /* End PBXContainerItemProxy section */ 49 | 50 | /* Begin PBXCopyFilesBuildPhase section */ 51 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = { 52 | isa = PBXCopyFilesBuildPhase; 53 | buildActionMask = 2147483647; 54 | dstPath = ""; 55 | dstSubfolderSpec = 10; 56 | files = ( 57 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXCopyFilesBuildPhase section */ 62 | 63 | /* Begin PBXFileReference section */ 64 | BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = ""; }; 65 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; 66 | E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 67 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 68 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 69 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 70 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 71 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 72 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 73 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 74 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 75 | E4B69B5B0A3A1756003C02F2 /* example-compositionDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example-compositionDebug.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 76 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; }; 77 | E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = testApp.cpp; path = src/testApp.cpp; sourceTree = SOURCE_ROOT; }; 78 | E4B69E1F0A3A1BDC003C02F2 /* testApp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = testApp.h; path = src/testApp.h; sourceTree = SOURCE_ROOT; }; 79 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; 80 | E4C2424410CC5A17004149E2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 81 | E4C2424510CC5A17004149E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 82 | E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 83 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 84 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 85 | E734177F18A357CA00411AEA /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; 86 | E734178118A357CA00411AEA /* Easing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Easing.h; sourceTree = ""; }; 87 | E734178218A357CA00411AEA /* Generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Generator.h; sourceTree = ""; }; 88 | E734178318A357CA00411AEA /* InstanceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InstanceManager.h; sourceTree = ""; }; 89 | E734178418A357CA00411AEA /* Pattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pattern.h; sourceTree = ""; }; 90 | E734178518A357CA00411AEA /* Replicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Replicator.h; sourceTree = ""; }; 91 | E734178618A357CA00411AEA /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Timer.cpp; sourceTree = ""; }; 92 | E734178718A357CA00411AEA /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = ""; }; 93 | E734178818A357CA00411AEA /* ofxAnimationPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxAnimationPrimitives.h; sourceTree = ""; }; 94 | E734179B18A36DE900411AEA /* Lerp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Lerp.h; sourceTree = ""; }; 95 | E742A47F18AB80C4009F8BF2 /* Composition.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Composition.h; sourceTree = ""; }; 96 | E742A48118AB80C4009F8BF2 /* Composition.inc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Composition.inc.h; sourceTree = ""; }; 97 | E742A48218AB8128009F8BF2 /* coroutine.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = coroutine.hpp; sourceTree = ""; }; 98 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; 99 | E7E077E715D3B6510020DFD4 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 100 | E7F985F515E0DE99003869B5 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; 101 | /* End PBXFileReference section */ 102 | 103 | /* Begin PBXFrameworksBuildPhase section */ 104 | E4B69B590A3A1756003C02F2 /* Frameworks */ = { 105 | isa = PBXFrameworksBuildPhase; 106 | buildActionMask = 2147483647; 107 | files = ( 108 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */, 109 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */, 110 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */, 111 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, 112 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */, 113 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */, 114 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */, 115 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */, 116 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */, 117 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */, 118 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */, 119 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */, 120 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */, 121 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */, 122 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */, 123 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */, 124 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */, 125 | ); 126 | runOnlyForDeploymentPostprocessing = 0; 127 | }; 128 | /* End PBXFrameworksBuildPhase section */ 129 | 130 | /* Begin PBXGroup section */ 131 | 6019543717A02F4A00339273 /* ofxAnimationPrimitives */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 605ABC8717B65E9D0060099B /* src */, 135 | ); 136 | name = ofxAnimationPrimitives; 137 | sourceTree = ""; 138 | }; 139 | 605ABC8717B65E9D0060099B /* src */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | E734177E18A357CA00411AEA /* ofxAnimationPrimitives */, 143 | E734178818A357CA00411AEA /* ofxAnimationPrimitives.h */, 144 | ); 145 | name = src; 146 | path = ../src; 147 | sourceTree = ""; 148 | }; 149 | BB4B014C10F69532006C3DED /* addons */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 6019543717A02F4A00339273 /* ofxAnimationPrimitives */, 153 | ); 154 | name = addons; 155 | sourceTree = ""; 156 | }; 157 | BBAB23C913894ECA00AA2426 /* system frameworks */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | E7F985F515E0DE99003869B5 /* Accelerate.framework */, 161 | E4C2424410CC5A17004149E2 /* AppKit.framework */, 162 | E4C2424510CC5A17004149E2 /* Cocoa.framework */, 163 | E4C2424610CC5A17004149E2 /* IOKit.framework */, 164 | E45BE9710E8CC7DD009D7055 /* AGL.framework */, 165 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */, 166 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */, 167 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */, 168 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */, 169 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */, 170 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */, 171 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */, 172 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */, 173 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */, 174 | E7E077E715D3B6510020DFD4 /* QTKit.framework */, 175 | ); 176 | name = "system frameworks"; 177 | sourceTree = ""; 178 | }; 179 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | BBAB23BE13894E4700AA2426 /* GLUT.framework */, 183 | ); 184 | name = "3rd party frameworks"; 185 | sourceTree = ""; 186 | }; 187 | E4328144138ABC890047C5CB /* Products */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */, 191 | ); 192 | name = Products; 193 | sourceTree = ""; 194 | }; 195 | E45BE5980E8CC70C009D7055 /* frameworks */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */, 199 | BBAB23C913894ECA00AA2426 /* system frameworks */, 200 | ); 201 | name = frameworks; 202 | sourceTree = ""; 203 | }; 204 | E4B69B4A0A3A1720003C02F2 = { 205 | isa = PBXGroup; 206 | children = ( 207 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, 208 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, 209 | E4B69E1C0A3A1BDC003C02F2 /* src */, 210 | E4EEC9E9138DF44700A80321 /* openFrameworks */, 211 | BB4B014C10F69532006C3DED /* addons */, 212 | E45BE5980E8CC70C009D7055 /* frameworks */, 213 | E4B69B5B0A3A1756003C02F2 /* example-compositionDebug.app */, 214 | ); 215 | sourceTree = ""; 216 | }; 217 | E4B69E1C0A3A1BDC003C02F2 /* src */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */, 221 | E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */, 222 | E4B69E1F0A3A1BDC003C02F2 /* testApp.h */, 223 | ); 224 | path = src; 225 | sourceTree = SOURCE_ROOT; 226 | }; 227 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = { 228 | isa = PBXGroup; 229 | children = ( 230 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, 231 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, 232 | ); 233 | name = openFrameworks; 234 | sourceTree = ""; 235 | }; 236 | E734177E18A357CA00411AEA /* ofxAnimationPrimitives */ = { 237 | isa = PBXGroup; 238 | children = ( 239 | E742A47F18AB80C4009F8BF2 /* Composition.h */, 240 | E742A48018AB80C4009F8BF2 /* detail */, 241 | E734177F18A357CA00411AEA /* Constants.h */, 242 | E734178118A357CA00411AEA /* Easing.h */, 243 | E734178218A357CA00411AEA /* Generator.h */, 244 | E734178318A357CA00411AEA /* InstanceManager.h */, 245 | E734178418A357CA00411AEA /* Pattern.h */, 246 | E734178518A357CA00411AEA /* Replicator.h */, 247 | E734178618A357CA00411AEA /* Timer.cpp */, 248 | E734178718A357CA00411AEA /* Timer.h */, 249 | E734179B18A36DE900411AEA /* Lerp.h */, 250 | ); 251 | path = ofxAnimationPrimitives; 252 | sourceTree = ""; 253 | }; 254 | E742A48018AB80C4009F8BF2 /* detail */ = { 255 | isa = PBXGroup; 256 | children = ( 257 | E742A48218AB8128009F8BF2 /* coroutine.hpp */, 258 | E742A48118AB80C4009F8BF2 /* Composition.inc.h */, 259 | ); 260 | path = detail; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXGroup section */ 264 | 265 | /* Begin PBXNativeTarget section */ 266 | E4B69B5A0A3A1756003C02F2 /* example-composition */ = { 267 | isa = PBXNativeTarget; 268 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example-composition" */; 269 | buildPhases = ( 270 | E4B69B580A3A1756003C02F2 /* Sources */, 271 | E4B69B590A3A1756003C02F2 /* Frameworks */, 272 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, 273 | E4C2427710CC5ABF004149E2 /* CopyFiles */, 274 | ); 275 | buildRules = ( 276 | ); 277 | dependencies = ( 278 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, 279 | ); 280 | name = "example-composition"; 281 | productName = myOFApp; 282 | productReference = E4B69B5B0A3A1756003C02F2 /* example-compositionDebug.app */; 283 | productType = "com.apple.product-type.application"; 284 | }; 285 | /* End PBXNativeTarget section */ 286 | 287 | /* Begin PBXProject section */ 288 | E4B69B4C0A3A1720003C02F2 /* Project object */ = { 289 | isa = PBXProject; 290 | attributes = { 291 | }; 292 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example-composition" */; 293 | compatibilityVersion = "Xcode 2.4"; 294 | developmentRegion = English; 295 | hasScannedForEncodings = 0; 296 | knownRegions = ( 297 | English, 298 | Japanese, 299 | French, 300 | German, 301 | ); 302 | mainGroup = E4B69B4A0A3A1720003C02F2; 303 | productRefGroup = E4B69B4A0A3A1720003C02F2; 304 | projectDirPath = ""; 305 | projectReferences = ( 306 | { 307 | ProductGroup = E4328144138ABC890047C5CB /* Products */; 308 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 309 | }, 310 | ); 311 | projectRoot = ""; 312 | targets = ( 313 | E4B69B5A0A3A1756003C02F2 /* example-composition */, 314 | ); 315 | }; 316 | /* End PBXProject section */ 317 | 318 | /* Begin PBXReferenceProxy section */ 319 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { 320 | isa = PBXReferenceProxy; 321 | fileType = archive.ar; 322 | path = openFrameworksDebug.a; 323 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; 324 | sourceTree = BUILT_PRODUCTS_DIR; 325 | }; 326 | /* End PBXReferenceProxy section */ 327 | 328 | /* Begin PBXShellScriptBuildPhase section */ 329 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { 330 | isa = PBXShellScriptBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | ); 334 | inputPaths = ( 335 | ); 336 | outputPaths = ( 337 | ); 338 | runOnlyForDeploymentPostprocessing = 0; 339 | shellPath = /bin/sh; 340 | shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";"; 341 | }; 342 | /* End PBXShellScriptBuildPhase section */ 343 | 344 | /* Begin PBXSourcesBuildPhase section */ 345 | E4B69B580A3A1756003C02F2 /* Sources */ = { 346 | isa = PBXSourcesBuildPhase; 347 | buildActionMask = 2147483647; 348 | files = ( 349 | E734178918A357CA00411AEA /* Timer.cpp in Sources */, 350 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */, 351 | E4B69E210A3A1BDC003C02F2 /* testApp.cpp in Sources */, 352 | ); 353 | runOnlyForDeploymentPostprocessing = 0; 354 | }; 355 | /* End PBXSourcesBuildPhase section */ 356 | 357 | /* Begin PBXTargetDependency section */ 358 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { 359 | isa = PBXTargetDependency; 360 | name = openFrameworks; 361 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; 362 | }; 363 | /* End PBXTargetDependency section */ 364 | 365 | /* Begin XCBuildConfiguration section */ 366 | E4B69B4E0A3A1720003C02F2 /* Debug */ = { 367 | isa = XCBuildConfiguration; 368 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 369 | buildSettings = { 370 | ARCHS = "$(NATIVE_ARCH)"; 371 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 372 | COPY_PHASE_STRIP = NO; 373 | DEAD_CODE_STRIPPING = YES; 374 | GCC_AUTO_VECTORIZATION = YES; 375 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 376 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 377 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 378 | GCC_OPTIMIZATION_LEVEL = 0; 379 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 380 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 381 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 382 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 383 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 384 | GCC_WARN_UNUSED_VALUE = NO; 385 | GCC_WARN_UNUSED_VARIABLE = NO; 386 | MACOSX_DEPLOYMENT_TARGET = 10.8; 387 | OTHER_CPLUSPLUSFLAGS = ( 388 | "-D__MACOSX_CORE__", 389 | "-lpthread", 390 | "-mtune=native", 391 | ); 392 | SDKROOT = macosx; 393 | }; 394 | name = Debug; 395 | }; 396 | E4B69B4F0A3A1720003C02F2 /* Release */ = { 397 | isa = XCBuildConfiguration; 398 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 399 | buildSettings = { 400 | ARCHS = "$(NATIVE_ARCH)"; 401 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 402 | COPY_PHASE_STRIP = YES; 403 | DEAD_CODE_STRIPPING = YES; 404 | GCC_AUTO_VECTORIZATION = YES; 405 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 406 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 407 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 408 | GCC_OPTIMIZATION_LEVEL = 3; 409 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 410 | GCC_UNROLL_LOOPS = YES; 411 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 412 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 413 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 414 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 415 | GCC_WARN_UNUSED_VALUE = NO; 416 | GCC_WARN_UNUSED_VARIABLE = NO; 417 | MACOSX_DEPLOYMENT_TARGET = 10.8; 418 | OTHER_CPLUSPLUSFLAGS = ( 419 | "-D__MACOSX_CORE__", 420 | "-lpthread", 421 | "-mtune=native", 422 | ); 423 | SDKROOT = macosx; 424 | }; 425 | name = Release; 426 | }; 427 | E4B69B600A3A1757003C02F2 /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | COPY_PHASE_STRIP = NO; 431 | FRAMEWORK_SEARCH_PATHS = ( 432 | "$(inherited)", 433 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 434 | ); 435 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 436 | GCC_DYNAMIC_NO_PIC = NO; 437 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 438 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 439 | GCC_MODEL_TUNING = NONE; 440 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 441 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; 442 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 443 | INSTALL_PATH = "$(HOME)/Applications"; 444 | LIBRARY_SEARCH_PATHS = ( 445 | "$(inherited)", 446 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 447 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 448 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 449 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 450 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 451 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 452 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 453 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 454 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 455 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 456 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 457 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 458 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 459 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 460 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 461 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 462 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 463 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 464 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 465 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 466 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 467 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 468 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 469 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 470 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 471 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 472 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 473 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 474 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 475 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 476 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 477 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 478 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 479 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 480 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 481 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 482 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 483 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 484 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 485 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 486 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 487 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 488 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 489 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 490 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 491 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 492 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 493 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 494 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 495 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 496 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 497 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 498 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 499 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 500 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 501 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 502 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 503 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 504 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 505 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 506 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_52)", 507 | ); 508 | PREBINDING = NO; 509 | PRODUCT_NAME = "example-compositionDebug"; 510 | WRAPPER_EXTENSION = app; 511 | }; 512 | name = Debug; 513 | }; 514 | E4B69B610A3A1757003C02F2 /* Release */ = { 515 | isa = XCBuildConfiguration; 516 | buildSettings = { 517 | COPY_PHASE_STRIP = YES; 518 | FRAMEWORK_SEARCH_PATHS = ( 519 | "$(inherited)", 520 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 521 | ); 522 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 523 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 524 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 525 | GCC_MODEL_TUNING = NONE; 526 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 527 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; 528 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 529 | INSTALL_PATH = "$(HOME)/Applications"; 530 | LIBRARY_SEARCH_PATHS = ( 531 | "$(inherited)", 532 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 533 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 534 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 535 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 536 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 537 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 538 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 539 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 540 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 541 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 542 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 543 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 544 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 545 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 546 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 547 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 548 | "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 549 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 550 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 551 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 552 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 553 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 554 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 555 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 556 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 557 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 558 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 559 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 560 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 561 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 562 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 563 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 564 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 565 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 566 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 567 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 568 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 569 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 570 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 571 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 572 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 573 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 574 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 575 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 576 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 577 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 578 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 579 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 580 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 581 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 582 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 583 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 584 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 585 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 586 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 587 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 588 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 589 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 590 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 591 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 592 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 593 | ); 594 | PREBINDING = NO; 595 | PRODUCT_NAME = "example-composition"; 596 | WRAPPER_EXTENSION = app; 597 | }; 598 | name = Release; 599 | }; 600 | /* End XCBuildConfiguration section */ 601 | 602 | /* Begin XCConfigurationList section */ 603 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example-composition" */ = { 604 | isa = XCConfigurationList; 605 | buildConfigurations = ( 606 | E4B69B4E0A3A1720003C02F2 /* Debug */, 607 | E4B69B4F0A3A1720003C02F2 /* Release */, 608 | ); 609 | defaultConfigurationIsVisible = 0; 610 | defaultConfigurationName = Release; 611 | }; 612 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example-composition" */ = { 613 | isa = XCConfigurationList; 614 | buildConfigurations = ( 615 | E4B69B600A3A1757003C02F2 /* Debug */, 616 | E4B69B610A3A1757003C02F2 /* Release */, 617 | ); 618 | defaultConfigurationIsVisible = 0; 619 | defaultConfigurationName = Release; 620 | }; 621 | /* End XCConfigurationList section */ 622 | }; 623 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; 624 | } 625 | --------------------------------------------------------------------------------