kr15h / ofxPiMapper

Projection mapping addon for openFrameworks that works on the Raspberry Pi
http://ofxpimapper.com
Other
457 stars 92 forks source link

new MediaServer #121

Open toughvj opened 6 years ago

toughvj commented 6 years ago

Hi, with your change of media server source code there is a problem, that when loading program it' tries to copy videos and images from data directory to data directory. Perhaps you should remove lines:

imageWatcher(ofToDataPath(DEFAULT_IMAGES_DIR, true), SourceType::SOURCE_TYPE_IMAGE), videoWatcher(ofToDataPath(DEFAULT_VIDEOS_DIR, true), SourceType::SOURCE_TYPE_VIDEO) ?

kr15h commented 6 years ago

Thanks for noticing. That might cause slowdown.

toughvj commented 6 years ago

I think this could help:

for(int i = 0; i < _directory.size(); ++i){
        _filePaths.push_back(path + _directory.getName(i));

        ofFile file(path + _directory.getName(i));
        if(_mediaType == SourceType::SOURCE_TYPE_VIDEO){
            if(!ofFile::doesFileExist("sources/videos/" + _directory.getName(i))){
                file.copyTo("sources/videos/" + _directory.getName(i));
                ofLogNotice("File: " + path + _directory.getName(i) + " added to source list");
            }
        }else if(_mediaType == SourceType::SOURCE_TYPE_IMAGE){
            if(!ofFile::doesFileExist("sources/images/" + _directory.getName(i))){
                file.copyTo("sources/images/" + _directory.getName(i));
                ofLogNotice("File: " + path + _directory.getName(i) + " added to source list");
            }
        }
    }
toughvj commented 6 years ago

any news on this?

kr15h commented 6 years ago

Not yet.