From 0fbfe7174b57f452829852a991000a29c6b14b05 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Fri, 1 Jan 2016 14:22:04 +0000 Subject: [PATCH] Remove `std::` prefix everywhere in `src` --- src/Commands/CmdManager.h | 2 +- src/MediaServer/DirectoryWatcher.cpp | 6 +-- src/MediaServer/DirectoryWatcher.h | 6 +-- src/MediaServer/MediaServer.cpp | 80 ++++++++++++++-------------- src/MediaServer/MediaServer.h | 50 ++++++++--------- src/Sources/BaseSource.cpp | 8 +-- src/Sources/BaseSource.h | 10 ++-- src/Sources/ImageSource.cpp | 4 +- src/Sources/ImageSource.h | 4 +- src/Sources/SourceType.h | 12 ++--- src/Sources/VideoSource.cpp | 2 +- src/Sources/VideoSource.h | 4 +- src/Surfaces/QuadSurface.cpp | 4 +- src/Surfaces/SurfaceManager.cpp | 34 ++++++------ src/Surfaces/SurfaceManager.h | 2 +- src/Surfaces/SurfaceManagerGui.cpp | 2 +- src/Surfaces/TriangleSurface.cpp | 4 +- src/UserInterface/RadioList.cpp | 2 +- src/UserInterface/RadioList.h | 2 +- src/UserInterface/SourcesEditor.cpp | 26 ++++----- src/UserInterface/SourcesEditor.h | 22 ++++---- 21 files changed, 143 insertions(+), 143 deletions(-) diff --git a/src/Commands/CmdManager.h b/src/Commands/CmdManager.h index 8cfcb09..a09f7d3 100644 --- a/src/Commands/CmdManager.h +++ b/src/Commands/CmdManager.h @@ -14,7 +14,7 @@ class CmdManager { void undo(); private: - std::vector cmdStack; + vector cmdStack; }; diff --git a/src/MediaServer/DirectoryWatcher.cpp b/src/MediaServer/DirectoryWatcher.cpp index 0959feb..dc3aa47 100644 --- a/src/MediaServer/DirectoryWatcher.cpp +++ b/src/MediaServer/DirectoryWatcher.cpp @@ -11,7 +11,7 @@ namespace ofx { namespace piMapper { -DirectoryWatcher::DirectoryWatcher(std::string path, int watcherMediaType){ +DirectoryWatcher::DirectoryWatcher(string path, int watcherMediaType){ mediaType = watcherMediaType; // Decide what filter we need depending on media type if(mediaType == SourceType::SOURCE_TYPE_VIDEO){ @@ -20,7 +20,7 @@ DirectoryWatcher::DirectoryWatcher(std::string path, int watcherMediaType){ filter = new ImagePathFilter(); }else{ ofLogFatalError("DirectoryWatcher::DirectoryWatcher", "Unkonwn media type"); - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } dirWatcher.registerAllEvents(this); // For some reason the filters are not working, @@ -35,7 +35,7 @@ DirectoryWatcher::~DirectoryWatcher(){ filter = 0; } -std::vector & DirectoryWatcher::getFilePaths(){ +vector & DirectoryWatcher::getFilePaths(){ return filePaths; } diff --git a/src/MediaServer/DirectoryWatcher.h b/src/MediaServer/DirectoryWatcher.h index 17c6c5f..9d4e780 100644 --- a/src/MediaServer/DirectoryWatcher.h +++ b/src/MediaServer/DirectoryWatcher.h @@ -52,7 +52,7 @@ class ImagePathFilter : public BasePathFilter { class DirectoryWatcher { public: - DirectoryWatcher(std::string path, int watcherMediaType); + DirectoryWatcher(string path, int watcherMediaType); ~DirectoryWatcher(); // TODO make useful stuff with onDirectoryWatcher* @@ -119,7 +119,7 @@ class DirectoryWatcher { } // Getters - std::vector & getFilePaths(); + vector & getFilePaths(); int getMediaType(); // Custom events @@ -132,7 +132,7 @@ class DirectoryWatcher { private: ofx::IO::DirectoryWatcherManager dirWatcher; BasePathFilter * filter; - std::vector filePaths; + vector filePaths; int mediaType; }; diff --git a/src/MediaServer/MediaServer.cpp b/src/MediaServer/MediaServer.cpp index 8278a82..186bd59 100644 --- a/src/MediaServer/MediaServer.cpp +++ b/src/MediaServer/MediaServer.cpp @@ -31,41 +31,41 @@ int MediaServer::getNumFboSources(){ return fboSources.size(); } -std::vector & MediaServer::getImagePaths(){ +vector & MediaServer::getImagePaths(){ return imageWatcher.getFilePaths(); } -std::vector MediaServer::getImageNames(){ - std::vector imageNames; +vector MediaServer::getImageNames(){ + vector imageNames; for(int i = 0; i < getNumImages(); i++){ // Split image path - std::vector pathParts = ofSplitString(getImagePaths()[i], "/"); + vector pathParts = ofSplitString(getImagePaths()[i], "/"); // And get only the last piece - std::string name = pathParts[pathParts.size() - 1]; + string name = pathParts[pathParts.size() - 1]; imageNames.push_back(name); } return imageNames; } -std::vector MediaServer::getFboSourceNames(){ - std::vector fboSourceNames; +vector MediaServer::getFboSourceNames(){ + vector fboSourceNames; for(int i = 0; i < fboSources.size(); i++){ fboSourceNames.push_back(fboSources[i]->getName()); } return fboSourceNames; } -std::vector & MediaServer::getVideoPaths(){ +vector & MediaServer::getVideoPaths(){ return videoWatcher.getFilePaths(); } -std::vector MediaServer::getVideoNames(){ - std::vector videoNames; +vector MediaServer::getVideoNames(){ + vector videoNames; for(int i = 0; i < getNumVideos(); i++){ // Split video path - std::vector pathParts = ofSplitString(getVideoPaths()[i], "/"); + vector pathParts = ofSplitString(getVideoPaths()[i], "/"); // And get only the last piece - std::string name = pathParts[pathParts.size() - 1]; + string name = pathParts[pathParts.size() - 1]; videoNames.push_back(name); } return videoNames; @@ -80,10 +80,10 @@ BaseSource * MediaServer::loadMedia(string & path, int mediaType){ }else if(mediaType == SourceType::SOURCE_TYPE_FBO){ return loadFboSource(path); }else{ - std::stringstream ss; + stringstream ss; ss << "Can not load media of unknown type: " << mediaType; ofLogFatalError("MediaServer") << ss.str(); - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } return 0; } @@ -101,11 +101,11 @@ BaseSource * MediaServer::loadImage(string & path){ // Increase reference count of this source //referenceCount[path]++; imageSource->referenceCount++; - std::stringstream refss; + stringstream refss; refss << "Current reference count for " << path << " = " << imageSource->referenceCount; ofLogNotice("MediaServer") << refss.str(); // Notify objects registered to onImageLoaded event - std::stringstream ss; + stringstream ss; ss << "Image " << path << " already loaded"; ofLogNotice("MediaServer") << ss.str(); ofNotifyEvent(onImageLoaded, path, this); @@ -117,7 +117,7 @@ BaseSource * MediaServer::loadImage(string & path){ loadedSources[path] = imageSource; // Set reference count of this image path to 1 //referenceCount[path] = 1; - std::stringstream refss; + stringstream refss; refss << "Initialized reference count of " << path << " to " << imageSource->referenceCount; ofLogNotice("MediaServer") << refss.str(); // Notify objects registered to onImageLoaded event @@ -136,14 +136,14 @@ void MediaServer::unloadImage(string & path){ return; } // Reference count 0 or less, unload image - std::stringstream ss; + stringstream ss; ss << "Removing image " << path; ofLogNotice("MediaServer") << ss.str(); // Destroy image source if(loadedSources.count(path)){ ofLogNotice("MediaServer") << "Source count BEFORE image removal: " << loadedSources.size() << endl; loadedSources[path]->clear(); - std::map ::iterator it = loadedSources.find(path); + map ::iterator it = loadedSources.find(path); delete it->second; loadedSources.erase(it); ofLogNotice("MediaServer") << "Source count AFTER image removal: " << loadedSources.size() << endl; @@ -151,10 +151,10 @@ void MediaServer::unloadImage(string & path){ return; } // Something wrong here, we should be out of the routine by now - std::stringstream failss; + stringstream failss; failss << "Failed to remove image source: " << path; ofLogFatalError("MediaServer") << failss.str(); - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } BaseSource * MediaServer::loadVideo(string & path){ @@ -169,11 +169,11 @@ BaseSource * MediaServer::loadVideo(string & path){ if(isVideoLoaded){ // Increase reference count of this source videoSource->referenceCount++; - std::stringstream refss; + stringstream refss; refss << "Current reference count for " << path << " = " << videoSource->referenceCount; ofLogNotice("MediaServer") << refss.str(); // Notify objects registered to onImageLoaded event - std::stringstream ss; + stringstream ss; ss << "Video " << path << " already loaded"; ofLogNotice("MediaServer") << ss.str(); ofNotifyEvent(onVideoLoaded, path, this); @@ -185,7 +185,7 @@ BaseSource * MediaServer::loadVideo(string & path){ loadedSources[path] = videoSource; // Set reference count of this image path to 1 //referenceCount[path] = 1; - std::stringstream refss; + stringstream refss; refss << "Initialized reference count of " << path << " to " << videoSource->referenceCount; ofLogNotice("MediaServer") << refss.str(); ofNotifyEvent(onVideoLoaded, path, this); @@ -208,7 +208,7 @@ void MediaServer::unloadVideo(string & path){ if(loadedSources.count(path)){ ofLogNotice("MediaServer") << "Source count before video removal: " << loadedSources.size() << endl; videoSource->clear(); - std::map ::iterator it = loadedSources.find(path); + map ::iterator it = loadedSources.find(path); delete it->second; loadedSources.erase(it); ofLogNotice("MediaServer") << "Source count after video removal: " << loadedSources.size() << endl; @@ -216,10 +216,10 @@ void MediaServer::unloadVideo(string & path){ return; } // Something wrong here, we should be out of the routine by now - std::stringstream failss; + stringstream failss; failss << "Failed to remove video source: " << path; ofLogFatalError("MediaServer") << failss.str(); - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } void MediaServer::unloadMedia(string & path){ @@ -234,7 +234,7 @@ void MediaServer::unloadMedia(string & path){ }else{ // Oh my god, what to do!? Relax and exit. ofLogFatalError("MediaServer") << "Attempt to unload media of unknown type"; - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } }else{ ofLogNotice("MediaServer") << "Nothing to unload"; @@ -243,7 +243,7 @@ void MediaServer::unloadMedia(string & path){ // Clear all loaded media void MediaServer::clear(){ - typedef std::map ::iterator it_type; + typedef map ::iterator it_type; for(it_type i = loadedSources.begin(); i != loadedSources.end(); i++){ // Do not delete FBO source pointers as they are (and should be) initialized elsewhere if(i->second->getType() != SourceType::SOURCE_TYPE_FBO){ @@ -254,35 +254,35 @@ void MediaServer::clear(){ } // TODO: getLoadedSourceByPath -BaseSource * MediaServer::getSourceByPath(std::string & mediaPath){ +BaseSource * MediaServer::getSourceByPath(string & mediaPath){ if(loadedSources.count(mediaPath)){ return loadedSources[mediaPath]; } // Source not found, exit with error - std::stringstream ss; + stringstream ss; ss << "Could not find source by path: " << mediaPath; ofLogFatalError("MediaServer") << ss.str(); - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } -std::string MediaServer::getDefaultImageDir(){ +string MediaServer::getDefaultImageDir(){ return DEFAULT_IMAGES_DIR; } -std::string MediaServer::getDefaultVideoDir(){ +string MediaServer::getDefaultVideoDir(){ return DEFAULT_VIDEOS_DIR; } -std::string MediaServer::getDefaultMediaDir(int sourceType){ +string MediaServer::getDefaultMediaDir(int sourceType){ if(sourceType == SourceType::SOURCE_TYPE_IMAGE){ return getDefaultImageDir(); }else if(sourceType == SourceType::SOURCE_TYPE_VIDEO){ return getDefaultVideoDir(); }else{ - std::stringstream ss; + stringstream ss; ss << "Could not get default media dir. Unknown source type: " << sourceType; ofLogFatalError("MediaServer") << ss.str(); - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } @@ -299,7 +299,7 @@ void MediaServer::addFboSource(ofx::piMapper::FboSource & fboSource){ fboSources.push_back(&fboSource); } // addFboSource -BaseSource * MediaServer::loadFboSource(std::string & fboSourceName){ +BaseSource * MediaServer::loadFboSource(string & fboSourceName){ ofLogNotice("MediaServer") << "Attempting to load FBO source with name " << fboSourceName; // Search for FBO source name in our storage FboSource * source = 0; @@ -331,7 +331,7 @@ BaseSource * MediaServer::loadFboSource(std::string & fboSourceName){ return loadedSources[fboSourceName]; } // loadFboSource -void MediaServer::unloadFboSource(std::string & fboSourceName){ +void MediaServer::unloadFboSource(string & fboSourceName){ ofLogNotice("MediaServer") << "Attempt to unload FBO source " << fboSourceName; // Check if loaded at all if(!loadedSources.count(fboSourceName)){ @@ -349,7 +349,7 @@ void MediaServer::unloadFboSource(std::string & fboSourceName){ ofLogNotice("MediaServer") << fboSourceName << " reference count <= 0, removing from loaded sources"; source->referenceCount = 0; source->removeAppListeners(); - std::map ::iterator it = loadedSources.find(fboSourceName); + map ::iterator it = loadedSources.find(fboSourceName); loadedSources.erase(it); ofLogNotice("MediaServer") << "Source count after FBO source removal: " << loadedSources.size() << endl; ofNotifyEvent(onFboSourceUnloaded, fboSourceName, this); diff --git a/src/MediaServer/MediaServer.h b/src/MediaServer/MediaServer.h index 705aa36..d497dcc 100644 --- a/src/MediaServer/MediaServer.h +++ b/src/MediaServer/MediaServer.h @@ -37,11 +37,11 @@ class MediaServer { int getNumVideos(); int getNumImages(); int getNumFboSources(); // new - std::vector & getVideoPaths(); - std::vector getVideoNames(); - std::vector & getImagePaths(); - std::vector getImageNames(); - std::vector getFboSourceNames(); // new + vector & getVideoPaths(); + vector getVideoNames(); + vector & getImagePaths(); + vector getImageNames(); + vector getFboSourceNames(); // new BaseSource * loadMedia(string & path, int mediaType); BaseSource * loadImage(string & path); @@ -50,36 +50,36 @@ class MediaServer { void unloadVideo(string & path); void unloadMedia(string & path); void clear(); // Force all loaded source unload - BaseSource * getSourceByPath(std::string & mediaPath); - std::string getDefaultImageDir(); - std::string getDefaultVideoDir(); - std::string getDefaultMediaDir(int sourceType); + BaseSource * getSourceByPath(string & mediaPath); + string getDefaultImageDir(); + string getDefaultVideoDir(); + string getDefaultMediaDir(int sourceType); // Do things with FBO sources void addFboSource(FboSource & fboSource); // could be called also as register FBO source - BaseSource * loadFboSource(std::string & fboSourceName); - void unloadFboSource(std::string & fboSourceName); + BaseSource * loadFboSource(string & fboSourceName); + void unloadFboSource(string & fboSourceName); // Custom events, add/remove - ofEvent onImageAdded; - ofEvent onImageRemoved; - ofEvent onVideoAdded; - ofEvent onVideoRemoved; - ofEvent onFboSourceAdded; - ofEvent onFboSourceRemoved; + ofEvent onImageAdded; + ofEvent onImageRemoved; + ofEvent onVideoAdded; + ofEvent onVideoRemoved; + ofEvent onFboSourceAdded; + ofEvent onFboSourceRemoved; // load/unload - ofEvent onImageLoaded; - ofEvent onImageUnloaded; - ofEvent onVideoLoaded; - ofEvent onVideoUnloaded; - ofEvent onFboSourceLoaded; - ofEvent onFboSourceUnloaded; + ofEvent onImageLoaded; + ofEvent onImageUnloaded; + ofEvent onVideoLoaded; + ofEvent onVideoUnloaded; + ofEvent onFboSourceLoaded; + ofEvent onFboSourceUnloaded; private: // Directory Watchers ofx::piMapper::DirectoryWatcher videoWatcher; ofx::piMapper::DirectoryWatcher imageWatcher; - std::map loadedSources; + map loadedSources; // imageWatcher event listeners void handleImageAdded(string & path); void handleImageRemoved(string & path); @@ -108,7 +108,7 @@ class MediaServer { void removeWatcherListeners(); // FBO source storage before they go to loadedSources - std::vector fboSources; // FBO source storage + vector fboSources; // FBO source storage }; } // namespace piMapper diff --git a/src/Sources/BaseSource.cpp b/src/Sources/BaseSource.cpp index e1a3a22..b8cdc0b 100644 --- a/src/Sources/BaseSource.cpp +++ b/src/Sources/BaseSource.cpp @@ -19,7 +19,7 @@ ofTexture * BaseSource::getTexture(){ return texture; } -std::string & BaseSource::getName(){ +string & BaseSource::getName(){ return name; } @@ -35,7 +35,7 @@ int BaseSource::getType(){ return type; } -std::string & BaseSource::getPath(){ +string & BaseSource::getPath(){ return path; } @@ -49,8 +49,8 @@ void BaseSource::init(){ referenceCount = 1; // We have one instance on init } -void BaseSource::setNameFromPath(std::string & fullPath){ - std::vector pathParts; +void BaseSource::setNameFromPath(string & fullPath){ + vector pathParts; //cout << "fullPath: " << fullPath << endl; pathParts = ofSplitString(fullPath, "/"); // Maybe on win "/" is "\", have to test //cout << "lastPathPart: " << pathParts[pathParts.size() - 1] << endl; diff --git a/src/Sources/BaseSource.h b/src/Sources/BaseSource.h index c989fb5..f6e0157 100644 --- a/src/Sources/BaseSource.h +++ b/src/Sources/BaseSource.h @@ -14,11 +14,11 @@ class BaseSource { BaseSource(ofTexture * newTexture); // Only one clean way of passing the texture ~BaseSource(); ofTexture * getTexture(); - std::string & getName(); + string & getName(); bool isLoadable(); // Maybe the loading features shoud go to a derrived class bool isLoaded(); // as BaseSourceLoadable int getType(); - std::string & getPath(); + string & getPath(); virtual void clear(){} // TODO: add virtual increaseReferenceCount and decreaseReferenceCount methods @@ -29,10 +29,10 @@ class BaseSource { void init(); protected: - void setNameFromPath(std::string & fullPath); + void setNameFromPath(string & fullPath); ofTexture * texture; - std::string name; - std::string path; // This is set only if loadable is true + string name; + string path; // This is set only if loadable is true bool loadable; // If the source can be loaded from disk like image and video bool loaded; // Is the source loaded? int type; diff --git a/src/Sources/ImageSource.cpp b/src/Sources/ImageSource.cpp index e31feac..20ea40d 100644 --- a/src/Sources/ImageSource.cpp +++ b/src/Sources/ImageSource.cpp @@ -12,7 +12,7 @@ ImageSource::ImageSource(){ ImageSource::~ImageSource(){} -void ImageSource::loadImage(std::string & filePath){ +void ImageSource::loadImage(string & filePath){ path = filePath; //cout << "loading image: " << filePath << endl; setNameFromPath(filePath); @@ -24,7 +24,7 @@ void ImageSource::loadImage(std::string & filePath){ if(!image->loadImage(filePath)){ #endif ofLogWarning("ImageSource") << "Could not load image"; - //std::exit(EXIT_FAILURE); + //exit(EXIT_FAILURE); } #if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0 texture = &image->getTexture(); diff --git a/src/Sources/ImageSource.h b/src/Sources/ImageSource.h index 2d34270..b22dba6 100644 --- a/src/Sources/ImageSource.h +++ b/src/Sources/ImageSource.h @@ -10,8 +10,8 @@ class ImageSource : public BaseSource { public: ImageSource(); ~ImageSource(); - std::string & getPath(); - void loadImage(std::string & filePath); + string & getPath(); + void loadImage(string & filePath); void clear(); private: ofImage * image; diff --git a/src/Sources/SourceType.h b/src/Sources/SourceType.h index ebd2e1f..7ec1cd1 100644 --- a/src/Sources/SourceType.h +++ b/src/Sources/SourceType.h @@ -17,7 +17,7 @@ class SourceType { SOURCE_TYPE_NONE, SOURCE_TYPE_IMAGE, SOURCE_TYPE_VIDEO, SOURCE_TYPE_FBO }; - static std::string GetSourceTypeName(int sourceTypeEnum){ + static string GetSourceTypeName(int sourceTypeEnum){ if(sourceTypeEnum == SOURCE_TYPE_IMAGE){ return SOURCE_TYPE_NAME_IMAGE; }else if(sourceTypeEnum == SOURCE_TYPE_VIDEO){ @@ -27,14 +27,14 @@ class SourceType { }else if(sourceTypeEnum == SOURCE_TYPE_FBO){ return SOURCE_TYPE_NAME_FBO; }else{ - std::stringstream ss; + stringstream ss; ss << "Invalid source type: " << sourceTypeEnum; ofLogFatalError("SourceType") << ss.str(); - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } - static int GetSourceTypeEnum(std::string sourceTypeName){ + static int GetSourceTypeEnum(string sourceTypeName){ if(sourceTypeName == SOURCE_TYPE_NAME_IMAGE){ return SOURCE_TYPE_IMAGE; }else if(sourceTypeName == SOURCE_TYPE_NAME_VIDEO){ @@ -44,10 +44,10 @@ class SourceType { }else if(sourceTypeName == SOURCE_TYPE_NAME_FBO){ return SOURCE_TYPE_FBO; }else{ - std::stringstream ss; + stringstream ss; ss << "Invalid source type name: " << sourceTypeName; ofLogFatalError("SourceType") << ss.str(); - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } diff --git a/src/Sources/VideoSource.cpp b/src/Sources/VideoSource.cpp index 9212adc..be48db9 100644 --- a/src/Sources/VideoSource.cpp +++ b/src/Sources/VideoSource.cpp @@ -18,7 +18,7 @@ VideoSource::VideoSource(){ VideoSource::~VideoSource(){} -void VideoSource::loadVideo(std::string & filePath){ +void VideoSource::loadVideo(string & filePath){ path = filePath; setNameFromPath(filePath); #ifdef TARGET_RASPBERRY_PI diff --git a/src/Sources/VideoSource.h b/src/Sources/VideoSource.h index 514989e..7deebd5 100644 --- a/src/Sources/VideoSource.h +++ b/src/Sources/VideoSource.h @@ -21,8 +21,8 @@ class VideoSource : public BaseSource { VideoSource(); ~VideoSource(); - std::string & getPath(); - void loadVideo(std::string & path); + string & getPath(); + void loadVideo(string & path); void clear(); #ifndef TARGET_RASPBERRY_PI diff --git a/src/Surfaces/QuadSurface.cpp b/src/Surfaces/QuadSurface.cpp index 7facb58..34055e7 100644 --- a/src/Surfaces/QuadSurface.cpp +++ b/src/Surfaces/QuadSurface.cpp @@ -141,7 +141,7 @@ bool QuadSurface::hitTest(ofVec2f p){ ofVec2f QuadSurface::getVertex(int index){ if(index > 3){ ofLog() << "Vertex with this index does not exist: " << index << endl; - throw std::runtime_error("Vertex index out of bounds."); + throw runtime_error("Vertex index out of bounds."); } ofVec3f vert = mesh.getVertex(index); @@ -150,7 +150,7 @@ ofVec2f QuadSurface::getVertex(int index){ ofVec2f QuadSurface::getTexCoord(int index){ if(index > 3){ - throw std::runtime_error("Texture coordinate index out of bounds."); + throw runtime_error("Texture coordinate index out of bounds."); } return mesh.getTexCoord(index); diff --git a/src/Surfaces/SurfaceManager.cpp b/src/Surfaces/SurfaceManager.cpp index 466c51c..a95555a 100644 --- a/src/Surfaces/SurfaceManager.cpp +++ b/src/Surfaces/SurfaceManager.cpp @@ -25,7 +25,7 @@ void SurfaceManager::addSurface(int surfaceType){ surfaces.push_back(new QuadSurface()); }else{ ofLogFatalError("SurfaceManager") << "Attempt to add non-existing surface type"; - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } @@ -38,7 +38,7 @@ void SurfaceManager::addSurface(int surfaceType, BaseSource * newSource){ surfaces.back()->setSource(newSource); }else{ ofLogFatalError("SurfaceManager") << "Attempt to add non-existing surface type"; - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } @@ -46,10 +46,10 @@ void SurfaceManager::addSurface(int surfaceType, vector vertices, vector texCoords){ if(surfaceType == SurfaceType::TRIANGLE_SURFACE){ if(vertices.size() < 3){ - throw std::runtime_error( + throw runtime_error( "There must be 3 vertices for a triangle surface."); }else if(texCoords.size() < 3){ - throw std::runtime_error( + throw runtime_error( "There must be 3 texture coordinates for a triangle surface."); } @@ -62,9 +62,9 @@ void SurfaceManager::addSurface(int surfaceType, vector vertices, }else if(surfaceType == SurfaceType::QUAD_SURFACE){ if(vertices.size() < 4){ - throw std::runtime_error("There must be 4 vertices for a quad surface."); + throw runtime_error("There must be 4 vertices for a quad surface."); }else if(texCoords.size() < 4){ - throw std::runtime_error( + throw runtime_error( "There must be 4 texture coordinates for a quad surface."); } @@ -76,7 +76,7 @@ void SurfaceManager::addSurface(int surfaceType, vector vertices, } }else{ ofLogFatalError("SurfaceManager") << "Attempt to add non-existing surface type"; - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } @@ -85,10 +85,10 @@ void SurfaceManager::addSurface(int surfaceType, BaseSource * newSource, vector texCoords){ if(surfaceType == SurfaceType::TRIANGLE_SURFACE){ if(vertices.size() < 3){ - throw std::runtime_error( + throw runtime_error( "There must be 3 vertices for a triangle surface."); }else if(texCoords.size() < 3){ - throw std::runtime_error( + throw runtime_error( "Thre must be 3 texture coordinates for a triangle surface."); } @@ -102,9 +102,9 @@ void SurfaceManager::addSurface(int surfaceType, BaseSource * newSource, }else if(surfaceType == SurfaceType::QUAD_SURFACE){ if(vertices.size() < 4){ - throw std::runtime_error("There must be 4 vertices for a quad surface."); + throw runtime_error("There must be 4 vertices for a quad surface."); }else if(texCoords.size() < 4){ - throw std::runtime_error( + throw runtime_error( "Thre must be 4 texture coordinates for a quad surface."); } @@ -117,7 +117,7 @@ void SurfaceManager::addSurface(int surfaceType, BaseSource * newSource, } }else{ ofLogFatalError("SurfaceManager") << "Attempt to add non-existing surface type"; - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } @@ -162,7 +162,7 @@ void SurfaceManager::saveXmlSettings(string fileName){ // Exit if mediaServer not set if(mediaServer == 0){ ofLogFatalError("SurfaceManager") << "Media server not set"; - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } // We need a fresh copy of the xml settings object xmlSettings.clear(); @@ -219,7 +219,7 @@ void SurfaceManager::loadXmlSettings(string fileName){ // Exit if there is no media server if(mediaServer == 0){ ofLogFatalError("SurfaceManager") << "Media server not set"; - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if(!xmlSettings.loadFile(fileName)){ ofLogWarning("SurfaceManager") << "Could not load XML settings"; @@ -249,7 +249,7 @@ void SurfaceManager::loadXmlSettings(string fileName){ }else{ // Construct full path string dir = mediaServer->getDefaultMediaDir(typeEnum); - std::stringstream pathss; + stringstream pathss; pathss << ofToDataPath(dir, true) << sourceName; string sourcePath = pathss.str(); // Load media by using full path @@ -383,7 +383,7 @@ void SurfaceManager::setMediaServer(MediaServer * newMediaServer){ BaseSurface * SurfaceManager::selectSurface(int index){ if(index >= surfaces.size()){ - throw std::runtime_error("Surface index out of bounds."); + throw runtime_error("Surface index out of bounds."); } selectedSurface = surfaces[index]; @@ -414,7 +414,7 @@ void SurfaceManager::deselectSurface(){ BaseSurface * SurfaceManager::getSurface(int index){ if(index >= surfaces.size()){ - throw std::runtime_error("Surface index out of bounds."); + throw runtime_error("Surface index out of bounds."); return 0; } diff --git a/src/Surfaces/SurfaceManager.h b/src/Surfaces/SurfaceManager.h index 0ddac13..9d162b9 100644 --- a/src/Surfaces/SurfaceManager.h +++ b/src/Surfaces/SurfaceManager.h @@ -52,7 +52,7 @@ class SurfaceManager { void deselectSurface(); private: - std::vector surfaces; + vector surfaces; BaseSurface * selectedSurface; ofxXmlSettings xmlSettings; MediaServer * mediaServer; diff --git a/src/Surfaces/SurfaceManagerGui.cpp b/src/Surfaces/SurfaceManagerGui.cpp index 159f2cc..b7c7d3a 100644 --- a/src/Surfaces/SurfaceManagerGui.cpp +++ b/src/Surfaces/SurfaceManagerGui.cpp @@ -248,7 +248,7 @@ void SurfaceManagerGui::setMode(int newGuiMode){ if(newGuiMode != GuiMode::NONE && newGuiMode != GuiMode::TEXTURE_MAPPING && newGuiMode != GuiMode::PROJECTION_MAPPING && newGuiMode != GuiMode::SOURCE_SELECTION){ - throw std::runtime_error("Trying to set invalid mode."); + throw runtime_error("Trying to set invalid mode."); } if(newGuiMode == GuiMode::NONE){ diff --git a/src/Surfaces/TriangleSurface.cpp b/src/Surfaces/TriangleSurface.cpp index ad2f49b..8937948 100644 --- a/src/Surfaces/TriangleSurface.cpp +++ b/src/Surfaces/TriangleSurface.cpp @@ -98,7 +98,7 @@ bool TriangleSurface::hitTest(ofVec2f p){ ofVec2f TriangleSurface::getVertex(int index){ if(index > 2){ ofLog() << "Vertex with this index does not exist: " << index << endl; - throw std::runtime_error("Vertex index out of bounds."); + throw runtime_error("Vertex index out of bounds."); } ofVec3f vert = mesh.getVertex(index); @@ -107,7 +107,7 @@ ofVec2f TriangleSurface::getVertex(int index){ ofVec2f TriangleSurface::getTexCoord(int index){ if(index > 2){ - throw std::runtime_error("Texture coordinate index out of bounds."); + throw runtime_error("Texture coordinate index out of bounds."); } return mesh.getTexCoord(index); diff --git a/src/UserInterface/RadioList.cpp b/src/UserInterface/RadioList.cpp index 2b51af2..abc3c57 100644 --- a/src/UserInterface/RadioList.cpp +++ b/src/UserInterface/RadioList.cpp @@ -85,7 +85,7 @@ void RadioList::selectItem(int index){ storedSelectedItem = index; } -bool RadioList::selectItemByValue(std::string itemValue){ +bool RadioList::selectItemByValue(string itemValue){ if(itemValue == ""){ ofLogNotice("RadioList") << "Item value empty"; return false; diff --git a/src/UserInterface/RadioList.h b/src/UserInterface/RadioList.h index 826dee4..5e67a4f 100644 --- a/src/UserInterface/RadioList.h +++ b/src/UserInterface/RadioList.h @@ -22,7 +22,7 @@ class RadioList { void setPosition(ofPoint p); void setPosition(float x, float y); void selectItem(int index); - bool selectItemByValue(std::string itemValue); + bool selectItemByValue(string itemValue); void enable(); void disable(); void clear(); diff --git a/src/UserInterface/SourcesEditor.cpp b/src/UserInterface/SourcesEditor.cpp index d598263..6b44ebd 100644 --- a/src/UserInterface/SourcesEditor.cpp +++ b/src/UserInterface/SourcesEditor.cpp @@ -66,7 +66,7 @@ void SourcesEditor::setup(ofEventArgs & args){ ofAddListener(videoSelector->onRadioSelected, this, &SourcesEditor::handleVideoSelected); } if(numFbos){ - std::vector fboNames = mediaServer->getFboSourceNames(); + vector fboNames = mediaServer->getFboSourceNames(); fboSelector->setup("FBOs", fboNames, fboNames); ofAddListener(fboSelector->onRadioSelected, this, &SourcesEditor::handleFboSelected); } @@ -157,7 +157,7 @@ void SourcesEditor::setMediaServer(MediaServer * newMediaServer){ if(newMediaServer == 0){ // Log an error and return from the routine ofLogFatalError("SourcesEditor") << "New media server is 0"; - std::exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } // Attempt to clear existing media server and assign new one clearMediaServer(); @@ -167,7 +167,7 @@ void SourcesEditor::setMediaServer(MediaServer * newMediaServer){ isMediaServerExternal = true; } -void SourcesEditor::selectSourceRadioButton(std::string & sourcePath){ +void SourcesEditor::selectSourceRadioButton(string & sourcePath){ if(sourcePath == ""){ ofLogNotice("SourcesEditor") << "Path is empty"; if(imageSelector->size()){ @@ -358,16 +358,16 @@ void SourcesEditor::clearMediaServer(){ } } -void SourcesEditor::handleImageAdded(std::string & path){} -void SourcesEditor::handleImageRemoved(std::string & path){} -void SourcesEditor::handleVideoAdded(std::string & path){} -void SourcesEditor::handleVideoRemoved(std::string & path){} -void SourcesEditor::handleImageLoaded(std::string & path){} -void SourcesEditor::handleImageUnloaded(std::string & path){} -void SourcesEditor::handleFboSourceAdded(std::string & name){} -void SourcesEditor::handleFboSourceRemoved(std::string & name){} -void SourcesEditor::handleFboSourceLoaded(std::string & name){} -void SourcesEditor::handleFboSourceUnloaded(std::string & name){} +void SourcesEditor::handleImageAdded(string & path){} +void SourcesEditor::handleImageRemoved(string & path){} +void SourcesEditor::handleVideoAdded(string & path){} +void SourcesEditor::handleVideoRemoved(string & path){} +void SourcesEditor::handleImageLoaded(string & path){} +void SourcesEditor::handleImageUnloaded(string & path){} +void SourcesEditor::handleFboSourceAdded(string & name){} +void SourcesEditor::handleFboSourceRemoved(string & name){} +void SourcesEditor::handleFboSourceLoaded(string & name){} +void SourcesEditor::handleFboSourceUnloaded(string & name){} } // namespace piMapper } // namespace ofx \ No newline at end of file diff --git a/src/UserInterface/SourcesEditor.h b/src/UserInterface/SourcesEditor.h index c4e2f14..625052a 100644 --- a/src/UserInterface/SourcesEditor.h +++ b/src/UserInterface/SourcesEditor.h @@ -35,7 +35,7 @@ class SourcesEditor { // Sets external MediaServer void setMediaServer(MediaServer * newMediaServer); //void selectImageSourceRadioButton(string name); - void selectSourceRadioButton(std::string & sourcePath); + void selectSourceRadioButton(string & sourcePath); int getLoadedTexCount(); ofTexture * getTexture(int index); @@ -74,16 +74,16 @@ class SourcesEditor { void clearMediaServer(); // MediaServer event handlers - void handleImageAdded(std::string & path); - void handleImageRemoved(std::string & path); - void handleVideoAdded(std::string & path); - void handleVideoRemoved(std::string & path); - void handleImageLoaded(std::string & path); - void handleImageUnloaded(std::string & path); - void handleFboSourceAdded(std::string & name); - void handleFboSourceRemoved(std::string & name); - void handleFboSourceLoaded(std::string & name); - void handleFboSourceUnloaded(std::string & name); + void handleImageAdded(string & path); + void handleImageRemoved(string & path); + void handleVideoAdded(string & path); + void handleVideoRemoved(string & path); + void handleImageLoaded(string & path); + void handleImageUnloaded(string & path); + void handleFboSourceAdded(string & name); + void handleFboSourceRemoved(string & name); + void handleFboSourceLoaded(string & name); + void handleFboSourceUnloaded(string & name); };