From e89f7750aff2e0a9fe8c4fd7fa60c62e0a02b594 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 30 Mar 2017 01:07:57 +0100 Subject: cleanup --- menuApp/src/ofApp.cpp | 45 ++++++++++++++++++--------------------------- menuApp/src/ofApp.h | 17 ++++++++--------- 2 files changed, 26 insertions(+), 36 deletions(-) (limited to 'menuApp') diff --git a/menuApp/src/ofApp.cpp b/menuApp/src/ofApp.cpp index f6f1c2f..6ac2b64 100644 --- a/menuApp/src/ofApp.cpp +++ b/menuApp/src/ofApp.cpp @@ -3,20 +3,14 @@ #define timtoken "3281768761.3dfcaf5.14ca9410c2aa4c00b9b60f36cd09d01a" #define hangdaitoken "3939854844.b31608d.a61a4e49a4dc40a688c22f4e0e81da3a" -/* -0. only display up to first hash -1. get tags - filter on tag -2. reload periodically -3. only reload changed images -*/ - -void ofApp::loadimages(){ +void ofApp::loadInstagramFeed(){ items.clear(); items.resize(IMAGE_SLOTS); instagram.getUserRecentMedia("self"); //instagram.getUserLikedMedia(12); ofLog(OF_LOG_NOTICE) << "instagram self feed -------------------> " << instagram.getImageURL().size() << " items "; + //leave in verbose logging as ofxInstagram does anyway int slot=0; @@ -28,21 +22,18 @@ void ofApp::loadimages(){ { vector tokens = ofSplitString(instagram.getImageCaption()[i]," ",true,true); //,ignoreEmpty=false,trim=false); - //ofLog(OF_LOG_NOTICE) <<"got "<isAllocated()) { - //ofLog(OF_LOG_NOTICE,"Image %i is %fx%f",i,images[i].getWidth(),images[i].getHeight()); + int imgx=(colinitialoffset+(col*coloffset))*FACTOR; int imgy=(rowinitialoffset+(row*rowoffset))*FACTOR; items[i].image->draw(imgx,imgy,imgsize*FACTOR,imgsize*FACTOR); @@ -187,11 +178,11 @@ ofPopMatrix(); //Restore the coordinate system } ofEnableAlphaBlending(); - overlay.draw(0,0,1080*FACTOR,1920*FACTOR); //ofGetWidth(),ofGetHeight()); + overlay.draw(0,0,1080*FACTOR,1920*FACTOR); //ofGetWidth(),ofGetHeight()); //don't work on a horiz screen?? ofDisableAlphaBlending(); if(ofGetElapsedTimef()-lastPoll>POLL_INTERVAL) { - loadimages(); + loadInstagramFeed(); lastPoll=ofGetElapsedTimef(); } diff --git a/menuApp/src/ofApp.h b/menuApp/src/ofApp.h index 7fd1c5f..1c1f747 100644 --- a/menuApp/src/ofApp.h +++ b/menuApp/src/ofApp.h @@ -30,7 +30,6 @@ class ofApp : public ofBaseApp{ void setup(); void update(); void draw(); - void loadimages(); void keyPressed(int key); void keyReleased(int key); @@ -45,24 +44,24 @@ class ofApp : public ofBaseApp{ void gotMessage(ofMessage msg); void exit(); - float lastPoll; - - ofImage background; - ofImage overlay; - ofxInstagram instagram; ofxThreadedImageLoader getImages; - deque items; + std::string menutag; + void loadInstagramFeed(); + + float lastPoll; + + deque items; map imagepool; ofTrueTypeFont type14; - //ofImage images[5]; ofxTextBlock myText; TextBlockAlignment alignment; //constants for controlling state - std::string menutag; + ofImage background; + ofImage overlay; }; -- cgit v1.2.3