Пример #1
0
void Tile::urlResponse(ofHttpResponse & response) {
	cout << response.request.name << "\n";
	if(response.status == 200 ) {
		if (response.request.name == ofToString(id)+":"+name) {
			ofUnregisterURLNotification(this);
			cache[key] = response.data;
			img.loadImage(response.data);

//		lock();
//		
//		// Get the loaded url from the async queue and move it into the update queue.
//		entry_iterator it = getEntryFromAsyncQueue(response.request.name);
//		if(it != images_async_loading.end()) {
//			(*it).image->loadImage(response.data);
//			images_to_update.push_back((*it));
//			images_async_loading.erase(it);
//		}
//		
//		unlock();
		}
	} else {
		// log error.
		stringstream ss;
		ss << "Could not load from url, response status: " << response.status;
		ofLog(OF_LOG_ERROR, ss.str());

	}

}
Пример #2
0
//--------------------------------------------------------------
void ofxTwitter::appExits(ofEventArgs& args) {
    
    ofLogNotice("ofxTwitter::appExits") << "Clearing Twitter client...";
    ofUnregisterURLNotification(this);
    ofRemoveAllURLRequests();
    
}
Пример #3
0
Map::~Map()
{
    ofUnregisterMouseEvents(this);
    ofUnregisterKeyEvents(this);
    ofRemoveListener(ofEvents().update, this, &Map::update);

    ofUnregisterURLNotification(this);
}
Пример #4
0
void
ofxQRcode::urlResponse(ofHttpResponse& response)
{
  if(response.request.name == "qrcode")
  {
    if (response.status == 200)
      loadImage(response.data);
    
    ofUnregisterURLNotification(this);
  }
}
Пример #5
0
void InstagramView::urlResponse(ofHttpResponse & response){
	ofUnregisterURLNotification(this);

	if(response.status != 200){
		return;
	}
	
	if(response.request.url == _args.imageUrl){
		initImage(response.request.name);
	}
	
	if(response.request.url == _args.videoUrl){
		initVideo(response.request.name);
	}
	
	if(response.request.url == _args.profilePictureUrl){
		initProfileImage(response.request.name);
	}
}
Пример #6
0
void InstagramView::unload(){
	ofUnregisterURLNotification(this);
	
	#ifdef TARGET_RASPBERRY_PI
		_video.close();
	#else
		if(_video.isLoaded() && _video.isInitialized()){
			_video.stop();
			_video.close();
		}
	#endif
	
	if(_image.isAllocated()){
		_image.clear();
	}
	
	if(_profileImage.isAllocated()){
		_profileImage.clear();
	}
	
	_isLoaded = false;
}
UIRpiCam::~UIRpiCam(){
    ofUnregisterURLNotification(this);
}
Пример #8
0
//--------------------------------------------------------------
void ofApp::exit() {
	ofUnregisterURLNotification(this);
}
Пример #9
0
void ofApp::exit() {
    
    ofUnregisterURLNotification(this);
    delete imgTopx;
    
}
Пример #10
0
InstagramView::~InstagramView(){
	ofUnregisterURLNotification(this);
}
Пример #11
0
ofxStreetView::~ofxStreetView(){
    if(bRegister){
        ofUnregisterURLNotification(this);
        bRegister = false;
    }
}