|
|
@ -31,32 +31,38 @@ namespace piMapper { |
|
|
|
return videoWatcher.getFilePaths(); |
|
|
|
} |
|
|
|
|
|
|
|
void MediaServer::onImageAdded(string& path) { |
|
|
|
void MediaServer::handleImageAdded(string& path) { |
|
|
|
cout << "onImageAdded: " << path << endl; |
|
|
|
cout << "numImages: " << getNumImages() << endl; |
|
|
|
ofNotifyEvent(onImageAdded, path, this); |
|
|
|
} |
|
|
|
void MediaServer::onImageRemoved(string& path) { |
|
|
|
void MediaServer::handleImageRemoved(string& path) { |
|
|
|
cout << "onImageRemoved: " << path << endl; |
|
|
|
cout << "numImages: " << getNumImages() << endl; |
|
|
|
ofNotifyEvent(onImageRemoved, path, this); |
|
|
|
} |
|
|
|
|
|
|
|
void MediaServer::onVideoAdded(string& path) { |
|
|
|
void MediaServer::handleVideoAdded(string& path) { |
|
|
|
cout << "onVideoAdded: " << path << endl; |
|
|
|
ofNotifyEvent(onVideoAdded, path, this); |
|
|
|
} |
|
|
|
void MediaServer::onVideoRemoved(string& path) { |
|
|
|
void MediaServer::handleVideoRemoved(string& path) { |
|
|
|
cout << "onVideoRemoved: " << path << endl; |
|
|
|
ofNotifyEvent(onVideoRemoved, path, this); |
|
|
|
} |
|
|
|
|
|
|
|
void MediaServer::addWatcherListeners() { |
|
|
|
ofAddListener(imageWatcher.onItemAdded, this, &MediaServer::onImageAdded); |
|
|
|
ofAddListener(imageWatcher.onItemRemoved, this, &MediaServer::onImageRemoved); |
|
|
|
ofAddListener(videoWatcher.onItemAdded, this, &MediaServer::onVideoAdded); |
|
|
|
ofAddListener(videoWatcher.onItemRemoved, this, &MediaServer::onVideoRemoved); |
|
|
|
ofAddListener(imageWatcher.onItemAdded, this, &MediaServer::handleImageAdded); |
|
|
|
ofAddListener(imageWatcher.onItemRemoved, this, &MediaServer::handleImageRemoved); |
|
|
|
ofAddListener(videoWatcher.onItemAdded, this, &MediaServer::handleVideoAdded); |
|
|
|
ofAddListener(videoWatcher.onItemRemoved, this, &MediaServer::handleVideoRemoved); |
|
|
|
} |
|
|
|
|
|
|
|
void MediaServer::removeWatcherListeners() { |
|
|
|
ofRemoveListener(imageWatcher.onItemAdded, this, &MediaServer::onImageAdded); |
|
|
|
ofRemoveListener(imageWatcher.onItemRemoved, this, &MediaServer::onImageRemoved); |
|
|
|
ofRemoveListener(videoWatcher.onItemAdded, this, &MediaServer::onVideoAdded); |
|
|
|
ofRemoveListener(videoWatcher.onItemRemoved, this, &MediaServer::onVideoRemoved); |
|
|
|
ofRemoveListener(imageWatcher.onItemAdded, this, &MediaServer::handleImageAdded); |
|
|
|
ofRemoveListener(imageWatcher.onItemRemoved, this, &MediaServer::handleImageRemoved); |
|
|
|
ofRemoveListener(videoWatcher.onItemAdded, this, &MediaServer::handleVideoAdded); |
|
|
|
ofRemoveListener(videoWatcher.onItemRemoved, this, &MediaServer::handleVideoRemoved); |
|
|
|
} |
|
|
|
|
|
|
|
} // namespace piMapper
|
|
|
|