diff --git a/src/libprojectM/CMakeLists.txt b/src/libprojectM/CMakeLists.txt index d96c9772d..d2a84d561 100644 --- a/src/libprojectM/CMakeLists.txt +++ b/src/libprojectM/CMakeLists.txt @@ -34,7 +34,7 @@ Func.cpp Eval.cpp PerFrameEqn.cpp PerPointEqn.cpp fftsg.cpp KeyHandler.cpp timer.cpp wipemalloc.cpp BuiltinFuncs.cpp BuiltinParams.cpp Renderer.cpp PresetLoader.cpp PresetChooser.cpp PresetFrameIO.cpp PresetMerge.cpp PipelineContext.cpp ConfigFile.cpp IdlePreset.cpp TextureManager.cpp TimeKeeper.cpp Filters.cpp Renderable.cpp Pipeline.cpp PerPixelMesh.cpp -MilkdropWaveform.cpp Waveform.cpp VideoEcho.cpp Shader.cpp PerlinNoise.cpp UserTexture.cpp ShaderEngine.cpp MilkdropPreset.cpp MilkdropPresetFactory.cpp CompiledPresetFactory.cpp PresetFactory.cpp PresetFactoryManager.cpp ${GLEW_SOURCES}) +MilkdropWaveform.cpp Waveform.cpp VideoEcho.cpp Shader.cpp PerlinNoise.cpp UserTexture.cpp ShaderEngine.cpp MilkdropPreset.cpp MilkdropPresetFactory.cpp NativePresetFactory.cpp PresetFactory.cpp PresetFactoryManager.cpp ${GLEW_SOURCES}) if (USE_DEVIL) SET (projectM_SOURCES ${projectM_SOURCES}) diff --git a/src/libprojectM/CompiledPreset.hpp b/src/libprojectM/NativePreset.hpp similarity index 65% rename from src/libprojectM/CompiledPreset.hpp rename to src/libprojectM/NativePreset.hpp index bf7c5c2a4..dc6828541 100644 --- a/src/libprojectM/CompiledPreset.hpp +++ b/src/libprojectM/NativePreset.hpp @@ -5,8 +5,8 @@ * Author: carm */ -#ifndef __COMPILED_PRESET_HPP_ -#define __COMPILED_PRESET_HPP_ +#ifndef __NATIVE_PRESET_HPP_ +#define __NATIVE_PRESET_HPP_ #include @@ -17,13 +17,13 @@ /// A templated preset class to build different various hard coded presets and /// compile them into object files to be loaded into a playlist template -class CompiledPreset : public Preset { +class NativePreset : public Preset { public: - inline CompiledPreset(const std::string & name=std::string(), + inline NativePreset(const std::string & name=std::string(), const std::string & author = std::string()) : Preset(name, author) {} - virtual ~CompiledPreset() {} + virtual ~NativePreset() {} inline PipelineT & pipeline() { return _pipeline; } inline virtual void Render(const BeatDetect &music, const PipelineContext &context) { @@ -35,12 +35,12 @@ private: }; template -extern "C" CompiledPreset * create(const char * url) { - return new CompiledPreset(std::string(url)); +extern "C" NativePreset * create(const char * url) { + return new NativePreset(std::string(url)); } template -extern "C" void destroy(CompiledPreset * preset) { +extern "C" void destroy(NativePreset * preset) { delete preset; } diff --git a/src/libprojectM/CompiledPresetFactory.cpp b/src/libprojectM/NativePresetFactory.cpp similarity index 75% rename from src/libprojectM/CompiledPresetFactory.cpp rename to src/libprojectM/NativePresetFactory.cpp index a7a4ab304..dd4e047ad 100644 --- a/src/libprojectM/CompiledPresetFactory.cpp +++ b/src/libprojectM/NativePresetFactory.cpp @@ -1,5 +1,5 @@ // -// C++ Implementation: CompiledPresetFactory +// C++ Implementation: NativePresetFactory // // Description: // @@ -11,7 +11,7 @@ // #include -#include "CompiledPresetFactory.hpp" +#include "NativePresetFactory.hpp" typedef void Handle; typedef Preset * CreateFunctor(const char * url); @@ -38,9 +38,9 @@ class PresetLibrary { }; -CompiledPresetFactory::CompiledPresetFactory() {} +NativePresetFactory::NativePresetFactory() {} -CompiledPresetFactory::~CompiledPresetFactory() { +NativePresetFactory::~NativePresetFactory() { for (PresetLibraryMap::iterator pos = _libraries.begin(); pos != _libraries.end(); ++pos) delete(pos->second); @@ -48,7 +48,7 @@ for (PresetLibraryMap::iterator pos = _libraries.begin(); pos != _libraries.end( } -PresetLibrary * CompiledPresetFactory::loadLibrary(const std::string & url) { +PresetLibrary * NativePresetFactory::loadLibrary(const std::string & url) { if (_libraries.count(url)) return _libraries[url]; @@ -56,7 +56,7 @@ PresetLibrary * CompiledPresetFactory::loadLibrary(const std::string & url) { // load the preset library void* handle = dlopen(url.c_str(), RTLD_LAZY); if (!handle) { - std::cerr << "[CompiledPresetFactory] Cannot load library: " << dlerror() << '\n'; + std::cerr << "[NativePresetFactory] Cannot load library: " << dlerror() << '\n'; return 0; } @@ -67,14 +67,14 @@ PresetLibrary * CompiledPresetFactory::loadLibrary(const std::string & url) { CreateFunctor * create = (CreateFunctor*) dlsym(handle, "create"); const char * dlsym_error = dlerror(); if (dlsym_error) { - std::cerr << "[CompiledPresetFactory] Cannot load symbol create: " << dlsym_error << '\n'; + std::cerr << "[NativePresetFactory] Cannot load symbol create: " << dlsym_error << '\n'; return 0; } DestroyFunctor * destroy = (DestroyFunctor*) dlsym(handle, "destroy"); dlsym_error = dlerror(); if (dlsym_error) { - std::cerr << "[CompiledPresetFactory] Cannot load symbol destroy: " << dlsym_error << '\n'; + std::cerr << "[NativePresetFactory] Cannot load symbol destroy: " << dlsym_error << '\n'; return 0; } @@ -85,7 +85,7 @@ PresetLibrary * CompiledPresetFactory::loadLibrary(const std::string & url) { } -std::auto_ptr CompiledPresetFactory::allocate +std::auto_ptr NativePresetFactory::allocate (const std::string & url, const std::string & name, const std::string & author) { PresetLibrary * library; diff --git a/src/libprojectM/CompiledPresetFactory.hpp b/src/libprojectM/NativePresetFactory.hpp similarity index 73% rename from src/libprojectM/CompiledPresetFactory.hpp rename to src/libprojectM/NativePresetFactory.hpp index abd6272cc..3e8febd4c 100644 --- a/src/libprojectM/CompiledPresetFactory.hpp +++ b/src/libprojectM/NativePresetFactory.hpp @@ -1,5 +1,5 @@ // -// C++ Interface: CompiledPresetFactory +// C++ Interface: NativePresetFactory // // Description: // @@ -10,21 +10,21 @@ // // -#ifndef __COMPILED_PRESET_FACTORY_HPP -#define __COMPILED_PRESET_FACTORY_HPP +#ifndef __NATIVE_PRESET_FACTORY_HPP +#define __NATIVE_PRESET_FACTORY_HPP #include #include "PresetFactory.hpp" class PresetLibrary; -class CompiledPresetFactory : public PresetFactory { +class NativePresetFactory : public PresetFactory { public: - CompiledPresetFactory(); + NativePresetFactory(); - virtual ~CompiledPresetFactory(); + virtual ~NativePresetFactory(); virtual std::auto_ptr allocate(const std::string & url, const std::string & name = std::string(), const std::string & author = std::string()); diff --git a/src/libprojectM/PresetFactoryManager.cpp b/src/libprojectM/PresetFactoryManager.cpp index 2eec829c6..50c8e0217 100644 --- a/src/libprojectM/PresetFactoryManager.cpp +++ b/src/libprojectM/PresetFactoryManager.cpp @@ -16,7 +16,7 @@ #endif #ifndef DISABLE_COMPILED_PRESETS -#include "CompiledPresetFactory.hpp" +#include "NativePresetFactory.hpp" #endif #include @@ -39,7 +39,7 @@ void PresetFactoryManager::initialize(int gx, int gy) { #endif #ifndef DISABLE_COMPILED_PRESETS - factory = new CompiledPresetFactory(); + factory = new NativePresetFactory(); registerFactory(factory->supportedExtensions(), factory); #endif }