From b3b88bb194ddb96b5d11e50324effd0b3adace8f Mon Sep 17 00:00:00 2001 From: psperl Date: Thu, 2 Aug 2007 02:21:37 +0000 Subject: [PATCH] - CEP: copy of engine so we can merge together some external changes. - resolved project file conflict. using sperl's kdevelop config files. git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/dev-1.0@287 6778bc44-b910-0410-a7a0-be141de4315d --- src/linux/projectmDev10.kdevelop | 52 +- src/linux/projectmDev10.kdevses | 131 +- src/projectM-engine-backup/Algorithms.hpp | 50 + src/projectM-engine-backup/BeatDetect.cpp | 175 + src/projectM-engine-backup/BeatDetect.hpp | 72 + src/projectM-engine-backup/BuiltinFuncs.cpp | 166 + src/projectM-engine-backup/BuiltinFuncs.hpp | 232 ++ src/projectM-engine-backup/BuiltinParams.cpp | 364 ++ src/projectM-engine-backup/BuiltinParams.hpp | 85 + src/projectM-engine-backup/CMakeLists.txt | 33 + src/projectM-engine-backup/CValue.hpp | 38 + src/projectM-engine-backup/Common.hpp | 98 + src/projectM-engine-backup/CustomShape.cpp | 227 ++ src/projectM-engine-backup/CustomShape.hpp | 117 + src/projectM-engine-backup/CustomWave.cpp | 530 +++ src/projectM-engine-backup/CustomWave.hpp | 158 + src/projectM-engine-backup/Eval.cpp | 91 + src/projectM-engine-backup/Eval.hpp | 93 + src/projectM-engine-backup/Expr.cpp | 549 +++ src/projectM-engine-backup/Expr.hpp | 125 + .../FindPkgConfig.cmake | 360 ++ src/projectM-engine-backup/Func.cpp | 87 + src/projectM-engine-backup/Func.hpp | 58 + src/projectM-engine-backup/InitCond.cpp | 137 + src/projectM-engine-backup/InitCond.hpp | 59 + src/projectM-engine-backup/InitCondUtils.hpp | 69 + src/projectM-engine-backup/Makefile.am | 48 + src/projectM-engine-backup/Makefile.dist | 24 + src/projectM-engine-backup/Makefile.in | 621 +++ src/projectM-engine-backup/PBuffer.cpp | 217 ++ src/projectM-engine-backup/PBuffer.hpp | 94 + src/projectM-engine-backup/PCM.cpp | 325 ++ src/projectM-engine-backup/PCM.hpp | 65 + src/projectM-engine-backup/Param.cpp | 243 ++ src/projectM-engine-backup/Param.hpp | 110 + src/projectM-engine-backup/ParamUtils.hpp | 138 + src/projectM-engine-backup/Parser.cpp | 2143 +++++++++++ src/projectM-engine-backup/Parser.hpp | 180 + src/projectM-engine-backup/PerFrameEqn.cpp | 65 + src/projectM-engine-backup/PerFrameEqn.hpp | 53 + src/projectM-engine-backup/PerPixelEqn.cpp | 90 + src/projectM-engine-backup/PerPixelEqn.hpp | 66 + src/projectM-engine-backup/PerPointEqn.cpp | 84 + src/projectM-engine-backup/PerPointEqn.hpp | 54 + src/projectM-engine-backup/Preset.cpp | 764 ++++ src/projectM-engine-backup/Preset.hpp | 141 + src/projectM-engine-backup/PresetChooser.cpp | 14 + src/projectM-engine-backup/PresetChooser.hpp | 225 ++ src/projectM-engine-backup/PresetFilters.hpp | 38 + src/projectM-engine-backup/PresetFrameIO.cpp | 202 + src/projectM-engine-backup/PresetFrameIO.hpp | 188 + src/projectM-engine-backup/PresetLoader.cpp | 137 + src/projectM-engine-backup/PresetLoader.hpp | 51 + src/projectM-engine-backup/Renderer.cpp | 1996 ++++++++++ src/projectM-engine-backup/Renderer.hpp | 93 + src/projectM-engine-backup/SplayNode.hpp | 91 + src/projectM-engine-backup/StaticArray.hpp | 212 ++ src/projectM-engine-backup/browser.cpp | 145 + src/projectM-engine-backup/browser.h | 45 + src/projectM-engine-backup/carbontoprojectM.h | 104 + src/projectM-engine-backup/compare.h | 114 + src/projectM-engine-backup/config | 22 + .../console_interface.cpp | 230 ++ .../console_interface.h | 39 + src/projectM-engine-backup/dlldefs.h | 40 + src/projectM-engine-backup/editor.cpp | 870 +++++ src/projectM-engine-backup/editor.h | 43 + src/projectM-engine-backup/event.h | 151 + src/projectM-engine-backup/fatal.h | 43 + src/projectM-engine-backup/fftsg.cpp | 3314 +++++++++++++++++ src/projectM-engine-backup/fftsg.h | 35 + src/projectM-engine-backup/fonts | 1 + src/projectM-engine-backup/glConsole.cpp | 1028 +++++ src/projectM-engine-backup/glConsole.h | 114 + src/projectM-engine-backup/libprojectM.dsp | 348 ++ src/projectM-engine-backup/libprojectM.ncb | Bin 0 -> 254976 bytes src/projectM-engine-backup/libprojectM.opt | Bin 0 -> 55808 bytes src/projectM-engine-backup/libprojectM.plg | 78 + .../libprojectM/Debug/libprojectM.pch | Bin 0 -> 186940 bytes .../libprojectM/Debug/vc60.idb | Bin 0 -> 246784 bytes .../libprojectM/Debug/vc60.pdb | Bin 0 -> 110592 bytes .../libprojectM/libprojectM.plg | 16 + src/projectM-engine-backup/lvtoprojectM.h | 156 + src/projectM-engine-backup/menu.cpp | 1033 +++++ src/projectM-engine-backup/menu.h | 118 + src/projectM-engine-backup/presets | 1 + src/projectM-engine-backup/projectM.cpp | 705 ++++ src/projectM-engine-backup/projectM.dsp | 381 ++ src/projectM-engine-backup/projectM.hpp | 242 ++ src/projectM-engine-backup/sdltoprojectM.h | 165 + src/projectM-engine-backup/timer.cpp | 44 + src/projectM-engine-backup/timer.h | 49 + src/projectM-engine-backup/win32-dirent.cpp | 231 ++ src/projectM-engine-backup/win32-dirent.h | 59 + src/projectM-engine-backup/wipemalloc.cpp | 44 + src/projectM-engine-backup/wipemalloc.h | 60 + src/projectM-xmms/main.cpp | 5 +- 97 files changed, 22850 insertions(+), 151 deletions(-) create mode 100644 src/projectM-engine-backup/Algorithms.hpp create mode 100755 src/projectM-engine-backup/BeatDetect.cpp create mode 100755 src/projectM-engine-backup/BeatDetect.hpp create mode 100644 src/projectM-engine-backup/BuiltinFuncs.cpp create mode 100644 src/projectM-engine-backup/BuiltinFuncs.hpp create mode 100644 src/projectM-engine-backup/BuiltinParams.cpp create mode 100644 src/projectM-engine-backup/BuiltinParams.hpp create mode 100644 src/projectM-engine-backup/CMakeLists.txt create mode 100755 src/projectM-engine-backup/CValue.hpp create mode 100755 src/projectM-engine-backup/Common.hpp create mode 100755 src/projectM-engine-backup/CustomShape.cpp create mode 100755 src/projectM-engine-backup/CustomShape.hpp create mode 100755 src/projectM-engine-backup/CustomWave.cpp create mode 100755 src/projectM-engine-backup/CustomWave.hpp create mode 100755 src/projectM-engine-backup/Eval.cpp create mode 100755 src/projectM-engine-backup/Eval.hpp create mode 100755 src/projectM-engine-backup/Expr.cpp create mode 100755 src/projectM-engine-backup/Expr.hpp create mode 100644 src/projectM-engine-backup/FindPkgConfig.cmake create mode 100755 src/projectM-engine-backup/Func.cpp create mode 100755 src/projectM-engine-backup/Func.hpp create mode 100755 src/projectM-engine-backup/InitCond.cpp create mode 100755 src/projectM-engine-backup/InitCond.hpp create mode 100644 src/projectM-engine-backup/InitCondUtils.hpp create mode 100755 src/projectM-engine-backup/Makefile.am create mode 100644 src/projectM-engine-backup/Makefile.dist create mode 100755 src/projectM-engine-backup/Makefile.in create mode 100755 src/projectM-engine-backup/PBuffer.cpp create mode 100755 src/projectM-engine-backup/PBuffer.hpp create mode 100755 src/projectM-engine-backup/PCM.cpp create mode 100755 src/projectM-engine-backup/PCM.hpp create mode 100755 src/projectM-engine-backup/Param.cpp create mode 100755 src/projectM-engine-backup/Param.hpp create mode 100644 src/projectM-engine-backup/ParamUtils.hpp create mode 100755 src/projectM-engine-backup/Parser.cpp create mode 100755 src/projectM-engine-backup/Parser.hpp create mode 100755 src/projectM-engine-backup/PerFrameEqn.cpp create mode 100755 src/projectM-engine-backup/PerFrameEqn.hpp create mode 100755 src/projectM-engine-backup/PerPixelEqn.cpp create mode 100755 src/projectM-engine-backup/PerPixelEqn.hpp create mode 100755 src/projectM-engine-backup/PerPointEqn.cpp create mode 100755 src/projectM-engine-backup/PerPointEqn.hpp create mode 100755 src/projectM-engine-backup/Preset.cpp create mode 100644 src/projectM-engine-backup/Preset.hpp create mode 100644 src/projectM-engine-backup/PresetChooser.cpp create mode 100644 src/projectM-engine-backup/PresetChooser.hpp create mode 100644 src/projectM-engine-backup/PresetFilters.hpp create mode 100644 src/projectM-engine-backup/PresetFrameIO.cpp create mode 100644 src/projectM-engine-backup/PresetFrameIO.hpp create mode 100644 src/projectM-engine-backup/PresetLoader.cpp create mode 100644 src/projectM-engine-backup/PresetLoader.hpp create mode 100644 src/projectM-engine-backup/Renderer.cpp create mode 100644 src/projectM-engine-backup/Renderer.hpp create mode 100644 src/projectM-engine-backup/SplayNode.hpp create mode 100644 src/projectM-engine-backup/StaticArray.hpp create mode 100755 src/projectM-engine-backup/browser.cpp create mode 100755 src/projectM-engine-backup/browser.h create mode 100755 src/projectM-engine-backup/carbontoprojectM.h create mode 100755 src/projectM-engine-backup/compare.h create mode 100644 src/projectM-engine-backup/config create mode 100755 src/projectM-engine-backup/console_interface.cpp create mode 100755 src/projectM-engine-backup/console_interface.h create mode 100755 src/projectM-engine-backup/dlldefs.h create mode 100755 src/projectM-engine-backup/editor.cpp create mode 100755 src/projectM-engine-backup/editor.h create mode 100755 src/projectM-engine-backup/event.h create mode 100755 src/projectM-engine-backup/fatal.h create mode 100755 src/projectM-engine-backup/fftsg.cpp create mode 100755 src/projectM-engine-backup/fftsg.h create mode 120000 src/projectM-engine-backup/fonts create mode 100755 src/projectM-engine-backup/glConsole.cpp create mode 100755 src/projectM-engine-backup/glConsole.h create mode 100755 src/projectM-engine-backup/libprojectM.dsp create mode 100755 src/projectM-engine-backup/libprojectM.ncb create mode 100755 src/projectM-engine-backup/libprojectM.opt create mode 100755 src/projectM-engine-backup/libprojectM.plg create mode 100755 src/projectM-engine-backup/libprojectM/Debug/libprojectM.pch create mode 100755 src/projectM-engine-backup/libprojectM/Debug/vc60.idb create mode 100755 src/projectM-engine-backup/libprojectM/Debug/vc60.pdb create mode 100755 src/projectM-engine-backup/libprojectM/libprojectM.plg create mode 100755 src/projectM-engine-backup/lvtoprojectM.h create mode 100755 src/projectM-engine-backup/menu.cpp create mode 100755 src/projectM-engine-backup/menu.h create mode 120000 src/projectM-engine-backup/presets create mode 100755 src/projectM-engine-backup/projectM.cpp create mode 100755 src/projectM-engine-backup/projectM.dsp create mode 100755 src/projectM-engine-backup/projectM.hpp create mode 100755 src/projectM-engine-backup/sdltoprojectM.h create mode 100755 src/projectM-engine-backup/timer.cpp create mode 100755 src/projectM-engine-backup/timer.h create mode 100755 src/projectM-engine-backup/win32-dirent.cpp create mode 100755 src/projectM-engine-backup/win32-dirent.h create mode 100755 src/projectM-engine-backup/wipemalloc.cpp create mode 100755 src/projectM-engine-backup/wipemalloc.h diff --git a/src/linux/projectmDev10.kdevelop b/src/linux/projectmDev10.kdevelop index 745e0e430..711f28a9e 100644 --- a/src/linux/projectmDev10.kdevelop +++ b/src/linux/projectmDev10.kdevelop @@ -1,8 +1,8 @@ - Carmelo Piccione, Peter Sperl - carmelo.piccione@gmail.com, psperl@gmail.com + Carmelo Piccione + carmelo.piccione@gmail.com 1 KDevCustomProject C++ @@ -10,24 +10,23 @@ projectmDev10 ../../ false - + - + kdevsubversion - custom - /usr/local/bin/xmms - + executable + /home/pete/personal/carm/dev-1.0 + - /home/carm/projects/projectM/dev-1.0 + /home/pete/personal/carm/dev-1.0 false false - true - true + false + false false - /home/carm/projects/dev-1.0/src/ *.java @@ -48,7 +47,7 @@ make - /home/carm/projects/dev-1.0/src + src 0 @@ -66,8 +65,8 @@ 0 false make - - + + default @@ -76,18 +75,17 @@ - - - - - + + + + + true false false - - true + false true 10 @@ -161,7 +159,7 @@ true false true - 150 + 300 400 250 false @@ -179,13 +177,9 @@ true true .; - true - true - true - true - + set m_,_ theValue @@ -197,7 +191,9 @@ true Vertical - + + automatic_%2Fhome%2Fpete%2Fpersonal%2Fcarm%2Fdev-1.0 + diff --git a/src/linux/projectmDev10.kdevses b/src/linux/projectmDev10.kdevses index adba10e62..fdae90158 100644 --- a/src/linux/projectmDev10.kdevses +++ b/src/linux/projectmDev10.kdevses @@ -1,139 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - + + + diff --git a/src/projectM-engine-backup/Algorithms.hpp b/src/projectM-engine-backup/Algorithms.hpp new file mode 100644 index 000000000..e7aed3712 --- /dev/null +++ b/src/projectM-engine-backup/Algorithms.hpp @@ -0,0 +1,50 @@ +#ifndef PROJECTM_ALGORITHMS_HPP +#define PROJECTM_ALGORITHMS_HPP + +namespace Algorithms +{ + + template + void traverse(Container & container) + { + + TraverseFunctor functor; + + for (typename Container::iterator pos = container.begin(); pos != container.end(); ++pos) + { + functor(pos->second); + } + + } + + + template + void traverse(Container & container, TraverseFunctor & functor) + { + + for (typename Container::iterator pos = container.begin(); pos != container.end(); ++pos) + { + functor(pos->second); + } + + } + + namespace TraverseFunctors + { + template + class DeleteFunctor + { + + public: + + void operator() (Data * data) + { + delete(data); + } + + }; + } + + +} +#endif diff --git a/src/projectM-engine-backup/BeatDetect.cpp b/src/projectM-engine-backup/BeatDetect.cpp new file mode 100755 index 000000000..fbfad1b28 --- /dev/null +++ b/src/projectM-engine-backup/BeatDetect.cpp @@ -0,0 +1,175 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * Takes sound data from wherever and returns beat detection values + * Uses statistical Energy-Based methods. Very simple + * + * Some stuff was taken from Frederic Patin's beat-detection article, + * you'll find it online + */ + +#include +#include + +#include "wipemalloc.h" + +#include "Common.hpp" +#include "projectM.hpp" +#include "BeatDetect.hpp" +#include "PCM.hpp" + +DLLEXPORT BeatDetect::BeatDetect() { + int x,y; + + this->vol_instant=0; + this->vol_history=0; + + for (y=0;y<80;y++) + { + this->vol_buffer[y]=0; + } + + this->beat_buffer_pos=0; + + for (x=0;x<32;x++) { + this->beat_instant[x]=0; + this->beat_history[x]=0; + this->beat_val[x]=1.0; + this->beat_att[x]=1.0; + this->beat_variance[x]=0; + for (y=0;y<80;y++) { + this->beat_buffer[x][y]=0; + } + } + + this->treb = 0; + this->mid = 0; + this->bass = 0; + this->bass_old = 0; + this->beat_sensitivity = 8.00; + this->treb_att = 0; + this->mid_att = 0; + this->bass_att = 0; + this->vol = 0; + + this->pcm = new PCM(); + } + +void BeatDetect::reset() { + this->treb = 0; + this->mid = 0; + this->bass = 0; + this->treb_att = 0; + this->mid_att = 0; + this->bass_att = 0; + } + +void BeatDetect::detectFromSamples() { + bass_old = bass; + bass=0;mid=0;treb=0; + + getBeatVals(pcm->pcmdataL,pcm->pcmdataR); + } + +void BeatDetect::getBeatVals( float *vdataL,float *vdataR ) { + + int linear=0; + int x,y; + float temp2=0; + + vol_instant=0; + for ( x=0;x<16;x++) + { + + beat_instant[x]=0; + for ( y=linear*2;y<(linear+8+x)*2;y++) + { + beat_instant[x]+=((vdataL[y]*vdataL[y])+(vdataR[y]*vdataR[y]))*(1.0/(8+x)); +// printf( "beat_instant[%d]: %f %f %f\n", x, beat_instant[x], vdataL[y], vdataR[y] ); + vol_instant+=((vdataL[y]*vdataL[y])+(vdataR[y]*vdataR[y]))*(1.0/512.0); + + } +//printf("1"); + linear=y/2; + beat_history[x]-=(beat_buffer[x][beat_buffer_pos])*.0125; + beat_buffer[x][beat_buffer_pos]=beat_instant[x]; + beat_history[x]+=(beat_instant[x])*.0125; + + beat_val[x]=(beat_instant[x])/(beat_history[x]); + + beat_att[x]+=(beat_instant[x])/(beat_history[x]); + +//printf("2\n"); + + } +//printf("b\n"); + vol_history-=(vol_buffer[beat_buffer_pos])*.0125; + vol_buffer[beat_buffer_pos]=vol_instant; + vol_history+=(vol_instant)*.0125; + + mid=0; + for(x=1;x<10;x++) + { + mid+=(beat_instant[x]); + temp2+=(beat_history[x]); + + } + + mid=mid/(1.5*temp2); + temp2=0; + treb=0; + for(x=10;x<16;x++) + { + treb+=(beat_instant[x]); + temp2+=(beat_history[x]); + } +//printf("c\n"); + treb=treb/(1.5*temp2); +// *vol=vol_instant/(1.5*vol_history); + vol=vol_instant/(1.5*vol_history); + + bass=(beat_instant[0])/(1.5*beat_history[0]); + + if ( isnan( treb ) ) { + treb = 0.0; + } + if ( isnan( mid ) ) { + mid = 0.0; + } + if ( isnan( bass ) ) { + bass = 0.0; + } + treb_att=.6 * treb_att + .4 * treb; + mid_att=.6 * mid_att + .4 * mid; + bass_att=.6 * bass_att + .4 * bass; + + DWRITE( "BeatDetect::getBeatVals: treb: %f\tmid: %f\tbass: %f\n", + treb, mid, bass ); + DWRITE( "BeatDetect::getBeatVals: treb_att: %f\tmid_att: %f\tbass_att: %f\n", + treb_att, mid_att, bass_att ); + + // *vol=(beat_instant[3])/(beat_history[3]); + beat_buffer_pos++; + if( beat_buffer_pos>79)beat_buffer_pos=0; + +} + + diff --git a/src/projectM-engine-backup/BeatDetect.hpp b/src/projectM-engine-backup/BeatDetect.hpp new file mode 100755 index 000000000..c43b9f8f1 --- /dev/null +++ b/src/projectM-engine-backup/BeatDetect.hpp @@ -0,0 +1,72 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Beat detection class. Takes decompressed sound buffers and returns + * various characteristics + * + * $Log$ + * + */ + +#ifndef _BEAT_DETECT_H +#define _BEAT_DETECT_H + +#include "projectM.hpp" +#include "PCM.hpp" + +class BeatDetect { +public: + /** Vars */ + float beat_buffer[32][80], + beat_instant[32], + beat_history[32]; + float beat_val[32], + beat_att[32], + beat_variance[32]; + int beat_buffer_pos; + float vol_buffer[80], + vol_instant, + vol_history; + + float treb ; + float mid ; + float bass ; + float bass_old ; + float beat_sensitivity; + float treb_att ; + float mid_att ; + float bass_att ; + float vol; + + PCM *pcm; + + /** Methods */ + DLLEXPORT BeatDetect(); + void initBeatDetect(); + void reset(); + void detectFromSamples(); + void getBeatVals( float *vdataL, float *vdataR); + void freeBeatDetect(); + }; + +#endif /** !_BEAT_DETECT_H */ diff --git a/src/projectM-engine-backup/BuiltinFuncs.cpp b/src/projectM-engine-backup/BuiltinFuncs.cpp new file mode 100644 index 000000000..80494efe9 --- /dev/null +++ b/src/projectM-engine-backup/BuiltinFuncs.cpp @@ -0,0 +1,166 @@ +// +// C++ Implementation: BuiltinFuncs +// +// Description: +// +// +// Author: Carmelo Piccione , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +/* Loads all builtin functions */ + + +/* Loads a builtin function */ +#include "BuiltinFuncs.hpp" +#include +#include "Algorithms.hpp" +#include + +using namespace Algorithms; + +std::map * BuiltinFuncs::builtin_func_tree = 0; + +int BuiltinFuncs::load_builtin_func(char * name, float (*func_ptr)(float*), int num_args) { + + Func * func; + int retval; + + /* Create new function */ + func = Func::create_func(name, func_ptr, num_args); + + if (func == NULL) + return PROJECTM_OUTOFMEM_ERROR; + + retval = insert_func( func ); + + return retval; + +} + + + +Func * BuiltinFuncs::find_func(char * name) { + + std::map::iterator pos = builtin_func_tree->find(std::string(name)); + + // Case: function not found, return null + if (pos == builtin_func_tree->end()) + return 0; + + // Case: function found, return a pointer to it + return pos->second; + +} + + + + +int BuiltinFuncs::load_all_builtin_func() { + + if (load_builtin_func("int", FuncWrappers::int_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("abs", FuncWrappers::abs_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("sin", FuncWrappers::sin_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("cos", FuncWrappers::cos_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("tan", FuncWrappers::tan_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("asin", FuncWrappers::asin_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("acos", FuncWrappers::acos_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("atan", FuncWrappers::atan_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("sqr", FuncWrappers::sqr_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("sqrt", FuncWrappers::sqrt_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("pow", FuncWrappers::pow_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("exp", FuncWrappers::exp_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("log", FuncWrappers::log_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("log10", FuncWrappers::log10_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("sign", FuncWrappers::sign_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("min", FuncWrappers::min_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("max", FuncWrappers::max_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("sigmoid", FuncWrappers::sigmoid_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("atan2", FuncWrappers::atan2_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("rand", FuncWrappers::rand_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("band", FuncWrappers::band_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("bor", FuncWrappers::bor_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("bnot", FuncWrappers::bnot_wrapper, 1) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("if", FuncWrappers::if_wrapper, 3) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("equal", FuncWrappers::equal_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("above", FuncWrappers::above_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("below", FuncWrappers::below_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("nchoosek", FuncWrappers::nchoosek_wrapper, 2) < 0) + return PROJECTM_ERROR; + if (load_builtin_func("fact", FuncWrappers::fact_wrapper, 1) < 0) + return PROJECTM_ERROR; + + return PROJECTM_SUCCESS; +} + + +/* Initialize the builtin function database. + Should only be necessary once */ +int BuiltinFuncs::init_builtin_func_db() { + int retval; + + builtin_func_tree = + new std::map(); + + if (builtin_func_tree == NULL) + return PROJECTM_OUTOFMEM_ERROR; + + retval = load_all_builtin_func(); + return PROJECTM_SUCCESS; +} + + + +/* Destroy the builtin function database. + Generally, do this on projectm exit */ +int BuiltinFuncs::destroy_builtin_func_db() { + +traverse >(*builtin_func_tree); +return PROJECTM_SUCCESS; +} + +/* Insert a function into the database */ +int BuiltinFuncs::insert_func( Func *func ) { + + std::pair::iterator, bool> inserteePair = + builtin_func_tree->insert(std::make_pair(std::string(func->name), func)); + + if (!inserteePair.second) { + std::cerr << "Failed to insert builtin function \"" << func->name << "\" into collection! Bailing..." << std::endl; + abort(); + + } + + return PROJECTM_SUCCESS; +} + + diff --git a/src/projectM-engine-backup/BuiltinFuncs.hpp b/src/projectM-engine-backup/BuiltinFuncs.hpp new file mode 100644 index 000000000..636e63cf5 --- /dev/null +++ b/src/projectM-engine-backup/BuiltinFuncs.hpp @@ -0,0 +1,232 @@ +// +// C++ Interface: BuiltinFuncs +// +// Description: +// +// +// Author: Carmelo Piccione , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef _BUILTIN_FUNCS_HPP +#define _BUILTIN_FUNCS_HPP + +#include "Common.hpp" +#include "Func.hpp" +#include +#include +#include +#include "projectM.hpp" +/* Wrappers for all the builtin functions + The arg_list pointer is a list of floats. Its + size is equal to the number of arguments the parameter + takes */ +class FuncWrappers { + +/* Values to optimize the sigmoid function */ +static const int R = 32767; +static const int RR = 65534; + +public: + +static inline float int_wrapper(float * arg_list) { + +return floor(arg_list[0]); + +} + + +static inline float sqr_wrapper(float * arg_list) { + +return pow(2, arg_list[0]); +} + + +static inline float sign_wrapper(float * arg_list) { + +return -arg_list[0]; +} + +static inline float min_wrapper(float * arg_list) { + +if (arg_list[0] > arg_list[1]) +return arg_list[1]; + +return arg_list[0]; +} + +static inline float max_wrapper(float * arg_list) { + +if (arg_list[0] > arg_list[1]) +return arg_list[0]; + +return arg_list[1]; +} + +/* consult your AI book */ +static inline float sigmoid_wrapper(float * arg_list) { +return (RR / (1 + exp( -(((float)(arg_list[0])) * arg_list[1]) / R) - R)); +} + + +static inline float bor_wrapper(float * arg_list) { + +return (float)((int)arg_list[0] || (int)arg_list[1]); +} + +static inline float band_wrapper(float * arg_list) { +return (float)((int)arg_list[0] && (int)arg_list[1]); +} + +static inline float bnot_wrapper(float * arg_list) { +return (float)(!(int)arg_list[0]); +} + +static inline float if_wrapper(float * arg_list) { + +if ((int)arg_list[0] == 0) +return arg_list[2]; +return arg_list[1]; +} + + +static inline float rand_wrapper(float * arg_list) { +float l=1; + +// printf("RAND ARG:(%d)\n", (int)arg_list[0]); +if ((int)arg_list[0] > 0) +l = (float)((rand()) % ((int)arg_list[0])); +//printf("VAL: %f\n", l); +return l; +} + +static inline float equal_wrapper(float * arg_list) { + return (arg_list[0] == arg_list[1]); +} + + +static inline float above_wrapper(float * arg_list) { + +return (arg_list[0] > arg_list[1]); +} + + +static inline float below_wrapper(float * arg_list) { + +return (arg_list[0] < arg_list[1]); +} + +static float sin_wrapper(float * arg_list) { + + assert(arg_list); +//return .5; +float d = sinf(*arg_list); +return d; +//return (sin (arg_list[0])); +} + + +static inline float cos_wrapper(float * arg_list) { +return (cos (arg_list[0])); +} + +static inline float tan_wrapper(float * arg_list) { +return (tan(arg_list[0])); +} + +static inline float asin_wrapper(float * arg_list) { +return (asin (arg_list[0])); +} + +static inline float acos_wrapper(float * arg_list) { +return (acos (arg_list[0])); +} + +static inline float atan_wrapper(float * arg_list) { +return (atan (arg_list[0])); +} + +static inline float atan2_wrapper(float * arg_list) { +return (atan2 (arg_list[0], arg_list[1])); +} + +static inline float pow_wrapper(float * arg_list) { +return (pow (arg_list[0], arg_list[1])); +} + +static inline float exp_wrapper(float * arg_list) { +return (exp(arg_list[0])); +} + +static inline float abs_wrapper(float * arg_list) { +return (fabs(arg_list[0])); +} + +static inline float log_wrapper(float* arg_list) { +return (log (arg_list[0])); +} + +static inline float log10_wrapper(float * arg_list) { +return (log10 (arg_list[0])); +} + +static inline float sqrt_wrapper(float * arg_list) { +return (sqrt (arg_list[0])); +} + + +static inline float nchoosek_wrapper(float * arg_list) { +unsigned long cnm = 1UL; +int i, f; +int n, m; + +n = (int)arg_list[0]; +m = (int)arg_list[1]; + +if (m*2 >n) m = n-m; +for (i=1 ; i <= m; n--, i++) +{ +if ((f=n) % i == 0) +f /= i; +else cnm /= i; +cnm *= f; +} +return (float)cnm; +} + + +static inline float fact_wrapper(float * arg_list) { + + +int result = 1; + +int n = (int)arg_list[0]; + +while (n > 1) { +result = result * n; +n--; +} +return (float)result; +} +}; + +#include +class BuiltinFuncs { + +public: + + static int init_builtin_func_db(); + static int destroy_builtin_func_db(); + static int load_all_builtin_func(); + static int load_builtin_func( char * name, float (*func_ptr)(float*), int num_args ); + + static int insert_func( Func *func ); + static int remove_func( Func *func ); + static Func *find_func( char *name ); +private: + static std::map * builtin_func_tree; +}; + +#endif diff --git a/src/projectM-engine-backup/BuiltinParams.cpp b/src/projectM-engine-backup/BuiltinParams.cpp new file mode 100644 index 000000000..fc5ee6d57 --- /dev/null +++ b/src/projectM-engine-backup/BuiltinParams.cpp @@ -0,0 +1,364 @@ + + +#include "BuiltinParams.hpp" +#include "projectM.hpp" +#include +#include "Algorithms.hpp" + +using namespace Algorithms; + +BuiltinParams::BuiltinParams() {} + +BuiltinParams::BuiltinParams(const PresetInputs & presetInputs, PresetOutputs & presetOutputs) +{ + + int ret; + if ((ret = init_builtin_param_db(presetInputs, presetOutputs)) != PROJECTM_SUCCESS) + { + throw ret; + } + +} + +BuiltinParams::~BuiltinParams() +{ + destroy_builtin_param_db(); +} + +/* Loads a float parameter into the builtin database */ +int BuiltinParams::load_builtin_param_float(char * name, void * engine_val, void * matrix, short int flags, + float init_val, float upper_bound, float lower_bound, char * alt_name) +{ + + Param * param = NULL; + CValue iv, ub, lb; + + iv.float_val = init_val; + ub.float_val = upper_bound; + lb.float_val = lower_bound; + + /* Create new parameter of type float */ + if (BUILTIN_PARAMS_DEBUG == 2) + { + printf("load_builtin_param_float: (name \"%s\") (alt_name = \"%s\") ", name, alt_name); + fflush(stdout); + } + + if ((param = new Param(name, P_TYPE_DOUBLE, flags, engine_val, matrix, iv, ub, lb)) == NULL) + { + return PROJECTM_OUTOFMEM_ERROR; + } + + if (BUILTIN_PARAMS_DEBUG == 2) + { + printf("created..."); + fflush(stdout); + } + + /* Insert the paremeter into the database */ + + if (insert_builtin_param( param ) < 0) + { + delete param; + return PROJECTM_ERROR; + } + + if (BUILTIN_PARAMS_DEBUG == 2) + { + printf("inserted..."); + fflush(stdout); + } + + /* If this parameter has an alternate name, insert it into the database as link */ + + if (alt_name != NULL) + { + insert_param_alt_name(param,alt_name); + + if (BUILTIN_PARAMS_DEBUG == 2) + { + printf("alt_name inserted..."); + fflush(stdout); + } + + + } + + if (BUILTIN_PARAMS_DEBUG == 2) printf("finished\n"); + + /* Finished, return success */ + return PROJECTM_SUCCESS; +} + + + +/* Destroy the builtin parameter database. + Generally, do this on projectm exit */ +int BuiltinParams::destroy_builtin_param_db() +{ + + Algorithms::traverse >(*builtin_param_tree); + delete builtin_param_tree; + builtin_param_tree = NULL; + return PROJECTM_SUCCESS; +} + + +/* Insert a parameter into the database with an alternate name */ +int BuiltinParams::insert_param_alt_name(Param *param, char * alt_name) +{ + + assert(alt_name); + + aliasMap.insert(std::make_pair(std::string(alt_name), std::string(param->name))); + + return PROJECTM_SUCCESS; +} + +Param * BuiltinParams::find_builtin_param(const std::string & name) +{ + + AliasMap::iterator pos = aliasMap.find(name); + Param * param = 0; + + if (pos == aliasMap.end()) + { + std::map::iterator builtinPos = builtin_param_tree->find(name); + + if (builtinPos != builtin_param_tree->end()) + param = builtinPos->second; + } + else + { + + std::map::iterator builtinPos = builtin_param_tree->find(pos->second); + + if (builtinPos != builtin_param_tree->end()) + param = builtinPos->second; + } + return param; +} + + +/* Loads a integer parameter into the builtin database */ +int BuiltinParams::load_builtin_param_int(char * name, void * engine_val, short int flags, + int init_val, int upper_bound, int lower_bound, char * alt_name) +{ + + Param * param; + CValue iv, ub, lb; + + iv.int_val = init_val; + ub.int_val = upper_bound; + lb.int_val = lower_bound; + + param = new Param(name, P_TYPE_INT, flags, engine_val, NULL, iv, ub, lb); + + if (param == NULL) + { + return PROJECTM_OUTOFMEM_ERROR; + } + + if (insert_builtin_param( param ) < 0) + { + delete param; + return PROJECTM_ERROR; + } + + if (alt_name != NULL) + { + insert_param_alt_name(param,alt_name); + } + + return PROJECTM_SUCCESS; + +} + +/* Loads a boolean parameter */ +int BuiltinParams::load_builtin_param_bool(char * name, void * engine_val, short int flags, + int init_val, char * alt_name) +{ + + Param * param; + CValue iv, ub, lb; + + iv.int_val = init_val; + ub.int_val = TRUE; + lb.int_val = FALSE; + + param = new Param(name, P_TYPE_BOOL, flags, engine_val, NULL, iv, ub, lb); + + if (param == NULL) + { + return PROJECTM_OUTOFMEM_ERROR; + } + + if (insert_builtin_param(param) < 0) + { + delete param; + return PROJECTM_ERROR; + } + + if (alt_name != NULL) + { + insert_param_alt_name(param,alt_name); + } + + return PROJECTM_SUCCESS; + +} + +/* Inserts a parameter into the builtin database */ +int BuiltinParams::insert_builtin_param( Param *param ) +{ + std::pair::iterator, bool> inserteePos = builtin_param_tree->insert(std::make_pair(param->name, param)); + + return inserteePos.second; +} + + + +/* Initialize the builtin parameter database. + Should only be necessary once */ +int BuiltinParams::init_builtin_param_db(const PresetInputs & presetInputs, PresetOutputs & presetOutputs) +{ + + /* Create the builtin parameter splay tree (go Sleator...) */ + if ((this->builtin_param_tree = new std::map()) == NULL) + { + if (BUILTIN_PARAMS_DEBUG) printf("init_builtin_param_db: failed to initialize database (FATAL)\n"); + return PROJECTM_OUTOFMEM_ERROR; + } + + if (BUILTIN_PARAMS_DEBUG) + { + printf("init_builtin_param: loading database..."); + fflush(stdout); + } + + /* Loads all builtin parameters into the database */ + if (load_all_builtin_param(presetInputs, presetOutputs) < 0) + { + if (BUILTIN_PARAMS_DEBUG) printf("failed loading builtin parameters (FATAL)\n"); + return PROJECTM_ERROR; + } + + if (BUILTIN_PARAMS_DEBUG) printf("success!\n"); + + /* Finished, no errors */ + return PROJECTM_SUCCESS; +} + + + +/* Loads all builtin parameters, limits are also defined here */ +int BuiltinParams::load_all_builtin_param(const PresetInputs & presetInputs, PresetOutputs & presetOutputs) +{ + + load_builtin_param_float("fRating", (void*)&presetOutputs.fRating, NULL, P_FLAG_NONE, 0.0 , 5.0, 0.0, NULL); + load_builtin_param_float("fWaveScale", (void*)&presetOutputs.fWaveScale, NULL, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("gamma", (void*)&presetOutputs.fGammaAdj, NULL, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, "fGammaAdj"); + load_builtin_param_float("echo_zoom", (void*)&presetOutputs.fVideoEchoZoom, NULL, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, "fVideoEchoZoom"); + load_builtin_param_float("echo_alpha", (void*)&presetOutputs.fVideoEchoAlpha, NULL, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, "fVideoEchoAlpha"); + load_builtin_param_float("wave_a", (void*)&presetOutputs.fWaveAlpha, NULL, P_FLAG_NONE, 0.0, 1.0, 0, "fWaveAlpha"); + load_builtin_param_float("fWaveSmoothing", (void*)&presetOutputs.fWaveSmoothing, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, NULL); + load_builtin_param_float("fModWaveAlphaStart", (void*)&presetOutputs.fModWaveAlphaStart, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, NULL); + load_builtin_param_float("fModWaveAlphaEnd", (void*)&presetOutputs.fModWaveAlphaEnd, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, NULL); + load_builtin_param_float("fWarpAnimSpeed", (void*)&presetOutputs.fWarpAnimSpeed, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, NULL); + // load_builtin_param_float("warp", (void*)&presetOutputs.warp, warp_mesh, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, NULL); + + load_builtin_param_float("fShader", (void*)&presetOutputs.fShader, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, NULL); + load_builtin_param_float("decay", (void*)&presetOutputs.decay, NULL, P_FLAG_NONE, 0.0, 1.0, 0, "fDecay"); + + load_builtin_param_int("echo_orient", (void*)&presetOutputs.nVideoEchoOrientation, P_FLAG_NONE, 0, 3, 0, "nVideoEchoOrientation"); + load_builtin_param_int("wave_mode", (void*)&presetOutputs.nWaveMode, P_FLAG_NONE, 0, 7, 0, "nWaveMode"); + + load_builtin_param_bool("wave_additive", (void*)&presetOutputs.bAdditiveWaves, P_FLAG_NONE, FALSE, "bAdditiveWaves"); + load_builtin_param_bool("bModWaveAlphaByVolume", (void*)&presetOutputs.bModWaveAlphaByVolume, P_FLAG_NONE, FALSE, NULL); + load_builtin_param_bool("wave_brighten", (void*)&presetOutputs.bMaximizeWaveColor, P_FLAG_NONE, FALSE, "bMaximizeWaveColor"); + load_builtin_param_bool("wrap", (void*)&presetOutputs.bTexWrap, P_FLAG_NONE, FALSE, "bTexWrap"); + load_builtin_param_bool("darken_center", (void*)&presetOutputs.bDarkenCenter, P_FLAG_NONE, FALSE, "bDarkenCenter"); + load_builtin_param_bool("bRedBlueStereo", (void*)&presetOutputs.bRedBlueStereo, P_FLAG_NONE, FALSE, NULL); + load_builtin_param_bool("brighten", (void*)&presetOutputs.bBrighten, P_FLAG_NONE, FALSE, "bBrighten"); + load_builtin_param_bool("darken", (void*)&presetOutputs.bDarken, P_FLAG_NONE, FALSE, "bDarken"); + load_builtin_param_bool("solarize", (void*)&presetOutputs.bSolarize, P_FLAG_NONE, FALSE, "bSolarize"); + load_builtin_param_bool("invert", (void*)&presetOutputs.bInvert, P_FLAG_NONE, FALSE, "bInvert"); + load_builtin_param_bool("bMotionVectorsOn", (void*)&presetOutputs.bMotionVectorsOn, P_FLAG_NONE, FALSE, NULL); + load_builtin_param_bool("wave_dots", (void*)&presetOutputs.bWaveDots, P_FLAG_NONE, FALSE, "bWaveDots"); + load_builtin_param_bool("wave_thick", (void*)&presetOutputs.bWaveThick, P_FLAG_NONE, FALSE, "bWaveThick"); + + load_builtin_param_float("zoom", (void*)&presetOutputs.zoom, presetOutputs.zoom_mesh, P_FLAG_PER_PIXEL |P_FLAG_DONT_FREE_MATRIX, 0.0, MAX_DOUBLE_SIZE, 0, NULL); + load_builtin_param_float("rot", (void*)&presetOutputs.rot, presetOutputs.rot_mesh, P_FLAG_PER_PIXEL |P_FLAG_DONT_FREE_MATRIX, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, NULL); + load_builtin_param_float("zoomexp", (void*)&presetOutputs.zoomexp, presetOutputs.zoomexp_mesh, P_FLAG_PER_PIXEL |P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, "fZoomExponent"); + + load_builtin_param_float("cx", (void*)&presetOutputs.cx, presetOutputs.cx_mesh, P_FLAG_PER_PIXEL | P_FLAG_DONT_FREE_MATRIX, 0.0, 1.0, 0, NULL); + load_builtin_param_float("cy", (void*)&presetOutputs.cy, presetOutputs.cy_mesh, P_FLAG_PER_PIXEL | P_FLAG_DONT_FREE_MATRIX, 0.0, 1.0, 0, NULL); + load_builtin_param_float("dx", (void*)&presetOutputs.dx, presetOutputs.dx_mesh, P_FLAG_PER_PIXEL | P_FLAG_DONT_FREE_MATRIX, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, NULL); + load_builtin_param_float("dy", (void*)&presetOutputs.dy, presetOutputs.dy_mesh, P_FLAG_PER_PIXEL |P_FLAG_DONT_FREE_MATRIX, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, NULL); + load_builtin_param_float("sx", (void*)&presetOutputs.sx, presetOutputs.sx_mesh, P_FLAG_PER_PIXEL |P_FLAG_DONT_FREE_MATRIX, 0.0, MAX_DOUBLE_SIZE, 0, NULL); + load_builtin_param_float("sy", (void*)&presetOutputs.sy, presetOutputs.sy_mesh, P_FLAG_PER_PIXEL |P_FLAG_DONT_FREE_MATRIX, 0.0, MAX_DOUBLE_SIZE, 0, NULL); + + load_builtin_param_float("wave_r", (void*)&presetOutputs.wave_r, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("wave_g", (void*)&presetOutputs.wave_g, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("wave_b", (void*)&presetOutputs.wave_b, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("wave_x", (void*)&presetOutputs.wave_x, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("wave_y", (void*)&presetOutputs.wave_y, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("wave_mystery", (void*)&presetOutputs.wave_mystery, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "fWaveParam"); + + load_builtin_param_float("ob_size", (void*)&presetOutputs.ob_size, NULL, P_FLAG_NONE, 0.0, 0.5, 0, NULL); + load_builtin_param_float("ob_r", (void*)&presetOutputs.ob_r, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("ob_g", (void*)&presetOutputs.ob_g, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("ob_b", (void*)&presetOutputs.ob_b, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("ob_a", (void*)&presetOutputs.ob_a, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + + load_builtin_param_float("ib_size", (void*)&presetOutputs.ib_size, NULL,P_FLAG_NONE, 0.0, .5, 0.0, NULL); + load_builtin_param_float("ib_r", (void*)&presetOutputs.ib_r, NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("ib_g", (void*)&presetOutputs.ib_g, NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("ib_b", (void*)&presetOutputs.ib_b, NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("ib_a", (void*)&presetOutputs.ib_a, NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + + load_builtin_param_float("mv_r", (void*)&presetOutputs.mv_r, NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("mv_g", (void*)&presetOutputs.mv_g, NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("mv_b", (void*)&presetOutputs.mv_b, NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + load_builtin_param_float("mv_x", (void*)&presetOutputs.mv_x, NULL,P_FLAG_NONE, 0.0, 64.0, 0.0, "nMotionVectorsX"); + load_builtin_param_float("mv_y", (void*)&presetOutputs.mv_y, NULL,P_FLAG_NONE, 0.0, 48.0, 0.0, "nMotionVectorsY"); + load_builtin_param_float("mv_l", (void*)&presetOutputs.mv_l, NULL,P_FLAG_NONE, 0.0, 5.0, 0.0, NULL); + load_builtin_param_float("mv_dy", (void*)&presetOutputs.mv_dy, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, NULL); + load_builtin_param_float("mv_dx", (void*)&presetOutputs.mv_dx, NULL,P_FLAG_NONE, 0.0, 1.0, -1.0, NULL); + load_builtin_param_float("mv_a", (void*)&presetOutputs.mv_a, NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, NULL); + + load_builtin_param_float("time", (void*)&presetInputs.time, NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0.0, NULL); + load_builtin_param_float("bass", (void*)&presetInputs.bass, NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0.0, NULL); + load_builtin_param_float("mid", (void*)&presetInputs.mid, NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, NULL); + load_builtin_param_float("bass_att", (void*)&presetInputs.bass_att, NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, NULL); + load_builtin_param_float("mid_att", (void*)&presetInputs.mid_att, NULL, P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, NULL); + load_builtin_param_float("treb_att", (void*)&presetInputs.treb_att, NULL, P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, NULL); + load_builtin_param_int("frame", (void*)&presetInputs.frame, P_FLAG_READONLY, 0, MAX_INT_SIZE, 0, NULL); + load_builtin_param_float("progress", (void*)&presetInputs.progress, NULL,P_FLAG_READONLY, 0.0, 1, 0, NULL); + load_builtin_param_int("fps", (void*)&presetInputs.fps, P_FLAG_READONLY, 15, MAX_INT_SIZE, 0, NULL); + + load_builtin_param_float("x", (void*)&presetInputs.x_per_pixel, presetInputs.x_mesh, P_FLAG_PER_PIXEL |P_FLAG_ALWAYS_MATRIX | P_FLAG_READONLY | P_FLAG_DONT_FREE_MATRIX, + 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("y", (void*)&presetInputs.y_per_pixel, presetInputs.y_mesh, P_FLAG_PER_PIXEL |P_FLAG_ALWAYS_MATRIX |P_FLAG_READONLY | P_FLAG_DONT_FREE_MATRIX, + 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("ang", (void*)&presetInputs.ang_per_pixel, presetInputs.theta_mesh, P_FLAG_PER_PIXEL |P_FLAG_ALWAYS_MATRIX | P_FLAG_READONLY | P_FLAG_DONT_FREE_MATRIX, + 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("rad", (void*)&presetInputs.rad_per_pixel, presetInputs.rad_mesh, P_FLAG_PER_PIXEL |P_FLAG_ALWAYS_MATRIX | P_FLAG_READONLY | P_FLAG_DONT_FREE_MATRIX, + 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + + load_builtin_param_float("q1", (void*)&presetOutputs.q1, NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("q2", (void*)&presetOutputs.q2, NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("q3", (void*)&presetOutputs.q3, NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("q4", (void*)&presetOutputs.q4, NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("q5", (void*)&presetOutputs.q5, NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("q6", (void*)&presetOutputs.q6, NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("q7", (void*)&presetOutputs.q7, NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + load_builtin_param_float("q8", (void*)&presetOutputs.q8, NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, NULL); + + /* variables added in 1.04 */ + load_builtin_param_int("meshx", (void*)&presetInputs.gx, P_FLAG_READONLY, 32, 96, 8, NULL); + load_builtin_param_int("meshy", (void*)&presetInputs.gy, P_FLAG_READONLY, 24, 72, 6, NULL); + + return PROJECTM_SUCCESS; + +} diff --git a/src/projectM-engine-backup/BuiltinParams.hpp b/src/projectM-engine-backup/BuiltinParams.hpp new file mode 100644 index 000000000..b3fc3997f --- /dev/null +++ b/src/projectM-engine-backup/BuiltinParams.hpp @@ -0,0 +1,85 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + + +/** BuiltinParams.hpp :: a class to encapsulate and centralize + * all projectm builtin parameter methods and state. Used primarily + * by preset class +**/ +#ifndef _BUILTIN_PARAMS_HPP +#define _BUILTIN_PARAMS_HPP + +#include +#include "PresetFrameIO.hpp" +#include "Param.hpp" +#include +#include "Algorithms.hpp" + +class BuiltinParams { + +public: + typedef std::map AliasMap; + + /** Default constructor leaves database in an uninitialized state. */ + BuiltinParams(); + + /** Construct a new builtin parameter database with variables references given by + * the preset input and output structures */ + BuiltinParams(const PresetInputs & presetInputs, PresetOutputs & presetOutputs); + + ~BuiltinParams(); + + /** Param database initalizer / destructor functions */ + int init_builtin_param_db(const PresetInputs & presetInputs, PresetOutputs & presetOutputs); + int load_all_builtin_param(const PresetInputs & presetInputs, PresetOutputs & presetOutputs); + int destroy_builtin_param_db(); + + int insert_param_alt_name( Param *param, char *alt_name ); + Param *find_builtin_param( const std::string & name ); + int load_builtin_param_float( char *name, void *engine_val, void *matrix, + short int flags, + float init_val, float upper_bound, + float lower_bound, char *alt_name ); + int load_builtin_param_int( char *name, void *engine_val, short int flags, + int init_val, int upper_bound, + int lower_bound, char *alt_name ); + int load_builtin_param_bool( char *name, void *engine_val, short int flags, + int init_val, char *alt_name ); + int insert_builtin_param( Param *param ); + + template + void traverse(Fun & fun) { + Algorithms::traverse(*builtin_param_tree, fun); + } + + + void traverse(void (*func_ptr)(void*)); + +private: + static const bool BUILTIN_PARAMS_DEBUG = false; + + // Used to associate multiple string names to one parameter + AliasMap aliasMap; + + // Internal datastructure to store the parameters + std::map * builtin_param_tree; +}; +#endif diff --git a/src/projectM-engine-backup/CMakeLists.txt b/src/projectM-engine-backup/CMakeLists.txt new file mode 100644 index 000000000..8afd95f54 --- /dev/null +++ b/src/projectM-engine-backup/CMakeLists.txt @@ -0,0 +1,33 @@ +PROJECT(projectM) +ADD_LIBRARY(projectM SHARED projectM.cpp projectM.hpp PBuffer.cpp PBuffer.hpp InitCond.cpp InitCond.hpp + Expr.cpp PCM.cpp Parser.cpp Preset.cpp Common.hpp BeatDetect.cpp PCM.hpp PerPixelEqn.cpp Eval.hpp +Param.cpp CustomWave.cpp CustomShape.hpp CustomShape.cpp Param.hpp CustomWave.hpp BeatDetect.hpp menu.cpp console_interface.h +Func.hpp Func.cpp Eval.cpp wipemalloc.h browser.cpp PerFrameEqn.cpp PerPointEqn.cpp editor.cpp fftsg.cpp glConsole.cpp console_interface.cpp +CValue.hpp Expr.hpp timer.cpp wipemalloc.cpp PerFrameEqn.hpp PerPixelEqn.hpp PerPointEqn.hpp browser.h BuiltinFuncs.hpp +BuiltinFuncs.cpp compare.h editor.h event.h fatal.h fftsg.h glConsole.h menu.h timer.h SplayNode.hpp BuiltinParams.hpp BuiltinParams.cpp Preset.hpp Renderer.cpp Renderer.hpp ParamUtils.hpp PresetLoader.cpp PresetLoader.hpp PresetChooser.hpp PresetChooser.cpp PresetFrameIO.cpp PresetFrameIO.hpp) + +OPTION(USE_FTGL "Use FTGL for on-screen fonts" ON) + +ADD_DEFINITIONS(-DLINUX -DUSE_FBO) + +FIND_PACKAGE(OpenGL) + +INCLUDE(FindPkgConfig.cmake) + +TARGET_LINK_LIBRARIES(projectM GLEW m) + +IF(USE_FTGL) + pkg_search_module (FTGL ftgl) + ADD_DEFINITIONS(-DUSE_FTGL) + INCLUDE_DIRECTORIES(${FTGL_INCLUDE_DIRS}) + LINK_DIRECTORIES(${FTGL_LIBRARY_DIRS}) + TARGET_LINK_LIBRARIES(projectM GLEW m ftgl) +ENDIF(USE_FTGL) + +INSTALL(TARGETS projectM DESTINATION lib) +INSTALL(FILES projectM.hpp PBuffer.hpp PCM.hpp BeatDetect.hpp Preset.hpp event.h console_interface.h dlldefs.h fatal.h PresetFrameIO.hpp PCM.hpp Renderer.hpp PresetChooser.hpp DESTINATION include/libprojectM) +INSTALL(FILES config DESTINATION share/projectM) +FILE(GLOB presets "presets/*.milk") +INSTALL(FILES ${presets} DESTINATION share/projectM/presets) +FILE(GLOB fonts "fonts/*.ttf") +INSTALL(FILES ${fonts} DESTINATION share/projectM/fonts) diff --git a/src/projectM-engine-backup/CValue.hpp b/src/projectM-engine-backup/CValue.hpp new file mode 100755 index 000000000..bc55e11f7 --- /dev/null +++ b/src/projectM-engine-backup/CValue.hpp @@ -0,0 +1,38 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Value + * + * $Log$ + */ + +#ifndef _CVALUE_H +#define _CVALUE_H + +typedef union CValue_t { + int bool_val; + int int_val; + float float_val; + } CValue; + +#endif /** _CVALUE_H */ diff --git a/src/projectM-engine-backup/Common.hpp b/src/projectM-engine-backup/Common.hpp new file mode 100755 index 000000000..849703ec6 --- /dev/null +++ b/src/projectM-engine-backup/Common.hpp @@ -0,0 +1,98 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * $Log$ + */ + +#ifndef COMMON_H +#define COMMON_H + +#include + +#ifdef _MSC_VER +# define strcasecmp(s, t) _strcmpi(s, t) +#endif + +#ifdef DEBUG +extern FILE *debugFile; +#endif + +#ifdef MACOS +#include +extern FILE *fmemopen(void *buf, size_t len, const char *pMode); +#endif /** MACOS */ + +#include "dlldefs.h" + +#define DEFAULT_FONT_PATH "/home/carm/fonts/courier1.glf" +#define MAX_TOKEN_SIZE 512 +#define MAX_PATH_SIZE 4096 + +#define STRING_BUFFER_SIZE 1024*150 +#define STRING_LINE_SIZE 1024 + +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + + +#define MAX_DOUBLE_SIZE 10000000.0 +#define MIN_DOUBLE_SIZE -10000000.0 + +#define MAX_INT_SIZE 10000000 +#define MIN_INT_SIZE -10000000 + +/* default float initial value */ +#define DEFAULT_DOUBLE_IV 0.0 + +/* default float lower bound */ +#define DEFAULT_DOUBLE_LB MIN_DOUBLE_SIZE + +/* default float upper bound */ +#define DEFAULT_DOUBLE_UB MAX_DOUBLE_SIZE + +#ifdef WIN32 +#include +#define isnan _isnan#endif /** WIN32 */ +#endif /** WIN32 */ + +inline void DWRITE( char *fmt, ... ) { + va_list args; + va_start( args, fmt ); +//#ifdef DEBUG +//#ifdef MACOS + // if ( debugFile != NULL ) {\ + vprintf(fmt, args ); + // fflush( debugFile );\ + // } else {\ + // printf( fmt, args );\ + // } +//#endif +//#endif + va_end( args ); + } + +#endif diff --git a/src/projectM-engine-backup/CustomShape.cpp b/src/projectM-engine-backup/CustomShape.cpp new file mode 100755 index 000000000..507786640 --- /dev/null +++ b/src/projectM-engine-backup/CustomShape.cpp @@ -0,0 +1,227 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include +#include +#include + +#include "Common.hpp" +#include "fatal.h" + +#include "CustomShape.hpp" +#include "Eval.hpp" +#include "Expr.hpp" +#include "InitCond.hpp" +#include "Param.hpp" +#include "PerFrameEqn.hpp" +#include "Preset.hpp" +#include +#include "ParamUtils.hpp" +#include "InitCondUtils.hpp" +#include "wipemalloc.h" +#include "Algorithms.hpp" + + +using namespace Algorithms; + +void eval_custom_shape_init_conds(CustomShape * custom_shape); +void load_unspec_init_cond_shape(Param * param); + + +CustomShape::CustomShape( int id ) { + + Param * param; + + this->id = id; + this->per_frame_count = 0; + this->per_frame_eqn_string_index = 0; + this->per_frame_init_eqn_string_index = 0; + + /* Initialize tree data structures */ + this->param_tree = new + std::map(); + + this->per_frame_eqn_tree = + std::map(); + + this->init_cond_tree = + std::map(); + + this->per_frame_init_eqn_tree = + std::map(); + + /* Start: Load custom shape parameters */ + param = Param::new_param_float("r", P_FLAG_NONE, &this->r, NULL, 1.0, 0.0, 0.5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("g", P_FLAG_NONE, &this->g, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("b", P_FLAG_NONE, &this->b, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("a", P_FLAG_NONE, &this->a, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("border_r", P_FLAG_NONE, &this->border_r, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("border_g", P_FLAG_NONE, &this->border_g, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("border_b", P_FLAG_NONE, &this->border_b, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("border_a", P_FLAG_NONE, &this->border_a, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("r2", P_FLAG_NONE, &this->r2, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("g2", P_FLAG_NONE, &this->g2, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("b2", P_FLAG_NONE, &this->b2, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("a2", P_FLAG_NONE, &this->a2, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("x", P_FLAG_NONE, &this->x, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("y", P_FLAG_NONE, &this->y, NULL, 1.0, 0.0, .5); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_bool("thickOutline", P_FLAG_NONE, &this->thickOutline, 1, 0, 0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_bool("enabled", P_FLAG_NONE, &this->enabled, 1, 0, 0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_int("sides", P_FLAG_NONE, &this->sides, 100, 3, 3); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_bool("additive", P_FLAG_NONE, &this->additive, 1, 0, 0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_bool("textured", P_FLAG_NONE, &this->textured, 1, 0, 0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("rad", P_FLAG_NONE, &this->radius, NULL, MAX_DOUBLE_SIZE, 0, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("ang", P_FLAG_NONE, &this->ang, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("tex_zoom", P_FLAG_NONE, &this->tex_zoom, NULL, MAX_DOUBLE_SIZE, .00000000001, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("tex_ang", P_FLAG_NONE, &this->tex_ang, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("t1", P_FLAG_TVAR, &this->t1, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("t2", P_FLAG_TVAR, &this->t2, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("t3", P_FLAG_TVAR, &this->t3, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("t4", P_FLAG_TVAR, &this->t4, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("t5", P_FLAG_TVAR, &this->t5, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("t6", P_FLAG_TVAR, &this->t6, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("t7", P_FLAG_TVAR, &this->t7, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + param = Param::new_param_float("t8", P_FLAG_TVAR, &this->t8, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0); + if ( ParamUtils::insert(param, this->param_tree) < 0 ) { + DWRITE( "%s\n", "failed to insert param!" ); + } + } + +/* Frees a custom shape form object */ +CustomShape::~CustomShape() { + + if (param_tree == NULL) + return; + + traverse >(per_frame_eqn_tree); + traverse >(init_cond_tree); + traverse >(*param_tree); + traverse >(per_frame_init_eqn_tree); + + return; + +} + +void CustomShape::load_custom_shape_init() { + + // NOTE: This is verified to be same behavior as trunk + + InitCondUtils::LoadUnspecInitCond fun(this->init_cond_tree, this->per_frame_init_eqn_tree); + + traverse(*param_tree, fun); +} + +void CustomShape::eval_custom_shape_init_conds() { + + // NOTE: This is verified to be same behavior as trunk + for (std::map::iterator pos = per_frame_init_eqn_tree.begin(); pos != per_frame_init_eqn_tree.end();++pos) + pos->second->evaluate(); +} diff --git a/src/projectM-engine-backup/CustomShape.hpp b/src/projectM-engine-backup/CustomShape.hpp new file mode 100755 index 000000000..d8dca4256 --- /dev/null +++ b/src/projectM-engine-backup/CustomShape.hpp @@ -0,0 +1,117 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Encapsulation of a custom shape + * + * $Log$ + */ + +#ifndef _CUSTOM_SHAPE_H +#define _CUSTOM_SHAPE_H + +#define CUSTOM_SHAPE_DEBUG 0 +#include +#include "Param.hpp" +#include "PerFrameEqn.hpp" +#include "InitCond.hpp" + +class Preset; + + +class CustomShape { +public: + /* Numerical id */ + int id; + int per_frame_count; + + /* Parameter tree associated with this custom shape */ + std::map * param_tree; + + /* Engine variables */ + int sides; + int thickOutline; + int enabled; + int additive; + int textured; + + float tex_zoom; + float tex_ang; + + float x; /* x position for per point equations */ + float y; /* y position for per point equations */ + float radius; + float ang; + + float r; /* red color value */ + float g; /* green color value */ + float b; /* blue color value */ + float a; /* alpha color value */ + + float r2; /* red color value */ + float g2; /* green color value */ + float b2; /* blue color value */ + float a2; /* alpha color value */ + + float border_r; /* red color value */ + float border_g; /* green color value */ + float border_b; /* blue color value */ + float border_a; /* alpha color value */ + + /* stupid t variables */ + float t1; + float t2; + float t3; + float t4; + float t5; + float t6; + float t7; + float t8; + + /* Data structure to hold per frame / per frame init equations */ + std::map init_cond_tree; + std::map per_frame_eqn_tree; + std::map per_frame_init_eqn_tree; + + /* Denotes the index of the last character for each stdring buffer */ + int per_frame_eqn_string_index; + int per_frame_init_eqn_string_index; + + + /* String buffers for per frame / per frame init equations */ + char per_frame_eqn_string_buffer[STRING_BUFFER_SIZE]; + char per_frame_init_eqn_string_buffer[STRING_BUFFER_SIZE]; + + /* Per point equation array */ + CustomShape( int id ); + ~CustomShape(); + + /** Checks all internal trees are built correctly */ + int checkTrees(); + + void load_custom_shape_init(); + void eval_custom_shape_init_conds(); + }; + + +#endif /** !_CUSTOM_SHAPE_H */ + diff --git a/src/projectM-engine-backup/CustomWave.cpp b/src/projectM-engine-backup/CustomWave.cpp new file mode 100755 index 000000000..8b497a50a --- /dev/null +++ b/src/projectM-engine-backup/CustomWave.cpp @@ -0,0 +1,530 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include +#include +#include + +#include "projectM.hpp" + +#include "Common.hpp" +#include "fatal.h" + +#include "CustomWave.hpp" +#include "Eval.hpp" +#include "Expr.hpp" +#include "InitCond.hpp" +#include "Param.hpp" +#include "PerFrameEqn.hpp" +#include "PerPointEqn.hpp" +#include "Preset.hpp" +#include +#include "ParamUtils.hpp" +#include "InitCondUtils.hpp" +#include "wipemalloc.h" + +#define MAX_SAMPLE_SIZE 4096 + + +int interface_id = 0; + +CustomWave::CustomWave(int _id): + id(_id), + per_frame_count(0), + samples(512), + bSpectrum(0), + sep(1), + smoothing(0.0), + bUseDots(0), + bAdditive(0), + r(0), + g(0), + b(0), + a(0), + scaling(1.0), + per_frame_eqn_string_index(0), + per_frame_init_eqn_string_index(0), + per_point_eqn_string_index(0) +{ + + Param * param; + + /// @bug deprecate the use of wipemalloc + this->r_mesh = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + this->g_mesh = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + this->b_mesh = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + this->a_mesh = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + this->x_mesh = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + this->y_mesh = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + this->value1 = (float*) wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + this->value2 = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + this->sample_mesh = (float*)wipemalloc(MAX_SAMPLE_SIZE*sizeof(float)); + + + /* Start: Load custom wave parameters */ + + if ((param = Param::new_param_float("r", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->r, this->r_mesh, 1.0, 0.0, .5)) == NULL) { + delete(this); + /// @bug make exception + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + /// @bug make exception + abort(); + } + + if ((param = Param::new_param_float("g", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->g, this->g_mesh, 1.0, 0.0, .5)) == NULL){ + delete(this); +/// @bug make exception + abort(); + + } + + if (ParamUtils::insert(param, param_tree) < 0) { + delete(this); +/// @bug make exception + abort(); + } + + if ((param = Param::new_param_float("b", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->b, this->b_mesh, 1.0, 0.0, .5)) == NULL){ + delete(this); +/// @bug make exception + abort(); + + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); +/// @bug make exception + abort(); + + } + + if ((param = Param::new_param_float("a", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->a, this->a_mesh, 1.0, 0.0, .5)) == NULL){ + delete(this); +/// @bug make exception + abort(); + + + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); +/// @bug make exception + abort(); + + } + + if ((param = Param::new_param_float("x", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->x, this->x_mesh, 1.0, 0.0, .5)) == NULL) { + delete(this); +/// @bug make exception + abort(); + + + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); +/// @bug make exception + abort(); + + } + + if ((param = Param::new_param_float("y", P_FLAG_DONT_FREE_MATRIX | P_FLAG_PER_POINT, &this->y, this->y_mesh, 1.0, 0.0, .5)) == NULL) { + delete(this); +/// @bug make exception + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + +/// @bug make exception + abort(); + + } + + if ((param = Param::new_param_bool("enabled", P_FLAG_NONE, &this->enabled, 1, 0, 0)) == NULL) { + delete(this); +/// @bug make exception + abort(); + + + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + +/// @bug make exception + abort(); + + } + + if ((param = Param::new_param_int("sep", P_FLAG_NONE, &this->sep, 100, -100, 0)) == NULL) { + delete(this); +/// @bug make exception + abort(); + + + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); +/// @bug make exception + abort(); + + + } + + if ((param = Param::new_param_bool("bSpectrum", P_FLAG_NONE, &this->bSpectrum, 1, 0, 0)) == NULL) { + delete(this); +/// @bug make exception + abort(); + + + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); +/// @bug make exception + abort(); + + } + + if ((param = Param::new_param_bool("bDrawThick", P_FLAG_NONE, &this->bDrawThick, 1, 0, 0)) == NULL) { + delete(this); +/// @bug make exception + abort(); + + + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); +/// @bug make exception + abort(); + + } + + if ((param = Param::new_param_bool("bUseDots", P_FLAG_NONE, &this->bUseDots, 1, 0, 0)) == NULL) { + delete(this); +/// @bug make exception + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_bool("bAdditive", P_FLAG_NONE, &this->bAdditive, 1, 0, 0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_int("samples", P_FLAG_NONE, &this->samples, 2048, 1, 512)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_float("sample", P_FLAG_READONLY | P_FLAG_DONT_FREE_MATRIX | P_FLAG_ALWAYS_MATRIX | P_FLAG_PER_POINT, + &this->sample, this->sample_mesh, 1.0, 0.0, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + printf("failed to insert sample\n"); + delete(this); + abort(); + } + + if ((param = Param::new_param_float("value1", P_FLAG_READONLY | P_FLAG_DONT_FREE_MATRIX | P_FLAG_ALWAYS_MATRIX | P_FLAG_PER_POINT, &this->v1, this->value1, 1.0, -1.0, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_float("value2", P_FLAG_READONLY | P_FLAG_DONT_FREE_MATRIX | P_FLAG_ALWAYS_MATRIX | P_FLAG_PER_POINT, &this->v2, this->value2, 1.0, -1.0, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_float("smoothing", P_FLAG_NONE, &this->smoothing, NULL, 1.0, 0.0, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_float("scaling", P_FLAG_NONE, &this->scaling, NULL, MAX_DOUBLE_SIZE, 0.0, 1.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_float("t1", P_FLAG_PER_POINT | P_FLAG_TVAR, &this->t1, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_float("t2", P_FLAG_PER_POINT |P_FLAG_TVAR, &this->t2, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_float("t3", P_FLAG_PER_POINT |P_FLAG_TVAR, &this->t3, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + if ((param = Param::new_param_float("t4", P_FLAG_PER_POINT |P_FLAG_TVAR, &this->t4, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + if ((param = Param::new_param_float("t5", P_FLAG_TVAR, &this->t5, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + if ((param = Param::new_param_float("t6", P_FLAG_TVAR | P_FLAG_PER_POINT, &this->t6, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + if ((param = Param::new_param_float("t7", P_FLAG_TVAR | P_FLAG_PER_POINT, &this->t7, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + if ((param = Param::new_param_float("t8", P_FLAG_TVAR | P_FLAG_PER_POINT, &this->t8, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0)) == NULL) { + delete(this); + abort(); + } + + if (ParamUtils::insert(param, this->param_tree) < 0) { + delete(this); + abort(); + } + + /* End of parameter loading. Note that the read only parameters associated + with custom waves (ie, sample) are variables stored in PresetFrameIO.hpp, + and not specific to the custom wave datastructure. */ + +} + +CustomWave::~CustomWave() { + + if (param_tree == NULL) + return; + + + for (std::map::iterator pos = per_point_eqn_tree.begin(); pos != per_point_eqn_tree.end(); ++pos) + delete(pos->second); + + for (std::map::iterator pos = per_frame_eqn_tree.begin(); pos != per_frame_eqn_tree.end(); ++pos) + delete(pos->second); + + for (std::map::iterator pos = init_cond_tree.begin(); pos != init_cond_tree.end(); ++pos) + delete(pos->second); + + for (std::map::iterator pos = per_frame_init_eqn_tree.begin(); pos != per_frame_init_eqn_tree.end(); ++pos) + delete(pos->second); + + for (std::map::iterator pos = param_tree->begin(); pos != param_tree->end(); ++pos) + delete(pos->second); + + + free(r_mesh); + free(g_mesh); + free(b_mesh); + free(a_mesh); + free(x_mesh); + free(y_mesh); + free(value1); + free(value2); + free(sample_mesh); + + r_mesh = NULL; + g_mesh = NULL; + b_mesh = NULL; + a_mesh = NULL; + x_mesh = NULL; + y_mesh = NULL; + value1 = NULL; + value2 = NULL; + sample_mesh = NULL; + + +} + + + + + +int CustomWave::add_per_point_eqn(char * name, GenExpr * gen_expr) { + + PerPointEqn * per_point_eqn; + int index; + Param * param = NULL; + + /* Argument checks */ + if (gen_expr == NULL) + return PROJECTM_FAILURE; + if (name == NULL) + return PROJECTM_FAILURE; + + if (CUSTOM_WAVE_DEBUG) printf("add_per_point_eqn: per pixel equation (name = \"%s\")\n", name); + + /* Search for the parameter so we know what matrix the per pixel equation is referencing */ + + if ((param = ParamUtils::find(name,param_tree)) == NULL) { + if (CUSTOM_WAVE_DEBUG) printf("add_per_point_eqn: failed to allocate a new parameter!\n"); + return PROJECTM_FAILURE; + + } + + /* Find most largest index in the splaytree */ + + std::map::iterator pos = --per_point_eqn_tree.end(); + + if (pos == per_point_eqn_tree.end()) + index = 0; + else + index = pos->second->index+1; + + /* Create the per pixel equation given the index, parameter, and general expression */ + + if ((per_point_eqn = new PerPointEqn(index, param, gen_expr, samples)) == NULL) + return PROJECTM_FAILURE; + if (CUSTOM_WAVE_DEBUG) + printf("add_per_point_eqn: created new equation (index = %d) (name = \"%s\")\n", per_point_eqn->index, per_point_eqn->param->name.c_str()); + + /* Insert the per pixel equation into the preset per pixel database */ + + per_point_eqn_tree.insert(std::make_pair(per_point_eqn->index, per_point_eqn)); + + /* Done */ + return PROJECTM_SUCCESS; +} + + +void CustomWave::eval_custom_wave_init_conds() { + + for (std::map::iterator pos = init_cond_tree.begin(); pos != init_cond_tree.end(); ++pos) + pos->second->evaluate(); + + for (std::map::iterator pos = per_frame_init_eqn_tree.begin(); pos != per_frame_init_eqn_tree.end(); ++pos) + pos->second->evaluate(); +} + +/** Evaluate per-point equations */ +void CustomWave::evalPerPointEqns() { + + int x; + + for (x = 0; x < samples; x++) + r_mesh[x] = r; + for (x = 0; x < samples; x++) + g_mesh[x] = g; + for (x = 0; x < samples; x++) + b_mesh[x] = b; + for (x = 0; x < samples; x++) + a_mesh[x] = a; + for (x = 0; x < samples; x++) + x_mesh[x] = x; + for (x = 0; x < samples; x++) + y_mesh[x] = y; + + /* Evaluate per pixel equations */ + for (std::map::iterator pos = per_point_eqn_tree.begin(); pos != per_point_eqn_tree.end();++pos) + pos->second->evaluate(); + +} + +void CustomWave::load_unspecified_init_conds() { + + InitCondUtils::LoadUnspecInitCond fun(this->init_cond_tree, this->per_frame_init_eqn_tree); + Algorithms::traverse(*param_tree, fun); +} + + + + diff --git a/src/projectM-engine-backup/CustomWave.hpp b/src/projectM-engine-backup/CustomWave.hpp new file mode 100755 index 000000000..3e6b2767d --- /dev/null +++ b/src/projectM-engine-backup/CustomWave.hpp @@ -0,0 +1,158 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Encapsulation of a custom wave + * + * $Log$ + */ + +#ifndef _CUSTOM_WAVE_H +#define _CUSTOM_WAVE_H + +#define CUSTOM_WAVE_DEBUG 0 + +#define X_POINT_OP 0 +#define Y_POINT_OP 1 +#define R_POINT_OP 2 +#define G_POINT_OP 3 +#define B_POINT_OP 4 +#define A_POINT_OP 5 +#define NUM_POINT_OPS 6 + +class CustomWave; +class GenExpr; +class PerPointEqn; +class Preset; + +#include "Common.hpp" +#include "Param.hpp" +#include "PerFrameEqn.hpp" + +#include + +class CustomWave { +public: + + /** Empty constructor leaves wave in undefined state **/ + CustomWave() {} + + /** Initializes a custom wave id given the integer id */ + CustomWave(int id); + + /** Destructor is necessary so we can free the per point matrices **/ + ~CustomWave(); + + /* Numerical id */ + int id; + int per_frame_count; + + /* Parameter tree associated with this custom wave */ + std::map * param_tree; + + /* Engine variables */ + float x; /* x position for per point equations */ + float y; /* y position for per point equations */ + float r; /* red color value */ + float g; /* green color value */ + float b; /* blue color value */ + float a; /* alpha color value */ + float * x_mesh; + float * y_mesh; + float * r_mesh; + float * b_mesh; + float * g_mesh; + float * a_mesh; + float * value1; + float * value2; + float * sample_mesh; + + int enabled; /* if nonzero then wave is visible, hidden otherwise */ + int samples; /* number of samples associated with this wave form. Usually powers of 2 */ + float sample; + int bSpectrum; /* spectrum data or pcm data */ + int bUseDots; /* draw wave as dots or lines */ + int bDrawThick; /* draw thicker lines */ + int bAdditive; /* add color values together */ + + float scaling; /* scale factor of waveform */ + float smoothing; /* smooth factor of waveform */ + int sep; /* no idea what this is yet... */ + + /* stupid t variables */ + float t1; + float t2; + float t3; + float t4; + float t5; + float t6; + float t7; + float t8; + float v1,v2; + + /* Data structures to hold per frame and per point equations */ + std::map init_cond_tree; + std::map per_frame_eqn_tree; + std::map per_point_eqn_tree; + std::map per_frame_init_eqn_tree; + + /* Denotes the index of the last character for each string buffer */ + int per_point_eqn_string_index; + int per_frame_eqn_string_index; + int per_frame_init_eqn_string_index; + + /* String buffers for per point and per frame equations */ + char per_point_eqn_string_buffer[STRING_BUFFER_SIZE]; + char per_frame_eqn_string_buffer[STRING_BUFFER_SIZE]; + char per_frame_init_eqn_string_buffer[STRING_BUFFER_SIZE]; + + /* Per point equation array */ + GenExpr * per_point_eqn_array[NUM_POINT_OPS]; + + void reset_per_point_eqn_array(CustomWave *custom_wave); + + int add_per_point_eqn(char * name, GenExpr * gen_expr); + void evalCustomWaveInitConditions(Preset *preset); + void evalPerPointEqns(); + + void load_unspecified_init_conds(); + + void eval_custom_wave_init_conds(); + void evalPerPointEqn(PerPointEqn * per_point_eqn); + + +}; + +/** Splaytree traversal helpers */ +inline void free_custom_wave_helper( void *custom_wave ) { + delete((CustomWave *)custom_wave); + } + +inline void load_custom_wave_init_helper( void *custom_wave ) { + ((CustomWave *)custom_wave)->load_unspecified_init_conds(); + } + +inline void eval_custom_wave_init_conds_helper( void *custom_wave ) { + ((CustomWave *)custom_wave)->eval_custom_wave_init_conds(); + } + +#endif /** !_CUSTOM_WAVE_H */ diff --git a/src/projectM-engine-backup/Eval.cpp b/src/projectM-engine-backup/Eval.cpp new file mode 100755 index 000000000..a2cdf359a --- /dev/null +++ b/src/projectM-engine-backup/Eval.cpp @@ -0,0 +1,91 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/* Evaluation Code */ + +#include +#include + +#include "projectM.hpp" +#include "Common.hpp" +#include "fatal.h" + +#include "Eval.hpp" +#include "Expr.hpp" +#include "Param.hpp" +#include "Func.hpp" +#include "BuiltinFuncs.hpp" +#include "wipemalloc.h" + +InfixOp *Eval::infix_add = NULL; +InfixOp *Eval::infix_minus = NULL; +InfixOp *Eval::infix_div = NULL; +InfixOp *Eval::infix_mult = NULL; +InfixOp *Eval::infix_or = NULL; +InfixOp *Eval::infix_and = NULL; +InfixOp *Eval::infix_mod = NULL; +InfixOp *Eval::infix_negative = NULL; +InfixOp *Eval::infix_positive = NULL; + +/* Initializes all infix operators */ +int Eval::init_infix_ops() { + + Eval::infix_add = new InfixOp(INFIX_ADD, 4); + Eval::infix_minus = new InfixOp(INFIX_MINUS, 3); + Eval::infix_div = new InfixOp(INFIX_DIV, 2); + Eval::infix_or = new InfixOp(INFIX_OR, 5); + Eval::infix_and = new InfixOp(INFIX_AND,4); + Eval::infix_mod = new InfixOp(INFIX_MOD, 1); + Eval::infix_mult = new InfixOp(INFIX_MULT, 2); + + /* Prefix operators */ + Eval::infix_positive = new InfixOp(INFIX_ADD, 0); + Eval::infix_negative = new InfixOp(INFIX_MINUS, 0); + + return PROJECTM_SUCCESS; +} + +/* Destroys the infix operator list. This should + be done on program exit */ +int Eval::destroy_infix_ops() +{ + + delete(Eval::infix_add); + delete(Eval::infix_minus); + delete(Eval::infix_div); + delete(Eval::infix_or); + delete(Eval::infix_and); + delete(Eval::infix_mod); + delete(Eval::infix_mult); + delete(Eval::infix_positive); + delete(Eval::infix_negative); + + Eval::infix_add = NULL; + Eval::infix_minus = NULL; + Eval::infix_div = NULL; + Eval::infix_or = NULL; + Eval::infix_and = NULL; + Eval::infix_mod = NULL; + Eval::infix_mult = NULL; + Eval::infix_positive = NULL; + Eval::infix_negative = NULL; + + return PROJECTM_SUCCESS; +} diff --git a/src/projectM-engine-backup/Eval.hpp b/src/projectM-engine-backup/Eval.hpp new file mode 100755 index 000000000..bdf0113f1 --- /dev/null +++ b/src/projectM-engine-backup/Eval.hpp @@ -0,0 +1,93 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Expression evaluators + * + * $Log$ + */ + +/* Eval.hpp: evaluation functions of expressions */ + +#ifndef _EVAL_H +#define _EVAL_H + +#include "projectM.hpp" +#include "Func.hpp" +#include "Param.hpp" + +//#define EVAL_DEBUG 2 +//#define EVAL_DEBUG_DOUBLE 2 + +#define VAL_T 1 +#define PREFUN_T 3 +#define TREE_T 4 +#define NONE_T 0 + +#define CONSTANT_TERM_T 0 +#define PARAM_TERM_T 1 + +#define INFIX_ADD 0 +#define INFIX_MINUS 1 +#define INFIX_MOD 2 +#define INFIX_DIV 3 +#define INFIX_MULT 4 +#define INFIX_OR 5 +#define INFIX_AND 6 + +class InfixOp; + +class Eval { +public: + static InfixOp *infix_add, + *infix_minus, + *infix_div, + *infix_mult, + *infix_or, + *infix_and, + *infix_mod, + *infix_negative, + *infix_positive; + + float eval_gen_expr(GenExpr * gen_expr); + inline GenExpr * opt_gen_expr(GenExpr * gen_expr, int ** param_list); + + GenExpr * const_to_expr(float val); + GenExpr * param_to_expr(Param * param); + GenExpr * prefun_to_expr(float (*func_ptr)(), GenExpr ** expr_list, int num_args); + + static TreeExpr * new_tree_expr(InfixOp * infix_op, GenExpr * gen_expr, TreeExpr * left, TreeExpr * right); + static GenExpr * new_gen_expr(int type, void * item); + static ValExpr * new_val_expr(int type, Term *term); + + static InfixOp * new_infix_op(int type, int precedence); + static int init_infix_ops(); + static int destroy_infix_ops(); + void reset_engine_vars(); + + GenExpr * clone_gen_expr(GenExpr * gen_expr); + TreeExpr * clone_tree_expr(TreeExpr * tree_expr); + ValExpr * clone_val_expr(ValExpr * val_expr); + PrefunExpr * clone_prefun_expr(PrefunExpr * prefun_expr); + }; + +#endif /** !_EVAL_H */ diff --git a/src/projectM-engine-backup/Expr.cpp b/src/projectM-engine-backup/Expr.cpp new file mode 100755 index 000000000..1453c6aa8 --- /dev/null +++ b/src/projectM-engine-backup/Expr.cpp @@ -0,0 +1,549 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include "wipemalloc.h" + +#include "Expr.hpp" +#include "Eval.hpp" +#include +#include + +float GenExpr::eval_gen_expr(int mesh_i, int mesh_j) { + float l; + + assert(item); + switch(this->type) { + case VAL_T: + return ((ValExpr*)item)->eval_val_expr(mesh_i, mesh_j); + case PREFUN_T: + l = ((PrefunExpr *)item)->eval_prefun_expr(mesh_i, mesh_j); + //if (EVAL_DEBUG) DWRITE( "eval_gen_expr: prefix function return value: %f\n", l); + return l; + case TREE_T: + return ((TreeExpr*)(item))->eval_tree_expr(mesh_i, mesh_j); + default: + #ifdef EVAL_DEBUG + DWRITE( "eval_gen_expr: general expression matched no cases!\n"); + #endif + return EVAL_ERROR; + } + +} + +/* Evaluates functions in prefix form */ +float PrefunExpr::eval_prefun_expr(int mesh_i, int mesh_j) { + + + assert(func_ptr); + /* This is slightly less than safe, since + who knows if the passed argument is valid. For + speed purposes we'll go with this */ + float arg_list[this->num_args]; + + #ifdef EVAL_DEBUG_DOUBLE + DWRITE( "fn["); + #endif + + //printf("numargs %d", num_args); + + /* Evaluate each argument before calling the function itself */ + for (int i = 0; i < num_args; i++) { + arg_list[i] = expr_list[i]->eval_gen_expr(mesh_i, mesh_j); + #ifdef EVAL_DEBUG_DOUBLE + if (i < (num_args - 1)) + DWRITE( ", "); + #endif + //printf("numargs %x", arg_list[i]); + + + } + + #ifdef EVAL_DEBUG_DOUBLE + DWRITE( "]"); + #endif + + /* Now we call the function, passing a list of + floats as its argument */ + + return (func_ptr)(arg_list); + +} + + +/* Evaluates a value expression */ +float ValExpr::eval_val_expr(int mesh_i, int mesh_j) { + + /* Value is a constant, return the float value */ + if (type == CONSTANT_TERM_T) { + #ifdef EVAL_DEBUG + DWRITE( "%.4f", term.constant); + #endif + return (term.constant); + } + + /* Value is variable, dereference it */ + if (type == PARAM_TERM_T) { + switch (term.param->type) { + + case P_TYPE_BOOL: + #ifdef EVAL_DEBUG + DWRITE( "(%s:%.4f)", term.param->name.c_str(), (float)(*((int*)(term.param->engine_val)))); + #endif + + + return (float)(*((int*)(term.param->engine_val))); + case P_TYPE_INT: + #ifdef EVAL_DEBUG + DWRITE( "(%s:%.4f)", term.param->name.c_str(), (float)(*((int*)(term.param->engine_val)))); + #endif + + + return (float)(*((int*)(term.param->engine_val))); + case P_TYPE_DOUBLE: + + if (term.param->matrix_flag | (term.param->flags & P_FLAG_ALWAYS_MATRIX)) { + + /* Sanity check the matrix is there... */ + assert(term.param->matrix != NULL ); + + /// @slow boolean check could be expensive in this critical (and common) step of evaluation + if (mesh_i >= 0) { + if (mesh_j >= 0) { + return (((float**)term.param->matrix)[mesh_i][mesh_j]); + } else { + return (((float*)term.param->matrix)[mesh_i]); + } + } + //assert(mesh_i >=0); + } + //std::cout << term.param->name << ": " << (*((float*)term.param->engine_val)) << std::endl; + return *((float*)(term.param->engine_val)); + default: + return EVAL_ERROR; + } + } + /* Unknown type, return failure */ + return PROJECTM_FAILURE; +} + +/* Evaluates an expression tree */ +float TreeExpr::eval_tree_expr(int mesh_i, int mesh_j) { + + float left_arg, right_arg; + + /* A leaf node, evaluate the general expression. If the expression is null as well, return zero */ + if (infix_op == NULL) { + if (gen_expr == NULL) + return 0; + else + return gen_expr->eval_gen_expr( mesh_i, mesh_j); + } + + /* Otherwise, this node is an infix operator. Evaluate + accordingly */ + + #ifdef EVAL_DEBUG + DWRITE( "("); + #endif + + left_arg = left->eval_tree_expr(mesh_i, mesh_j); + + #ifdef EVAL_DEBUG + + switch (infix_op->type) { + case INFIX_ADD: + DWRITE( "+"); + break; + case INFIX_MINUS: + DWRITE( "-"); + break; + case INFIX_MULT: + DWRITE( "*"); + break; + case INFIX_MOD: + DWRITE( "%%"); + break; + case INFIX_OR: + DWRITE( "|"); + break; + case INFIX_AND: + DWRITE( "&"); + break; + case INFIX_DIV: + DWRITE( "/"); + break; + default: + DWRITE( "?"); + } + + #endif + + right_arg = right->eval_tree_expr(mesh_i, mesh_j); + + #ifdef EVAL_DEBUG + DWRITE( ")"); + #endif + +#ifdef EVAL_DEBUG + DWRITE( "\n" ); +#endif + + switch (infix_op->type) { + case INFIX_ADD: + return (left_arg + right_arg); + case INFIX_MINUS: + return (left_arg - right_arg); + case INFIX_MULT: + return (left_arg * right_arg); + case INFIX_MOD: + if ((int)right_arg == 0) { + #ifdef EVAL_DEBUG + DWRITE( "eval_tree_expr: modulo zero!\n"); + #endif + return PROJECTM_DIV_BY_ZERO; + } + return ((int)left_arg % (int)right_arg); + case INFIX_OR: + return ((int)left_arg | (int)right_arg); + case INFIX_AND: + return ((int)left_arg & (int)right_arg); + case INFIX_DIV: + if (right_arg == 0) { + #ifdef EVAL_DEBUG + DWRITE( "eval_tree_expr: division by zero!\n"); + #endif + return MAX_DOUBLE_SIZE; + } + return (left_arg / right_arg); + default: + #ifdef EVAL_DEBUG + DWRITE( "eval_tree_expr: unknown infix operator!\n"); + #endif + return EVAL_ERROR; + } + + return EVAL_ERROR; +} + +/* Converts a float value to a general expression */ +GenExpr * GenExpr::const_to_expr(float val) { + + GenExpr * gen_expr; + ValExpr * val_expr; + Term term; + + term.constant = val; + + if ((val_expr = ValExpr::new_val_expr(CONSTANT_TERM_T, &term)) == NULL) + return NULL; + + gen_expr = GenExpr::new_gen_expr(VAL_T, (void*)val_expr); + + if (gen_expr == NULL) { + delete val_expr; + } + + return gen_expr; +} + +/* Converts a regular parameter to an expression */ +GenExpr * GenExpr::param_to_expr(Param * param) { + + GenExpr * gen_expr = NULL; + ValExpr * val_expr = NULL; + Term term; + + if (param == NULL) + return NULL; + + /* This code is still a work in progress. We need + to figure out if the initial condition is used for + each per frame equation or not. I am guessing that + it isn't, and it is thusly implemented this way */ + + /* Current guess of true behavior (08/01/03) note from carm + First try to use the per_pixel_expr (with cloning). + If it is null however, use the engine variable instead. */ + + /* 08/20/03 : Presets are now objects, as well as per pixel equations. This ends up + making the parser handle the case where parameters are essentially per pixel equation + substitutions */ + + + term.param = param; + if ((val_expr = ValExpr::new_val_expr(PARAM_TERM_T, &term)) == NULL) + return NULL; + + if ((gen_expr = GenExpr::new_gen_expr(VAL_T, (void*)val_expr)) == NULL) { + delete val_expr; + return NULL; + } + return gen_expr; +} + +/* Converts a prefix function to an expression */ +GenExpr * GenExpr::prefun_to_expr(float (*func_ptr)(void *), GenExpr ** expr_list, int num_args) { + + GenExpr * gen_expr; + PrefunExpr * prefun_expr; + + + /* Malloc a new prefix function expression */ + prefun_expr = (PrefunExpr*)wipemalloc(sizeof(PrefunExpr)); + + if (prefun_expr == NULL) + return NULL; + + prefun_expr->num_args = num_args; + prefun_expr->func_ptr =(float (*)(void*)) func_ptr; + prefun_expr->expr_list = expr_list; + + gen_expr = new_gen_expr(PREFUN_T, (void*)prefun_expr); + + if (gen_expr == NULL) + delete prefun_expr; + + return gen_expr; +} + +/* Creates a new tree expression */ +TreeExpr *TreeExpr::new_tree_expr(InfixOp * infix_op, GenExpr * gen_expr, TreeExpr * left, TreeExpr * right) { + + TreeExpr * tree_expr; + tree_expr = (TreeExpr*)wipemalloc(sizeof(TreeExpr)); + assert(tree_expr); + + tree_expr->infix_op = infix_op; + tree_expr->gen_expr = gen_expr; + tree_expr->left = left; + tree_expr->right = right; + return tree_expr; +} + + +/* Creates a new value expression */ +ValExpr *ValExpr::new_val_expr(int _type, Term * _term) { + + ValExpr * val_expr; + val_expr = (ValExpr*)wipemalloc(sizeof(ValExpr)); + + if (val_expr == NULL) + return NULL; + + val_expr->type = _type; + val_expr->term.constant = _term->constant; + val_expr->term.param = _term->param; + + return val_expr; +} + +/* Creates a new general expression */ +GenExpr * GenExpr::new_gen_expr(int _type, void * _item) { + + GenExpr * gen_expr; + + gen_expr = (GenExpr*)wipemalloc(sizeof(GenExpr)); + if (gen_expr == NULL) + return NULL; + gen_expr->type = _type; + gen_expr->item = _item; + + return gen_expr; +} + +/* Frees a general expression */ +GenExpr::~GenExpr() { + + switch (type) { + case VAL_T: + delete ((ValExpr*)item); + break; + case PREFUN_T: + delete ((PrefunExpr*)item); + break; + case TREE_T: + delete ((TreeExpr*)item); + break; + } +} + +/* Frees a function in prefix notation */ +PrefunExpr::~PrefunExpr() { + + int i; + + /* Free every element in expression list */ + for (i = 0 ; i < num_args; i++) { + delete expr_list[i]; + } + free(expr_list); +} + +/* Frees values of type VARIABLE and CONSTANT */ +ValExpr::~ValExpr() { + } + +/* Frees a tree expression */ +TreeExpr::~TreeExpr() { + + /* free left tree */ + if ( left != NULL ) { + delete left; + } + + /* free general expression object */ + if ( gen_expr != NULL ) { + delete gen_expr; + } + + /* Note that infix operators are always + stored in memory unless the program + exits, so we don't remove them here */ + + /* free right tree */ + if ( right != NULL ) { + delete right; + } + } + +/* Initializes an infix operator */ +DLLEXPORT InfixOp::InfixOp(int type, int precedence) { + + this->type = type; + this->precedence = precedence; + } + +/* Clones a general expression */ +GenExpr *GenExpr::clone_gen_expr() { + + GenExpr * new_gen_expr; + ValExpr * val_expr; + TreeExpr * tree_expr; + PrefunExpr * prefun_expr; + + /* Out of memory */ + if ((new_gen_expr = (GenExpr*)wipemalloc(sizeof(GenExpr))) == NULL) + return NULL; + + /* Case on the type of general expression */ + switch (new_gen_expr->type = type) { + + case VAL_T: /* val expression */ + if ((val_expr = ((ValExpr*)item)->clone_val_expr()) == NULL) { + free(new_gen_expr); + new_gen_expr = NULL; + return NULL; + } + new_gen_expr->item = (void*)val_expr; + break; + + case PREFUN_T: /* prefix function expression */ + if ((prefun_expr = ((PrefunExpr*)item)->clone_prefun_expr()) == NULL) { + free(new_gen_expr); + new_gen_expr = NULL; + return NULL; + } + new_gen_expr->item = (void*)prefun_expr; + break; + + case TREE_T: /* tree expression */ + if ((tree_expr = ((TreeExpr*)item)->clone_tree_expr()) == NULL) { + free(new_gen_expr); + new_gen_expr = NULL; + return NULL; + } + new_gen_expr->item = (void*)tree_expr; + break; + + default: /* unknown type, ut oh.. */ + free(new_gen_expr); + new_gen_expr = NULL; + return NULL; + } + + return new_gen_expr; /* Return the new (cloned) general expression */ +} + + +/* Clones a tree expression */ +TreeExpr *TreeExpr::clone_tree_expr() { + + TreeExpr * new_tree_expr; + + /* Out of memory */ + if ((new_tree_expr = (TreeExpr*)wipemalloc(sizeof(TreeExpr))) == NULL) + return NULL; + + /* Set each argument in TreeExpr struct */ + new_tree_expr->infix_op = infix_op; /* infix operators are in shared memory */ + new_tree_expr->gen_expr = gen_expr->clone_gen_expr(); /* clone the general expression */ + new_tree_expr->left = left->clone_tree_expr(); /* clone the left tree expression */ + new_tree_expr->right = right->clone_tree_expr(); /* clone the right tree expression */ + + return new_tree_expr; /* Return the new (cloned) tree expression */ +} + +/* Clones a value expression, currently only passes the pointer to + the value that this object represents, not a pointer to a copy of the value */ +ValExpr *ValExpr::clone_val_expr() { + + ValExpr * new_val_expr; + + /* Allocate space, check for out of memory */ + if ((new_val_expr = (ValExpr*)wipemalloc(sizeof(ValExpr))) == NULL) + return NULL; + + /* Set the values in the ValExpr struct */ + new_val_expr->type = type; + new_val_expr->term = term; + + /* Return the new (cloned) value expression */ + return new_val_expr; +} + +/* Clones a prefix function with its arguments */ +PrefunExpr *PrefunExpr::clone_prefun_expr() { + + int i; + PrefunExpr * new_prefun_expr; + + /* Out of memory */ + if ((new_prefun_expr = (PrefunExpr*)wipemalloc(sizeof(PrefunExpr))) == NULL) + return NULL; + + /* Set the function argument paired with its number of arguments */ + new_prefun_expr->num_args = num_args; + new_prefun_expr->func_ptr = func_ptr; + + /* Allocate space for the expression list pointers */ + if ((new_prefun_expr->expr_list = (GenExpr**)wipemalloc(sizeof(GenExpr*)*new_prefun_expr->num_args)) == NULL) { + free( new_prefun_expr ); + new_prefun_expr = NULL; + return NULL; + } + + /* Now copy each general expression from the argument expression list */ + for (i = 0; i < new_prefun_expr->num_args;i++) + new_prefun_expr->expr_list[i] = expr_list[i]->clone_gen_expr(); + + /* Finally, return the new (cloned) prefix function expression */ + return new_prefun_expr; +} diff --git a/src/projectM-engine-backup/Expr.hpp b/src/projectM-engine-backup/Expr.hpp new file mode 100755 index 000000000..799eb43b3 --- /dev/null +++ b/src/projectM-engine-backup/Expr.hpp @@ -0,0 +1,125 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Expression + * + * $Log$ + */ + +#ifndef _EXPR_H +#define _EXPR_H + +#include "dlldefs.h" +#include "CValue.hpp" + +class Param; + +#define CONST_STACK_ELEMENT 0 +#define EXPR_STACK_ELEMENT 1 + +#define EVAL_ERROR -1 + +/* Infix Operator Function */ +class InfixOp +{ +public: + int type; + int precedence; + + DLLEXPORT InfixOp( int type, int precedence ); +}; + +/** Term */ +class Term +{ +public: + float constant; /* static variable */ + Param *param; /* pointer to a changing variable */ + + Term() { this->constant = 0; this->param = 0; } +}; + +/* General Expression Type */ +class GenExpr +{ +public: + int type; + void * item; + + ~GenExpr(); + + static GenExpr *new_gen_expr( int type, void *item ); + GenExpr *clone_gen_expr(); + float eval_gen_expr(int mesh_i, int mesh_j); + + static GenExpr *const_to_expr( float val ); + static GenExpr *param_to_expr( Param *param ); + static GenExpr *prefun_to_expr( float (*func_ptr)(void *), GenExpr **expr_list, int num_args ); +}; + +/* Value expression, contains a term union */ +class ValExpr +{ +public: + int type; + Term term; + + ~ValExpr(); + static ValExpr *new_val_expr( int type, Term *term ); + ValExpr *clone_val_expr(); + + float eval_val_expr(int mesh_i, int mesh_j); +}; + +/* A binary expression tree ordered by operator precedence */ +class TreeExpr +{ +public: + InfixOp * infix_op; /* null if leaf */ + GenExpr * gen_expr; + TreeExpr *left, *right; + + ~TreeExpr(); + static TreeExpr *new_tree_expr( InfixOp *infix_op, GenExpr *gen_expr, + TreeExpr *left, TreeExpr *right ); + TreeExpr *clone_tree_expr(); + float eval_tree_expr(int mesh_i, int mesh_j); +}; + +/* A function expression in prefix form */ +class PrefunExpr +{ +public: + float (*func_ptr)(void*); + int num_args; + GenExpr **expr_list; + + ~PrefunExpr(); + PrefunExpr *clone_prefun_expr(); + + /* Evaluates functions in prefix form */ + float eval_prefun_expr(int mesh_i, int mesh_j); + +}; + +#endif /** _EXPR_H */ diff --git a/src/projectM-engine-backup/FindPkgConfig.cmake b/src/projectM-engine-backup/FindPkgConfig.cmake new file mode 100644 index 000000000..afae15cb0 --- /dev/null +++ b/src/projectM-engine-backup/FindPkgConfig.cmake @@ -0,0 +1,360 @@ +# - a pkg-config module for CMake +# +# Usage: +# pkg_check_modules( [REQUIRED] []*) +# checks for all the given modules +# +# pkg_search_module( [REQUIRED] []*) +# checks for given modules and uses the first working one +# +# When the 'REQUIRED' argument was set, macros will fail with an error +# when module(s) could not be found +# +# It sets the following variables: +# PKG_CONFIG_FOUND ... true iff pkg-config works on the system +# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program +# _FOUND ... set to 1 iff module(s) exist +# +# For the following variables two sets of values exist; first one is the +# common one and has the given PREFIX. The second set contains flags +# which are given out when pkgconfig was called with the '--static' +# option. +# _LIBRARIES ... only the libraries (w/o the '-l') +# _LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') +# _LDFLAGS ... all required linker flags +# _LDFLAGS_OTHERS ... all other linker flags +# _INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I') +# _CFLAGS ... all required cflags +# _CFLAGS_OTHERS ... the other compiler flags +# +# = for common case +# = _STATIC for static linking +# +# There are some special variables whose prefix depends on the count +# of given modules. When there is only one module, stays +# unchanged. When there are multiple modules, the prefix will be +# changed to _: +# _VERSION ... version of the module +# _PREFIX ... prefix-directory of the module +# _INCLUDEDIR ... include-dir of the module +# _LIBDIR ... lib-dir of the module +# +# = when |MODULES| == 1, else +# = _ +# +# A parameter can have the following formats: +# {MODNAME} ... matches any version +# {MODNAME}>={VERSION} ... at least version is required +# {MODNAME}={VERSION} ... exactly version is required +# {MODNAME}<={VERSION} ... modules must not be newer than +# +# Examples +# pkg_check_modules (GLIB2 glib-2.0) +# +# pkg_check_modules (GLIB2 glib-2.0>=2.10) +# requires at least version 2.10 of glib2 and defines e.g. +# GLIB2_VERSION=2.10.3 +# +# pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0) +# requires both glib2 and gtk2, and defines e.g. +# FOO_glib-2.0_VERSION=2.10.3 +# FOO_gtk+-2.0_VERSION=2.8.20 +# +# pkg_check_modules (XRENDER REQUIRED xrender) +# defines e.g.: +# XRENDER_LIBRARIES=Xrender;X11 +# XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp +# +# pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2) + + +# Copyright (C) 2006 Enrico Scholz +# +# Redistribution and use, with or without modification, are permitted +# provided that the following conditions are met: +# +# 1. Redistributions must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# 2. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +### Common stuff #### +set(PKG_CONFIG_VERSION 1) +set(PKG_CONFIG_FOUND 0) + +find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable") +mark_as_advanced(PKG_CONFIG_EXECUTABLE) + +if(PKG_CONFIG_EXECUTABLE) + set(PKG_CONFIG_FOUND 1) +endif(PKG_CONFIG_EXECUTABLE) + + +# Unsets the given variables +macro(_pkgconfig_unset var) + set(${var} "" CACHE INTERNAL "") +endmacro(_pkgconfig_unset) + +macro(_pkgconfig_set var value) + set(${var} ${value} CACHE INTERNAL "") +endmacro(_pkgconfig_set) + +# Invokes pkgconfig, cleans up the result and sets variables +macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp) + set(_pkgconfig_invoke_result) + + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist} + OUTPUT_VARIABLE _pkgconfig_invoke_result + RESULT_VARIABLE _pkgconfig_failed) + + if (_pkgconfig_failed) + set(_pkgconfig_${_varname} "") + _pkgconfig_unset(${_prefix}_${_varname}) + else(_pkgconfig_failed) + string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") + string(REGEX REPLACE " +$" "" _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") + + if (NOT ${_regexp} STREQUAL "") + string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") + endif(NOT ${_regexp} STREQUAL "") + + separate_arguments(_pkgconfig_invoke_result) + + #message(STATUS " ${_varname} ... ${_pkgconfig_invoke_result}") + set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result}) + _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}") + endif(_pkgconfig_failed) +endmacro(_pkgconfig_invoke) + +# Invokes pkgconfig two times; once without '--static' and once with +# '--static' +macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp) + _pkgconfig_invoke("${_pkglist}" ${_prefix} ${_varname} "${cleanup_regexp}" ${ARGN}) + _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static ${ARGN}) +endmacro(_pkgconfig_invoke_dyn) + +# Splits given arguments into options and a package list +macro(_pkgconfig_parse_options _result _is_req) + set(${_is_req} 0) + + foreach(_pkg ${ARGN}) + if (_pkg STREQUAL "REQUIRED") + set(${_is_req} 1) + endif (_pkg STREQUAL "REQUIRED") + endforeach(_pkg ${ARGN}) + + set(${_result} ${ARGN}) + list(REMOVE_ITEM ${_result} "REQUIRED") +endmacro(_pkgconfig_parse_options) + +### +macro(_pkg_check_modules_internal _is_required _is_silent _prefix) + _pkgconfig_unset(${_prefix}_FOUND) + _pkgconfig_unset(${_prefix}_VERSION) + _pkgconfig_unset(${_prefix}_PREFIX) + _pkgconfig_unset(${_prefix}_INCLUDEDIR) + _pkgconfig_unset(${_prefix}_LIBDIR) + _pkgconfig_unset(${_prefix}_LIBS) + _pkgconfig_unset(${_prefix}_LIBS_L) + _pkgconfig_unset(${_prefix}_LIBS_PATHS) + _pkgconfig_unset(${_prefix}_LIBS_OTHER) + _pkgconfig_unset(${_prefix}_CFLAGS) + _pkgconfig_unset(${_prefix}_CFLAGS_I) + _pkgconfig_unset(${_prefix}_CFLAGS_OTHER) + _pkgconfig_unset(${_prefix}_STATIC_LIBDIR) + _pkgconfig_unset(${_prefix}_STATIC_LIBS) + _pkgconfig_unset(${_prefix}_STATIC_LIBS_L) + _pkgconfig_unset(${_prefix}_STATIC_LIBS_PATHS) + _pkgconfig_unset(${_prefix}_STATIC_LIBS_OTHER) + _pkgconfig_unset(${_prefix}_STATIC_CFLAGS) + _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_I) + _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_OTHER) + + # create a better addressable variable of the modules and calculate its size + set(_pkg_check_modules_list ${ARGN}) + list(LENGTH _pkg_check_modules_list _pkg_check_modules_cnt) + + if(PKG_CONFIG_EXECUTABLE) + # give out status message telling checked module + if (NOT ${_is_silent}) + if (_pkg_check_modules_cnt EQUAL 1) + message(STATUS "checking for module '${_pkg_check_modules_list}'") + else(_pkg_check_modules_cnt EQUAL 1) + message(STATUS "checking for modules '${_pkg_check_modules_list}'") + endif(_pkg_check_modules_cnt EQUAL 1) + endif(NOT ${_is_silent}) + + set(_pkg_check_modules_packages) + set(_pkg_check_modules_failed) + + # iterate through module list and check whether they exist and match the required version + foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list}) + set(_pkg_check_modules_exist_query) + + # check whether version is given + if (_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") + string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") + string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op "${_pkg_check_modules_pkg}") + string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver "${_pkg_check_modules_pkg}") + else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") + set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") + set(_pkg_check_modules_pkg_op) + set(_pkg_check_modules_pkg_ver) + endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") + + # handle the operands + if (_pkg_check_modules_pkg_op STREQUAL ">=") + list(APPEND _pkg_check_modules_exist_query --atleast-version) + endif(_pkg_check_modules_pkg_op STREQUAL ">=") + + if (_pkg_check_modules_pkg_op STREQUAL "=") + list(APPEND _pkg_check_modules_exist_query --exact-version) + endif(_pkg_check_modules_pkg_op STREQUAL "=") + + if (_pkg_check_modules_pkg_op STREQUAL "<=") + list(APPEND _pkg_check_modules_exist_query --max-version) + endif(_pkg_check_modules_pkg_op STREQUAL "<=") + + # create the final query which is of the format: + # * --atleast-version + # * --exact-version + # * --max-version + # * --exists + if (_pkg_check_modules_pkg_op) + list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}") + else(_pkg_check_modules_pkg_op) + list(APPEND _pkg_check_modules_exist_query --exists) + endif(_pkg_check_modules_pkg_op) + + _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION) + _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX) + _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR) + _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR) + + list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}") + list(APPEND _pkg_check_modules_packages "${_pkg_check_modules_pkg_name}") + + # execute the query + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query} + RESULT_VARIABLE _pkgconfig_retval) + + # evaluate result and tell failures + if (_pkgconfig_retval) + if(NOT ${_is_silent}) + message(STATUS " package '${_pkg_check_modules_pkg}' not found") + endif(NOT ${_is_silent}) + + set(_pkg_check_modules_failed 1) + endif(_pkgconfig_retval) + endforeach(_pkg_check_modules_pkg) + + if(_pkg_check_modules_failed) + # fail when requested + if (${_is_required}) + message(SEND_ERROR "A required package was not found") + endif (${_is_required}) + else(_pkg_check_modules_failed) + # when we are here, we checked whether requested modules + # exist. Now, go through them and set variables + + _pkgconfig_set(${_prefix}_FOUND 1) + list(LENGTH _pkg_check_modules_packages pkg_count) + + # iterate through all modules again and set individual variables + foreach (_pkg_check_modules_pkg ${_pkg_check_modules_packages}) + # handle case when there is only one package required + if (pkg_count EQUAL 1) + set(_pkg_check_prefix "${_prefix}") + else(pkg_count EQUAL 1) + set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}") + endif(pkg_count EQUAL 1) + + _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion ) + _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix ) + _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir ) + _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR "" --variable=libdir ) + + message(STATUS " found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}") + endforeach(_pkg_check_modules_pkg) + + # set variables which are combined for multiple modules + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS "(^| )-L" --libs-only-L ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS "" --libs ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER "" --libs-only-other ) + + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )-I" --cflags-only-I ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other ) + endif(_pkg_check_modules_failed) + else(PKG_CONFIG_EXECUTABLE) + if (${_is_required}) + message(SEND_ERROR "pkg-config tool not found") + endif (${_is_required}) + endif(PKG_CONFIG_EXECUTABLE) +endmacro(_pkg_check_modules_internal) + +### +### User visible macros start here +### + +### +macro(pkg_check_modules _prefix _module0) + # check cached value + if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) + _pkgconfig_parse_options (_pkg_modules _pkg_is_required "${_module0}" ${ARGN}) + _pkg_check_modules_internal("${_pkg_is_required}" 0 "${_prefix}" ${_pkg_modules}) + + _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) + endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) +endmacro(pkg_check_modules) + +### +macro(pkg_search_module _prefix _module0) + # check cached value + if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) + set(_pkg_modules_found 0) + _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required "${_module0}" ${ARGN}) + + message(STATUS "checking for one of the modules '${_pkg_modules_alt}'") + + # iterate through all modules and stop at the first working one. + foreach(_pkg_alt ${_pkg_modules_alt}) + if(NOT _pkg_modules_found) + _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}") + endif(NOT _pkg_modules_found) + + if (${_prefix}_FOUND) + set(_pkg_modules_found 1) + endif(${_prefix}_FOUND) + endforeach(_pkg_alt) + + if (NOT ${_prefix}_FOUND) + if(${_pkg_is_required}) + message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found") + endif(${_pkg_is_required}) + endif(NOT ${_prefix}_FOUND) + + _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) + endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) +endmacro(pkg_search_module) + +### Local Variables: +### mode: cmake +### End: diff --git a/src/projectM-engine-backup/Func.cpp b/src/projectM-engine-backup/Func.cpp new file mode 100755 index 000000000..febc81d76 --- /dev/null +++ b/src/projectM-engine-backup/Func.cpp @@ -0,0 +1,87 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/* Function management */ + +#include +#include +#include + +#include "Common.hpp" +#include "fatal.h" + +#include "Func.hpp" +#include + +#include "wipemalloc.h" + + + + +/* Private function prototypes */ +void *Func::copy_func_key(char * string) { + + char * clone_string; + + if ((clone_string = (char*)wipemalloc(MAX_TOKEN_SIZE)) == NULL) + return NULL; + + strncpy(clone_string, string, MAX_TOKEN_SIZE-1); + + return (void*)clone_string; +} + +/* Compare string name with function name */ +int Func::compare_func(char * name, char * name2) { + + int cmpval; + + /* Uses string comparison function */ + cmpval = strncmp(name, name2, MAX_TOKEN_SIZE-1); + + return cmpval; +} + +Func * Func::create_func (char * name, float (*func_ptr)(float*), int num_args) { + + Func * func; + func = (Func*)wipemalloc(sizeof(Func)); + + if (func == NULL) + return NULL; + + + /* Clear name space */ + memset(func->name, 0, MAX_TOKEN_SIZE); + + /* Copy given name into function structure */ + strncpy(func->name, name, MAX_TOKEN_SIZE); + + /* Assign value pointer */ + func->func_ptr = func_ptr; + func->num_args = num_args; + /* Return instantiated function */ + return func; + +} + +/* Frees a function type, real complicated... */ +Func::~Func() { + } diff --git a/src/projectM-engine-backup/Func.hpp b/src/projectM-engine-backup/Func.hpp new file mode 100755 index 000000000..2d07e7215 --- /dev/null +++ b/src/projectM-engine-backup/Func.hpp @@ -0,0 +1,58 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Function + * + * $Log$ + */ + +#ifndef _FUNC_H +#define _FUNC_H + +#include "Common.hpp" + +class Func; +//#include + +/* Function Type */ +class Func { +public: + char name[MAX_TOKEN_SIZE]; + float (*func_ptr)(float*); + int num_args; + + Func() {} + + /* Public Prototypes */ + DLLEXPORT ~Func(); + static Func *create_func ( char *name, float (*func_ptr)(float*), int num_args ); + static void * copy_func_key(char * string); + int compare_func(char * name, char * name2); + }; + +/** Splay traversal */ +inline void free_func_helper( void *func ) { + delete (Func *)func; +} + +#endif /** !_FUNC_H */ diff --git a/src/projectM-engine-backup/InitCond.cpp b/src/projectM-engine-backup/InitCond.cpp new file mode 100755 index 000000000..79ea005a3 --- /dev/null +++ b/src/projectM-engine-backup/InitCond.cpp @@ -0,0 +1,137 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/* Library functions to manipulate initial condition values */ + +#include +#include +#include + +#include "Common.hpp" +#include "fatal.h" + +#include "Expr.hpp" +#include "InitCond.hpp" +#include "Param.hpp" +#include + +#include "wipemalloc.h" + +char InitCond::init_cond_string_buffer[STRING_BUFFER_SIZE]; +int InitCond::init_cond_string_buffer_index = 0; + +/* Creates a new initial condition */ +InitCond::InitCond( Param * param, CValue init_val ) { + + this->param = param; + this->init_val = init_val; + + if ( INIT_COND_DEBUG ) { + DWRITE( "InitCond::InitCond: %s -> %X -> %X\n", + this->param->name.c_str(), this->param, this->param->engine_val ); + } +} + +/* Frees initial condition structure */ +InitCond::~InitCond() { + } + +/* Evaluate an initial conditon */ +void InitCond::evaluate() { + + /* Parameter is of boolean type, either a 1 or 0 value integer */ + /* Set matrix flag to zero. This ensures + its constant value will be used rather than a matrix value + */ + param->matrix_flag = 0; + if (param->type == P_TYPE_BOOL) { + if (INIT_COND_DEBUG) { + DWRITE( "init_cond: %s = %d (TYPE BOOL)\n", param->name.c_str(), init_val.bool_val); + } + *((int*)param->engine_val) = init_val.bool_val; + return; + } + + /* Parameter is an integer type, just like C */ + + if ( param->type == P_TYPE_INT) { + if ((param->name == "wave_mode") == 0 ) { + } + if (INIT_COND_DEBUG) { + DWRITE( "init_cond: %s = %d (TYPE INT)\n", param->name.c_str(), init_val.int_val); + } + *((int*)param->engine_val) = init_val.int_val; + return; + } + + /* Parameter is of a float type, just like C */ + + if (param->type == P_TYPE_DOUBLE) { + if (INIT_COND_DEBUG) { + DWRITE( "init_cond: %s = %f (TYPE DOUBLE) -> %f -> %X -> %X\n", param->name.c_str(), + init_val.float_val, *((float *)param->engine_val), + param, param->engine_val ); + } + *((float*)param->engine_val) = init_val.float_val; + return; + } + + /* Unknown type of parameter */ + return; +} + +/* WIP */ +void InitCond::init_cond_to_string() { + + int string_length; + char string[MAX_TOKEN_SIZE]; + + /* Create a string "param_name=val" */ + switch (param->type) { + + case P_TYPE_BOOL: + sprintf(string, "%s=%d\n", param->name.c_str(), init_val.bool_val); + break; + case P_TYPE_INT: + sprintf(string, "%s=%d\n", param->name.c_str(), init_val.int_val); + break; + case P_TYPE_DOUBLE: + sprintf(string, "%s=%f\n", param->name.c_str(), init_val.float_val); + break; + default: + return; + } + + /* Compute the length of the string */ + string_length = strlen(string); + + /* Buffer overflow check */ + if ((init_cond_string_buffer_index + string_length + 1) > (STRING_BUFFER_SIZE - 1)) + return; + + /* Copy the string into the initial condition string buffer */ + + strncpy(init_cond_string_buffer + init_cond_string_buffer_index, string, string_length); + + /* Increment the string buffer, offset by one for the null terminator, which will be + overwritten by the next call to this function */ + init_cond_string_buffer_index+= string_length + 1; +} + diff --git a/src/projectM-engine-backup/InitCond.hpp b/src/projectM-engine-backup/InitCond.hpp new file mode 100755 index 000000000..66cc46b33 --- /dev/null +++ b/src/projectM-engine-backup/InitCond.hpp @@ -0,0 +1,59 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Initial condition + * + * $Log$ + */ + +#ifndef _INIT_COND_HPP +#define _INIT_COND_HPP + + +//#define INIT_COND_DEBUG 2 +#define INIT_COND_DEBUG 0 + +#include "Param.hpp" + +class InitCond; +class Param; +#include + +class InitCond { +public: + Param *param; + CValue init_val; + + static char init_cond_string_buffer[STRING_BUFFER_SIZE]; + static int init_cond_string_buffer_index; + + InitCond( Param * param, CValue init_val ); + ~InitCond(); + void evaluate(); + + void init_cond_to_string(); + void write_init(); + }; + + +#endif /** !_INIT_COND_H */ diff --git a/src/projectM-engine-backup/InitCondUtils.hpp b/src/projectM-engine-backup/InitCondUtils.hpp new file mode 100644 index 000000000..4ff0d90c9 --- /dev/null +++ b/src/projectM-engine-backup/InitCondUtils.hpp @@ -0,0 +1,69 @@ +#ifndef _INIT_COND_UTILS_HPP +#define _INIT_COND_UTILS_HPP +#include +#include "InitCond.hpp" + +namespace InitCondUtils { +class LoadUnspecInitCond { + public: + + LoadUnspecInitCond(std::map & initCondTree, std::map & perFrameInitEqnTree): + m_initCondTree(initCondTree), m_perFrameInitEqnTree(perFrameInitEqnTree) {} + + void operator()(Param * param); + + private: + std::map & m_initCondTree; + std::map & m_perFrameInitEqnTree; +}; + + +inline void LoadUnspecInitCond::operator() (Param * param) { + + InitCond * init_cond; + CValue init_val; + + /* Don't count these parameters as initial conditions */ + if (param->flags & P_FLAG_READONLY) + return; + if (param->flags & P_FLAG_QVAR) + return; + if (param->flags & P_FLAG_TVAR) + return; + if (param->flags & P_FLAG_USERDEF) + return; + + /* If initial condition was not defined by the preset file, force a default one + with the following code */ + + if (m_initCondTree.find(param->name) == m_initCondTree.end()) { + + /* Make sure initial condition does not exist in the set of per frame initial equations */ + if (m_perFrameInitEqnTree.find(param->name) != m_perFrameInitEqnTree.end()) + return; + + // Set an initial vialue via correct union member + if (param->type == P_TYPE_BOOL) + init_val.bool_val = 0; + + else if (param->type == P_TYPE_INT) + init_val.int_val = *(int*)param->engine_val; + + else if (param->type == P_TYPE_DOUBLE) + init_val.float_val = *(float*)param->engine_val; + + //printf("%s\n", param->name); + /* Create new initial condition */ + if ((init_cond = new InitCond(param, init_val)) == NULL) + return; + + /* Insert the initial condition into this presets tree */ + /// @bug check the reult status of insert + m_initCondTree.insert(std::make_pair(init_cond->param->name, init_cond)); + + } + + +} +} +#endif diff --git a/src/projectM-engine-backup/Makefile.am b/src/projectM-engine-backup/Makefile.am new file mode 100755 index 000000000..88b9f0087 --- /dev/null +++ b/src/projectM-engine-backup/Makefile.am @@ -0,0 +1,48 @@ +lib_LTLIBRARIES = libprojectM.la + +libprojectM_la_SOURCES=\ +PCM.cc \ +beat_detect.cc \ +browser.cc \ +builtin_funcs.cc \ +console_interface.cc \ +custom_shape.cc \ +custom_wave.cc \ +editor.cc \ +eval.cc \ +fftsg.cc \ +func.cc \ +glConsole.cc \ +init_cond.cc \ +menu.cc \ +param.cc \ +parser.cc \ +pbuffer.cc \ +per_frame_eqn.cc \ +per_pixel_eqn.cc \ +preset.cc \ +projectM.cc \ +splaytree.cc \ +timer.cc \ +tree_types.cc \ +wipemalloc.cc + +libprojectMincludedir = $(includedir)/projectM +libprojectMinclude_HEADERS = projectM.h pbuffer.h event.h console_interface.h PCM.h + +libprojectM_la_LDFLAGS = -version-info 0:0:0 + +AM_LIBS = @GL_LIBS@ @FTGL_LIBS@ +AM_CXXFLAGS= -DLINUX -D__CPLUSPLUS @GL_CFLAGS@ @FTGL_CFLAGS@ + +libprojectM_la_LIBADD = $(AM_LIBS) + +libprojectMconfigdir = $(datadir)/projectM +libprojectMconfig_DATA = share/config share/config.fastcomputers share/config.slowcomputers + +libprojectMfontdir = $(datadir)/projectM/fonts +libprojectMfont_DATA = share/fonts/*.ttf + +libprojectMpresetdir = $(datadir)/projectM/presets +libprojectMpreset_DATA= share/presets/*.milk + diff --git a/src/projectM-engine-backup/Makefile.dist b/src/projectM-engine-backup/Makefile.dist new file mode 100644 index 000000000..1b8b8d0ae --- /dev/null +++ b/src/projectM-engine-backup/Makefile.dist @@ -0,0 +1,24 @@ +# +# projectM -- Milkdrop-esque visualisation SDK +# Copyright (C)2003-2007 projectM Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# See 'LICENSE.txt' included within this release + +clean: + rm -rf Debug + rm -rf Release + rm projectM.ncb + rm projectM.opt diff --git a/src/projectM-engine-backup/Makefile.in b/src/projectM-engine-backup/Makefile.in new file mode 100755 index 000000000..0f72972a2 --- /dev/null +++ b/src/projectM-engine-backup/Makefile.in @@ -0,0 +1,621 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src +DIST_COMMON = $(libprojectMinclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/m4/ax_check_gl.m4 \ + $(top_srcdir)/m4/ax_lang_compiler_ms.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(libprojectMconfigdir)" \ + "$(DESTDIR)$(libprojectMfontdir)" \ + "$(DESTDIR)$(libprojectMpresetdir)" \ + "$(DESTDIR)$(libprojectMincludedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libprojectM_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libprojectM_la_OBJECTS = PCM.lo beat_detect.lo browser.lo \ + builtin_funcs.lo console_interface.lo custom_shape.lo \ + custom_wave.lo editor.lo eval.lo fftsg.lo func.lo glConsole.lo \ + init_cond.lo menu.lo param.lo parser.lo pbuffer.lo \ + per_frame_eqn.lo per_pixel_eqn.lo preset.lo projectM.lo \ + splaytree.lo timer.lo tree_types.lo wipemalloc.lo +libprojectM_la_OBJECTS = $(am_libprojectM_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libprojectM_la_SOURCES) +DIST_SOURCES = $(libprojectM_la_SOURCES) +libprojectMconfigDATA_INSTALL = $(INSTALL_DATA) +libprojectMfontDATA_INSTALL = $(INSTALL_DATA) +libprojectMpresetDATA_INSTALL = $(INSTALL_DATA) +DATA = $(libprojectMconfig_DATA) $(libprojectMfont_DATA) \ + $(libprojectMpreset_DATA) +libprojectMincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(libprojectMinclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FTGL_CFLAGS = @FTGL_CFLAGS@ +FTGL_LIBS = @FTGL_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POW_LIB = @POW_LIB@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +lib_LTLIBRARIES = libprojectM.la +libprojectM_la_SOURCES = \ +PCM.cc \ +beat_detect.cc \ +browser.cc \ +builtin_funcs.cc \ +console_interface.cc \ +custom_shape.cc \ +custom_wave.cc \ +editor.cc \ +eval.cc \ +fftsg.cc \ +func.cc \ +glConsole.cc \ +init_cond.cc \ +menu.cc \ +param.cc \ +parser.cc \ +pbuffer.cc \ +per_frame_eqn.cc \ +per_pixel_eqn.cc \ +preset.cc \ +projectM.cc \ +splaytree.cc \ +timer.cc \ +tree_types.cc \ +wipemalloc.cc + +libprojectMincludedir = $(includedir)/projectM +libprojectMinclude_HEADERS = projectM.h pbuffer.h event.h console_interface.h PCM.h +libprojectM_la_LDFLAGS = -version-info 0:0:0 +AM_LIBS = @GL_LIBS@ @FTGL_LIBS@ +AM_CXXFLAGS = -DLINUX -D__CPLUSPLUS @GL_CFLAGS@ @FTGL_CFLAGS@ +libprojectM_la_LIBADD = $(AM_LIBS) +libprojectMconfigdir = $(datadir)/projectM +libprojectMconfig_DATA = share/config share/config.fastcomputers share/config.slowcomputers +libprojectMfontdir = $(datadir)/projectM/fonts +libprojectMfont_DATA = share/fonts/*.ttf +libprojectMpresetdir = $(datadir)/projectM/presets +libprojectMpreset_DATA = share/presets/*.milk +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libprojectM.la: $(libprojectM_la_OBJECTS) $(libprojectM_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libprojectM_la_LDFLAGS) $(libprojectM_la_OBJECTS) $(libprojectM_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PCM.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/beat_detect.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/browser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builtin_funcs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console_interface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/custom_shape.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/custom_wave.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/editor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fftsg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/func.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glConsole.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_cond.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/param.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbuffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/per_frame_eqn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/per_pixel_eqn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/projectM.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splaytree.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree_types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wipemalloc.Plo@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-libprojectMconfigDATA: $(libprojectMconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(libprojectMconfigdir)" || $(mkdir_p) "$(DESTDIR)$(libprojectMconfigdir)" + @list='$(libprojectMconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(libprojectMconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(libprojectMconfigdir)/$$f'"; \ + $(libprojectMconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(libprojectMconfigdir)/$$f"; \ + done + +uninstall-libprojectMconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(libprojectMconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libprojectMconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libprojectMconfigdir)/$$f"; \ + done +install-libprojectMfontDATA: $(libprojectMfont_DATA) + @$(NORMAL_INSTALL) + test -z "$(libprojectMfontdir)" || $(mkdir_p) "$(DESTDIR)$(libprojectMfontdir)" + @list='$(libprojectMfont_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(libprojectMfontDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(libprojectMfontdir)/$$f'"; \ + $(libprojectMfontDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(libprojectMfontdir)/$$f"; \ + done + +uninstall-libprojectMfontDATA: + @$(NORMAL_UNINSTALL) + @list='$(libprojectMfont_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libprojectMfontdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libprojectMfontdir)/$$f"; \ + done +install-libprojectMpresetDATA: $(libprojectMpreset_DATA) + @$(NORMAL_INSTALL) + test -z "$(libprojectMpresetdir)" || $(mkdir_p) "$(DESTDIR)$(libprojectMpresetdir)" + @list='$(libprojectMpreset_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(libprojectMpresetDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(libprojectMpresetdir)/$$f'"; \ + $(libprojectMpresetDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(libprojectMpresetdir)/$$f"; \ + done + +uninstall-libprojectMpresetDATA: + @$(NORMAL_UNINSTALL) + @list='$(libprojectMpreset_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libprojectMpresetdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libprojectMpresetdir)/$$f"; \ + done +install-libprojectMincludeHEADERS: $(libprojectMinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(libprojectMincludedir)" || $(mkdir_p) "$(DESTDIR)$(libprojectMincludedir)" + @list='$(libprojectMinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(libprojectMincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libprojectMincludedir)/$$f'"; \ + $(libprojectMincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libprojectMincludedir)/$$f"; \ + done + +uninstall-libprojectMincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libprojectMinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libprojectMincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(libprojectMincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libprojectMconfigdir)" "$(DESTDIR)$(libprojectMfontdir)" "$(DESTDIR)$(libprojectMpresetdir)" "$(DESTDIR)$(libprojectMincludedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-libprojectMconfigDATA \ + install-libprojectMfontDATA install-libprojectMincludeHEADERS \ + install-libprojectMpresetDATA + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-libprojectMconfigDATA uninstall-libprojectMfontDATA \ + uninstall-libprojectMincludeHEADERS \ + uninstall-libprojectMpresetDATA + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-libprojectMconfigDATA \ + install-libprojectMfontDATA install-libprojectMincludeHEADERS \ + install-libprojectMpresetDATA install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES uninstall-libprojectMconfigDATA \ + uninstall-libprojectMfontDATA \ + uninstall-libprojectMincludeHEADERS \ + uninstall-libprojectMpresetDATA + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/projectM-engine-backup/PBuffer.cpp b/src/projectM-engine-backup/PBuffer.cpp new file mode 100755 index 000000000..744517569 --- /dev/null +++ b/src/projectM-engine-backup/PBuffer.cpp @@ -0,0 +1,217 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: pbuffer.c,v 1.1.1.1 2005/12/23 18:05:00 psperl Exp $ + * + * Render this methods + */ + +#include +//#include + +#include "Common.hpp" +#include "PBuffer.hpp" + +#ifdef MACOS +#include +#endif /** MACOS */ + +/** Creates new pbuffers */ +RenderTarget::RenderTarget(int texsize, int width, int height) : usePbuffers(true) { + + int mindim = 0; + int origtexsize = 0; + int usePbuffers = 1; + + this->texsize=texsize; + +#ifdef USE_FBO + if(this->usePbuffers) + { + glewInit(); + + GLuint fb, color_rb, depth_rb, rgba_tex, depth_tex, i, other_tex; + glGenFramebuffersEXT(1, &fb); + glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, fb ); + + glGenRenderbuffersEXT(1, &depth_rb); + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, depth_rb ); + glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, this->texsize,this->texsize ); + glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_rb ); + this->fbuffer[0] = depth_rb; + + glGenTextures(1, &other_tex); + glBindTexture(GL_TEXTURE_2D,other_tex); + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, texsize, texsize, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + //glGenerateMipmapEXT(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + + + glGenTextures(1, &rgba_tex); + glBindTexture(GL_TEXTURE_2D, rgba_tex); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, texsize, texsize, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL ); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + //glGenerateMipmapEXT(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + + + glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, rgba_tex, 0 ); + this->textureID[0] = rgba_tex; + this->textureID[1] = other_tex; + + GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + if (status == GL_FRAMEBUFFER_COMPLETE_EXT) { + return; + } + } +#endif + +fallback: + DWRITE( "using teximage hack fallback\n" ); + + /** Fallback pbuffer creation via teximage hack */ + /** Check the texture size against the viewport size */ + /** If the viewport is smaller, then we'll need to scale the texture size down */ + /** If the viewport is larger, scale it up */ + mindim = width < height ? width : height; + origtexsize = this->texsize; + this->texsize = nearestPower2( mindim, SCALE_MINIFY ); + + /* Create the texture that will be bound to the render this */ + if ( glIsTexture( this->textureID[0] ) ) { + DWRITE( "texture already exists\n" ); + if ( this->texsize != origtexsize ) { + DWRITE( "deleting existing texture due to resize\n" ); + glDeleteTextures( 1, &this->textureID[0] ); + } + } + + if ( !glIsTexture( this->textureID[0] ) ) { + glGenTextures(1, &this->textureID[0] ); + + DWRITE( "allocate texture: %d\ttexsize: %d x %d\n", + this->textureID[0], this->texsize, this->texsize ); + glBindTexture(GL_TEXTURE_2D, this->textureID[0] ); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + glTexImage2D(GL_TEXTURE_2D, + 0, + 3, + this->texsize, this->texsize, + 0, + GL_RGB, + GL_UNSIGNED_BYTE, + NULL); + } + + this->usePbuffers=0; + return; + } + +/** Destroys the pbuffer */ + +/** Locks the pbuffer */ +void RenderTarget::lock() { + +#ifdef USE_FBO + if(this->usePbuffers) + { + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, this->fbuffer[0]); + } + +#endif + } + +/** Unlocks the pbuffer */ +void RenderTarget::unlock() { + +#ifdef USE_FBO + if(this->usePbuffers) + { + glBindTexture( GL_TEXTURE_2D, this->textureID[1] ); + glCopyTexSubImage2D( GL_TEXTURE_2D, + 0, 0, 0, 0, 0, + this->texsize, this->texsize ); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + return; + } + +#endif + + /** Fallback texture path */ + DWRITE( "copying framebuffer to texture\n" ); + glBindTexture( GL_TEXTURE_2D, this->textureID[0] ); + glCopyTexSubImage2D( GL_TEXTURE_2D, + 0, 0, 0, 0, 0, + this->texsize, this->texsize ); + } + +/** + * Calculates the nearest power of two to the given number using the + * appropriate rule + */ +int RenderTarget::nearestPower2( int value, TextureScale scaleRule ) { + + int x = value; + int power = 0; + + DWRITE( "nearestPower2(): %d\n", value ); + + while ( ( x & 0x01 ) != 1 ) { + x >>= 1; + } + + if ( x == 1 ) { + return value; + } else { + x = value; + while ( x != 0 ) { + x >>= 1; + power++; + } + switch ( scaleRule ) { + case SCALE_NEAREST: + if ( ( ( 1 << power ) - value ) <= ( value - ( 1 << ( power - 1 ) ) ) ) { + return 1 << power; + } else { + return 1 << ( power - 1 ); + } + case SCALE_MAGNIFY: + return 1 << power; + case SCALE_MINIFY: + return 1 << ( power - 1 ); + default: + break; + } + } + return 0; + } diff --git a/src/projectM-engine-backup/PBuffer.hpp b/src/projectM-engine-backup/PBuffer.hpp new file mode 100755 index 000000000..f5474860e --- /dev/null +++ b/src/projectM-engine-backup/PBuffer.hpp @@ -0,0 +1,94 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: PBuffer.hpp,v 1.1.1.1 2005/12/23 18:05:00 psperl Exp $ + * + * Opaque render target + * + */ + +#ifndef _RENDERTARGET_H +#define _RENDERTARGET_H + +#ifdef USE_FBO +#include +#endif + +#if defined(MACOS) && !defined(USE_FBO) +#include +#endif /** MACOS */ + +#ifdef WIN32 +#include +#include +#endif /** WIN32 */ + +#ifdef LINUX +#include +#include +#endif + +typedef enum { SCALE_NEAREST, SCALE_MAGNIFY, SCALE_MINIFY } TextureScale; +typedef enum { + AGL_CONTEXT, + CGL_CONTEXT, + NSGL_CONTEXT, + GLX_CONTEXT, + WGL_CONTEXT, + } ContextType; + +typedef enum { PBUFFER_PASS1, PBUFFER_PASS2 } PBufferPass; + +class RenderTarget { + + +public: + /** Texture size */ + int texsize; + + /** Application context */ + ContextType origContextType; + + +int usePbuffers; + + RenderTarget( int texsize, int width, int height ); + void lock(); + void unlock(); + int nearestPower2( int value, TextureScale scaleRule ); + + /** Opaque pbuffer context and pbuffer */ +/* +#ifdef MACOS + void *origContext; + void *pbufferContext; + void *pbuffer; +#endif +*/ + /** Render target texture ID for non-pbuffer systems */ + GLuint textureID[2]; + GLuint fbuffer[1]; + GLuint depthb[1]; + }; + + + +#endif /** !_RENDERTARGET_H */ diff --git a/src/projectM-engine-backup/PCM.cpp b/src/projectM-engine-backup/PCM.cpp new file mode 100755 index 000000000..d4db5f17e --- /dev/null +++ b/src/projectM-engine-backup/PCM.cpp @@ -0,0 +1,325 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: PCM.c,v 1.3 2006/03/13 20:35:26 psperl Exp $ + * + * Takes sound data from wherever and hands it back out. + * Returns PCM Data or spectrum data, or the derivative of the PCM data + */ + +#include +#include + +#include "Common.hpp" +#include "wipemalloc.h" +#include "fftsg.h" +#include "PCM.hpp" + +//initPCM(int samples) +// +//Initializes the PCM buffer to +// number of samples specified. + +PCM::PCM() { + initPCM( 2048 ); + } + +void PCM::initPCM(int samples) { + int i; + + DWRITE( "initPCM()\n" ); + + waveSmoothing = 0; + + //Allocate memory for PCM data buffer + PCMd = (float **)wipemalloc(2 * sizeof(float *)); + PCMd[0] = (float *)wipemalloc(samples * sizeof(float)); + PCMd[1] = (float *)wipemalloc(samples * sizeof(float)); + + maxsamples=samples; + newsamples=0; + numsamples = maxsamples; + + //Initialize buffers to 0 + for (i=0;imaxsamples = 2048; +// this->numsamples = 0; +// this->pcmdataL = NULL; +// this->pcmdataR = NULL; + + /** Allocate PCM data structures */ + pcmdataL=(float *)wipemalloc(this->maxsamples*sizeof(float)); + pcmdataR=(float *)wipemalloc(this->maxsamples*sizeof(float)); + +} + + +void PCM::addPCMfloat(float *PCMdata, int samples) +{ + int i,j; + + + for(i=0;imaxsamples) newsamples=maxsamples; + numsamples = getPCMnew(pcmdataR,1,0,waveSmoothing,0,0); + getPCMnew(pcmdataL,0,0,waveSmoothing,0,1); + getPCM(vdataL,512,0,1,0,0); + getPCM(vdataR,512,1,1,0,0); +} + +void PCM::addPCM16Data(const short* pcm_data, short samples) { + int i, j; + + for (i = 0; i < samples; ++i) { + j=i+start; + PCMd[0][j % maxsamples]=(pcm_data[i * 2 + 0]/16384.0); + PCMd[1][j % maxsamples]=(pcm_data[i * 2 + 1]/16384.0); + } + + start = (start + samples) % maxsamples; + + newsamples+=samples; + if (newsamples>maxsamples) newsamples=maxsamples; + numsamples = getPCMnew(pcmdataR,1,0,waveSmoothing,0,0); + getPCMnew(pcmdataL,0,0,waveSmoothing,0,1); + getPCM(vdataL,512,0,1,0,0); + getPCM(vdataR,512,1,1,0,0); +} + + +void PCM::addPCM16(short PCMdata[2][512]) +{ + int i,j; + int samples=512; + + DWRITE( "start: %d\n", start ); + + for(i=0;imaxsamples) newsamples=maxsamples; + + numsamples = getPCMnew(pcmdataR,1,0,waveSmoothing,0,0); + getPCMnew(pcmdataL,0,0,waveSmoothing,0,1); + getPCM(vdataL,512,0,1,0,0); + getPCM(vdataR,512,1,1,0,0); +} + + +void PCM::addPCM8( unsigned char PCMdata[2][512]) +{ + int i,j; + int samples=512; + + + for(i=0;imaxsamples) newsamples=maxsamples; + numsamples = getPCMnew(pcmdataR,1,0,waveSmoothing,0,0); + getPCMnew(pcmdataL,0,0,waveSmoothing,0,1); + getPCM(vdataL,512,0,1,0,0); + getPCM(vdataR,512,1,1,0,0); +} + + +//puts sound data requested at provided pointer +// +//samples is number of PCM samples to return +//freq = 0 gives PCM data +//freq = 1 gives FFT data +//smoothing is the smoothing coefficient + +//returned values are normalized from -1 to 1 + +void PCM::getPCM(float *PCMdata, int samples, int channel, int freq, float smoothing, int derive) +{ + int i,index; + + index=start-1; + + if (index<0) index=maxsamples+index; + + PCMdata[0]=PCMd[channel][index]; + + for(i=1;i +#include +#include +#include +#include "projectM.hpp" + +#include "fatal.h" +#include "Common.hpp" + +#include "CustomShape.hpp" +#include "Eval.hpp" +#include "Expr.hpp" +#include "InitCond.hpp" +#include "Param.hpp" +#include "Preset.hpp" +#include + +#include "wipemalloc.h" + +/** Constructor */ +Param::Param( std::string _name, short int _type, short int _flags, void * _engine_val, void * _matrix, + CValue _default_init_val, CValue _upper_bound, CValue _lower_bound): + name(_name), + type(_type), + flags (_flags), + matrix_flag (0), + matrix (_matrix), + engine_val(_engine_val), + default_init_val (_default_init_val), + upper_bound (_upper_bound), + lower_bound (_lower_bound) + { + + /** @@FIX THIS */ + /// @bug listen to above's advice! + /// @NOTE this is a hack, but will probably work fine + this->gx = projectM::currentEngine->presetInputs.gx; + this->gy = projectM::currentEngine->presetInputs.gy; + +} + + +/* Creates a user defined parameter */ +Param::Param(std::string _name) : + type(P_TYPE_DOUBLE), + flags(P_FLAG_USERDEF), + matrix_flag(0), + matrix(0), + name(_name) + { + + engine_val = new float(); + + default_init_val.float_val = DEFAULT_DOUBLE_IV; + upper_bound.float_val = DEFAULT_DOUBLE_UB; + lower_bound.float_val = DEFAULT_DOUBLE_LB; + + + /** @@FIX THIS */ + /// @bug listen to above's advice! + /// @NOTE this is a hack, but will probably work fine + this->gx = projectM::currentEngine->presetInputs.gx; + this->gy = projectM::currentEngine->presetInputs.gy; +} + +/* Free's a parameter type */ +Param::~Param() { + + int x; + if (flags & P_FLAG_USERDEF) { + free(engine_val); + } + + //if (!(param->flags & P_FLAG_DONT_FREE_MATRIX)) { + if (matrix && !(flags & P_FLAG_DONT_FREE_MATRIX)) { + + if (flags & P_FLAG_PER_POINT) { + free(matrix); + } //FIX THIS NOW XMAS05 + else if (flags & P_FLAG_PER_PIXEL) { + for (x = 0; x < gx; x++) + free(((float**)matrix)[x]); + free(matrix); + matrix = NULL; + } + } + + if (PARAM_DEBUG) printf("~Param: freeing \"%s\".\n", name.c_str()); +} + + +/* Returns nonzero if the string is valid parameter name */ +int Param::is_valid_param_string( const char * string ) { + + if (string == NULL) + return FALSE; + + /* This ensures the first character is non numeric */ + if ( ((*string) >= 48) && ((*string) <= 57)) + return FALSE; + + /* These probably should never happen */ + if (*string == '.') + return FALSE; + + if (*string == '+') + return FALSE; + + if (*string == '-') + return FALSE; + + /* Could also add checks for other symbols. May do later */ + + return TRUE; + +} + +/* Sets the parameter engine value to value val. + clipping occurs if necessary */ +void Param::set_param( float val) { + + switch (type) { + + case P_TYPE_BOOL: + if (val < 0) + *((int*)engine_val) = 0; + else if (val > 0) + *((int*)engine_val) = 1; + else + *((int*)engine_val) = 0; + break; + case P_TYPE_INT: + /* Make sure value is an integer */ + val = floor(val); + if (val < lower_bound.int_val) + *((int*)engine_val) = lower_bound.int_val; + else if (val > upper_bound.int_val) + *((int*)engine_val) = upper_bound.int_val; + else + *((int*)engine_val) = (int)val; + break; + case P_TYPE_DOUBLE: + /* Make sure value is an integer */ + + + if (val < lower_bound.float_val) + *((float*)engine_val) = lower_bound.float_val; + else if (val > upper_bound.float_val) + *((float*)engine_val) = upper_bound.float_val; + else + *((float*)engine_val) = val; + break; + default: + abort(); + break; + + } + + return; +} + + +/* Loads a float parameter into the builtin database */ +Param * Param::new_param_float(char * name, short int flags, void * engine_val, void * matrix, + float upper_bound, float lower_bound, float init_val) { + + Param * param; + CValue iv, ub, lb; + + iv.float_val = init_val; + ub.float_val = upper_bound; + lb.float_val = lower_bound; + + if ((param = new Param(name, P_TYPE_DOUBLE, flags, engine_val, matrix,iv, ub, lb)) == NULL) + return NULL; + + + /* Finished, return success */ + return param; +} + +/* Creates a new parameter of type int */ +Param * Param::new_param_int(char * name, short int flags, void * engine_val, + int upper_bound, int lower_bound, int init_val) { + + Param * param; + CValue iv, ub, lb; + + iv.int_val = init_val; + ub.int_val = upper_bound; + lb.int_val = lower_bound; + + if ((param = new Param(name, P_TYPE_INT, flags, engine_val, NULL, iv, ub, lb)) == NULL) + return NULL; + + + /* Finished, return success */ + return param; +} + +/* Creates a new parameter of type bool */ +Param * Param::new_param_bool(char * name, short int flags, void * engine_val, + int upper_bound, int lower_bound, int init_val) { + + Param * param; + CValue iv, ub, lb; + + iv.bool_val = init_val; + ub.bool_val = upper_bound; + lb.bool_val = lower_bound; + + if ((param = new Param(name, P_TYPE_BOOL, flags, engine_val, NULL, iv, ub, lb)) == NULL) + return NULL; + + + /* Finished, return success */ + return param; +} + + diff --git a/src/projectM-engine-backup/Param.hpp b/src/projectM-engine-backup/Param.hpp new file mode 100755 index 000000000..09a8e895d --- /dev/null +++ b/src/projectM-engine-backup/Param.hpp @@ -0,0 +1,110 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Parameter used within a preset + * + * $Log$ + */ + +#ifndef _PARAM_H +#define _PARAM_H + +/* Debug level, zero for none */ +#define PARAM_DEBUG 0 + +#define P_CREATE 1 +#define P_NONE 0 + +#define P_TYPE_BOOL 0 +#define P_TYPE_INT 1 +#define P_TYPE_DOUBLE 2 + +#define P_FLAG_NONE 0 +#define P_FLAG_READONLY 1 +#define P_FLAG_USERDEF (1 << 1) +#define P_FLAG_QVAR (1 << 2) +#define P_FLAG_TVAR (1 << 3) +#define P_FLAG_ALWAYS_MATRIX (1 << 4) +#define P_FLAG_DONT_FREE_MATRIX (1 << 5) +#define P_FLAG_PER_PIXEL (1 << 6) +#define P_FLAG_PER_POINT (1 << 7) + +#include "Expr.hpp" +#include "Common.hpp" +#include +class InitCond; +class Param; +class Preset; +//#include + +/* Parameter Type */ +class Param { +public: + std::string name; /* name of the parameter, not necessary but useful neverthless */ + short int type; /* parameter number type (int, bool, or float) */ + short int flags; /* read, write, user defined, etc */ + short int matrix_flag; /* for optimization purposes */ + void * engine_val; /* pointer to the engine variable */ + void * matrix; /* per pixel / per point matrix for this variable */ + CValue default_init_val; /* a default initial condition value */ + CValue upper_bound; /* this parameter's upper bound */ + CValue lower_bound; /* this parameter's lower bound */ + int gx, gy; + + /* Function prototypes */ + Param(std::string name, short int type, short int flags, + void * eqn_val, void *matrix, + CValue default_init_val, CValue upper_bound, + CValue lower_bound); + + ~Param(); + + /** Create a user defined parameter **/ + Param( std::string name ); + static int init_user_param_db(); + static int destroy_user_param_db(); + + void load_unspec_init_cond_shape(); + + + int compare_param( char *name, char *name2 ); + static int is_valid_param_string( const char *string ); + void set_param( float val ); + + static Param *new_param_float( char *name, short int flags, void *engine_val, + void *matrix, float upper_bound, + float lower_bound, + float init_val ); + static Param *new_param_double( char *name, short int flags, void *engine_val, + void *matrix, double upper_bound, + double lower_bound, + double init_val ); + static Param * new_param_int( char * name, short int flags, void * engine_val, + int upper_bound, int lower_bound, int init_val ); + static Param * new_param_bool( char * name, short int flags, void * engine_val, + int upper_bound, int lower_bound, int init_val ); + +}; + +#endif /** !_PARAM_TYPES_H */ + diff --git a/src/projectM-engine-backup/ParamUtils.hpp b/src/projectM-engine-backup/ParamUtils.hpp new file mode 100644 index 000000000..866e3d143 --- /dev/null +++ b/src/projectM-engine-backup/ParamUtils.hpp @@ -0,0 +1,138 @@ +/** ParamUtils.hpp: + * A collection of utility functions to make using parameter types easier. + * In reality, this stuff belongs elsewhere, but one step at a time + */ +#ifndef _PARAM_UTILS_HPP +#define _PARAM_UTILS_HPP + +#include "Param.hpp" +#include +#include + + +class BuiltinParams; + +class ParamUtils +{ +public: + static bool insert(Param * param, std::map * paramTree) + { + + assert(param); + assert(paramTree); + + + return ((paramTree->insert(std::make_pair(param->name,param))).second); + + } + + static const int AUTO_CREATE = 1; + static const int NO_CREATE = 0; + + template + static Param * find(std::string name, std::map * paramTree) + { + + assert(paramTree); + + Param * param = NULL; + + /* First look in the builtin database */ + std::map::iterator pos = paramTree->find(name); + + + if ((FLAGS == AUTO_CREATE) && ((pos == paramTree->end()))) + { + /* Check if string is valid */ + if (!Param::is_valid_param_string(name.c_str())) + return NULL; + + /* Now, create the user defined parameter given the passed name */ + if ((param = new Param(name)) == NULL) + return NULL; + + /* Finally, insert the new parameter into this preset's proper splaytree */ + std::pair::iterator, bool> insertRetPair = + paramTree->insert(std::make_pair(param->name, param)); + + if (insertRetPair.second) + param = insertRetPair.first->second; + + } else + param = pos->second; + + + /* Return the found (or created) parameter. Note that this could be null */ + return param; + + + } + + /// Checks attempt + static Param * find(const std::string & name, BuiltinParams * builtinParams, std::map * insertionTree) + { + + Param * param; + + // Check first db + if ((param = builtinParams->find_builtin_param(name)) != 0) + return param; + + // Check second db, create if necessary + return find(name, insertionTree); + + } + + class LoadInitCondFunctor + { + public: + LoadInitCondFunctor(Preset * preset) :m_preset(preset) {} + + void operator() (Param * param) + { + + InitCond * init_cond; + CValue init_val; + + /* Don't count read only parameters as initial conditions */ + if (param->flags & P_FLAG_READONLY) + return; + + /* If initial condition was not defined by the preset file, force a default one + with the following code */ + std::map::iterator pos; + if ((pos = (m_preset->init_cond_tree.find(param->name))) == m_preset->init_cond_tree.end()) + { + + std::map::iterator per_frame_init_pos; + /* Make sure initial condition does not exist in the set of per frame initial equations */ + if ((per_frame_init_pos = (m_preset->per_frame_init_eqn_tree.find(param->name))) != m_preset->per_frame_init_eqn_tree.end()) + return; + + if (param->type == P_TYPE_BOOL) + init_val.bool_val = 0; + + else if (param->type == P_TYPE_INT) + init_val.int_val = *(int*)param->engine_val; + + else if (param->type == P_TYPE_DOUBLE) + init_val.float_val = *(float*)param->engine_val; + + /* Create new initial condition */ + if ((init_cond = new InitCond(param, init_val)) == NULL) + return; + + /* Insert the initial condition into this presets tree */ + /// @bug not error checking + m_preset->init_cond_tree.insert(std::make_pair(init_cond->param->name,init_cond)); + } + + } + + private : + Preset * m_preset; + }; + +}; + +#endif diff --git a/src/projectM-engine-backup/Parser.cpp b/src/projectM-engine-backup/Parser.cpp new file mode 100755 index 000000000..ed1a663b9 --- /dev/null +++ b/src/projectM-engine-backup/Parser.cpp @@ -0,0 +1,2143 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU +* License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/* parser.c */ + +#include +#include +#include + +#include "Common.hpp" +#include "fatal.h" + +#include "BuiltinFuncs.hpp" +#include "CustomWave.hpp" +#include "CustomShape.hpp" +#include "Expr.hpp" +#include "Eval.hpp" +#include "Func.hpp" +#include "InitCond.hpp" +#include "Param.hpp" +#include "Preset.hpp" +#include "Parser.hpp" +#include "PerFrameEqn.hpp" +#include "PerPixelEqn.hpp" +#include +#include "ParamUtils.hpp" + +#include "wipemalloc.h" + +/* Grabs the next token from the file. The second argument points + to the raw string */ + +line_mode_t Parser::line_mode; +CustomWave *Parser::current_wave; +CustomShape *Parser::current_shape; +int Parser::string_line_buffer_index; +char Parser::string_line_buffer[STRING_LINE_SIZE]; +unsigned int Parser::line_count; +int Parser::per_frame_eqn_count; +int Parser::per_frame_init_eqn_count; +int Parser::last_custom_wave_id; +int Parser::last_custom_shape_id; +char Parser::last_eqn_type[MAX_TOKEN_SIZE]; +int Parser::last_token_size; + +token_t Parser::parseToken(FILE * fs, char * string) { + + char c; + int i; + + if (string != NULL) + memset(string, 0, MAX_TOKEN_SIZE); + + /* Loop until a delimiter is found, or the maximum string size is found */ + for (i = 0; i < MAX_TOKEN_SIZE;i++) { + c = fgetc(fs); + last_token_size++; + /* If the string line buffer is full, quit */ + if (string_line_buffer_index == (STRING_LINE_SIZE - 1)) + return tStringBufferFilled; + + /* Otherwise add this character to the string line buffer */ + string_line_buffer[string_line_buffer_index++] = c; + /* Now interpret the character */ + switch (c) { + + case '+': + return tPlus; + case '-': + return tMinus; + case '%': + return tMod; + case '/': + + /* check for line comment here */ + if ((c = fgetc(fs)) == '/') { + while(1) { + c = fgetc(fs); + if (c == EOF) { + line_mode = NORMAL_LINE_MODE; + return tEOF; + } + if (c == '\n') { + line_mode = NORMAL_LINE_MODE; + return tEOL; + } + } + + } + + /* Otherwise, just a regular division operator */ + ungetc(c, fs); + return tDiv; + + case '*': + return tMult; + case '|': + return tOr; + case '&': + return tAnd; + case '(': + return tLPr; + case ')': + return tRPr; + case '[': + return tLBr; + case ']': + return tRBr; + case '=': + return tEq; + case '\n': + line_count++; + line_mode = NORMAL_LINE_MODE; + return tEOL; + case ',': + return tComma; + case ';': + return tSemiColon; + case ' ': /* space, skip the character */ + i--; + break; + case EOF: + line_count = 1; + line_mode = NORMAL_LINE_MODE; + return tEOF; + + default: + if (string != NULL) + string[i] = c; + } + + } + + /* String reached maximum length, return special token error */ + return tStringTooLong; + +} + +/* Parse input in the form of "exp, exp, exp, ...)" + Returns a general expression list */ + +GenExpr **Parser::parse_prefix_args(FILE * fs, int num_args, Preset * preset) { + + int i, j; + GenExpr ** expr_list; /* List of arguments to function */ + GenExpr * gen_expr; + + /* Malloc the expression list */ + expr_list = (GenExpr**)wipemalloc(sizeof(GenExpr*)*num_args); + + /* Malloc failed */ + if (expr_list == NULL) + return NULL; + + + i = 0; + + while (i < num_args) { + //if (PARSE_DEBUG) printf("parse_prefix_args: parsing argument %d...\n", i+1); + /* Parse the ith expression in the list */ + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + //if (PARSE_DEBUG) printf("parse_prefix_args: failed to get parameter # %d for function (LINE %d)\n", i+1, line_count); + for (j = 0; j < i; j++) + delete expr_list[j]; + free(expr_list); + expr_list = NULL; + return NULL; + } + /* Assign entry in expression list */ + expr_list[i++] = gen_expr; + } + + //if (PARSE_DEBUG) printf("parse_prefix_args: finished parsing %d arguments (LINE %d)\n", num_args, line_count); + /* Finally, return the resulting expression list */ + return expr_list; +} + +/* Parses a comment at the top of the file. Stops when left bracket is found */ +int Parser::parse_top_comment(FILE * fs) { + + char string[MAX_TOKEN_SIZE]; + token_t token; + + /* Process tokens until left bracket is found */ + while ((token = parseToken(fs, string)) != tLBr) { + if (token == tEOF) + return PROJECTM_PARSE_ERROR; + } + + /* Done, return success */ + return PROJECTM_SUCCESS; +} + +/* Right Bracket is parsed by this function. + puts a new string into name */ +int Parser::parse_preset_name(FILE * fs, char * name) { + + token_t token; + + if (name == NULL) + return PROJECTM_FAILURE; + + if ((token = parseToken(fs, name)) != tRBr) + return PROJECTM_PARSE_ERROR; + +#ifdef DEBUG + if (PARSE_DEBUG) DWRITE("parse_preset_name: parsed preset (name = \"%s\")\n", name); +#endif + + return PROJECTM_SUCCESS; +} + + +/* Parses per pixel equations */ +int Parser::parse_per_pixel_eqn(FILE * fs, Preset * preset, char * init_string) { + + + char string[MAX_TOKEN_SIZE]; + GenExpr * gen_expr; + +#ifdef DEBUG + if (PARSE_DEBUG) DWRITE("parse_per_pixel: per_pixel equation parsing start...(LINE %d)\n", line_count); +#endif + +if (init_string != 0) { + strncpy(string, init_string, strlen(init_string)); +} else { + + if (parseToken(fs, string) != tEq) { /* parse per pixel operator name */ +#ifdef DEBUG + if (PARSE_DEBUG) DWRITE("parse_per_pixel: equal operator expected after per pixel operator \"%s\", but not found (LINE %d)\n", + string, line_count); +#endif + return PROJECTM_PARSE_ERROR; + } +} + + /* Parse right side of equation as an expression */ + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { +#ifdef DEBUG + if (PARSE_DEBUG) DWRITE("parse_per_pixel: equation evaluated to null? (LINE %d)\n", line_count); +#endif + return PROJECTM_PARSE_ERROR; + } + + /* Add the per pixel equation */ + if (preset->add_per_pixel_eqn(string, gen_expr) < 0) { + if (PARSE_DEBUG) { + DWRITE( "parse_per_pixel: no param associated with \"%s\" (LINE %d)", string, line_count); + + } + delete gen_expr; + return PROJECTM_PARSE_ERROR; + } + + return PROJECTM_SUCCESS; +} + +/* Parses an equation line, this function is way too big, should add some helper functions */ +int Parser::parse_line(FILE * fs, Preset * preset) { + + char eqn_string[MAX_TOKEN_SIZE]; + token_t token; + InitCond * init_cond; + PerFrameEqn * per_frame_eqn; + //PerFrameEqn * per_frame_init_eqn; + + /* Clear the string line buffer */ + memset(string_line_buffer, 0, STRING_LINE_SIZE); + string_line_buffer_index = 0; + + token = parseToken( fs, eqn_string ); + switch (token ) { + + /* Invalid Cases */ + case tRBr: + case tLPr: + case tRPr: + case tComma: + case tLBr: + case tPlus: + case tMinus: + case tMod: + case tMult: + case tOr: + case tAnd: + case tDiv: + + // if (PARSE_DEBUG) printf("parse_line: invalid token found at start of line (LINE %d)\n", line_count); + /* Invalid token found, return a parse error */ + return PROJECTM_PARSE_ERROR; + + + case tEOL: /* Empty line */ + line_mode = NORMAL_LINE_MODE; + return PROJECTM_SUCCESS; + + case tEOF: /* End of File */ + line_mode = NORMAL_LINE_MODE; + line_count = 1; + return EOF; + + case tSemiColon: /* Indicates end of expression */ + return PROJECTM_SUCCESS; + + /* Valid Case, either an initial condition or equation should follow */ + case tEq: + + /* CASE: PER FRAME INIT EQUATION */ + if (!strncmp(eqn_string, PER_FRAME_INIT_STRING, PER_FRAME_INIT_STRING_LENGTH)) { + + //if (PARSE_DEBUG) printf("parse_line: per frame init equation found...(LINE %d)\n", line_count); + + /* Parse the per frame equation */ + if ((init_cond = parse_per_frame_init_eqn(fs, preset, NULL)) == NULL) { + //if (PARSE_DEBUG) printf("parse_line: per frame init equation parsing failed (LINE %d)\n", line_count); + return PROJECTM_PARSE_ERROR; + } + + /* Insert the equation in the per frame equation tree */ + preset->per_frame_init_eqn_tree.insert(std::make_pair(init_cond->param->name, init_cond)); + + if (update_string_buffer(preset->per_frame_init_eqn_string_buffer, + &preset->per_frame_init_eqn_string_index) < 0) + { return PROJECTM_FAILURE;} + line_mode = PER_FRAME_INIT_LINE_MODE; + return PROJECTM_SUCCESS; + } + + /* Per frame equation case */ + if (!strncmp(eqn_string, PER_FRAME_STRING, PER_FRAME_STRING_LENGTH)) { + + /* Sometimes per frame equations are implicitly defined without the + per_frame_ prefix. This informs the parser that one could follow */ + line_mode = PER_FRAME_LINE_MODE; + + //if (PARSE_DEBUG) printf("parse_line: per frame equation found...(LINE %d)\n", line_count); + + /* Parse the per frame equation */ + if ((per_frame_eqn = parse_per_frame_eqn(fs, ++per_frame_eqn_count, preset)) == NULL) { + if (PARSE_DEBUG) printf("parse_line: per frame equation parsing failed (LINE %d)\n", line_count); + return PROJECTM_PARSE_ERROR; + } + + /* Insert the equation in the per frame equation tree */ + preset->per_frame_eqn_tree.insert(std::make_pair(per_frame_eqn_count, per_frame_eqn)); + + if (update_string_buffer(preset->per_frame_eqn_string_buffer, + &preset->per_frame_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + return PROJECTM_SUCCESS; + + } + + /* Wavecode initial condition case */ + if (!strncmp(eqn_string, WAVECODE_STRING, WAVECODE_STRING_LENGTH)) { + + line_mode = CUSTOM_WAVE_WAVECODE_LINE_MODE; + + //if (PARSE_DEBUG) + // printf("parse_line: wavecode prefix found: \"%s\"\n", eqn_string); + + // printf("string:%d\n", 5); + + //SUPER MYSTERIO-BUG - Don't Remove + printf(""); + + return parse_wavecode(eqn_string, fs, preset); + } + + /* Custom Wave Prefix */ + if ((!strncmp(eqn_string, WAVE_STRING, WAVE_STRING_LENGTH)) && + ((eqn_string[5] >= 48) && (eqn_string[5] <= 57))) { + + // if (PARSE_DEBUG) printf("parse_line wave prefix found: \"%s\"\n", eqn_string); + + return parse_wave(eqn_string, fs, preset); + + } + + + /* Shapecode initial condition case */ + if (!strncmp(eqn_string, SHAPECODE_STRING, SHAPECODE_STRING_LENGTH)) { + + line_mode = CUSTOM_SHAPE_SHAPECODE_LINE_MODE; + + if (PARSE_DEBUG) printf("parse_line: shapecode prefix found: \"%s\"\n", eqn_string); + + return parse_shapecode(eqn_string, fs, preset); + } + + /* Custom Shape Prefix */ + if ((!strncmp(eqn_string, SHAPE_STRING, SHAPE_STRING_LENGTH)) && + ((eqn_string[6] >= 48) && (eqn_string[6] <= 57))) { + + if (PARSE_DEBUG) printf("parse_line shape prefix found: \"%s\"\n", eqn_string); + return parse_shape(eqn_string, fs, preset); + + } + + /* Per pixel equation case */ + if (!strncmp(eqn_string, PER_PIXEL_STRING, PER_PIXEL_STRING_LENGTH)) { + line_mode = PER_PIXEL_LINE_MODE; + + if (parse_per_pixel_eqn(fs, preset, 0) < 0) + return PROJECTM_PARSE_ERROR; + + + if (update_string_buffer(preset->per_pixel_eqn_string_buffer, + &preset->per_pixel_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + if (PARSE_DEBUG) printf("parse_line: finished parsing per pixel equation (LINE %d)\n", line_count); + return PROJECTM_SUCCESS; + } + + /* Sometimes equations are written implicitly in milkdrop files, in the form + + per_frame_1 = p1 = eqn1; p2 = eqn2; p3 = eqn3;..; + + which is analagous to: + + per_frame_1 = p1 = eqn1; per_frame_2 = p2 = eqn2; per_frame_3 = p3 = eqn3; ...; + + The following line mode hack allows such implicit declaration of the + prefix that specifies the equation type. An alternative method + may be to associate each equation line as list of equations separated + by semicolons (and a new line ends the list). Instead, however, a global + variable called "line_mode" specifies the last type of equation found, + and bases any implicitly typed input on this fact + + Note added by Carmelo Piccione (cep@andrew.cmu.edu) 10/19/03 + */ + + /* Per frame line mode previously, try to parse the equation implicitly */ + if (line_mode == PER_FRAME_LINE_MODE) { + if ((per_frame_eqn = parse_implicit_per_frame_eqn(fs, eqn_string, ++per_frame_eqn_count, preset)) == NULL) + return PROJECTM_PARSE_ERROR; + + /* Insert the equation in the per frame equation tree */ + preset->per_frame_eqn_tree.insert(std::make_pair(per_frame_eqn_count, per_frame_eqn)); + + if (update_string_buffer(preset->per_frame_eqn_string_buffer, + &preset->per_frame_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + return PROJECTM_SUCCESS; + + } else if (line_mode == PER_FRAME_INIT_LINE_MODE) { + if (PARSE_DEBUG) printf("parse_line: parsing impliict per frame init eqn)\n"); + if ((init_cond = parse_per_frame_init_eqn(fs, preset, NULL)) == NULL) + return PROJECTM_PARSE_ERROR; + + ++per_frame_init_eqn_count; + + /* Insert the equation in the per frame equation tree */ + preset->per_frame_init_eqn_tree.insert(std::make_pair(init_cond->param->name, init_cond)); + + + if (update_string_buffer(preset->per_frame_init_eqn_string_buffer, + &preset->per_frame_init_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + return PROJECTM_SUCCESS; + } else if (line_mode == PER_PIXEL_LINE_MODE) { + + if (PARSE_DEBUG) printf("parse_line: implicit per pixel eqn\n", line_count); + return parse_per_pixel_eqn(fs, preset, eqn_string); + + + } else if (line_mode == CUSTOM_WAVE_PER_POINT_LINE_MODE) { + + if (PARSE_DEBUG) printf("parse_line: implicit cwave ppoint eqn found (LINE %d)\n", line_count); + //int len = strlen(eqn_string); + + if (parse_wave_helper(fs, preset, last_custom_wave_id, last_eqn_type, eqn_string) < 0) { + if (PARSE_DEBUG) printf("parse_line: failed to parse an implicit custom wave per point eqn\n"); + return PROJECTM_FAILURE; + } + return PROJECTM_SUCCESS; + } else if (line_mode == CUSTOM_WAVE_PER_FRAME_LINE_MODE) { + + //Added by PJS. I hope I did it right + CustomWave * custom_wave; + + /* Retrieve custom shape associated with this id */ + if ((custom_wave = preset->find_custom_wave(last_custom_wave_id, TRUE)) == NULL) + return PROJECTM_FAILURE; + return parse_wave_per_frame_eqn(fs, custom_wave, preset); + + } else if (line_mode == CUSTOM_WAVE_WAVECODE_LINE_MODE) { + if (PARSE_DEBUG) printf("unsupported line mode: CUSTOM_WAVE_WAVECODE_LINE_MODE\n"); + return PROJECTM_FAILURE; + } else if (line_mode == CUSTOM_SHAPE_SHAPECODE_LINE_MODE) { + if (PARSE_DEBUG) printf("unsupported line mode: CUSTOM_SHAPE_SHAPECODE_LINE_MODE\n"); + return PROJECTM_FAILURE; + } else if (line_mode == CUSTOM_SHAPE_PER_FRAME_LINE_MODE) { + + CustomShape * custom_shape; + + /* Retrieve custom shape associated with this id */ + if ((custom_shape = preset->find_custom_shape(last_custom_shape_id, TRUE)) == NULL) + return PROJECTM_FAILURE; + + return parse_shape_per_frame_eqn(fs, custom_shape, preset); + + } else if (line_mode == CUSTOM_SHAPE_PER_FRAME_INIT_LINE_MODE) { + + CustomShape * custom_shape; + + /* Retrieve custom shape associated with this id */ + if ((custom_shape = preset->find_custom_shape(last_custom_shape_id, TRUE)) == NULL) + return PROJECTM_FAILURE; + + return parse_shape_per_frame_init_eqn(fs, custom_shape, preset); + + } + + //if (PARSE_DEBUG) printf("parse_line: found initial condition: name = \"%s\" (LINE %d)\n", eqn_string, line_count); + /* Evaluate the initial condition */ + if ((init_cond = parse_init_cond(fs, eqn_string, preset)) == NULL) { + if (PARSE_DEBUG) printf("parse_line: failed to parse initial condition (LINE %d)\n", line_count); + return PROJECTM_PARSE_ERROR; + } + + /* Add equation to initial condition tree */ + preset->init_cond_tree.insert(std::make_pair(init_cond->param->name, init_cond)); + + /* Finished with initial condition line */ + // if (PARSE_DEBUG) printf("parse_line: initial condition parsed successfully\n"); + + return PROJECTM_SUCCESS; + + /* END INITIAL CONDITIONING PARSING */ + + default: /* an uncaught type or an error has occurred */ + if (PARSE_DEBUG) printf("parse_line: uncaught case, token val = %d\n", token); + return PROJECTM_PARSE_ERROR; + } + + /* Because of the default in the case statement, + control flow should never actually reach here */ + return PROJECTM_PARSE_ERROR; +} + + + +/* Parses a general expression, this function is the meat of the parser */ +GenExpr * Parser::parse_gen_expr ( FILE * fs, TreeExpr * tree_expr, Preset * preset) { + + int i; + char string[MAX_TOKEN_SIZE]; + token_t token; + GenExpr * gen_expr; + float val; + Param * param = NULL; + Func * func; + GenExpr ** expr_list; + + switch (token = parseToken(fs,string)) { + /* Left Parentice Case */ + case tLPr: + + /* CASE 1 (Left Parentice): See if the previous string before this parentice is a function name */ + if ((func = BuiltinFuncs::find_func(string)) != NULL) { + if (PARSE_DEBUG) { + DWRITE( "parse_gen_expr: found prefix function (name = %s) (LINE %d)\n", func->name, line_count); + + } + + /* Parse the functions arguments */ + if ((expr_list = parse_prefix_args(fs, func->num_args, preset)) == NULL) { + if (PARSE_DEBUG) { + DWRITE( "parse_prefix_args: failed to generate an expresion list! (LINE %d) \n", line_count); + + } + if ( tree_expr != NULL ) { + delete tree_expr; + } + return NULL; + } + + /* Convert function to expression */ + if ((gen_expr = GenExpr::prefun_to_expr((float (*)(void *))func->func_ptr, expr_list, func->num_args)) == NULL) { + if (PARSE_DEBUG) printf("parse_prefix_args: failed to convert prefix function to general expression (LINE %d) \n", + line_count); + delete tree_expr; + for (i = 0; i < func->num_args;i++) + delete expr_list[i]; + free(expr_list); + expr_list = NULL; + return NULL; + } + + + + token = parseToken(fs, string); + + if (*string != 0) { + if (PARSE_DEBUG) printf("parse_prefix_args: empty string expected, but not found...(LINE %d)\n", line_count); + /* continue anyway for now, could be implicit multiplication */ + } + + return parse_infix_op(fs, token, insert_gen_expr(gen_expr, &tree_expr), preset); + } + + + /* Case 2: (Left Parentice), a string coupled with a left parentice. Either an error or implicit + multiplication operator. For now treat it as an error */ + if (*string != 0) { + if (PARSE_DEBUG) printf("parse_gen_expr: implicit multiplication case unimplemented!\n"); + delete tree_expr; + return NULL; + } + + /* CASE 3 (Left Parentice): the following is enclosed parentices to change order + of operations. So we create a new expression tree */ + + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + //if (PARSE_DEBUG) printf("parse_gen_expr: found left parentice, but failed to create new expression tree \n"); + delete tree_expr; + return NULL; + } + + if (PARSE_DEBUG) printf("parse_gen_expr: finished enclosed expression tree...\n"); + token = parseToken(fs, string); + return parse_infix_op(fs, token, insert_gen_expr(gen_expr, &tree_expr), preset); + + /* Plus is a prefix operator check */ + case tPlus: + if (*string == 0) { + + //if (PARSE_DEBUG) printf("parse_gen_expr: plus used as prefix (LINE %d)\n", line_count); + + /* Treat prefix plus as implict 0 preceding operator */ + gen_expr = GenExpr::const_to_expr(0); + + return parse_infix_op(fs, tPositive, insert_gen_expr(gen_expr, &tree_expr), preset); + } + + /* Minus is a prefix operator check */ + case tMinus: + if (*string == 0) { + + /* Use the negative infix operator, but first add an implicit zero to the operator tree */ + gen_expr = GenExpr::const_to_expr(0); + //return parse_gen_expr(fs, insert_gen_expr(gen_expr, &tree_expr), preset); + return parse_infix_op(fs, tNegative, insert_gen_expr(gen_expr, &tree_expr), preset); + } + + /* All the following cases are strings followed by an infix operator or terminal */ + case tRPr: + case tEOL: + case tEOF: + case tSemiColon: + case tComma: + + /* CASE 1 (terminal): string is empty, but not null. Not sure if this will actually happen + any more. */ + if (*string == 0) { + //if (PARSE_DEBUG) printf("parse_gen_expr: empty string coupled with terminal (LINE %d) \n", line_count); + return parse_infix_op(fs, token, tree_expr, preset); + + } + + default: + + /* CASE 0: Empty string, parse error */ + if (*string == 0) { + if (PARSE_DEBUG) { + DWRITE( "parse_gen_expr: empty string coupled with infix op (ERROR!) (LINE %d) \n", line_count); + + } + delete tree_expr; + return NULL; + } + + /* CASE 1: Check if string is a just a floating point number */ + if (string_to_float(string, &val) != PROJECTM_PARSE_ERROR) { + if ((gen_expr = GenExpr::const_to_expr(val)) == NULL) { + delete tree_expr; + return NULL; + } + + /* Parse the rest of the line */ + return parse_infix_op(fs, token, insert_gen_expr(gen_expr, &tree_expr), preset); + + } + + + /* CASE 4: custom shape variable */ + if (current_shape != NULL) { + if ((param = ParamUtils::find(string, current_shape->param_tree)) == NULL) { + if ((param = preset->builtinParams.find_builtin_param(string)) == NULL) + if ((param = ParamUtils::find(string, current_shape->param_tree)) == NULL) { + delete tree_expr; + return NULL; + } + } + + if (PARSE_DEBUG) { + DWRITE( "parse_gen_expr: custom shape parameter (name = %s)... \n", param->name.c_str()); + + } + + /* Convert parameter to an expression */ + if ((gen_expr = GenExpr::param_to_expr(param)) == NULL) { + delete tree_expr; + return NULL; + } + + //if (PARSE_DEBUG) printf("converted to expression (LINE %d)\n", line_count); + + /* Parse the rest of the line */ + return parse_infix_op(fs, token, insert_gen_expr(gen_expr, &tree_expr), preset); + } + + /* CASE 5: custom wave variable */ + if (current_wave != NULL) { + if ((param = ParamUtils::find(string, current_wave->param_tree)) == NULL) { + if ((param = preset->builtinParams.find_builtin_param(string)) == NULL) + if ((param = ParamUtils::find(string, current_wave->param_tree)) == NULL) { + delete tree_expr; + return NULL; + } + } + + if (PARSE_DEBUG) { + DWRITE("parse_gen_expr: custom wave parameter (name = %s)... \n", param->name.c_str()); + + } + + /* Convert parameter to an expression */ + if ((gen_expr = GenExpr::param_to_expr(param)) == NULL) { + delete tree_expr; + return NULL; + } + + if (PARSE_DEBUG) printf("converted to expression (LINE %d)\n", line_count); + + /* Parse the rest of the line */ + return parse_infix_op(fs, token, insert_gen_expr(gen_expr, &tree_expr), preset); + + } + + /* CASE 6: regular parameter. Will be created if necessary and the string has no invalid characters */ + if ((param = ParamUtils::find(string, &preset->builtinParams, &preset->user_param_tree)) != NULL) { + + if (PARSE_DEBUG) { + DWRITE("parse_gen_expr: parameter (name = %s)...\n", param->name.c_str()); + + } + + /* Convert parameter to an expression */ + if ((gen_expr = GenExpr::param_to_expr(param)) == NULL) { + delete tree_expr; + return NULL; + } + + if (PARSE_DEBUG) printf("converted to expression (LINE %d)\n", line_count); + + /* Parse the rest of the line */ + return parse_infix_op(fs, token, insert_gen_expr(gen_expr, &tree_expr), preset); + + } + + /* CASE 7: Bad string, give up */ + if (PARSE_DEBUG) { + DWRITE( "parse_gen_expr: syntax error [string = \"%s\"] (LINE %d)\n", string, line_count); + + } + delete tree_expr; + return NULL; + } +} + + + +/* Inserts expressions into tree according to operator precedence. + If root is null, a new tree is created, with gen_expr as only element */ + +TreeExpr * Parser::insert_infix_op(InfixOp * infix_op, TreeExpr **root) { + + TreeExpr * new_root; + + /* Sanity check */ + if (infix_op == NULL) + return NULL; + + /* The root is null, so make this operator + the new root */ + + if (*root == NULL) { + new_root = TreeExpr::new_tree_expr(infix_op, NULL, NULL, NULL); + *root = new_root; + return new_root; + } + + /* The root node is not an infix function, + so we make this infix operator the new root */ + + if ((*root)->infix_op == NULL) { + new_root = TreeExpr::new_tree_expr(infix_op, NULL, *root, NULL); + (*root) = new_root; + return new_root; + } + + /* The root is an infix function. If the precedence + of the item to be inserted is greater than the root's + precedence, then make gen_expr the root */ + + if (infix_op->precedence > (*root)->infix_op->precedence) { + new_root = TreeExpr::new_tree_expr(infix_op, NULL, *root, NULL); + (*root) = new_root; + return new_root; + } + + /* If control flow reaches here, use a recursive helper + with the knowledge that the root is higher precedence + than the item to be inserted */ + + insert_infix_rec(infix_op, *root); + return *root; + +} + + +TreeExpr * Parser::insert_gen_expr(GenExpr * gen_expr, TreeExpr ** root) { + + TreeExpr * new_root; + + /* If someone foolishly passes a null + pointer to insert, return the original tree */ + + if (gen_expr == NULL) { + return *root; + } + + /* If the root is null, generate a new expression tree, + using the passed expression as the root element */ + + if (*root == NULL) { + new_root = TreeExpr::new_tree_expr(NULL, gen_expr, NULL, NULL); + *root = new_root; + return new_root; + } + + + /* Otherwise. the new element definitely will not replace the current root. + Use a recursive helper function to do insertion */ + + insert_gen_rec(gen_expr, *root); + return *root; +} + +/* A recursive helper function to insert general expression elements into the operator tree */ +int Parser::insert_gen_rec(GenExpr * gen_expr, TreeExpr * root) { + + /* Trivial Case: root is null */ + + if (root == NULL) { + ////if (PARSE_DEBUG) printf("insert_gen_rec: root is null, returning failure\n"); + return PROJECTM_FAILURE; + } + + + /* The current node's left pointer is null, and this + current node is an infix operator, so insert the + general expression at the left pointer */ + + if ((root->left == NULL) && (root->infix_op != NULL)) { + root->left = TreeExpr::new_tree_expr(NULL, gen_expr, NULL, NULL); + return PROJECTM_SUCCESS; + } + + /* The current node's right pointer is null, and this + current node is an infix operator, so insert the + general expression at the right pointer */ + + if ((root->right == NULL) && (root->infix_op != NULL)) { + root->right = TreeExpr::new_tree_expr(NULL, gen_expr, NULL, NULL); + return PROJECTM_SUCCESS; + } + + /* Otherwise recurse down to the left. If + this succeeds then return. If it fails, try + recursing down to the right */ + + if (insert_gen_rec(gen_expr, root->left) == PROJECTM_FAILURE) + return insert_gen_rec(gen_expr, root->right); + + /* Impossible for control flow to reach here, but in + the world of C programming, who knows... */ + //if (PARSE_DEBUG) printf("insert_gen_rec: should never reach here!\n"); + return PROJECTM_FAILURE; +} + + +/* A recursive helper function to insert infix arguments by operator precedence */ +int Parser::insert_infix_rec(InfixOp * infix_op, TreeExpr * root) { + + /* Shouldn't happen, implies a parse error */ + + if (root == NULL) + return PROJECTM_FAILURE; + + /* Also shouldn't happen, also implies a (different) parse error */ + + if (root->infix_op == NULL) + return PROJECTM_FAILURE; + + /* Left tree is empty, attach this operator to it. + I don't think this will ever happen */ + if (root->left == NULL) { + root->left = TreeExpr::new_tree_expr(infix_op, NULL, root->left, NULL); + return PROJECTM_SUCCESS; + } + + /* Right tree is empty, attach this operator to it */ + if (root->right == NULL) { + root->right = TreeExpr::new_tree_expr(infix_op, NULL, root->right, NULL); + return PROJECTM_SUCCESS; + } + + /* The left element can now be ignored, since there is no way for this + operator to use those expressions */ + + /* If the right element is not an infix operator, + then insert the expression here, attaching the old right branch + to the left of the new expression */ + + if (root->right->infix_op == NULL) { + root->right = TreeExpr::new_tree_expr(infix_op, NULL, root->right, NULL); + return PROJECTM_SUCCESS; + } + + /* Traverse deeper if the inserting operator precedence is less than the + the root's right operator precedence */ + if (infix_op->precedence < root->right->infix_op->precedence) + return insert_infix_rec(infix_op, root->right); + + /* Otherwise, insert the operator here */ + + root->right = TreeExpr::new_tree_expr(infix_op, NULL, root->right, NULL); + return PROJECTM_SUCCESS; + +} + +/* Parses an infix operator */ +GenExpr * Parser::parse_infix_op(FILE * fs, token_t token, TreeExpr * tree_expr, Preset * preset) { + + GenExpr * gen_expr; + + switch (token) { + /* All the infix operators */ + case tPlus: + //if (PARSE_DEBUG) printf("parse_infix_op: found addition operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_add, &tree_expr), preset); + case tMinus: + //if (PARSE_DEBUG) printf("parse_infix_op: found subtraction operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_minus, &tree_expr), preset); + case tMult: + //if (PARSE_DEBUG) printf("parse_infix_op: found multiplication operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_mult, &tree_expr), preset); + case tDiv: + //if (PARSE_DEBUG) printf("parse_infix_op: found division operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_div, &tree_expr), preset); + case tMod: + //if (PARSE_DEBUG) printf("parse_infix_op: found modulo operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_mod, &tree_expr), preset); + case tOr: + //if (PARSE_DEBUG) printf("parse_infix_op: found bitwise or operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_or, &tree_expr), preset); + case tAnd: + //if (PARSE_DEBUG) printf("parse_infix_op: found bitwise and operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_and, &tree_expr), preset); + case tPositive: + //if (PARSE_DEBUG) printf("parse_infix_op: found positive operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_positive, &tree_expr), preset); + case tNegative: + //if (PARSE_DEBUG) printf("parse_infix_op: found negative operator (LINE %d)\n", line_count); + return parse_gen_expr(fs, insert_infix_op(Eval::infix_negative, &tree_expr), preset); + + case tEOL: + case tEOF: + case tSemiColon: + case tRPr: + case tComma: + //if (PARSE_DEBUG) printf("parse_infix_op: terminal found (LINE %d)\n", line_count); + gen_expr = GenExpr::new_gen_expr(TREE_T, (void*)tree_expr); + return gen_expr; + default: + //if (PARSE_DEBUG) printf("parse_infix_op: operator or terminal expected, but not found (LINE %d)\n", line_count); + delete tree_expr; + return NULL; + } + + /* Will never happen */ + return NULL; + +} + +/* Parses an integer, checks for +/- prefix */ +int Parser::parse_int(FILE * fs, int * int_ptr) { + +char string[MAX_TOKEN_SIZE]; + token_t token; + int sign; + char * end_ptr = " "; + + token = parseToken(fs, string); + + + switch (token) { + case tMinus: + sign = -1; + token = parseToken(fs, string); + break; + case tPlus: + sign = 1; + token = parseToken(fs, string); + break; + default: + sign = 1; + break; + } + + + if (string[0] == 0) + return PROJECTM_PARSE_ERROR; + + /* Convert the string to an integer. *end_ptr + should end up pointing to null terminator of 'string' + if the conversion was successful. */ + // printf("STRING: \"%s\"\n", string); + + (*int_ptr) = sign*strtol(string, &end_ptr, 10); + + /* If end pointer is a return character or null terminator, all is well */ + if ((*end_ptr == '\r') || (*end_ptr == '\0')) + return PROJECTM_SUCCESS; + + return PROJECTM_PARSE_ERROR; + +} +/* Parses a floating point number */ +int Parser::string_to_float(char * string, float * float_ptr) { + + char ** error_ptr; + + if (*string == 0) + return PROJECTM_PARSE_ERROR; + + error_ptr = (char**)wipemalloc(sizeof(char**)); + + (*float_ptr) = strtod(string, error_ptr); + + /* These imply a succesful parse of the string */ + if ((**error_ptr == '\0') || (**error_ptr == '\r')) { + free(error_ptr); + error_ptr = NULL; + return PROJECTM_SUCCESS; + } + + (*float_ptr) = 0; + free(error_ptr); + error_ptr = NULL; + return PROJECTM_PARSE_ERROR; +} + +/* Parses a floating point number */ +int Parser::parse_float(FILE * fs, float * float_ptr) { + + char string[MAX_TOKEN_SIZE]; + char ** error_ptr; + token_t token; + int sign; + + error_ptr =(char**) wipemalloc(sizeof(char**)); + + token = parseToken(fs, string); + + switch (token) { + case tMinus: + sign = -1; + token = parseToken(fs, string); + break; + case tPlus: + sign = 1; + token = parseToken(fs, string); + break; + default: + sign = 1; + } + + if (string[0] == 0) { + free(error_ptr); + error_ptr = NULL; + return PROJECTM_PARSE_ERROR; + } + + (*float_ptr) = sign*strtod(string, error_ptr); + + /* No conversion was performed */ + if ((**error_ptr == '\0') || (**error_ptr == '\r')) { + free(error_ptr); + error_ptr = NULL; + return PROJECTM_SUCCESS; + } + + //if (PARSE_DEBUG) printf("parse_float: float conversion failed for string \"%s\"\n", string); + + (*float_ptr) = 0; + free(error_ptr); + error_ptr = NULL; + return PROJECTM_PARSE_ERROR; + +} + +/* Parses a per frame equation. That is, interprets a stream of data as a per frame equation */ +PerFrameEqn * Parser::parse_per_frame_eqn(FILE * fs, int index, Preset * preset) { + + char string[MAX_TOKEN_SIZE]; + Param * param; + PerFrameEqn * per_frame_eqn; + GenExpr * gen_expr; + + if (parseToken(fs, string) != tEq) { + //if (PARSE_DEBUG) printf("parse_per_frame_eqn: no equal sign after string \"%s\" (LINE %d)\n", string, line_count); + return NULL; + } + + /* Find the parameter associated with the string, create one if necessary */ + if ((param = ParamUtils::find(string, &preset->builtinParams, &preset->user_param_tree)) == NULL) { + return NULL; + } + + /* Make sure parameter is writable */ + if (param->flags & P_FLAG_READONLY) { + //if (PARSE_DEBUG) printf("parse_per_frame_eqn: parameter %s is marked as read only (LINE %d)\n", param->name, line_count); + return NULL; + } + + /* Parse right side of equation as an expression */ + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + //if (PARSE_DEBUG) printf("parse_per_frame_eqn: equation evaluated to null (LINE %d)\n", line_count); + return NULL; + } + + //if (PARSE_DEBUG) printf("parse_per_frame_eqn: finished per frame equation evaluation (LINE %d)\n", line_count); + + /* Create a new per frame equation */ + if ((per_frame_eqn = new PerFrameEqn(index, param, gen_expr)) == NULL) { + //if (PARSE_DEBUG) printf("parse_per_frame_eqn: failed to create a new per frame eqn, out of memory?\n"); + delete gen_expr; + return NULL; + } + + //if (PARSE_DEBUG) printf("parse_per_frame_eqn: per_frame eqn parsed succesfully\n"); + + return per_frame_eqn; +} + +/* Parses an 'implicit' per frame equation. That is, interprets a stream of data as a per frame equation without a prefix */ +PerFrameEqn * Parser::parse_implicit_per_frame_eqn(FILE * fs, char * param_string, int index, Preset * preset) { + + Param * param; + PerFrameEqn * per_frame_eqn; + GenExpr * gen_expr; + + if (fs == NULL) + return NULL; + if (param_string == NULL) + return NULL; + if (preset == NULL) + return NULL; + + //rintf("param string: %s\n", param_string); + /* Find the parameter associated with the string, create one if necessary */ + if ((param = ParamUtils::find(param_string, &preset->builtinParams, &preset->user_param_tree)) == NULL) { + return NULL; + } + + //printf("parse_implicit_per_frame_eqn: param is %s\n", param->name); + + /* Make sure parameter is writable */ + if (param->flags & P_FLAG_READONLY) { + //if (PARSE_DEBUG) printf("parse_implicit_per_frame_eqn: parameter %s is marked as read only (LINE %d)\n", param->name, line_count); + return NULL; + } + + /* Parse right side of equation as an expression */ + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + //if (PARSE_DEBUG) printf("parse_implicit_per_frame_eqn: equation evaluated to null (LINE %d)\n", line_count); + return NULL; + } + + //if (PARSE_DEBUG) printf("parse_implicit_per_frame_eqn: finished per frame equation evaluation (LINE %d)\n", line_count); + + /* Create a new per frame equation */ + if ((per_frame_eqn = new PerFrameEqn(index, param, gen_expr)) == NULL) { + //if (PARSE_DEBUG) printf("parse_implicit_per_frame_eqn: failed to create a new per frame eqn, out of memory?\n"); + delete gen_expr; + return NULL; + } + + //if (PARSE_DEBUG) printf("parse_implicit_per_frame_eqn: per_frame eqn parsed succesfully\n"); + + return per_frame_eqn; +} + +/* Parses an initial condition */ +InitCond * Parser::parse_init_cond(FILE * fs, char * name, Preset * preset) { + + Param * param; + CValue init_val; + InitCond * init_cond; + + if (name == NULL) + return NULL; + if (preset == NULL) + return NULL; + + /* Search for the paramater in the database, creating it if necessary */ + if ((param = ParamUtils::find(name, &preset->builtinParams, &preset->user_param_tree)) == NULL) { + return NULL; + } + + //if (PARSE_DEBUG) printf("parse_init_cond: parameter = \"%s\" (LINE %d)\n", param->name, line_count); + + if (param->flags & P_FLAG_READONLY) { + //if (PARSE_DEBUG) printf("parse_init_cond: builtin parameter \"%s\" marked as read only!\n", param->name); + return NULL; + } + + /* At this point, a parameter has been created or was found + in the database. */ + + //if (PARSE_DEBUG) printf("parse_init_cond: parsing initial condition value... (LINE %d)\n", line_count); + + /* integer value (boolean is an integer in C) */ + if ((param->type == P_TYPE_INT) || (param->type == P_TYPE_BOOL)) { + if ((parse_int(fs, (int*)&init_val.int_val)) == PROJECTM_PARSE_ERROR) { + //if (PARSE_DEBUG) printf("parse_init_cond: error parsing integer!\n"); + return NULL; + } + } + + /* float value */ + else if (param->type == P_TYPE_DOUBLE) { + if ((parse_float(fs, (float*)&init_val.float_val)) == PROJECTM_PARSE_ERROR) { + //if (PARSE_DEBUG) printf("parse_init_cond: error parsing float!\n"); + return NULL; + } + } + + /* Unknown value */ + else { + //if (PARSE_DEBUG) printf("parse_init_cond: unknown parameter type!\n"); + return NULL; + } + + /* Create new initial condition */ + if ((init_cond = new InitCond(param, init_val)) == NULL) { + //if (PARSE_DEBUG) printf("parse_init_cond: new_init_cond failed!\n"); + return NULL; + } + + /* Finished */ + return init_cond; +} + +/* Parses a per frame init equation, not sure if this works right now */ +InitCond * Parser::parse_per_frame_init_eqn(FILE * fs, Preset * preset, std::map * database) { + + char name[MAX_TOKEN_SIZE]; + Param * param = NULL; + CValue init_val; + InitCond * init_cond; + GenExpr * gen_expr; + float val; + token_t token; + + + if (preset == NULL) + return NULL; + if (fs == NULL) + return NULL; + + if ((token = parseToken(fs, name)) != tEq) + return NULL; + + + /* If a database was specified,then use ParamUtils::find_db instead */ + if ((database != NULL) && ((param = ParamUtils::find(name, database)) == NULL)) { + return NULL; + } + + /* Otherwise use the builtin parameter and user databases. This is confusing. Sorry. */ + if ((param == NULL) && ((param = ParamUtils::find(name, &preset->builtinParams, &preset->user_param_tree)) == NULL)) { + return NULL; + } + + if (PARSE_DEBUG) printf("parse_per_frame_init_eqn: parameter = \"%s\" (LINE %d)\n", param->name.c_str(), line_count); + + if (param->flags & P_FLAG_READONLY) { + //if (PARSE_DEBUG) printf("pars_per_frame_init_eqn: builtin parameter \"%s\" marked as read only!\n", param->name); + return NULL; + } + + /* At this point, a parameter has been created or was found + in the database. */ + + if (PARSE_DEBUG) printf("parse_per_frame_init_eqn: parsing right hand side of per frame init equation.. (LINE %d)\n", line_count); + + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + if (PARSE_DEBUG) printf("parse_per_frame_init_eqn: failed to parse general expresion!\n"); + return NULL; + } + + /* Compute initial condition value */ + val = gen_expr->eval_gen_expr(-1,-1); + + /* Free the general expression now that we are done with it */ + delete gen_expr; + + /* integer value (boolean is an integer in C) */ + if ((param->type == P_TYPE_INT) || (param->type == P_TYPE_BOOL)) { + init_val.int_val = (int)val; + } + + /* float value */ + else if (param->type == P_TYPE_DOUBLE) { + init_val.float_val = val; + } + + /* Unknown value */ + else { + if (PARSE_DEBUG) printf("pase_per_frame_init_eqn: unknown parameter type!\n"); + return NULL; + } + + + /* Create new initial condition */ + if ((init_cond = new InitCond(param, init_val)) == NULL) { + if (PARSE_DEBUG) printf("parse_per_frame_init_eqn: new_init_cond failed!\n"); + return NULL; + } + + + /* Finished */ + return init_cond; +} + +int Parser::parse_wavecode(char * token, FILE * fs, Preset * preset) { + + char * var_string; + InitCond * init_cond; + CustomWave * custom_wave; + int id; + CValue init_val; + Param * param; + + /* Null argument checks */ + if (preset == NULL) + return PROJECTM_FAILURE; + if (fs == NULL) + return PROJECTM_FAILURE; + if (token == NULL) + return PROJECTM_FAILURE; + + /* token should be in the form wavecode_N_var, such as wavecode_1_samples */ + + /* Get id and variable name from token string */ + if (parse_wavecode_prefix(token, &id, &var_string) < 0) + return PROJECTM_PARSE_ERROR; + + //if (PARSE_DEBUG) printf("parse_wavecode: wavecode id = %d, parameter = \"%s\"\n", id, var_string); + + /* Retrieve custom wave information from preset. The 3rd argument + if true creates a custom wave if one does not exist */ + if ((custom_wave = preset->find_custom_wave(id, TRUE)) == NULL) { + //if (PARSE_DEBUG) printf("parse_wavecode: failed to load (or create) custom wave (id = %d)!\n", id); + return PROJECTM_FAILURE; + } + //if (PARSE_DEBUG) printf("parse_wavecode: custom wave found (id = %d)\n", custom_wave->id); + + /* Retrieve parameter from this custom waves parameter db */ + if ((param = ParamUtils::find(var_string,custom_wave->param_tree)) == NULL) + return PROJECTM_FAILURE; + + //if (PARSE_DEBUG) printf("parse_wavecode: custom wave parameter found (name = %s)\n", param->name); + + /* integer value (boolean is an integer in C) */ + if ((param->type == P_TYPE_INT) || (param->type == P_TYPE_BOOL)) { + if ((parse_int(fs, (int*)&init_val.int_val)) == PROJECTM_PARSE_ERROR) { + //if (PARSE_DEBUG) printf("parse_wavecode: error parsing integer!\n"); + return PROJECTM_PARSE_ERROR; + } + } + + /* float value */ + else if (param->type == P_TYPE_DOUBLE) { + if ((parse_float(fs, (float*)&init_val.float_val)) == PROJECTM_PARSE_ERROR) { + //if (PARSE_DEBUG) printf("parse_wavecode: error parsing float!\n"); + return PROJECTM_PARSE_ERROR; + } + } + + /* Unknown value */ + else { + //if (PARSE_DEBUG) printf("parse_wavecode: unknown parameter type!\n"); + return PROJECTM_PARSE_ERROR; + } + + /* Create new initial condition */ + if ((init_cond = new InitCond(param, init_val)) == NULL) { + //if (PARSE_DEBUG) printf("parse_wavecode: new_init_cond failed!\n"); + return PROJECTM_FAILURE; + } + + custom_wave->init_cond_tree.insert(std::make_pair(param->name, init_cond)); + + line_mode = CUSTOM_WAVE_WAVECODE_LINE_MODE; + + //if (PARSE_DEBUG) printf("parse_wavecode: [success]\n"); + return PROJECTM_SUCCESS; +} + +int Parser::parse_shapecode(char * token, FILE * fs, Preset * preset) { + + char * var_string; + InitCond * init_cond; + CustomShape * custom_shape; + int id; + CValue init_val; + Param * param; + + /* Null argument checks */ + if (preset == NULL) + return PROJECTM_FAILURE; + if (fs == NULL) + return PROJECTM_FAILURE; + if (token == NULL) + return PROJECTM_FAILURE; + + /* token should be in the form shapecode_N_var, such as shapecode_1_samples */ + + /* Get id and variable name from token string */ + if (parse_shapecode_prefix(token, &id, &var_string) < 0) + return PROJECTM_PARSE_ERROR; + + last_custom_shape_id = id; + + //if (PARSE_DEBUG) printf("parse_shapecode: shapecode id = %d, parameter = \"%s\"\n", id, var_string); + + /* Retrieve custom shape information from preset. The 3rd argument + if true creates a custom shape if one does not exist */ + + if ((custom_shape = preset->find_custom_shape(id, TRUE)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shapecode: failed to load (or create) custom shape (id = %d)!\n", id); + return PROJECTM_FAILURE; + } + //if (PARSE_DEBUG) printf("parse_shapecode: custom shape found (id = %d)\n", custom_shape->id); + + /* Retrieve parameter from this custom shapes parameter db */ + + + if ((param = ParamUtils::find(var_string, custom_shape->param_tree)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shapecode: failed to create parameter.\n"); + return PROJECTM_FAILURE; + } + //if (PARSE_DEBUG) printf("parse_shapecode: custom shape parameter found (name = %s)\n", param->name); + + /* integer value (boolean is an integer in C) */ + if ((param->type == P_TYPE_INT) || (param->type == P_TYPE_BOOL)) { + if ((parse_int(fs, (int*)&init_val.int_val)) == PROJECTM_PARSE_ERROR) { + //if (PARSE_DEBUG) printf("parse_shapecode: error parsing integer!\n"); + return PROJECTM_PARSE_ERROR; + } + } + + /* float value */ + else if (param->type == P_TYPE_DOUBLE) { + if ((parse_float(fs, (float*)&init_val.float_val)) == PROJECTM_PARSE_ERROR) { + //if (PARSE_DEBUG) printf("parse_shapecode: error parsing float!\n"); + return PROJECTM_PARSE_ERROR; + } + } + + /* Unknown value */ + else { + //if (PARSE_DEBUG) printf("parse_shapecode: unknown parameter type!\n"); + return PROJECTM_PARSE_ERROR; + } + + /* Create new initial condition */ + if ((init_cond = new InitCond(param, init_val)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shapecode: new_init_cond failed!\n"); + return PROJECTM_FAILURE; + } + + custom_shape->init_cond_tree.insert(std::make_pair(param->name,init_cond)); + line_mode = CUSTOM_SHAPE_SHAPECODE_LINE_MODE; + + //if (PARSE_DEBUG) printf("parse_shapecode: [success]\n"); + return PROJECTM_SUCCESS; +} + + +int Parser::parse_wavecode_prefix(char * token, int * id, char ** var_string) { + + int len, i, j; + + if (token == NULL) + return PROJECTM_FAILURE; + /* + if (*var_string == NULL) + return PROJECTM_FAILURE; + */ + if (id == NULL) + return PROJECTM_FAILURE; + + len = strlen(token); + + /* Move pointer passed "wavecode_" prefix */ + if (len <= WAVECODE_STRING_LENGTH) + return PROJECTM_FAILURE; + i = WAVECODE_STRING_LENGTH; + j = 0; + (*id) = 0; + + /* This loop grabs the integer id for this custom wave */ + while ((i < len) && (token[i] >= 48) && (token[i] <= 57)) { + if (j >= MAX_TOKEN_SIZE) + return PROJECTM_FAILURE; + + (*id) = 10*(*id) + (token[i]-48); + j++; + i++; + } + + + if (i > (len - 2)) + return PROJECTM_FAILURE; + + *var_string = token + i + 1; + + return PROJECTM_SUCCESS; + +} + + +int Parser::parse_shapecode_prefix(char * token, int * id, char ** var_string) { + + int len, i, j; + + if (token == NULL) + return PROJECTM_FAILURE; + /* + if (*var_string == NULL) + return PROJECTM_FAILURE; + */ + if (id == NULL) + return PROJECTM_FAILURE; + + len = strlen(token); + + /* Move pointer passed "shapecode_" prefix */ + if (len <= SHAPECODE_STRING_LENGTH) + return PROJECTM_FAILURE; + i = SHAPECODE_STRING_LENGTH; + j = 0; + (*id) = 0; + + /* This loop grabs the integer id for this custom shape */ + while ((i < len) && (token[i] >= 48) && (token[i] <= 57)) { + if (j >= MAX_TOKEN_SIZE) + return PROJECTM_FAILURE; + + (*id) = 10*(*id) + (token[i]-48); + j++; + i++; + } + + + if (i > (len - 2)) + return PROJECTM_FAILURE; + + *var_string = token + i + 1; + + return PROJECTM_SUCCESS; + +} + +int Parser::parse_wave_prefix(char * token, int * id, char ** eqn_string) { + + int len, i, j; + + if (token == NULL) + return PROJECTM_FAILURE; + if (eqn_string == NULL) + return PROJECTM_FAILURE; + if (id == NULL) + return PROJECTM_FAILURE; + + len = strlen(token); + + if (len <= WAVE_STRING_LENGTH) + return PROJECTM_FAILURE; + + + i = WAVE_STRING_LENGTH; + j = 0; + (*id) = 0; + + /* This loop grabs the integer id for this custom wave */ + while ((i < len) && (token[i] >= 48) && (token[i] <= 57)) { + if (j >= MAX_TOKEN_SIZE) + return PROJECTM_FAILURE; + + (*id) = 10*(*id) + (token[i]-48); + j++; + i++; + } + + if (i > (len - 2)) + return PROJECTM_FAILURE; + + *eqn_string = token + i + 1; + + if (PARSE_DEBUG) printf("parse_wave_prefix: prefix = %s\n (LINE %d)", *eqn_string, line_count); + return PROJECTM_SUCCESS; + +} + +int Parser::parse_shape_prefix(char * token, int * id, char ** eqn_string) { + + int len, i, j; + + if (token == NULL) + return PROJECTM_FAILURE; + if (eqn_string == NULL) + return PROJECTM_FAILURE; + if (id == NULL) + return PROJECTM_FAILURE; + + len = strlen(token); + + if (len <= SHAPE_STRING_LENGTH) + return PROJECTM_FAILURE; + + + i = SHAPE_STRING_LENGTH; + j = 0; + (*id) = 0; + + /* This loop grabs the integer id for this custom wave */ + while ((i < len) && (token[i] >= 48) && (token[i] <= 57)) { + if (j >= MAX_TOKEN_SIZE) + return PROJECTM_FAILURE; + + (*id) = 10*(*id) + (token[i]-48); + j++; + i++; + } + + if (i > (len - 2)) + return PROJECTM_FAILURE; + + *eqn_string = token + i + 1; + + return PROJECTM_SUCCESS; + +} + +/* Parses custom wave equations */ +int Parser::parse_wave(char * token, FILE * fs, Preset * preset) { + + int id; + char * eqn_type; + + if (PARSE_DEBUG) printf("parse_wave:begin\n"); + + if (token == NULL) + return PROJECTM_FAILURE; + if (fs == NULL) + return PROJECTM_FAILURE; + if (preset == NULL) + return PROJECTM_FAILURE; + + /* Grab custom wave id and equation type (per frame or per point) from string token */ + if (parse_wave_prefix(token, &id, &eqn_type) < 0) { + if (PARSE_DEBUG) printf("parse_wave: syntax error in custom wave prefix!\n"); + return PROJECTM_FAILURE; + } + + int last_custom_wave_id = id; + strncpy(last_eqn_type, eqn_type, MAX_TOKEN_SIZE); + + return parse_wave_helper(fs, preset, id, eqn_type, 0); + +} + +int Parser::parse_wave_helper(FILE * fs, Preset * preset, int id, char * eqn_type, char * init_string) { + + Param * param; + GenExpr * gen_expr; + char string[MAX_TOKEN_SIZE]; + PerFrameEqn * per_frame_eqn; + CustomWave * custom_wave; + InitCond * init_cond; + + /* Retrieve custom wave associated with this id */ + if ((custom_wave = preset->find_custom_wave(id, TRUE)) == NULL) { + if (PARSE_DEBUG) printf("parse_wave_helper: custom wave id %d not found!\n", id); + return PROJECTM_FAILURE; + } + + /* per frame init equation case */ + if (!strncmp(eqn_type, WAVE_INIT_STRING, WAVE_INIT_STRING_LENGTH)) { + + if (PARSE_DEBUG) printf("parse_wave_helper (per frame init): [begin] (LINE %d)\n", line_count); + + /* Parse the per frame init equation */ + if ((init_cond = parse_per_frame_init_eqn(fs, preset, custom_wave->param_tree)) == NULL) { + if (PARSE_DEBUG) printf("parse_wave_helper (per frame init): equation parsing failed (LINE %d)\n", line_count); + return PROJECTM_PARSE_ERROR; + } + + /* Insert the equation in the per frame equation tree */ + custom_wave->per_frame_init_eqn_tree.insert(std::make_pair(init_cond->param->name,init_cond)); + + if (update_string_buffer(custom_wave->per_frame_init_eqn_string_buffer, + &custom_wave->per_frame_init_eqn_string_index) < 0) { + if (PARSE_DEBUG) printf("parse_wave_helper: failed to update string buffer (LINE %d)\n", line_count); + return PROJECTM_FAILURE; + } + line_mode = CUSTOM_WAVE_PER_FRAME_INIT_LINE_MODE; + + return PROJECTM_SUCCESS; + + } + + /* per frame equation case */ + if (!strncmp(eqn_type, PER_FRAME_STRING_NO_UNDERSCORE, PER_FRAME_STRING_NO_UNDERSCORE_LENGTH)) { + + if (PARSE_DEBUG) printf("parse_wave_helper (per_frame): [start] (custom wave id = %d)\n", custom_wave->id); + + if (parseToken(fs, string) != tEq) { + //if (PARSE_DEBUG) printf("parse_wave (per_frame): no equal sign after string \"%s\" (LINE %d)\n", string, line_count); + return PROJECTM_PARSE_ERROR; + } + + /* Find the parameter associated with the string in the custom wave database */ + if ((param = ParamUtils::find(string, custom_wave->param_tree)) == NULL) { + //if (PARSE_DEBUG) printf("parse_wave (per_frame): parameter \"%s\" not found or cannot be wipemalloc'ed!!\n", string); + return PROJECTM_FAILURE; + } + + + /* Make sure parameter is writable */ + if (param->flags & P_FLAG_READONLY) { + //if (PARSE_DEBUG) printf("parse_wave (per_frame): parameter %s is marked as read only (LINE %d)\n", param->name, line_count); + return PROJECTM_FAILURE; + } + + /* Parse right side of equation as an expression */ + + current_wave = custom_wave; + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + //if (PARSE_DEBUG) printf("parse_wave (per_frame): equation evaluated to null (LINE %d)\n", line_count); + current_wave = NULL; + return PROJECTM_PARSE_ERROR; + + } + + current_wave = NULL; + + //if (PARSE_DEBUG) printf("parse_wave (per_frame): [finished parsing equation] (LINE %d)\n", line_count); + + /* Create a new per frame equation */ + if ((per_frame_eqn = new PerFrameEqn(custom_wave->per_frame_count++, param, gen_expr)) == NULL) { + //if (PARSE_DEBUG) printf("parse_wave (per_frame): failed to create a new per frame eqn, out of memory?\n"); + delete gen_expr; + return PROJECTM_FAILURE; + } + + custom_wave->per_frame_eqn_tree.insert(std::make_pair(per_frame_eqn->index, per_frame_eqn)); + //if (PARSE_DEBUG) printf("parse_wave (per_frame): equation %d associated with custom wave %d [success]\n", + // per_frame_eqn->index, custom_wave->id); + + + /* Need to add stuff to string buffer so the editor can read the equations. + Why not make a nice little helper function for this? - here it is: */ + + if (update_string_buffer(custom_wave->per_frame_eqn_string_buffer, &custom_wave->per_frame_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + line_mode = CUSTOM_WAVE_PER_FRAME_LINE_MODE; + return PROJECTM_SUCCESS; + } + + + /* per point equation case */ + if (!strncmp(eqn_type, PER_POINT_STRING, PER_POINT_STRING_LENGTH)) { + + if (PARSE_DEBUG) printf("parse_wave_helper (per_point): per_pixel equation parsing start...(LINE %d)\n", line_count); + + /// HACK the parse_line code already parsed the per_pixel variable name. This handles that case + /// Parser needs reworked. Don't have time for it. So this is the result. + if (init_string) + strncpy(string, init_string, strlen(init_string)); + else { + if (parseToken(fs, string) != tEq) { /* parse per pixel operator name */ + if (PARSE_DEBUG) printf("parse_wave_helper (per_point): equal operator missing after per pixel operator. Last token = \"%s\" (LINE %d)\n", string, line_count); + + return PROJECTM_PARSE_ERROR; + } + } + + /* Parse right side of equation as an expression, First tell parser we are parsing a custom wave */ + current_wave = custom_wave; + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + if (PARSE_DEBUG) printf("parse_wave_helper (per_point): equation evaluated to null? (LINE %d)\n", line_count); + + return PROJECTM_PARSE_ERROR; + } + + + /* Add the per point equation */ + if (custom_wave->add_per_point_eqn(string, gen_expr) < 0) { + delete gen_expr; + + return PROJECTM_PARSE_ERROR; + } + // This tells the parser we are no longer parsing a custom wave + current_wave = NULL; + + if (update_string_buffer(custom_wave->per_point_eqn_string_buffer, &custom_wave->per_point_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + line_mode = CUSTOM_WAVE_PER_POINT_LINE_MODE; + if (PARSE_DEBUG) printf("parse_wave_helper (per_point): [finished] (custom wave id = %d)\n", custom_wave->id); + return PROJECTM_SUCCESS; + } + + return PROJECTM_FAILURE; +} + +/* Parses custom shape equations */ +int Parser::parse_shape(char * token, FILE * fs, Preset * preset) { + + int id; + char * eqn_type; + char string[MAX_TOKEN_SIZE]; + CustomShape * custom_shape; + InitCond * init_cond; + + if (token == NULL) + + return PROJECTM_FAILURE; + if (fs == NULL) + return PROJECTM_FAILURE; + if (preset == NULL) + return PROJECTM_FAILURE; + + /* Grab custom shape id and equation type (per frame or per point) from string token */ + if (parse_shape_prefix(token, &id, &eqn_type) < 0) { + //if (PARSE_DEBUG) printf("parse_shape: syntax error in custom shape prefix!\n"); + return PROJECTM_PARSE_ERROR; + } + + /* Retrieve custom shape associated with this id */ + if ((custom_shape = preset->find_custom_shape(id, TRUE)) == NULL) + return PROJECTM_FAILURE; + + + /* per frame init equation case */ + if (!strncmp(eqn_type, SHAPE_INIT_STRING, SHAPE_INIT_STRING_LENGTH)) { + return parse_shape_per_frame_init_eqn(fs, custom_shape, preset); + } + + /* per frame equation case */ + if (!strncmp(eqn_type, PER_FRAME_STRING_NO_UNDERSCORE, PER_FRAME_STRING_NO_UNDERSCORE_LENGTH)) { + return parse_shape_per_frame_eqn(fs, custom_shape, preset); + } + + + /* Syntax error, return parse error */ + return PROJECTM_PARSE_ERROR; +} + +/* Helper function to update the string buffers used by the editor */ +int Parser::update_string_buffer(char * buffer, int * index) { + + int string_length; + int skip_size; + + if (!buffer) + return PROJECTM_FAILURE; + if (!index) + return PROJECTM_FAILURE; + + + /* If the string line buffer used by the parser is already full then quit */ + if (string_line_buffer_index == (STRING_LINE_SIZE-1)) + return PROJECTM_FAILURE; + + if ((skip_size = get_string_prefix_len(string_line_buffer)) == PROJECTM_FAILURE) + return PROJECTM_FAILURE; + + string_line_buffer[string_line_buffer_index++] = '\n'; + + // string_length = strlen(string_line_buffer + strlen(eqn_string)+1); + if (skip_size >= STRING_LINE_SIZE) + return PROJECTM_FAILURE; + + string_length = strlen(string_line_buffer + skip_size); + + if (skip_size > (STRING_LINE_SIZE-1)) + return PROJECTM_FAILURE; + + /* Add line to string buffer */ + strncpy(buffer + (*index), + string_line_buffer + skip_size, string_length); + + /* Buffer full, quit */ + if ((*index) > (STRING_BUFFER_SIZE - 1)) { + //if (PARSE_DEBUG) printf("update_string_buffer: string buffer full!\n"); + return PROJECTM_FAILURE; + } + + /* Otherwise, increment string index by the added string length */ + (*index)+=string_length; + + return PROJECTM_SUCCESS; + +} + + +/* Helper function: returns the length of the prefix portion in the line + buffer (the passed string here). In other words, given + the string 'per_frame_1 = x = ....', return the length of 'per_frame_1 = ' + Returns -1 if syntax error +*/ + +int Parser::get_string_prefix_len(char * string) { + + int i = 0; + + /* Null argument check */ + if (string == NULL) + return PROJECTM_FAILURE; + + /* First find the equal sign */ + while (string[i] != '=') { + if (string[i] == 0) + return PROJECTM_FAILURE; + i++; + } + + /* If the string already ends at the next char then give up */ + if (string[i+1] == 0) + return PROJECTM_FAILURE; + + /* Move past the equal sign */ + i++; + + /* Now found the start of the LHS variable, ie skip the spaces */ + while(string[i] == ' ') { + i++; + } + + /* If this is the end of the string then its a syntax error */ + if (string[i] == 0) + return PROJECTM_FAILURE; + + /* Finished succesfully, return the length */ + return i; +} + +int Parser::parse_shape_per_frame_init_eqn(FILE * fs, CustomShape * custom_shape, Preset * preset) { + InitCond * init_cond; + + //if (PARSE_DEBUG) printf("parse_shape (per frame init): [begin] (LINE %d)\n", line_count); + + /* Parse the per frame equation */ + if ((init_cond = parse_per_frame_init_eqn(fs, preset, custom_shape->param_tree)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shape (per frame init): equation parsing failed (LINE %d)\n", line_count); + return PROJECTM_PARSE_ERROR; + } + + /* Insert the equation in the per frame equation tree */ + custom_shape->per_frame_init_eqn_tree.insert(std::make_pair(init_cond->param->name,init_cond)); + if (update_string_buffer(custom_shape->per_frame_init_eqn_string_buffer, + &custom_shape->per_frame_init_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + line_mode = CUSTOM_SHAPE_PER_FRAME_INIT_LINE_MODE; + return PROJECTM_SUCCESS; + } + +int Parser::parse_shape_per_frame_eqn(FILE * fs, CustomShape * custom_shape, Preset * preset) { + +Param * param; +GenExpr * gen_expr; +PerFrameEqn * per_frame_eqn; + +char string[MAX_TOKEN_SIZE]; + +//if (PARSE_DEBUG) printf("parse_shape (per_frame): [start] (custom shape id = %d)\n", custom_shape->id); + + if (parseToken(fs, string) != tEq) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): no equal sign after string \"%s\" (LINE %d)\n", string, line_count); + return PROJECTM_PARSE_ERROR; + } + + /* Find the parameter associated with the string in the custom shape database */ + if ((param = ParamUtils::find(string, custom_shape->param_tree)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): parameter \"%s\" not found or cannot be wipemalloc'ed!!\n", string); + return PROJECTM_FAILURE; + } + + + /* Make sure parameter is writable */ + if (param->flags & P_FLAG_READONLY) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): parameter %s is marked as read only (LINE %d)\n", param->name, line_count); + return PROJECTM_FAILURE; + } + + /* Parse right side of equation as an expression */ + + current_shape = custom_shape; + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): equation evaluated to null (LINE %d)\n", line_count); + current_shape = NULL; + return PROJECTM_PARSE_ERROR; + } + + current_shape = NULL; + + //if (PARSE_DEBUG) printf("parse_shape (per_frame): [finished parsing equation] (LINE %d)\n", line_count); + + /* Create a new per frame equation */ + if ((per_frame_eqn = new PerFrameEqn(custom_shape->per_frame_count++, param, gen_expr)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): failed to create a new per frame eqn, out of memory?\n"); + delete gen_expr; + return PROJECTM_FAILURE; + } + + custom_shape->per_frame_eqn_tree.insert(std::make_pair(per_frame_eqn->index, per_frame_eqn)); + + /* Need to add stuff to string buffer so the editor can read the equations. + Why not make a nice little helper function for this? - here it is: */ + + if (update_string_buffer(custom_shape->per_frame_eqn_string_buffer, &custom_shape->per_frame_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + line_mode = CUSTOM_SHAPE_PER_FRAME_LINE_MODE; + return PROJECTM_SUCCESS; +} + +int Parser::parse_wave_per_frame_eqn(FILE * fs, CustomWave * custom_wave, Preset * preset) { + +Param * param; +GenExpr * gen_expr; +PerFrameEqn * per_frame_eqn; + +char string[MAX_TOKEN_SIZE]; + +//if (PARSE_DEBUG) printf("parse_shape (per_frame): [start] (custom shape id = %d)\n", custom_shape->id); + + if (parseToken(fs, string) != tEq) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): no equal sign after string \"%s\" (LINE %d)\n", string, line_count); + return PROJECTM_PARSE_ERROR; + } + + /* Find the parameter associated with the string in the custom shape database */ + if ((param = ParamUtils::find(string, custom_wave->param_tree)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): parameter \"%s\" not found or cannot be wipemalloc'ed!!\n", string); + return PROJECTM_FAILURE; + } + + + /* Make sure parameter is writable */ + if (param->flags & P_FLAG_READONLY) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): parameter %s is marked as read only (LINE %d)\n", param->name, line_count); + return PROJECTM_FAILURE; + } + + /* Parse right side of equation as an expression */ + + current_wave = custom_wave; + if ((gen_expr = parse_gen_expr(fs, NULL, preset)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): equation evaluated to null (LINE %d)\n", line_count); + current_wave = NULL; + return PROJECTM_PARSE_ERROR; + } + + current_wave = NULL; + + //if (PARSE_DEBUG) printf("parse_shape (per_frame): [finished parsing equation] (LINE %d)\n", line_count); + + /* Create a new per frame equation */ + if ((per_frame_eqn = new PerFrameEqn(custom_wave->per_frame_count++, param, gen_expr)) == NULL) { + //if (PARSE_DEBUG) printf("parse_shape (per_frame): failed to create a new per frame eqn, out of memory?\n"); + delete gen_expr; + return PROJECTM_FAILURE; + } + + custom_wave->per_frame_eqn_tree.insert(std::make_pair(per_frame_eqn->index, per_frame_eqn)); + //if (PARSE_DEBUG) printf("parse_shape (per_frame): equation %d associated with custom shape %d [success]\n", + // per_frame_eqn->index, custom_shape->id); + + + /* Need to add stuff to string buffer so the editor can read the equations. + Why not make a nice little helper function for this? - here it is: */ + + if (update_string_buffer(custom_wave->per_frame_eqn_string_buffer, &custom_wave->per_frame_eqn_string_index) < 0) + return PROJECTM_FAILURE; + + line_mode = CUSTOM_WAVE_PER_FRAME_LINE_MODE; + return PROJECTM_SUCCESS; +} diff --git a/src/projectM-engine-backup/Parser.hpp b/src/projectM-engine-backup/Parser.hpp new file mode 100755 index 000000000..3a5b248f6 --- /dev/null +++ b/src/projectM-engine-backup/Parser.hpp @@ -0,0 +1,180 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Preset parser + * + * $Log$ + */ + +#ifndef _PARSER_H +#define _PARSER_H + +//#define PARSE_DEBUG 2 +#define PARSE_DEBUG 2 + +#include + +#include "Expr.hpp" +#include "PerFrameEqn.hpp" +#include "InitCond.hpp" +#include "Preset.hpp" + +/* Strings that prefix (and denote the type of) equations */ +#define PER_FRAME_STRING "per_frame_" +#define PER_FRAME_STRING_LENGTH 10 + +#define PER_PIXEL_STRING "per_pixel_" +#define PER_PIXEL_STRING_LENGTH 10 + +#define PER_FRAME_INIT_STRING "per_frame_init_" +#define PER_FRAME_INIT_STRING_LENGTH 15 + +#define WAVECODE_STRING "wavecode_" +#define WAVECODE_STRING_LENGTH 9 + +#define WAVE_STRING "wave_" +#define WAVE_STRING_LENGTH 5 + +#define PER_POINT_STRING "per_point" +#define PER_POINT_STRING_LENGTH 9 + +#define PER_FRAME_STRING_NO_UNDERSCORE "per_frame" +#define PER_FRAME_STRING_NO_UNDERSCORE_LENGTH 9 + +#define SHAPECODE_STRING "shapecode_" +#define SHAPECODE_STRING_LENGTH 10 + +#define SHAPE_STRING "shape_" +#define SHAPE_STRING_LENGTH 6 + +#define SHAPE_INIT_STRING "init" +#define SHAPE_INIT_STRING_LENGTH 4 + +#define WAVE_INIT_STRING "init" +#define WAVE_INIT_STRING_LENGTH 4 + +typedef enum { + NORMAL_LINE_MODE, + PER_FRAME_LINE_MODE, + PER_PIXEL_LINE_MODE, + PER_FRAME_INIT_LINE_MODE, + INIT_COND_LINE_MODE, + CUSTOM_WAVE_PER_POINT_LINE_MODE, + CUSTOM_WAVE_PER_FRAME_LINE_MODE, + CUSTOM_WAVE_WAVECODE_LINE_MODE, + CUSTOM_SHAPE_SHAPECODE_LINE_MODE, + CUSTOM_SHAPE_PER_FRAME_LINE_MODE, + CUSTOM_SHAPE_PER_FRAME_INIT_LINE_MODE, + CUSTOM_WAVE_PER_FRAME_INIT_LINE_MODE +} line_mode_t; + +/** Token enumeration type */ +typedef enum { + tEOL, /* end of a line, usually a '/n' or '/r' */ + tEOF, /* end of file */ + tLPr, /* ( */ + tRPr, /* ) */ + tLBr, /* [ */ + tRBr, /* ] */ + tEq, /* = */ + tPlus, /* + */ + tMinus, /* - */ + tMult, /* * */ + tMod, /* % */ + tDiv, /* / */ + tOr, /* | */ + tAnd, /* & */ + tComma, /* , */ + tPositive, /* + as a prefix operator */ + tNegative, /* - as a prefix operator */ + tSemiColon, /* ; */ + tStringTooLong, /* special token to indicate an invalid string length */ + tStringBufferFilled /* the string buffer for this line is maxed out */ + } token_t; + +class CustomShape; +class CustomWave; +class GenExpr; +class InfixOp; +class PerFrameEqn; +class Preset; +class TreeExpr; + +class Parser { +public: + static line_mode_t line_mode; + static CustomWave *current_wave; + static CustomShape *current_shape; + static int string_line_buffer_index; + static char string_line_buffer[STRING_LINE_SIZE]; + static unsigned int line_count; + static int per_frame_eqn_count; + static int per_frame_init_eqn_count; + static int last_custom_wave_id; + static int last_custom_shape_id; + static char last_eqn_type[MAX_TOKEN_SIZE]; + static int last_token_size; + + static PerFrameEqn *parse_per_frame_eqn( FILE * fs, int index, + Preset * preset); + static int parse_per_pixel_eqn( FILE * fs, Preset * preset, + char * init_string); + static InitCond *parse_init_cond( FILE * fs, char * name, Preset * preset ); + static int parse_preset_name( FILE * fs, char * name ); + static int parse_top_comment( FILE * fs ); + static int parse_line( FILE * fs, Preset * preset ); + + static int get_string_prefix_len(char * string); + static TreeExpr * insert_gen_expr(GenExpr * gen_expr, TreeExpr ** root); + static TreeExpr * insert_infix_op(InfixOp * infix_op, TreeExpr ** root); + static token_t parseToken(FILE * fs, char * string); + static GenExpr ** parse_prefix_args(FILE * fs, int num_args, Preset * preset); + static GenExpr * parse_infix_op(FILE * fs, token_t token, TreeExpr * tree_expr, Preset * preset); + static GenExpr * parse_sign_arg(FILE * fs); + static int parse_float(FILE * fs, float * float_ptr); + static int parse_int(FILE * fs, int * int_ptr); + static int insert_gen_rec(GenExpr * gen_expr, TreeExpr * root); + static int insert_infix_rec(InfixOp * infix_op, TreeExpr * root); + static GenExpr * parse_gen_expr(FILE * fs, TreeExpr * tree_expr, Preset * preset); + static PerFrameEqn * parse_implicit_per_frame_eqn(FILE * fs, char * param_string, int index, Preset * preset); + static InitCond * parse_per_frame_init_eqn(FILE * fs, Preset * preset, std::map * database); + static int parse_wavecode_prefix(char * token, int * id, char ** var_string); + static int parse_wavecode(char * token, FILE * fs, Preset * preset); + static int parse_wave_prefix(char * token, int * id, char ** eqn_string); + static int parse_wave_helper(FILE * fs, Preset * preset, int id, char * eqn_type, char * init_string); + static int parse_shapecode(char * eqn_string, FILE * fs, Preset * preset); + static int parse_shapecode_prefix(char * token, int * id, char ** var_string); + + static int parse_wave(char * eqn_string, FILE * fs, Preset * preset); + static int parse_shape(char * eqn_string, FILE * fs, Preset * preset); + static int parse_shape_prefix(char * token, int * id, char ** eqn_string); + + static int update_string_buffer(char * buffer, int * index); + static int string_to_float(char * string, float * float_ptr); + static int parse_shape_per_frame_init_eqn(FILE * fs, CustomShape * custom_shape, Preset * preset); + static int parse_shape_per_frame_eqn(FILE * fs, CustomShape * custom_shape, Preset * preset); + static int parse_wave_per_frame_eqn(FILE * fs, CustomWave * custom_wave, Preset * preset); + }; + +#endif /** !_PARSER_H */ + diff --git a/src/projectM-engine-backup/PerFrameEqn.cpp b/src/projectM-engine-backup/PerFrameEqn.cpp new file mode 100755 index 000000000..592b7b343 --- /dev/null +++ b/src/projectM-engine-backup/PerFrameEqn.cpp @@ -0,0 +1,65 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include +#include +#include + +#include "fatal.h" +#include "Common.hpp" + +#include "Param.hpp" +#include "PerFrameEqn.hpp" + +#include "Eval.hpp" +#include "Expr.hpp" + +#include "wipemalloc.h" +#include + +/* Evaluate an equation */ +void PerFrameEqn::evaluate() { + + if (PER_FRAME_EQN_DEBUG) { + printf("per_frame_%d=%s= ", index, param->name.c_str()); + fflush(stdout); + } + + //*((float*)per_frame_eqn->param->engine_val) = eval_gen_expr(per_frame_eqn->gen_expr); + assert(gen_expr); + assert(param); + param->set_param(gen_expr->eval_gen_expr(-1,-1)); + if (PER_FRAME_EQN_DEBUG) printf(" = %.4f\n", *((float*)param->engine_val)); + +} + + +/* Frees perframe equation structure. Warning: assumes gen_expr pointer is not freed by anyone else! */ +PerFrameEqn::~PerFrameEqn() { + + delete gen_expr; + + /** @bug Destroy param? - great question, don't know yet*/ +} + +/* Create a new per frame equation */ +PerFrameEqn::PerFrameEqn(int _index, Param * _param, GenExpr * _gen_expr) : + index(_index), param(_param), gen_expr(_gen_expr) {} diff --git a/src/projectM-engine-backup/PerFrameEqn.hpp b/src/projectM-engine-backup/PerFrameEqn.hpp new file mode 100755 index 000000000..39640805d --- /dev/null +++ b/src/projectM-engine-backup/PerFrameEqn.hpp @@ -0,0 +1,53 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Per-frame equation + * + * $Log$ + */ + +#ifndef _PER_FRAME_EQN_H +#define _PER_FRAME_EQN_H + +#define PER_FRAME_EQN_DEBUG 0 + +class GenExpr; +class Param; +class PerFrameEqn; + +class PerFrameEqn { +public: + int index; /* a unique id for each per frame eqn (generated by order in preset files) */ + Param *param; /* parameter to be assigned a value */ + GenExpr *gen_expr; /* expression that paremeter is equal to */ + + PerFrameEqn(int index, Param * param, GenExpr * gen_expr); + ~PerFrameEqn(); + + /// Evaluate the per frame equation + void evaluate(); + + }; + + +#endif /** !_PER_FRAME_EQN_H */ diff --git a/src/projectM-engine-backup/PerPixelEqn.cpp b/src/projectM-engine-backup/PerPixelEqn.cpp new file mode 100755 index 000000000..25f739800 --- /dev/null +++ b/src/projectM-engine-backup/PerPixelEqn.cpp @@ -0,0 +1,90 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include +#include +#include +#include +#include "projectM.hpp" + +#include "fatal.h" +#include "Common.hpp" + +#include "Expr.hpp" +#include "Eval.hpp" +#include "Param.hpp" +#include "PerPixelEqn.hpp" +#include + +#include "wipemalloc.h" +#include +/* Evaluates a per pixel equation */ +void PerPixelEqn::evaluate() { + + GenExpr * eqn_ptr = 0; + int x,y; + + eqn_ptr = this->gen_expr; + + float ** param_matrix = (float**)this->param->matrix; + + if (param_matrix == 0) { + if (PER_PIXEL_EQN_DEBUG) printf("evalPerPixelEqn: [begin initializing matrix] (index = %d) (name = %s)\n", + index, param->name.c_str()); + + param_matrix = (float**)wipemalloc(param->gx*sizeof(float*)); + for(x = 0; x < param->gx; x++) + param_matrix[x] = (float *)wipemalloc(param->gy * sizeof(float)); + + for (x = 0; x < param->gx; x++) + for (y = 0; y < param->gy; y++) { + /// @slow is this necessary? + param_matrix[x][y] = 0.0; + } + this->param->matrix = param_matrix; + } + + assert(!(eqn_ptr == NULL || param_matrix == NULL)); + +// param->matrix_flag = 0; /** Force matrix ignore to update time */ + for (int mesh_i = 0; mesh_i < param->gx; mesh_i++) { + for (int mesh_j = 0; mesh_j < param->gy; mesh_j++) { +// std::cout << "gx,gy is " << param->gx << "," << param->gy << std::endl; + param_matrix[mesh_i][mesh_j] = eqn_ptr->eval_gen_expr(mesh_i, mesh_j); + } + } + + /* Now that this parameter has been referenced with a per + pixel equation, we let the evaluator know by setting + this flag */ + /// @bug review and verify this behavior + param->matrix_flag = true; + param->flags |= P_FLAG_PER_PIXEL; +} + +PerPixelEqn::PerPixelEqn(int _index, Param * _param, GenExpr * _gen_expr):index(_index), param(_param), gen_expr(_gen_expr) { + + assert(index >= 0); + assert(param != 0); + assert(gen_expr != 0); + +} + diff --git a/src/projectM-engine-backup/PerPixelEqn.hpp b/src/projectM-engine-backup/PerPixelEqn.hpp new file mode 100755 index 000000000..fbb2be15b --- /dev/null +++ b/src/projectM-engine-backup/PerPixelEqn.hpp @@ -0,0 +1,66 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Per-pixel equation + * + * $Log$ + */ + +#ifndef _PER_PIXEL_EQN_H +#define _PER_PIXEL_EQN_H + +#define PER_PIXEL_EQN_DEBUG 0 + +#define ZOOM_OP 0 +#define ZOOMEXP_OP 1 +#define ROT_OP 2 +#define CX_OP 3 +#define CY_OP 4 +#define SX_OP 5 +#define SY_OP 6 +#define DX_OP 7 +#define DY_OP 8 +#define WARP_OP 9 +#define NUM_OPS 10 /* obviously, this number is dependent on the number of existing per pixel operations */ + +class GenExpr; +class Param; +class PerPixelEqn; +class Preset; + +class PerPixelEqn { +public: + int index; /* used for splay tree ordering. */ + int flags; /* primarily to specify if this variable is user-defined */ + Param *param; + GenExpr *gen_expr; + + void evalPerPixelEqns( Preset *preset ); + void evaluate(); + + PerPixelEqn(int index, Param * param, GenExpr * gen_expr); + + }; + + +#endif /** !_PER_PIXEL_EQN_H */ diff --git a/src/projectM-engine-backup/PerPointEqn.cpp b/src/projectM-engine-backup/PerPointEqn.cpp new file mode 100755 index 000000000..ba3736974 --- /dev/null +++ b/src/projectM-engine-backup/PerPointEqn.cpp @@ -0,0 +1,84 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include +#include +#include + +#include "projectM.hpp" + +#include "fatal.h" +#include "Common.hpp" + +#include "CustomWave.hpp" +#include "Eval.hpp" +#include "Expr.hpp" +#include "Param.hpp" +#include "PerPixelEqn.hpp" +#include "PerPointEqn.hpp" +#include + +#include "wipemalloc.h" + +/* Evaluates a per point equation for the current custom wave given by interface_wave ptr */ +void PerPointEqn::evaluate() { + + int size; + float * param_matrix; + GenExpr * eqn_ptr; + +// samples = CustomWave::interface_wave->samples; + + eqn_ptr = gen_expr; + + if (param->matrix == NULL) { + + if ((param_matrix = (float*) (param->matrix = wipemalloc(size = samples*sizeof(float)))) == NULL) + return; + + memset(param_matrix, 0, size); + } + else + param_matrix = (float*)param->matrix; + + for (int i = 0; i < samples; i++) { + // -1 is because per points only use one dimension + param_matrix[i] = eqn_ptr->eval_gen_expr(i, -1); + } + + /* Now that this parameter has been referenced with a per + point equation, we let the evaluator know by setting + this flag */ +if (!param->matrix_flag) + param->matrix_flag = true; +} + +PerPointEqn::PerPointEqn(int _index, Param * _param, GenExpr * _gen_expr, int _samples): + index(_index), + param(_param), + gen_expr(_gen_expr), + samples(_samples) +{} + + +PerPointEqn::~PerPointEqn() { + delete gen_expr; + } diff --git a/src/projectM-engine-backup/PerPointEqn.hpp b/src/projectM-engine-backup/PerPointEqn.hpp new file mode 100755 index 000000000..89ad22b47 --- /dev/null +++ b/src/projectM-engine-backup/PerPointEqn.hpp @@ -0,0 +1,54 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Per-point equation + * + * $Log$ + */ + +#ifndef _PER_POINT_EQN_H +#define _PER_POINT_EQN_H + +class CustomWave; +class GenExpr; +class Param; +class PerPointEqn; + +class PerPointEqn { +public: + int index; + int samples; // the number of samples to iterate over + Param *param; + GenExpr * gen_expr; + + ~PerPointEqn(); + void evaluate(); + PerPointEqn( int index, Param *param, GenExpr *gen_expr, int samples); + }; + + +//inline void eval_per_point_eqn_helper( void *per_point_eqn ) { +// ((PerPointEqn *)per_point_eqn)->evalPerPointEqn(); +// } + +#endif /** !_PER_POINT_EQN_H */ diff --git a/src/projectM-engine-backup/Preset.cpp b/src/projectM-engine-backup/Preset.cpp new file mode 100755 index 000000000..80bd77c7d --- /dev/null +++ b/src/projectM-engine-backup/Preset.cpp @@ -0,0 +1,764 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include +#include +#include +#ifdef WIN32 +#include "win32-dirent.h" +#else +#include +#endif /** WIN32 */ +#include + +#include "Preset.hpp" +#include "Parser.hpp" +#include "ParamUtils.hpp" +#include "fatal.h" +#include + +Preset::Preset(const std::string & filename, const PresetInputs & presetInputs, PresetOutputs & presetOutputs): + file_path(filename), + builtinParams(presetInputs, presetOutputs), + customWaves(&presetOutputs.customWaves), + customShapes(&presetOutputs.customShapes), + m_presetOutputs(presetOutputs) + +{ + + + initialize(filename); + +} + +Preset::~Preset() +{ + +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "~preset(): in\n" ); +#endif + + + + Algorithms::traverse >(init_cond_tree); + + Algorithms::traverse >(per_frame_init_eqn_tree); + + Algorithms::traverse >(per_pixel_eqn_tree); + + Algorithms::traverse >(per_frame_eqn_tree); + + Algorithms::traverse >(user_param_tree); + + /// @note no need to clear the actual container itself + for (PresetOutputs::cwave_container::iterator pos = customWaves->begin(); pos != customWaves->end(); ++pos) + delete(*pos); + + for (PresetOutputs::cshape_container::iterator pos = customShapes->begin(); pos != customShapes->end(); ++pos) + delete(*pos); + + +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "~Preset(): out\n" ); +#endif + + +} +/* Adds a per pixel equation according to its string name. This + will be used only by the parser */ + +int Preset::add_per_pixel_eqn(char * name, GenExpr * gen_expr) +{ + + PerPixelEqn * per_pixel_eqn = NULL; + int index; + Param * param = NULL; + + /* Argument checks */ + if (gen_expr == NULL) + return PROJECTM_FAILURE; + if (name == NULL) + return PROJECTM_FAILURE; + + if (PER_PIXEL_EQN_DEBUG) printf("add_per_pixel_eqn: per pixel equation (name = \"%s\")\n", name); + + if (!strncmp(name, "dx", strlen("dx"))) + this->m_presetOutputs.dx_is_mesh = true; + else if (!strncmp(name, "dy", strlen("dy"))) + this->m_presetOutputs.dy_is_mesh = true; + else if (!strncmp(name, "cx", strlen("cx"))) + this->m_presetOutputs.cx_is_mesh = true; + else if (!strncmp(name, "cy", strlen("cy"))) + this->m_presetOutputs.cy_is_mesh = true; + else if (!strncmp(name, "zoom", strlen("zoom"))) + this->m_presetOutputs.zoom_is_mesh = true; + else if (!strncmp(name, "zoomexp", strlen("zoomexp"))) + this->m_presetOutputs.zoomexp_is_mesh = true; + else if (!strncmp(name, "rot", strlen("rot"))) + this->m_presetOutputs.rot_is_mesh= true; + else if (!strncmp(name, "sx", strlen("sx"))) + this->m_presetOutputs.sx_is_mesh = true; + else if (!strncmp(name, "sy", strlen("sy"))) + this->m_presetOutputs.sy_is_mesh = true; + + /* Search for the parameter so we know what matrix the per pixel equation is referencing */ + + param = ParamUtils::find(name, &this->builtinParams, &this->user_param_tree); + if ( !param ) + { + if (PER_PIXEL_EQN_DEBUG) printf("add_per_pixel_eqn: failed to allocate a new parameter!\n"); + return PROJECTM_FAILURE; + } + + if (per_pixel_eqn_tree.empty()) + { + index = 0; + } + else + { + std::map::iterator lastPos = per_pixel_eqn_tree.end(); + index = per_pixel_eqn_tree.size(); + } + + /* Create the per pixel equation given the index, parameter, and general expression */ + if ((per_pixel_eqn = new PerPixelEqn(index, param, gen_expr)) == NULL) + { + if (PER_PIXEL_EQN_DEBUG) printf("add_per_pixel_eqn: failed to create new per pixel equation!\n"); + return PROJECTM_FAILURE; + + } + + if (PER_PIXEL_EQN_DEBUG) printf("add_per_pixel_eqn: new equation (index = %d,matrix=%X) (param = \"%s\")\n", + per_pixel_eqn->index, per_pixel_eqn->param->matrix, per_pixel_eqn->param->name.c_str()); + + /* Insert the per pixel equation into the preset per pixel database */ + std::pair::iterator, bool> inserteeOption = per_pixel_eqn_tree.insert + (std::make_pair(per_pixel_eqn->index, per_pixel_eqn)); + + if (!inserteeOption.second) + { + printf("failed to add per pixel eqn!\n"); + delete(per_pixel_eqn); + return PROJECTM_FAILURE; + } + + /* Done */ + return PROJECTM_SUCCESS; +} + +void Preset::evalCustomShapeInitConditions() +{ + + for (PresetOutputs::cshape_container::iterator pos = customShapes->begin(); pos != customShapes->end(); ++pos) + (*pos)->eval_custom_shape_init_conds(); +} + + +void Preset::evalCustomWaveInitConditions() +{ + + for (PresetOutputs::cwave_container::iterator pos = customWaves->begin(); pos != customWaves->end(); ++pos) + (*pos)->eval_custom_wave_init_conds(); +} + + +void Preset::evalCustomWavePerFrameEquations() +{ + + /// @bug see above + for (PresetOutputs::cwave_container::iterator pos = customWaves->begin(); pos != customWaves->end(); ++pos) + { + + std::map & init_cond_tree = (*pos)->init_cond_tree; + for (std::map::iterator _pos = init_cond_tree.begin(); _pos != init_cond_tree.end(); ++_pos) + _pos->second->evaluate(); + + std::map & per_frame_eqn_tree = (*pos)->per_frame_eqn_tree; + for (std::map::iterator _pos = per_frame_eqn_tree.begin(); _pos != per_frame_eqn_tree.end(); ++_pos) + _pos->second->evaluate(); + } + +} + +void Preset::evalCustomShapePerFrameEquations() +{ + + for (PresetOutputs::cshape_container::iterator pos = customShapes->begin(); pos != customShapes->end(); ++pos) + { + + std::map & init_cond_tree = (*pos)->init_cond_tree; + for (std::map::iterator _pos = init_cond_tree.begin(); _pos != init_cond_tree.end(); ++_pos) + _pos->second->evaluate(); + + std::map & per_frame_eqn_tree = (*pos)->per_frame_eqn_tree; + for (std::map::iterator _pos = per_frame_eqn_tree.begin(); _pos != per_frame_eqn_tree.end(); ++_pos) + _pos->second->evaluate(); + } + +} + +void Preset::evalInitConditions() +{ + + for (std::map::iterator pos = per_frame_init_eqn_tree.begin(); pos != per_frame_init_eqn_tree.end(); ++pos) + pos->second->evaluate(); + +} + +void Preset::evalPerFrameEquations() +{ + + for (std::map::iterator pos = init_cond_tree.begin(); pos != init_cond_tree.end(); ++pos) + pos->second->evaluate(); + + for (std::map::iterator pos = per_frame_eqn_tree.begin(); pos != per_frame_eqn_tree.end(); ++pos) + pos->second->evaluate(); + +} + + +void Preset::initialize(const std::string & pathname) +{ + + // Clear equation trees + init_cond_tree.clear(); + user_param_tree.clear(); + per_frame_eqn_tree.clear(); + per_pixel_eqn_tree.clear(); + per_frame_init_eqn_tree.clear(); + + /* Set initial index values */ + this->per_pixel_eqn_string_index = 0; + this->per_frame_eqn_string_index = 0; + this->per_frame_init_eqn_string_index = 0; + + /* Clear string buffers */ + memset(this->per_pixel_eqn_string_buffer, 0, STRING_BUFFER_SIZE); + memset(this->per_frame_eqn_string_buffer, 0, STRING_BUFFER_SIZE); + memset(this->per_frame_init_eqn_string_buffer, 0, STRING_BUFFER_SIZE); + int retval; + + if ((retval = load_preset_file(pathname.c_str())) < 0) + { + +#ifdef PRESET_DEBUG + if (PRESET_DEBUG) std::cerr << "[Preset] failed to load file \"" << + pathname << "\"!" << std::endl; +#endif + //this->close_preset(); + /// @bug how should we handle this problem? a well define exception? + throw retval; + } + + /* It's kind of ugly to reset these values here. Should definitely be placed in the parser somewhere */ + this->per_frame_eqn_count = 0; + this->per_frame_init_eqn_count = 0; + +} + +/// @bug broken / unimplemented +void Preset::savePreset(char * filename) +{ + + return; + +#ifdef PANTS + FILE * fs; + + if (filename == NULL) + return; + + /* Open the file corresponding to pathname */ + if ((fs = fopen(filename, "w+")) == 0) + { +#ifdef PRESET_DEBUG + if (PRESET_DEBUG) printf("savePreset: failed to create filename \"%s\"!\n", filename); +#endif + return; + } + + write_stream = fs; + + if (write_preset_name(fs) < 0) + { + write_stream = NULL; + fclose(fs); + return; + } + + if (write_init_conditions(fs) < 0) + { + write_stream = NULL; + fclose(fs); + return; + } + + if (write_per_frame_init_equations(fs) < 0) + { + write_stream = NULL; + fclose(fs); + return; + } + + if (write_per_frame_equations(fs) < 0) + { + write_stream = NULL; + fclose(fs); + return; + } + + if (write_per_pixel_equations(fs) < 0) + { + write_stream = NULL; + fclose(fs); + return; + } + + write_stream = NULL; + fclose(fs); +#endif +} + +int Preset::write_preset_name(FILE * fs) +{ + + char s[256]; + int len; + + memset(s, 0, 256); + + if (fs == NULL) + return PROJECTM_FAILURE; + + /* Format the preset name in a string */ + /// @bug removed, code is dead + // sprintf(s, "[%s]\n", name); + + len = strlen(s); + + /* Write preset name to file stream */ + if (fwrite(s, 1, len, fs) != len) + return PROJECTM_FAILURE; + + return PROJECTM_SUCCESS; + +} + +#ifdef NEEDS_MOVED +int Preset::write_init_conditions(FILE * fs) +{ + + if (fs == NULL) + return PROJECTM_FAILURE; + + init_cond_tree.splay_traverse( (void (*)(void*))write_init); + + return PROJECTM_SUCCESS; +} + +void Preset::write_init( InitCond * init_cond ) +{ + + char s[512]; + int len; + + if (write_stream == NULL) + return; + + memset(s, 0, 512); + + if (init_cond->param->type == P_TYPE_BOOL) + sprintf(s, "%s=%d\n", init_cond->param->name, init_cond->init_val.bool_val); + + else if (init_cond->param->type == P_TYPE_INT) + sprintf(s, "%s=%d\n", init_cond->param->name, init_cond->init_val.int_val); + + else if (init_cond->param->type == P_TYPE_DOUBLE) + sprintf(s, "%s=%f\n", init_cond->param->name, init_cond->init_val.float_val); + +else { printf("write_init: unknown parameter type!\n"); return; } + + len = strlen(s); + + if ((fwrite(s, 1, len, write_stream)) != len) + printf("write_init: failed writing to file stream! Out of disk space?\n"); + +} + + +int Preset::write_per_frame_init_equations(FILE * fs) +{ + + int len; + + if (fs == NULL) + return PROJECTM_FAILURE; + + len = strlen(per_frame_init_eqn_string_buffer); + + if (fwrite(per_frame_init_eqn_string_buffer, 1, len, fs) != len) + return PROJECTM_FAILURE; + + return PROJECTM_SUCCESS; +} + + +int Preset::write_per_frame_equations(FILE * fs) +{ + + int len; + + if (fs == NULL) + return PROJECTM_FAILURE; + + len = strlen(per_frame_eqn_string_buffer); + + if (fwrite(per_frame_eqn_string_buffer, 1, len, fs) != len) + return PROJECTM_FAILURE; + + return PROJECTM_SUCCESS; +} + + +int Preset::write_per_pixel_equations(FILE * fs) +{ + + int len; + + if (fs == NULL) + return PROJECTM_FAILURE; + + len = strlen(per_pixel_eqn_string_buffer); + + if (fwrite(per_pixel_eqn_string_buffer, 1, len, fs) != len) + return PROJECTM_FAILURE; + + return PROJECTM_SUCCESS; +} +#endif /** NEEDS_MOVED */ + +void Preset::load_custom_wave_init_conditions() +{ + + for (PresetOutputs::cwave_container::iterator pos = customWaves->begin(); pos != customWaves->end(); ++pos) + (*pos)->load_unspecified_init_conds(); + +} + +void Preset::load_custom_shape_init_conditions() +{ + + // void eval_custom_shape_init_conds(); + + for (PresetOutputs::cshape_container::iterator pos = customShapes->begin(); pos != customShapes->end(); ++pos) + (*pos)->load_custom_shape_init(); +} + + + + +void Preset::evaluateFrame() +{ + + /* Evaluate all equation objects in same order as the renderer */ + + evalInitConditions(); + evalPerFrameEquations(); + evalPerPixelEqns(); + evalInitConditions(); + evalCustomShapeInitConditions(); + evalCustomWavePerFrameEquations(); + evalCustomShapePerFrameEquations(); + +} + +/** Evaluates all per-pixel equations */ +void Preset::evalPerPixelEqns() +{ + + /* Evaluate all per pixel equations using splay traversal */ + for (std::map::iterator pos = per_pixel_eqn_tree.begin(); + pos != per_pixel_eqn_tree.end(); ++pos) + pos->second->evaluate(); + + +} + +/** Finds / Creates (if necessary) initial condition associated with passed parameter */ +InitCond * Preset::get_init_cond( Param *param ) +{ + + InitCond * init_cond; + CValue init_val; + + assert(param); + + std::map::iterator pos = init_cond_tree.find(param->name); + + init_cond = pos == init_cond_tree.end() ? 0 : pos->second; + + if (init_cond == NULL) + { + + if (param->type == P_TYPE_BOOL) + init_val.bool_val = 0; + + else if (param->type == P_TYPE_INT) + init_val.int_val = *(int*)param->engine_val; + + else if (param->type == P_TYPE_DOUBLE) + init_val.float_val = *(float*)param->engine_val; + + /* Create new initial condition */ + if ((init_cond = new InitCond(param, init_val)) == NULL) + return NULL; + + /* Insert the initial condition into this presets tree */ + std::pair::iterator, bool> inserteePair = + init_cond_tree.insert(std::make_pair(init_cond->param->name, init_cond)); + + if (!inserteePair.second) + { + delete init_cond; + return NULL; + } + } + + return init_cond; + +} + +/* load_preset_file: private function that loads a specific preset denoted + by the given pathname */ +int Preset::load_preset_file(const char * pathname) +{ + + FILE * fs; + int retval; + int lineno; + line_mode_t line_mode; + + if (pathname == NULL) + return PROJECTM_FAILURE; + + /* Open the file corresponding to pathname */ + if ((fs = fopen(pathname, "rb")) == 0) + { +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "load_preset_file: loading of file %s failed!\n", pathname); +#endif + return PROJECTM_ERROR; + } + +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "load_preset_file: file stream \"%s\" opened successfully\n", pathname); +#endif + + /* Parse any comments */ + if (Parser::parse_top_comment(fs) < 0) + { +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "load_preset_file: no left bracket found...\n"); +#endif + fclose(fs); + return PROJECTM_FAILURE; + } + + /* Parse the preset name and a left bracket */ + char tmp_name[MAX_TOKEN_SIZE]; + + if (Parser::parse_preset_name(fs, tmp_name) < 0) + { +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "load_preset_file: loading of preset name in file \"%s\" failed\n", pathname); +#endif + fclose(fs); + return PROJECTM_ERROR; + } + name = std::string(tmp_name); + +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "load_preset_file: preset \"%s\" parsed\n", this->name); +#endif + + /* Parse each line until end of file */ + lineno = 0; +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "load_preset_file: beginning line parsing...\n"); +#endif + while ((retval = Parser::parse_line(fs, this)) != EOF) + { + if (retval == PROJECTM_PARSE_ERROR) + { + line_mode = NORMAL_LINE_MODE; +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE( "load_preset_file: parse error in file \"%s\": line %d\n", pathname,lineno); +#endif + + } + lineno++; + } + +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE("load_preset_file: finished line parsing successfully\n"); +#endif + + /* Now the preset has been loaded. + Evaluation calls can be made at appropiate + times in the frame loop */ + + fclose(fs); +#if defined(PRESET_DEBUG) && defined(DEBUG) + DWRITE("load_preset_file: file \"%s\" closed, preset ready\n", pathname); +#endif + return PROJECTM_SUCCESS; +} + + +void Preset::load_init_conditions() +{ + + ParamUtils::LoadInitCondFunctor functor(this); + builtinParams.traverse(functor); + +} + + + +CustomWave * Preset::find_custom_wave(int id, bool create_flag) +{ + CustomWave * custom_wave = NULL; + + assert(customWaves); + + if ((custom_wave = (*customWaves)[id]) == NULL) + { + + if (CUSTOM_WAVE_DEBUG) { printf("find_custom_wave: creating custom wave (id = %d)...", id);fflush(stdout);} + + if (create_flag == FALSE) + { + if (CUSTOM_WAVE_DEBUG) printf("you specified not to (create flag = false), returning null\n"); + return NULL; + } + + if ((custom_wave = new CustomWave(id)) == NULL) + { + if (CUSTOM_WAVE_DEBUG) printf("failed...out of memory?\n"); + return NULL; + } + + customWaves->push_back(custom_wave); + } + + return custom_wave; + +} + + +CustomShape * Preset::find_custom_shape(int id, bool create_flag) +{ + + CustomShape * custom_shape = NULL; + assert(customShapes); + if ((custom_shape = (*customShapes)[id]) == NULL) + { + + if (CUSTOM_SHAPE_DEBUG) { printf("find_custom_shape: creating custom shape (id = %d)...", id);fflush(stdout);} + + if (create_flag == FALSE) + { + if (CUSTOM_SHAPE_DEBUG) printf("you specified not to (create flag = false), returning null\n"); + return NULL; + } + + if ((custom_shape = new CustomShape(id)) == NULL) + { + if (CUSTOM_SHAPE_DEBUG) printf("failed...out of memory?\n"); + return NULL; + } + + customShapes->push_back(custom_shape); + + } + + return custom_shape; +} + +/* Find a parameter given its name, will create one if not found */ +Param * Preset::find(char * name, int flags) +{ + + Param * param = NULL; + + /* Null argument checks */ + assert(name); + + /* First look in the builtin database */ + param = (Param *)this->builtinParams.find_builtin_param(name); + + /* If the search failed, check the user database */ + if (param == NULL) + { + std::map::iterator pos = user_param_tree.find(name); + + if (pos == user_param_tree.end()) + param = 0; + else + param = pos->second; + } + + /* If it doesn't exist in the user (or builtin) database and + create_flag is set, then make it and insert into the database + */ + + if ((param == NULL) && (flags & P_CREATE)) + { + + /* Check if string is valid */ + if (!Param::is_valid_param_string(name)) + { + if (PARAM_DEBUG) printf("find: invalid parameter name:\"%s\"\n", name); + return NULL; + } + /* Now, create the user defined parameter given the passed name */ + if ((param = new Param(name)) == NULL) + { + if (PARAM_DEBUG) printf("find: failed to create a new user parameter!\n"); + return NULL; + } + /* Finally, insert the new parameter into this preset's proper splaytree */ + std::pair::iterator, bool> inserteePair + = user_param_tree.insert(std::make_pair(param->name, param)); + + if (!inserteePair.second) + { + if (PARAM_DEBUG) printf("PARAM \"%s\" already exists in user parameter tree!\n", param->name.c_str()); + delete param; + return NULL; + } + + } + + /* Return the found (or created) parameter. Note that if P_CREATE is not set, this could be null */ + return param; + +} diff --git a/src/projectM-engine-backup/Preset.hpp b/src/projectM-engine-backup/Preset.hpp new file mode 100644 index 000000000..95b7745ce --- /dev/null +++ b/src/projectM-engine-backup/Preset.hpp @@ -0,0 +1,141 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Preset + * + * $Log$ + */ + +#ifndef _PRESET_HPP +#define _PRESET_HPP + +#include "Common.hpp" +#include +#define PRESET_DEBUG 2 /* 0 for no debugging, 1 for normal, 2 for insane */ + +#include "CustomShape.hpp" +#include "CustomWave.hpp" +#include "Expr.hpp" +#include "PerPixelEqn.hpp" +#include "PerFrameEqn.hpp" +#include "BuiltinParams.hpp" +#include "PresetFrameIO.hpp" +#include +#include "InitCond.hpp" +#include + + +class CustomWave; +class CustomShape; +class InitCond; + +//#include + + +class Preset { +protected: + + +public: + + /** Load a preset by filename with input and output buffers specified. + * This is the only poper way to allocate a new preset. */ + Preset(const std::string & filename, const PresetInputs & presetInputs, PresetOutputs & presetOutputs); + + ~Preset(); + + /** Evaluates the preset for a frame given the current values of preset inputs / outputs */ + void evaluateFrame(); + + BuiltinParams builtinParams; + + std::string name; + std::string file_path; + + void load_init_conditions(); + CustomShape * find_custom_shape(int id, bool create_flag); + CustomWave * find_custom_wave(int id, bool create_flag); + + int per_pixel_eqn_string_index; + int per_frame_eqn_string_index; + int per_frame_init_eqn_string_index; + + int per_frame_eqn_count, + per_frame_init_eqn_count; + + char per_pixel_eqn_string_buffer[STRING_BUFFER_SIZE]; + char per_frame_eqn_string_buffer[STRING_BUFFER_SIZE]; + char per_frame_init_eqn_string_buffer[STRING_BUFFER_SIZE]; + + /* Data structures that contain equation and initial condition information */ + std::map per_frame_eqn_tree; /* per frame equations */ + std::map per_pixel_eqn_tree; /* per pixel equation tree */ + std::map per_frame_init_eqn_tree; /* per frame initial equations */ + std::map init_cond_tree; /* initial conditions */ + std::map user_param_tree; /* user parameter splay tree */ + + int add_per_pixel_eqn( char *name, GenExpr *gen_expr ); + + int resetPerPixelEqns(); + int resetPerPixelEqnFlags(); + + InitCond *get_init_cond( Param *param ); + + void load_custom_wave_init_conditions(); + void load_custom_wave_init( CustomWave *customWave ); + void load_custom_shape_init_conditions(); + void load_custom_shape_init( CustomShape *customShape ); + void initialize(const std::string & pathname); + + void reloadPerFrame(char * s); + void reloadPerFrameInit(char *s); + void reloadPerPixel(char *s); + int load_preset_file(const char * pathname); + static Preset *load_preset( const char *pathname ); + void savePreset(char * name); + int write_preset_name( FILE *fs ); + int write_init_conditions( FILE *fs ); + int write_init( InitCond *initCond ); + int write_per_frame_init_equations( FILE *fs ); + int write_per_frame_equations( FILE *fs ); + int write_per_pixel_equations( FILE *fs ); + Param * find(char * name, int flags) ; + int destroy(); + void load_init_cond(char *name, int flags); + +private: + + void evalCustomWavePerFrameEquations(); + void evalCustomShapePerFrameEquations(); + void evalInitConditions(); + void evalCustomWaveInitConditions(); + void evalCustomShapeInitConditions(); + void evalPerPixelEqns(); + void evalPerFrameEquations(); + + PresetOutputs::cwave_container * customWaves; + PresetOutputs::cshape_container * customShapes; + PresetOutputs & m_presetOutputs; +}; + +#endif /** !_PRESET_HPP */ diff --git a/src/projectM-engine-backup/PresetChooser.cpp b/src/projectM-engine-backup/PresetChooser.cpp new file mode 100644 index 000000000..b2397590e --- /dev/null +++ b/src/projectM-engine-backup/PresetChooser.cpp @@ -0,0 +1,14 @@ +// +// C++ Implementation: PresetChooser +// +// Description: +// +// +// Author: Carmelo Piccione , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "PresetChooser.hpp" + diff --git a/src/projectM-engine-backup/PresetChooser.hpp b/src/projectM-engine-backup/PresetChooser.hpp new file mode 100644 index 000000000..505915777 --- /dev/null +++ b/src/projectM-engine-backup/PresetChooser.hpp @@ -0,0 +1,225 @@ +/** PresetChooser.hpp: + * Provides functions and iterators to select presets. Requires a preset loader upon construction. + */ + +/// @idea Weighted random based on user stats + +#ifndef PRESET_CHOOSER_HPP +#define PRESET_CHOOSER_HPP + +#include "Preset.hpp" + +#include "PresetLoader.hpp" + +#include +#include + + +class PresetChooser; + +/// A simple iterator class to traverse back and forth a preset directory +class PresetIterator { + +public: + PresetIterator() {} + + /// Instantiate a preset iterator at the given starting position + PresetIterator(std::size_t start); + + /// Move iterator forward + void operator++(); + + /// Move iterator backword + void operator--() ; + + /// Not equal comparator + bool operator !=(const PresetIterator & presetPos) const ; + + + /// Equality comparator + bool operator ==(const PresetIterator & presetPos) const ; + + /// Returns an integer value representing the iterator position + /// @bug might become internal + /// \brief Returns the indexing value used by the current iterator. + std::size_t operator*() const; + + /// Allocate a new preset given this iterator's associated preset name + /// \param presetInputs the preset inputs to associate with the preset upon construction + /// \param presetOutputs the preset outputs to associate with the preset upon construction + /// \returns an auto pointer of the newly allocated preset + std::auto_ptr allocate(const PresetInputs & presetInputs, PresetOutputs & presetOutputs); + + /// Set the chooser asocciated with this iterator + void setChooser(const PresetChooser & chooser); + +private: + std::size_t m_currentIndex; + const PresetChooser * m_presetChooser; + +}; + +class PresetChooser { + +public: + typedef PresetIterator iterator; + + /// Initializes a chooser with an established preset loader. + /// \param presetLoader an initialized preset loader to choose presets from + /// \note The preset loader is refreshed via events or otherwise outside this class's scope + PresetChooser(const PresetLoader & presetLoader); + + + /// Choose a preset via the passed in index. Must be between 0 and num valid presets in directory + /// \param index An index lying in the interval [0, this->getNumPresets()] + /// \param presetInputs the preset inputs to associate with the preset upon construction + /// \param presetOutputs the preset outputs to associate with the preset upon construction + std::auto_ptr directoryIndex(std::size_t index, const PresetInputs & presetInputs, + PresetOutputs & presetOutputs) const; + + /// Gets the number of presets last believed to exist in the preset loader's filename collection + /// \returns the number of presets in the collection + std::size_t getNumPresets() const; + + /// A functor, for all preset indices, returns probability 1 / (number of presets in directory) + class UniformRandomFunctor { + + public: + /// Initialize a new functor with a particular collection size + /// \param collectionSize the number of presets one is sampling over + UniformRandomFunctor(std::size_t collectionSize); + + /// Returns uniform (fixed) probability for any index + /// \param index the index position of the preset to load + float operator() (std::size_t index) const; + + private: + std::size_t m_collectionSize; + + }; + + + /// An STL-esque iterator to beginning traversing presets from a directory + /// \returns the position of the first preset in the collection + PresetIterator begin(); + + /// An STL-esque iterator to retrieve an end position from a directory + /// \returns the end position of the collection + PresetIterator end() const; + + /// Perform a weighted sample to select a preset given a weight functor. + /// \param presetInputs the preset inputs to associate with the preset upon construction + /// \param presetOutputs the preset outputs to associate with the preset upon construction + /// \param WeightFunctor a functor that returns a probability for each index (see UniformRandomFunctor) + /// \returns an auto pointer of the newly allocated preset + template + std::auto_ptr weightedRandom(const PresetInputs & presetInputs, PresetOutputs & presetOutputs, WeightFunctor & weightFunctor) const; + + + /// Do a weighted sample given a weight functor and default construction (ie. element size) of the weight functor + /// \param presetInputs the preset inputs to associate with the preset upon construction + /// \param presetOutputs the preset outputs to associate with the preset upon construction + /// \param WeightFunctor a functor that returns a probability for each index (see UniformRandomFunctor) + /// \returns an auto pointer of the newly allocated preset + template + std::auto_ptr weightedRandom(const PresetInputs & presetInputs, PresetOutputs & preseOutputs) const; + +private: + template + std::auto_ptr doWeightedSample(WeightFunctor & weightFunctor, const PresetInputs & presetInputs, PresetOutputs & presetOutputs); + + const PresetLoader * m_presetLoader; +}; + + +inline PresetChooser::PresetChooser(const PresetLoader & presetLoader):m_presetLoader(&presetLoader) {} + +inline std::size_t PresetChooser::getNumPresets() const { + return m_presetLoader->getNumPresets(); +} + +inline void PresetIterator::setChooser(const PresetChooser & chooser) { + m_presetChooser = &chooser; +} + +inline std::size_t PresetIterator::operator*() const { + return m_currentIndex; +} + +inline PresetIterator::PresetIterator(std::size_t start):m_currentIndex(start) {} + +inline void PresetIterator::operator++() { + assert(m_currentIndex < m_presetChooser->getNumPresets()); + m_currentIndex++; +} + +inline void PresetIterator::operator--() { + assert(m_currentIndex > 0); + m_currentIndex--; +} + +inline bool PresetIterator::operator !=(const PresetIterator & presetPos) const { + return (*presetPos != **this); +} + + +inline bool PresetIterator::operator ==(const PresetIterator & presetPos) const { + return (*presetPos == **this); +} + +inline std::auto_ptr PresetIterator::allocate(const PresetInputs & presetInputs, PresetOutputs & presetOutputs) { + return m_presetChooser->directoryIndex(m_currentIndex, presetInputs, presetOutputs); +} + +inline float PresetChooser::UniformRandomFunctor::operator() (std::size_t index) const { + return (1.0 / m_collectionSize); +} + + +inline PresetIterator PresetChooser::begin() { + PresetIterator pos(0); + pos.setChooser(*this); + return pos; +} + +inline PresetIterator PresetChooser::end() const { + PresetIterator pos(m_presetLoader->getNumPresets()); + return pos; +} + +template +std::auto_ptr PresetChooser::weightedRandom(const PresetInputs & presetInputs, PresetOutputs & presetOutputs, WeightFunctor & weightFunctor) const { + doWeightedSample(weightFunctor); +} + +template +inline std::auto_ptr PresetChooser::weightedRandom(const PresetInputs & presetInputs, PresetOutputs & presetOutputs) const { + + WeightFunctor weightFunctor(m_presetLoader->getNumPresets()); + doWeightedSample(weightFunctor, presetInputs, presetOutputs); + +} + +inline std::auto_ptr PresetChooser::directoryIndex(std::size_t index, const PresetInputs & presetInputs, + PresetOutputs & presetOutputs) const { + + return m_presetLoader->loadPreset(index,presetInputs, presetOutputs); +} + +template +inline std::auto_ptr PresetChooser::doWeightedSample(WeightFunctor & weightFunctor, const PresetInputs & presetInputs, PresetOutputs & presetOutputs) { + + // Choose a random bounded mass between 0 and 1 + float cutoff = ((float)(random())) / RAND_MAX; + + // Sum up mass, stopping when cutoff is reached. This is the typical + // weighted sampling algorithm. + float mass = 0; + for (PresetIterator pos = this->begin();pos != this->end() ; ++pos) { + mass += weightFunctor(*pos); + if (mass >= cutoff) + return pos.allocate(presetInputs, presetOutputs); + } +} + +#endif diff --git a/src/projectM-engine-backup/PresetFilters.hpp b/src/projectM-engine-backup/PresetFilters.hpp new file mode 100644 index 000000000..0a7b98c6c --- /dev/null +++ b/src/projectM-engine-backup/PresetFilters.hpp @@ -0,0 +1,38 @@ +#ifndef PRESET_FILTERS_HPP +#define PRESET_FILTERS_HPP +#include "Preset.hpp" + +class PresetFilters { + +/// The merge functor decides how to put the presets together. +/// Assumes getMergedPreset() is implemented. +/// A sample is below +/// @bug this is screwed up, but functor idea still has merit once design is resolved +class LinearMergeFunctor { + +public: + LinearMergeFunctor(PresetOutputs & presetOutputsAB):m_presetOutputsAB(presetOutputsAB) {} + + + void operator() (const PresetInputs & inputsA, const PresetInputs & inputsB, + const PresetOutputs & outputsA, const PresetOutputs & outputsB) { + + // use time variables from inputsA/B to determine how presets should be merged + + } + + PresetOutputs & getMergedOutputs() { + return m_presetAB; + } + + +private: + PresetOutputs & m_presetOutputsAB; + +}; + +template +static void merge(const PresetOutput & outputsA, const Preset & outputsB, MergeFunctor & functor); + +}; +#endif diff --git a/src/projectM-engine-backup/PresetFrameIO.cpp b/src/projectM-engine-backup/PresetFrameIO.cpp new file mode 100644 index 000000000..c83028cb1 --- /dev/null +++ b/src/projectM-engine-backup/PresetFrameIO.cpp @@ -0,0 +1,202 @@ +#include "PresetFrameIO.hpp" +#include "wipemalloc.h" +#include +#include +#include +PresetInputs::PresetInputs() +{ +} + +void PresetInputs::Initialize(int gx, int gy) +{ + int x, y; + + this->gx =gx; + this->gy=gy; + std::cerr << "Allocating x_mesh, gx,gy is " << gx << "," << gy << std::endl; + this->x_mesh=(float **)wipemalloc(gx * sizeof(float *)); + assert(x_mesh); + for(x = 0; x < gx; x++) + { + this->x_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->y_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->y_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + + } + this->rad_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->rad_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->theta_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x theta_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + + this->origtheta=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->origtheta[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->origrad=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->origrad[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->origx=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->origx[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->origy=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->origy[x] = (float *)wipemalloc(gy * sizeof(float)); + } + +for (x=0;xorigx[x][y]=x/(float)(gx-1); + this->origy[x][y]=-((y/(float)(gy-1))-1); + this->origrad[x][y]=hypot((this->origx[x][y]-.5)*2,(this->origy[x][y]-.5)*2) * .7071067; + this->origtheta[x][y]=atan2(((this->origy[x][y]-.5)*2),((this->origx[x][y]-.5)*2)); + } + } + + + +} + +PresetOutputs::PresetOutputs() +{ +} + +void PresetOutputs::Initialize(int gx, int gy) +{ + int x; + this->sx_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->sx_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->sy_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->sy_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->dx_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->dx_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->dy_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->dy_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->cx_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->cx_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->cy_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->cy_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->zoom_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->zoom_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->zoomexp_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->zoomexp_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->rot_mesh=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->rot_mesh[x] = (float *)wipemalloc(gy * sizeof(float)); + } + zoom_is_mesh = false; + zoomexp_is_mesh =false; + rot_is_mesh =false; + + sx_is_mesh =false; + sy_is_mesh = false; + dx_is_mesh = false; + dy_is_mesh =false; + cx_is_mesh = false; + cy_is_mesh = false;; + +} + +PresetInputs::~PresetInputs() +{ + for(int x = 0; x < this->gx; x++) + { + + + free(this->origtheta[x]); + free(this->origrad[x]); + free(this->origx[x]); + free(this->origy[x]); + + free(this->x_mesh[x]); + free(this->y_mesh[x]); + free(this->rad_mesh[x]); + free(this->theta_mesh[x]); + + } + + + free(this->origx); + free(this->origy); + free(this->origrad); + free(this->origtheta); + + //std::cerr << "freeing x_mesh" <x_mesh); + free(this->y_mesh); + free(this->rad_mesh); + free(this->theta_mesh); + + this->origx = NULL; + this->origy = NULL; + this->origtheta = NULL; + this->origrad = NULL; + + this->x_mesh = NULL; + this->y_mesh = NULL; + this->rad_mesh = NULL; + this->theta_mesh = NULL; +} + +void PresetInputs::ResetMesh() +{ + int x,y; + + assert(x_mesh); + assert(y_mesh); + assert(rad_mesh); + assert(theta_mesh); + + for (x=0;xgx;x++) + { + for(y=0;ygy;y++) + { + x_mesh[x][y]=this->origx[x][y]; + y_mesh[x][y]=this->origy[x][y]; + rad_mesh[x][y]=this->origrad[x][y]; + theta_mesh[x][y]=this->origtheta[x][y]; + } + } + + } diff --git a/src/projectM-engine-backup/PresetFrameIO.hpp b/src/projectM-engine-backup/PresetFrameIO.hpp new file mode 100644 index 000000000..7ca6cfa0f --- /dev/null +++ b/src/projectM-engine-backup/PresetFrameIO.hpp @@ -0,0 +1,188 @@ +#ifndef PRESET_FRAME_IO_HPP +#define PRESET_FRAME_IO_HPP +#include + +class CustomWave; +class CustomShape; + + +/** Container for all preset writeable engine variables. It's a struct + * so that it's light weight. Access is done directly on + * members for Mr. Sperl's convenience */ +class PresetOutputs { +public: + typedef std::vector cwave_container; + typedef std::vector cshape_container; + + cwave_container customWaves; + cshape_container customShapes; + + void Initialize(int gx, int gy); + PresetOutputs(); + /* PER FRAME VARIABLES BEGIN */ + float zoom; + float zoomexp; + float rot; + float warp; + + float sx; + float sy; + float dx; + float dy; + float cx; + float cy; + + float decay; + + float wave_r; + float wave_g; + float wave_b; + float wave_o; + float wave_x; + float wave_y; + float wave_mystery; + + float ob_size; + float ob_r; + float ob_g; + float ob_b; + float ob_a; + + float ib_size; + float ib_r; + float ib_g; + float ib_b; + float ib_a; + + float mv_a ; + float mv_r ; + float mv_g ; + float mv_b ; + float mv_l; + float mv_x; + float mv_y; + float mv_dy; + float mv_dx; + + /* PER_FRAME VARIABLES END */ + + float fRating; + float fGammaAdj; + float fVideoEchoZoom; + float fVideoEchoAlpha; + + int nVideoEchoOrientation; + int nWaveMode; + int bAdditiveWaves; + int bWaveDots; + int bWaveThick; + int bModWaveAlphaByVolume; + int bMaximizeWaveColor; + int bTexWrap; + int bDarkenCenter; + int bRedBlueStereo; + int bBrighten; + int bDarken; + int bSolarize; + int bInvert; + int bMotionVectorsOn; + + + float fWaveAlpha ; + float fWaveScale; + float fWaveSmoothing; + float fWaveParam; + float fModWaveAlphaStart; + float fModWaveAlphaEnd; + float fWarpAnimSpeed; + float fWarpScale; + float fShader; + + /* Q VARIABLES START */ + + float q1; + float q2; + float q3; + float q4; + float q5; + float q6; + float q7; + float q8; + + + /* Q VARIABLES END */ + + float **zoom_mesh; + float **zoomexp_mesh; + float **rot_mesh; + + float **sx_mesh; + float **sy_mesh; + float **dx_mesh; + float **dy_mesh; + float **cx_mesh; + float **cy_mesh; + + bool zoom_is_mesh; + bool zoomexp_is_mesh; + bool rot_is_mesh; + + bool sx_is_mesh; + bool sy_is_mesh; + bool dx_is_mesh; + bool dy_is_mesh; + bool cx_is_mesh; + bool cy_is_mesh; + + +}; + +/** Container for all *read only* engine variables. It's a struct + * so that it's light weight. Access is done directly on + * members for Mr. Sperl's convenience */ +class PresetInputs { + +public: + /* PER_PIXEL VARIBLES BEGIN */ + + float x_per_pixel; + float y_per_pixel; + float rad_per_pixel; + float ang_per_pixel; + + /* PER_PIXEL VARIBLES END */ + + int fps; + + + float time; + float bass; + float mid; + float bass_att; + float mid_att; + float treb_att; + int frame; + float progress; + + + /* variables were added in milkdrop 1.04 */ + int gx,gy; + + + float **x_mesh; + float **y_mesh; + float **rad_mesh; + float **theta_mesh; + + float **origtheta; //grid containing interpolated mesh reference values + float **origrad; + float **origx; //original mesh + float **origy; + + void ResetMesh(); + ~PresetInputs(); + PresetInputs(); + void Initialize(int gx, int gy); +}; + +#endif diff --git a/src/projectM-engine-backup/PresetLoader.cpp b/src/projectM-engine-backup/PresetLoader.cpp new file mode 100644 index 000000000..a08bad4d9 --- /dev/null +++ b/src/projectM-engine-backup/PresetLoader.cpp @@ -0,0 +1,137 @@ +// +// C++ Implementation: PresetLoader +// +// Description: +// +// +// Author: Carmelo Piccione , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "PresetLoader.hpp" +#include "Preset.hpp" +#include +#include +extern "C" +{ +#include +#include +} +#include +#include "projectM.hpp" + +const std::string PresetLoader::PROJECTM_FILE_EXTENSION(".prjm"); +const std::string PresetLoader::MILKDROP_FILE_EXTENSION(".milk"); + +PresetLoader::PresetLoader(std::string dirname) :m_dirname(dirname), m_dir(0) +{ + // Do one scan + rescan(); +} + +PresetLoader::~PresetLoader() +{ + if (m_dir) + closedir(m_dir); +} + +void PresetLoader::setScanDirectory(std::string dirname) +{ + m_dirname = dirname; +} + + +void PresetLoader::rescan() +{ + std::cerr << "Rescanning..." << std::endl; + + // Clear the directory entry collection + m_entries.clear(); + + std::cerr << "cleared!" << std::endl; + + // If directory already opened, close it first + if (m_dir) + { + std::cerr << "m_dir" << std::endl; + closedir(m_dir); + m_dir = 0; + } + + std::cerr << "opening " << m_dirname << std::endl; + // Allocate a new a stream given the current directory name + if ((m_dir = opendir(m_dirname.c_str())) == NULL) + { + handleDirectoryError(); + abort(); + } + + struct dirent * dir_entry; + + while ((dir_entry = readdir(m_dir)) != NULL) + { + + + + std::ostringstream out; + // Convert char * to friendly string + std::string filename(dir_entry->d_name); + + + // Verify extension is projectm or milkdrop + if ((filename.rfind(PROJECTM_FILE_EXTENSION) != (filename.length() - PROJECTM_FILE_EXTENSION.length())) + && (filename.rfind(MILKDROP_FILE_EXTENSION) != (filename.length() - MILKDROP_FILE_EXTENSION.length()))) + continue; + + // Create full path name + out << m_dirname << PATH_SEPARATOR << filename; + + // std::cerr << "[PresetLoader]" << filename << std::endl; + // Add to our directory entry collection + m_entries.push_back(out.str()); + + // the directory entry struct is freed elsewhere + } + +} + +std::auto_ptr PresetLoader::loadPreset(unsigned int index, const PresetInputs & presetInputs, PresetOutputs & presetOutputs) const +{ + + // Check that index isn't insane + assert(index >= 0); + assert(index < m_entries.size()); + + // Return a new auto pointer to a present + return std::auto_ptr(new Preset(m_entries[index], presetInputs, presetOutputs)); +} + + + +void PresetLoader::handleDirectoryError() +{ + switch (errno) + { + case ENOENT: + std::cerr << "[PresetLoader] ENOENT error. \"man fopen\" for more info." << std::endl; + break; + case ENOMEM: + std::cerr << "[PresetLoader] out of memory! Are you running Windows?" << std::endl; + abort(); + case ENOTDIR: + std::cerr << "[PresetLoader] directory specified is not a preset directory! Cannot continue." << std::endl; + break; + case ENFILE: + std::cerr << "[PresetLoader] Your system has reached its open file limit. Giving up..." << std::endl; + abort(); + case EMFILE: + std::cerr << "[PresetLoader] too many files in use by projectM! Bailing!" << std::endl; + abort(); + case EACCES: + std::cerr << "[PresetLoader] permissions issue reading the specified preset directory." << std::endl; + break; + default: + break; + } +} diff --git a/src/projectM-engine-backup/PresetLoader.hpp b/src/projectM-engine-backup/PresetLoader.hpp new file mode 100644 index 000000000..a23571367 --- /dev/null +++ b/src/projectM-engine-backup/PresetLoader.hpp @@ -0,0 +1,51 @@ +#ifndef __PRESET_LOADER_HPP +#define __PRESET_LOADER_HPP + +#include // used for path / filename stuff + +#include // for auto pointers +#include +#include +#include + +class Preset; +class PresetInputs; +class PresetOutputs; + +class PresetLoader { + public: + static const std::string PROJECTM_FILE_EXTENSION; + static const std::string MILKDROP_FILE_EXTENSION; + + /** Initializes the preset loader with the target directory specified */ + PresetLoader(std::string dirname); + + /** Destructor will remove all alllocated presets */ + ~PresetLoader(); + + /** Load a preset by specifying a filename of the directory (that is, NOT full path) */ + /** Autopointers: when you take it, I leave it */ + std::auto_ptr loadPreset(unsigned int index, const PresetInputs & presetInputs, + PresetOutputs & presetOutputs) const; + + /** Returns the number of presets in the active directory */ + inline std::size_t getNumPresets() const { + return m_entries.size(); + } + + /** Sets the directory where the loader will search for files */ + void setScanDirectory(std::string pathname); + + /** Rescans the active preset directory */ + void rescan(); + + private: + void handleDirectoryError(); + std::string m_dirname; + DIR * m_dir; + + // vector chosen for speed, but not great for reverse index lookups + std::vector m_entries; +}; + +#endif diff --git a/src/projectM-engine-backup/Renderer.cpp b/src/projectM-engine-backup/Renderer.cpp new file mode 100644 index 000000000..15cf7d0fe --- /dev/null +++ b/src/projectM-engine-backup/Renderer.cpp @@ -0,0 +1,1996 @@ +#include "Renderer.hpp" +#include "wipemalloc.h" +#include "math.h" +#include "Common.hpp" +#include "console_interface.h" +#include "CustomShape.hpp" +#include "CustomWave.hpp" + +class Preset; + +Renderer::Renderer(int width, int height, int gx, int gy, RenderTarget *renderTarget, BeatDetect *beatDetect, char* fontURL) +{ + int x; int y; + + this->gx=gx; + this->gy=gy; + + this->totalframes = 1; + this->noSwitch = 0; + this->showfps = 0; + this->showtitle = 0; + this->showpreset = 0; + this->showhelp = 0; + this->showstats = 0; + this->studio = 0; +this->realfps=0; + + this->drawtitle=0; + + this->title = NULL; + + /** Other stuff... */ + this->correction = 1; + this->aspect=1.33333333; + + this->gridx=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->gridx[x] = (float *)wipemalloc(gy * sizeof(float)); + } + this->gridy=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->gridy[x] = (float *)wipemalloc(gy * sizeof(float)); + } + + this->origx2=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->origx2[x] = (float *)wipemalloc(gy * sizeof(float)); + } +this->origy2=(float **)wipemalloc(gx * sizeof(float *)); + for(x = 0; x < gx; x++) + { + this->origy2[x] = (float *)wipemalloc(gy * sizeof(float)); + } + + + //initialize reference grid values + for (x=0;xgridx[x][y]=origx*renderTarget->texsize; + this->gridy[x][y]=origy*renderTarget->texsize; + this->origx2[x][y]=( origx-.5)*2; + this->origy2[x][y]=( origy-.5)*2; + }} + +this->renderTarget = renderTarget; +this->beatDetect = beatDetect; +this->fontURL = fontURL; + +#ifdef USE_FTGL + /** Reset fonts */ + title_font = NULL; + other_font = NULL; + poly_font = NULL; +#endif /** USE_FTGL */ + +} + +void Renderer::RenderFrame(PresetOutputs *presetOutputs, PresetInputs *presetInputs) +{ + totalframes++; + + DWRITE( "start Pass 1 \n" ); + + //BEGIN PASS 1 + // + //This pass is used to render our texture + //the texture is drawn to a subsection of the framebuffer + //and then we perform our manipulations on it + //in pass 2 we will copy the texture into texture memory + + + renderTarget->lock(); + + + // glPushAttrib( GL_ALL_ATTRIB_BITS ); /* Overkill, but safe */ + + glViewport( 0, 0, renderTarget->texsize, renderTarget->texsize ); + + glEnable( GL_TEXTURE_2D ); + if(this->renderTarget->usePbuffers) + { + glBindTexture( GL_TEXTURE_2D, renderTarget->textureID[1] ); + } + else + { + glBindTexture( GL_TEXTURE_2D, renderTarget->textureID[0] ); + } + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + + glMatrixMode( GL_PROJECTION ); + glPushMatrix(); + glLoadIdentity(); + glOrtho(0.0, 1, 0.0, 1,10,40); + + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + glLoadIdentity(); + + DWRITE( "renderFrame: renderTarget->texsize: %d x %d\n", this->renderTarget->texsize, this->renderTarget->texsize ); + + + PerPixelMath(presetOutputs, presetInputs); + + if(this->renderTarget->usePbuffers) + { + //draw_motion_vectors(); //draw motion vectors + //unlockPBuffer( this->renderTarget); + //lockPBuffer( this->renderTarget, PBUFFER_PASS1 ); + } + PerFrame(presetOutputs); //apply per-frame effects + Interpolation(presetOutputs,presetInputs); //apply per-pixel effects + + draw_title_to_texture(); //draw title to texture + +// if(!this->renderTarget->usePbuffers) + { + draw_motion_vectors(presetOutputs); //draw motion vectors + } + draw_shapes(presetOutputs); + draw_custom_waves(presetOutputs); + draw_waveform(presetOutputs, presetInputs); + if(presetOutputs->bDarkenCenter)darken_center(); + draw_borders(presetOutputs); //draw borders + + /** Restore original view state */ + glMatrixMode( GL_MODELVIEW ); + glPopMatrix(); + + glMatrixMode( GL_PROJECTION ); + glPopMatrix(); + + /** Restore all original attributes */ + // glPopAttrib(); + glFlush(); + + renderTarget->unlock(); + + +#ifdef DEBUG + GLint msd = 0, + psd = 0; + glGetIntegerv( GL_MODELVIEW_STACK_DEPTH, &msd ); + glGetIntegerv( GL_PROJECTION_STACK_DEPTH, &psd ); + DWRITE( "end pass1: modelview matrix depth: %d\tprojection matrix depth: %d\n", + msd, psd ); + DWRITE( "begin pass2\n" ); +#endif + + //BEGIN PASS 2 + // + //end of texture rendering + //now we copy the texture from the framebuffer to + //video texture memory and render fullscreen on a quad surface. + + /** Reset the viewport size */ + DWRITE( "viewport: %d x %d\n", this->vw, this->vh ); + glViewport( 0, 0, this->vw, this->vh ); + glClear( GL_COLOR_BUFFER_BIT ); + + if ( this->renderTarget ) { + glBindTexture( GL_TEXTURE_2D, this->renderTarget->textureID[0] ); + } + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-0.5, 0.5, -0.5,0.5,10,40); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glLineWidth( this->renderTarget->texsize < 512 ? 1 : this->renderTarget->texsize/512.0); + //if(this->studio%2)render_texture_to_studio(); + //else + render_texture_to_screen(presetOutputs); + + // glClear(GL_COLOR_BUFFER_BIT); + //render_Studio(); + + //preset editing menu + glMatrixMode(GL_MODELVIEW); + glTranslated(-0.5,-0.5,-1); + + // When console refreshes, there is a chance the preset has been changed by the user + refreshConsole(); + draw_title_to_screen(); + if(this->showhelp%2)draw_help(); + if(this->showtitle%2)draw_title(); + if(this->showfps%2)draw_fps(this->realfps); + if(this->showpreset%2)draw_preset(); + if(this->showstats%2)draw_stats(presetInputs); + glTranslatef(0.5 ,0.5,1); + + DWRITE( "end pass2\n" ); +} + + +void Renderer::Interpolation(PresetOutputs *presetOutputs, PresetInputs *presetInputs) +{ + int x,y; + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glTranslated( 0, 0, -1 ); + + glColor4f(0.0, 0.0, 0.0,presetOutputs->decay); + + glEnable(GL_TEXTURE_2D); + +#ifdef MACOS2 + /** Bind the stashed texture */ + if ( this->renderTarget->pbuffer != NULL ) { + glBindTexture( GL_TEXTURE_2D, this->renderTarget->textureID[0] ); +#ifdef DEBUG + if ( glGetError() ) { + DWRITE( "failed to bind texture\n" ); + } +#endif + } +#endif + + for (x=0;xgx - 1;x++){ + glBegin(GL_TRIANGLE_STRIP); + for(y=0;ygy;y++){ + glTexCoord2f(presetInputs->x_mesh[x][y], presetInputs->y_mesh[x][y]); + glVertex2f(this->gridx[x][y], this->gridy[x][y]); + glTexCoord2f(presetInputs->x_mesh[x+1][y], presetInputs->y_mesh[x+1][y]); + glVertex2f(this->gridx[x+1][y], this->gridy[x+1][y]); + } + glEnd(); + } + +#ifdef MACOS2 + /** Re-bind the pbuffer */ + if ( this->renderTarget->pbuffer != NULL ) { + glBindTexture( GL_TEXTURE_2D, this->renderTarget->textureID[0] ); + } +#endif + + glDisable(GL_TEXTURE_2D); + + glPopMatrix(); +} + + +void Renderer::PerFrame(PresetOutputs *presetOutputs) +{ + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslated(0, 0, -9); + + //Texture wrapping( clamp vs. wrap) + if (presetOutputs->bTexWrap==0){ + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);} + else{ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);} + + + // glRasterPos2i(0,0); + // glClear(GL_COLOR_BUFFER_BIT); + // glColor4d(0.0, 0.0, 0.0,1.0); + + // glMatrixMode(GL_TEXTURE); + // glLoadIdentity(); + + glRasterPos2i(0,0); + glClear(GL_COLOR_BUFFER_BIT); + glColor4d(0.0, 0.0, 0.0,1.0); + + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + + /* + glTranslatef(presetOutputs->cx,presetOutputs->cy, 0); + if(this->correction) glScalef(1,this->vw/(float)this->vh,1); + + if(!isPerPixelEqn(ROT_OP)) { + // printf("ROTATING: rot = %f\n", rot); + glRotatef(presetOutputs->rot*90, 0, 0, 1); + } + if(!isPerPixelEqn(SX_OP)) glScalef(1/presetOutputs->sx,1,1); + if(!isPerPixelEqn(SY_OP)) glScalef(1,1/presetOutputs->sy,1); + + if(this->correction)glScalef(1,this->vh/(float)this->vw,1); + glTranslatef((-presetOutputs->cx) ,(-presetOutputs->cy),0); + */ + + if(!presetOutputs->dx_is_mesh) glTranslatef(-presetOutputs->dx,0,0); + if(!presetOutputs->dy_is_mesh) glTranslatef(0 ,-presetOutputs->dy,0); + } + + +Renderer::~Renderer() { + + int x; + + for(x = 0; x < this->gx; x++) + { + + free(this->gridx[x]); + free(this->gridy[x]); + free(this->origx2[x]); + free(this->origy2[x]); + + + } + + free(this->origx2); + free(this->origy2); + free(this->gridx); + free(this->gridy); + + + + this->origx2 = NULL; + this->origy2 = NULL; + this->gridx = NULL; + this->gridy = NULL; + +} + + +void Renderer::PerPixelMath(PresetOutputs *presetOutputs, PresetInputs *presetInputs) { + + int x,y; + float fZoom2,fZoom2Inv; + + + + if(!presetOutputs->cx_is_mesh) + { + for (x=0;xgx;x++){ + + for(y=0;ygy;y++){ + presetOutputs->cx_mesh[x][y]=presetOutputs->cx; + } + + } + } + + if(!presetOutputs->cy_is_mesh) + { + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetOutputs->cy_mesh[x][y]=presetOutputs->cy; + }} + } + + if(!presetOutputs->sx_is_mesh) + { + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetOutputs->sx_mesh[x][y]=presetOutputs->sx; + }} + } + + if(!presetOutputs->sy_is_mesh) + { + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetOutputs->sy_mesh[x][y]=presetOutputs->sy; + }} + } + + if(!presetOutputs->zoom_is_mesh) + { + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetOutputs->zoom_mesh[x][y]=presetOutputs->zoom; + }} + } + + if(!presetOutputs->zoomexp_is_mesh) + { + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetOutputs->zoomexp_mesh[x][y]=presetOutputs->zoomexp; + }} + } + + if(!presetOutputs->rot_is_mesh) + { + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetOutputs->rot_mesh[x][y]=presetOutputs->rot; + } + } + } + + /* + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + x_mesh[x][y]=(x_mesh[x][y]-.5)*2; + } + } + + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + y_mesh[x][y]=(y_mesh[x][y]-.5)*2; + } + } + */ + + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + fZoom2 = powf( presetOutputs->zoom_mesh[x][y], powf( presetOutputs->zoomexp_mesh[x][y], presetInputs->rad_mesh[x][y]*2.0f - 1.0f)); + fZoom2Inv = 1.0f/fZoom2; + presetInputs->x_mesh[x][y]= this->origx2[x][y]*0.5f*fZoom2Inv + 0.5f; + presetInputs->y_mesh[x][y]= this->origy2[x][y]*0.5f*fZoom2Inv + 0.5f; + } + } + + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetInputs->x_mesh[x][y] = ( presetInputs->x_mesh[x][y] - presetOutputs->cx_mesh[x][y])/presetOutputs->sx_mesh[x][y] + presetOutputs->cx_mesh[x][y]; + } + } + + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetInputs->y_mesh[x][y] = ( presetInputs->y_mesh[x][y] - presetOutputs->cy_mesh[x][y])/presetOutputs->sy_mesh[x][y] + presetOutputs->cy_mesh[x][y]; + } + } + + + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + float u2 = presetInputs->x_mesh[x][y] - presetOutputs->cx_mesh[x][y]; + float v2 = presetInputs->y_mesh[x][y] - presetOutputs->cy_mesh[x][y]; + + float cos_rot = cosf(presetOutputs->rot_mesh[x][y]); + float sin_rot = sinf(presetOutputs->rot_mesh[x][y]); + + presetInputs->x_mesh[x][y] = u2*cos_rot - v2*sin_rot + presetOutputs->cx_mesh[x][y]; + presetInputs->y_mesh[x][y] = u2*sin_rot + v2*cos_rot + presetOutputs->cy_mesh[x][y]; + + } + } + + if(presetOutputs->dx_is_mesh) + { + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetInputs->x_mesh[x][y] -= presetOutputs->dx_mesh[x][y]; + } + } + } + + if(presetOutputs->dy_is_mesh) + { + for (x=0;xgx;x++){ + for(y=0;ygy;y++){ + presetInputs->y_mesh[x][y] -= presetOutputs->dy_mesh[x][y]; + } + } + + } + +} + + + +void Renderer::reset(int w, int h) +{ + this->aspect=(float)h / (float)w; + this -> vw = w; + this -> vh = h; + +//FIXME maybe needs called elsewhere + //if (!this->renderTarget->usePbuffers) { + // renderTarge->createPBuffers(w,h,this->renderTarget); + // } + + /* Our shading model--Gouraud (smooth). */ + glShadeModel( GL_SMOOTH); + /* Culling. */ + // glCullFace( GL_BACK ); + // glFrontFace( GL_CCW ); + // glEnable( GL_CULL_FACE ); + /* Set the clear color. */ + glClearColor( 0, 0, 0, 0 ); + /* Setup our viewport. */ + glViewport( 0, 0, w, h ); + /* + * Change to the projection matrix and set + * our viewing volume. + */ + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + + // gluOrtho2D(0.0, (GLfloat) width, 0.0, (GLfloat) height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + // glFrustum(0.0, height, 0.0,width,10,40); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glDrawBuffer(GL_BACK); + glReadBuffer(GL_BACK); + glEnable(GL_BLEND); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glEnable( GL_LINE_SMOOTH ); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + + glEnable(GL_POINT_SMOOTH); + + // glCopyTexImage2D(GL_TEXTURE_2D,0,GL_RGB,0,0,renderTarget->texsize,renderTarget->texsize,0); + //glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,renderTarget->texsize,renderTarget->texsize); + glLineStipple(2, 0xAAAA); + + /** (Re)create the offscreen for pass 1 */ + + //REME: necesary? + //rescale_per_pixel_matrices(); + + /** Load TTF font **/ + + + +#ifdef USE_FTGL + /**f Load the standard fonts */ + if ( title_font == NULL && other_font == NULL ) { + char path[1024]; + + sprintf( path, "%s%cVera.ttf", this->fontURL, PATH_SEPARATOR ); + title_font = new FTGLPixmapFont(path); + poly_font = new FTGLPolygonFont(path); + sprintf( path, "%s%cVeraMono.ttf", this->fontURL, PATH_SEPARATOR ); + other_font = new FTGLPixmapFont(path); + + } +#endif /** USE_FTGL */ +} + + + + + +void Renderer::draw_custom_waves(PresetOutputs *presetOutputs) { + + int x; + CustomWave *wavecode; + + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + glTranslatef( 0, 0, -1 ); + + glPointSize(this->renderTarget->texsize < 512 ? 1 : this->renderTarget->texsize/512); + + /// @bug SPERL: this is a starting point at least + for (PresetOutputs::cwave_container::const_iterator pos = presetOutputs->customWaves.begin(); + pos != presetOutputs->customWaves.end(); ++pos) + { + + if(wavecode->enabled==1) + { + + if (wavecode->bAdditive==0) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + else glBlendFunc(GL_SRC_ALPHA, GL_ONE); + if (wavecode->bDrawThick==1) glLineWidth(this->renderTarget->texsize < 512 ? 1 : 2*this->renderTarget->texsize/512); + + beatDetect->pcm->getPCM(wavecode->value1,wavecode->samples,0,wavecode->bSpectrum,wavecode->smoothing,0); + beatDetect->pcm->getPCM(wavecode->value2,wavecode->samples,1,wavecode->bSpectrum,wavecode->smoothing,0); + // printf("%f\n",pcmL[0]); + + + float mult=wavecode->scaling*presetOutputs->fWaveScale*(wavecode->bSpectrum ? 0.015f :1.0f); + + for(x=0;xsamples;x++) + {wavecode->value1[x]*=mult;} + + for(x=0;xsamples;x++) + {wavecode->value2[x]*=mult;} + + for(x=0;xsamples;x++) + {wavecode->sample_mesh[x]=((float)x)/((float)(wavecode->samples-1));} + + // printf("mid inner loop\n"); + wavecode->evalPerPointEqns(); + + //put drawing code here + if (wavecode->bUseDots==1) glBegin(GL_POINTS); + else glBegin(GL_LINE_STRIP); + + for(x=0;xsamples;x++) + { + + glColor4f(wavecode->r_mesh[x],wavecode->g_mesh[x],wavecode->b_mesh[x],wavecode->a_mesh[x]); + glVertex3f(wavecode->x_mesh[x],-(wavecode->y_mesh[x]-1),-1); + } + glEnd(); + glPointSize(this->renderTarget->texsize < 512 ? 1 : this->renderTarget->texsize/512); + glLineWidth(this->renderTarget->texsize < 512 ? 1 : this->renderTarget->texsize/512); + glDisable(GL_LINE_STIPPLE); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + // glPopMatrix(); + + } + + } + + glPopMatrix(); +} + + +void Renderer::draw_shapes(PresetOutputs *presetOutputs) { + + int i; + + float theta; + float radius; + + CustomShape *shapecode; + + float pi = 3.14159265; + float start,inc,xval,yval; + + float t; + + // more=isMoreCustomWave(); + // printf("not inner loop\n"); + + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + glTranslatef( 0, 0, -1 ); + +/// @bug SPERL: this is a starting point at least + for (PresetOutputs::cshape_container::const_iterator pos = presetOutputs->customShapes.begin(); + pos != presetOutputs->customShapes.end(); ++pos) + { + + if(shapecode->enabled==1) + { + // printf("drawing shape %f\n",shapecode->ang); + shapecode->y=-((shapecode->y)-1); + radius=.5; + shapecode->radius=shapecode->radius*(.707*.707*.707*1.04); + //Additive Drawing or Overwrite + if (shapecode->additive==0) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + else glBlendFunc(GL_SRC_ALPHA, GL_ONE); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + /* DEPRECATED + if(this->correction) + { + glTranslatef(0.5,0.5, 0); + glScalef(1.0,this->vw/(float)this->vh,1.0); + glTranslatef(-0.5 ,-0.5,0); + } + */ + + xval=shapecode->x; + yval=shapecode->y; + + if (shapecode->textured) + { + glMatrixMode(GL_TEXTURE); + glPushMatrix(); + glLoadIdentity(); + //glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + //glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + + //glTranslatef(.5,.5, 0); + //if (this->correction) glScalef(1,this->vw/(float)this->vh,1); + + //glRotatef((shapecode->tex_ang*360/6.280), 0, 0, 1); + + //glScalef(1/(shapecode->tex_zoom),1/(shapecode->tex_zoom),1); + + // glScalef(1,vh/(float)vw,1); + //glTranslatef((-.5) ,(-.5),0); + // glScalef(1,this->vw/(float)this->vh,1); + glEnable(GL_TEXTURE_2D); + + + glBegin(GL_TRIANGLE_FAN); + glColor4f(0.0,0.0,0.0,shapecode->a); + //glColor4f(shapecode->r,shapecode->g,shapecode->b,shapecode->a); + + glTexCoord2f(.5,.5); + glVertex3f(xval,yval,-1); + //glColor4f(shapecode->r2,shapecode->g2,shapecode->b2,shapecode->a2); + glColor4f(0.0,0.0,0.0,shapecode->a2); + + for ( i=1;isides+2;i++) + { + + // theta+=inc; + // glColor4f(shapecode->r2,shapecode->g2,shapecode->b2,shapecode->a2); + //glTexCoord2f(radius*cos(theta)+.5 ,radius*sin(theta)+.5 ); + //glVertex3f(shapecode->radius*cos(theta)+xval,shapecode->radius*sin(theta)+yval,-1); + t = (i-1)/(float)shapecode->sides; + + glTexCoord2f( 0.5f + 0.5f*cosf(t*3.1415927f*2 + shapecode->tex_ang + 3.1415927f*0.25f)*(this->correction ? this->aspect : 1.0)/shapecode->tex_zoom, 0.5f + 0.5f*sinf(t*3.1415927f*2 + shapecode->tex_ang + 3.1415927f*0.25f)/shapecode->tex_zoom); + glVertex3f(shapecode->radius*cosf(t*3.1415927f*2 + shapecode->ang + 3.1415927f*0.25f)*(this->correction ? this->aspect : 1.0)+xval, shapecode->radius*sinf(t*3.1415927f*2 + shapecode->ang + 3.1415927f*0.25f)+yval,-1); + } + glEnd(); + + + + + glDisable(GL_TEXTURE_2D); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + } + else{//Untextured (use color values) + //printf("untextured %f %f %f @:%f,%f %f %f\n",shapecode->a2,shapecode->a,shapecode->border_a, shapecode->x,shapecode->y,shapecode->radius,shapecode->ang); + //draw first n-1 triangular pieces + glBegin(GL_TRIANGLE_FAN); + + glColor4f(shapecode->r,shapecode->g,shapecode->b,shapecode->a); + + // glTexCoord2f(.5,.5); + glVertex3f(xval,yval,-1); + glColor4f(shapecode->r2,shapecode->g2,shapecode->b2,shapecode->a2); + + for ( i=1;isides+2;i++) + { + + //theta+=inc; + // glColor4f(shapecode->r2,shapecode->g2,shapecode->b2,shapecode->a2); + // glTexCoord2f(radius*cos(theta)+.5 ,radius*sin(theta)+.5 ); + //glVertex3f(shapecode->radius*cos(theta)+xval,shapecode->radius*sin(theta)+yval,-1); + + t = (i-1)/(float)shapecode->sides; + glVertex3f(shapecode->radius*cosf(t*3.1415927f*2 + shapecode->ang + 3.1415927f*0.25f)*(this->correction ? this->aspect : 1.0)+xval, shapecode->radius*sinf(t*3.1415927f*2 + shapecode->ang + 3.1415927f*0.25f)+yval,-1); + + } + glEnd(); + + + } + if (presetOutputs->bWaveThick==1) glLineWidth(this->renderTarget->texsize < 512 ? 1 : 2*this->renderTarget->texsize/512); + glBegin(GL_LINE_LOOP); + glColor4f(shapecode->border_r,shapecode->border_g,shapecode->border_b,shapecode->border_a); + for ( i=1;isides+1;i++) + { + + t = (i-1)/(float)shapecode->sides; + glVertex3f(shapecode->radius*cosf(t*3.1415927f*2 + shapecode->ang + 3.1415927f*0.25f)*(this->correction ? this->aspect : 1.0)+xval, shapecode->radius*sinf(t*3.1415927f*2 + shapecode->ang + 3.1415927f*0.25f)+yval,-1); + + //theta+=inc; + //glVertex3f(shapecode->radius*cos(theta)+xval,shapecode->radius*sin(theta)+yval,-1); + } + glEnd(); + if (presetOutputs->bWaveThick==1) glLineWidth(this->renderTarget->texsize < 512 ? 1 : this->renderTarget->texsize/512); + + glPopMatrix(); + } + } + + glPopMatrix(); +} + + +void Renderer::draw_waveform(PresetOutputs *presetOutputs, PresetInputs *presetInputs) { + + int x; + + float r,theta; + + float offset,scale,dy2_adj; + + float co; + + float wave_x_temp=0; + float wave_y_temp=0; + float dy_adj; + float xx,yy; + + float cos_rot; + float sin_rot; + + DWRITE( "draw_waveform: %d\n", presetOutputs->nWaveMode ); + + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + + modulate_opacity_by_volume(presetOutputs); + maximize_colors(presetOutputs); + + if(presetOutputs->bWaveDots==1) glEnable(GL_LINE_STIPPLE); + + offset=presetOutputs->wave_x-.5; + scale=505.0/512.0; + + + + + //Thick wave drawing + if (presetOutputs->bWaveThick==1) glLineWidth( (this->renderTarget->texsize < 512 ) ? 2 : 2*this->renderTarget->texsize/512); + + //Additive wave drawing (vice overwrite) + if (presetOutputs->bAdditiveWaves==0) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + else glBlendFunc(GL_SRC_ALPHA, GL_ONE); + + switch(presetOutputs->nWaveMode) + { + + case 8://monitor + + glTranslatef(0.5,0.5, 0); + glRotated(-presetOutputs->wave_mystery*90,0,0,1); + + glTranslatef(-0.5,-0.825, 0); + glTranslatef( 0, 0, -1 ); + + /* + for (x=0;x<16;x++) + { + glBegin(GL_LINE_STRIP); + glColor4f(1.0-(x/15.0),.5,x/15.0,1.0); + glVertex3f((this->totalframes%256)*2*scale, -this->beat_val[x]*presetOutputs->fWaveScale+renderTarget->texsize*wave_y,-1); + glColor4f(.5,.5,.5,1.0); + glVertex3f((this->totalframes%256)*2*scale, this->renderTarget->texsize*presetOutputs->wave_y,-1); + glColor4f(1.0,1.0,0,1.0); + //glVertex3f((this->totalframes%256)*scale*2, this->beat_val_att[x]*presetOutputs->fWaveScale+this->renderTarget->texsize*presetOutputs->wave_y,-1); + glEnd(); + + glTranslatef(0,this->renderTarget->texsize*(1/36.0), 0); + } + */ + + glTranslatef(0,(1/18.0), 0); + + + glBegin(GL_LINE_STRIP); + glColor4f(1.0,1.0,0.5,1.0); + glVertex2f((this->totalframes%256)*2*scale, beatDetect->treb_att*5*presetOutputs->fWaveScale+presetOutputs->wave_y); + glColor4f(.2,.2,.2,1.0); + glVertex2f((this->totalframes%256)*2*scale, presetOutputs->wave_y); + glColor4f(1.0,1.0,0,1.0); + glVertex2f((this->totalframes%256)*scale*2, beatDetect->treb*-5*presetOutputs->fWaveScale+presetOutputs->wave_y); + glEnd(); + + glTranslatef(0,.075, 0); + glBegin(GL_LINE_STRIP); + glColor4f(0,1.0,0.0,1.0); + glVertex2f((this->totalframes%256)*2*scale, beatDetect->mid_att*5*presetOutputs->fWaveScale+presetOutputs->wave_y); + glColor4f(.2,.2,.2,1.0); + glVertex2f((this->totalframes%256)*2*scale, presetOutputs->wave_y); + glColor4f(.5,1.0,.5,1.0); + glVertex2f((this->totalframes%256)*scale*2, beatDetect->mid*-5*presetOutputs->fWaveScale+presetOutputs->wave_y); + glEnd(); + + + glTranslatef(0,.075, 0); + glBegin(GL_LINE_STRIP); + glColor4f(1.0,0,0,1.0); + glVertex2f((this->totalframes%256)*2*scale, beatDetect->bass_att*5*presetOutputs->fWaveScale+presetOutputs->wave_y); + glColor4f(.2,.2,.2,1.0); + glVertex2f((this->totalframes%256)*2*scale, presetOutputs->wave_y); + glColor4f(1.0,.5,.5,1.0); + glVertex2f((this->totalframes%256)*scale*2, beatDetect->bass*-5*presetOutputs->fWaveScale+presetOutputs->wave_y); + glEnd(); + + break; + + case 0://circular waveforms + // float co; + // glPushMatrix(); + /* + if(this->correction) + { + glTranslatef(this->renderTarget->texsize*.5,this->renderTarget->texsize*.5, 0); + glScalef(1.0,this->vw/(float)this->vh,1.0); + glTranslatef((-this->renderTarget->texsize*.5) ,(-this->renderTarget->texsize*.5),0); + } + */ + + glTranslatef( 0, 0, -1 ); + + presetOutputs->wave_y=-1*(presetOutputs->wave_y-1.0); + + glBegin(GL_LINE_STRIP); + + DWRITE( "nsamples: %d\n", beatDetect->pcm->numsamples ); + + for ( x=0;xpcm->numsamples;x++) + { float inv_nverts_minus_one = 1.0f/(float)(beatDetect->pcm->numsamples); + //co= -(fabs(x-((beatDetect->pcm->numsamples*.5)-1))/beatDetect->pcm->numsamples)+1; + // printf("%d %f\n",x,co); + //theta=x*(6.28/beatDetect->pcm->numsamples); + //r= ((1+2*presetOutputs->wave_mystery)*(this->renderTarget->texsize/5.0)+ + // ( co*beatDetect->pcm->pcmdataL[x]+ (1-co)*beatDetect->pcm->pcmdataL[-(x-(beatDetect->pcm->numsamples-1))]) + // *25*presetOutputs->fWaveScale); + r=(0.5 + 0.4f*.12*beatDetect->pcm->pcmdataR[x]*presetOutputs->fWaveScale + presetOutputs->wave_mystery)*.5; + theta=(x)*inv_nverts_minus_one*6.28f + presetInputs->time*0.2f; + /* + if (x < 51) + { + float mix = x/51.0; + mix = 0.5f - 0.5f*cosf(mix * 3.1416f); + float rad_2 = 0.5f + 0.4f*.12*beatDetect->pcm->pcmdataR[x]*presetOutputs->fWaveScale + presetOutputs->wave_mystery; + r = rad_2*(1.0f-mix) + r*(mix); + } + */ + glVertex2f((r*cos(theta)*(this->correction ? this->aspect : 1.0)+presetOutputs->wave_x), (r*sin(theta)+presetOutputs->wave_y)); + + } + + // r= ( (1+2*presetOutputs->wave_mystery)*(this->renderTarget->texsize/5.0)+ + // (0.5*beatDetect->pcm->pcmdataL[0]+ 0.5*beatDetect->pcm->pcmdataL[beatDetect->pcm->numsamples-1]) + // *20*presetOutputs->fWaveScale); + + //glVertex3f(r*cos(0)+(presetOutputs->wave_x*this->renderTarget->texsize),r*sin(0)+(presetOutputs->wave_y*this->renderTarget->texsize),-1); + + glEnd(); + /* + glBegin(GL_LINE_LOOP); + + for ( x=0;x<(512/pcmbreak);x++) + { + theta=(blockstart+x)*((6.28*pcmbreak)/512.0); + r= ((1+2*presetOutputs->wave_mystery)*(this->renderTarget->texsize/5.0)+fdata_buffer[fbuffer][0][blockstart+x]*.0025*presetOutputs->fWaveScale); + + glVertex3f(r*cos(theta)+(presetOutputs->wave_x*this->renderTarget->texsize),r*sin(theta)+(wave_y*this->renderTarget->texsize),-1); + } + glEnd(); + */ + //glPopMatrix(); + + break; + + case 1://circularly moving waveform + // float co; + + glTranslatef(.5,.5, 0); + glScalef(1.0,this->vw/(float)this->vh,1.0); + glTranslatef((-.5) ,(-.5),0); + glTranslatef( 0, 0, -1 ); + + presetOutputs->wave_y=-1*(presetOutputs->wave_y-1.0); + + glBegin(GL_LINE_STRIP); + //theta=(frame%512)*(6.28/512.0); + + for ( x=1;x<(512-32);x++) + { + //co= -(abs(x-255)/512.0)+1; + // printf("%d %f\n",x,co); + //theta=((this->frame%256)*(2*6.28/512.0))+beatDetect->pcm->pcmdataL[x]*.2*presetOutputs->fWaveScale; + //r= ((1+2*presetOutputs->wave_mystery)*(this->renderTarget->texsize/5.0)+ + // (beatDetect->pcm->pcmdataL[x]-beatDetect->pcm->pcmdataL[x-1])*80*presetOutputs->fWaveScale); + theta=beatDetect->pcm->pcmdataL[x+32]*0.06*presetOutputs->fWaveScale * 1.57 + presetInputs->time*2.3; + r=(0.53 + 0.43*beatDetect->pcm->pcmdataR[x]*0.12*presetOutputs->fWaveScale+ presetOutputs->wave_mystery)*.5; + + + glVertex2f((r*cos(theta)*(this->correction ? this->aspect : 1.0)+presetOutputs->wave_x),(r*sin(theta)+presetOutputs->wave_y)); + } + + glEnd(); + /* + presetOutputs->wave_y=-1*(presetOutputs->wave_y-1.0); + wave_x_temp=(presetOutputs->wave_x*.75)+.125; + wave_x_temp=-(wave_x_temp-1); + + glBegin(GL_LINE_STRIP); + + + + for (x=0; x<512-32; x++) + { + float rad = (.53 + 0.43*beatDetect->pcm->pcmdataR[x]) + presetOutputs->wave_mystery; + float ang = beatDetect->pcm->pcmdataL[x+32] * 1.57f + this->Time*2.3f; + glVertex3f((rad*cosf(ang)*.2*scale*presetOutputs->fWaveScale + wave_x_temp)*this->renderTarget->texsize,(rad*sinf(ang)*presetOutputs->fWaveScale*.2*scale + presetOutputs->wave_y)*this->renderTarget->texsize,-1); + + } + glEnd(); + */ + + break; + + case 2://EXPERIMENTAL + + glTranslatef( 0, 0, -1 ); + presetOutputs->wave_y=-1*(presetOutputs->wave_y-1.0); + + + glBegin(GL_LINE_STRIP); + + for (x=0; x<512-32; x++) + { + + glVertex2f((beatDetect->pcm->pcmdataR[x]*presetOutputs->fWaveScale*0.5*(this->correction ? this->aspect : 1.0) + presetOutputs->wave_x),( (beatDetect->pcm->pcmdataL[x+32]*presetOutputs->fWaveScale*0.5 + presetOutputs->wave_y))); + } + glEnd(); + + break; + + case 3://EXPERIMENTAL + + glTranslatef( 0, 0, -9 ); + presetOutputs->wave_y=-1*(presetOutputs->wave_y-1.0); + //wave_x_temp=(presetOutputs->wave_x*.75)+.125; + //wave_x_temp=-(wave_x_temp-1); + + + + glBegin(GL_LINE_STRIP); + + for (x=0; x<512-32; x++) + { + + glVertex2f((beatDetect->pcm->pcmdataR[x] * presetOutputs->fWaveScale*0.5 + presetOutputs->wave_x),( (beatDetect->pcm->pcmdataL[x+32]*presetOutputs->fWaveScale*0.5 + presetOutputs->wave_y))); + + } + glEnd(); + + break; + + case 4://single x-axis derivative waveform + { + presetOutputs->wave_y=-1*(presetOutputs->wave_y-1.0); + glTranslatef(.5,.5, 0); + glRotated(-presetOutputs->wave_mystery*90,0,0,1); + glTranslatef(-.5,-.5, 0); + glTranslatef( 0, 0, -1 ); + + float w1 = 0.45f + 0.5f*(presetOutputs->wave_mystery*0.5f + 0.5f); + float w2 = 1.0f - w1; + float xx[512],yy[512]; + + glBegin(GL_LINE_STRIP); + for (int i=0; i<512; i++) + { + xx[i] = -1.0f + 2.0f*(i/512.0) + presetOutputs->wave_x; + yy[i] =0.4* beatDetect->pcm->pcmdataL[i]*0.47f*presetOutputs->fWaveScale + presetOutputs->wave_y; + xx[i] += 0.4*beatDetect->pcm->pcmdataR[i]*0.44f*presetOutputs->fWaveScale; + + if (i>1) + { + xx[i] = xx[i]*w2 + w1*(xx[i-1]*2.0f - xx[i-2]); + yy[i] = yy[i]*w2 + w1*(yy[i-1]*2.0f - yy[i-2]); + } + glVertex2f(xx[i],yy[i]); + } + + glEnd(); + + /* + presetOutputs->wave_x=(presetOutputs->wave_x*.75)+.125; + presetOutputs->wave_x=-(presetOutputs->wave_x-1); + glBegin(GL_LINE_STRIP); + + for ( x=1;x<512;x++) + { + dy_adj= beatDetect->pcm->pcmdataL[x]*20*presetOutputs->fWaveScale-beatDetect->pcm->pcmdataL[x-1]*20*presetOutputs->fWaveScale; + glVertex3f((x*(this->renderTarget->texsize/512))+dy_adj, beatDetect->pcm->pcmdataL[x]*20*presetOutputs->fWaveScale+this->renderTarget->texsize*presetOutputs->wave_x,-1); + } + glEnd(); + */ + } + break; + + case 5://EXPERIMENTAL + + glTranslatef( 0, 0, -5 ); + + presetOutputs->wave_y=-1*(presetOutputs->wave_y-1.0); + + cos_rot = cosf(presetInputs->time*0.3f); + sin_rot = sinf(presetInputs->time*0.3f); + + glBegin(GL_LINE_STRIP); + + for (x=0; x<512; x++) + { + float x0 = (beatDetect->pcm->pcmdataR[x]*beatDetect->pcm->pcmdataL[x+32] + beatDetect->pcm->pcmdataL[x+32]*beatDetect->pcm->pcmdataR[x]); + float y0 = (beatDetect->pcm->pcmdataR[x]*beatDetect->pcm->pcmdataR[x] - beatDetect->pcm->pcmdataL[x+32]*beatDetect->pcm->pcmdataL[x+32]); + + glVertex2f(((x0*cos_rot - y0*sin_rot)*presetOutputs->fWaveScale*0.5*(this->correction ? this->aspect : 1.0) + presetOutputs->wave_x),( (x0*sin_rot + y0*cos_rot)*presetOutputs->fWaveScale*0.5 + presetOutputs->wave_y)); + + } + glEnd(); + + + break; + + case 6://single waveform + + + //glMatrixMode(GL_MODELVIEW); + // glLoadIdentity(); + + glTranslatef(.5,.5, 0); + glRotated(-presetOutputs->wave_mystery*90,0,0,1); + glTranslatef(0,0, -1); + + wave_x_temp=-2*0.4142*(fabs(fabs(presetOutputs->wave_mystery)-.5)-.5); + glScalef(1.0+wave_x_temp,1.0,1.0); + glTranslatef(-.5,-.5, 0); + wave_x_temp=-1*(presetOutputs->wave_x-1.0); + + glBegin(GL_LINE_STRIP); + // wave_x_temp=(wave_x*.75)+.125; + // wave_x_temp=-(wave_x_temp-1); + for ( x=0;xpcm->numsamples;x++) + { + + //glVertex3f(x*scale, fdata_buffer[fbuffer][0][blockstart+x]*.0012*fWaveScale+renderTarget->texsize*wave_x_temp,-1); + glVertex2f(x/(float)beatDetect->pcm->numsamples, beatDetect->pcm->pcmdataR[x]*.04*presetOutputs->fWaveScale+wave_x_temp); + + //glVertex3f(x*scale, renderTarget->texsize*wave_y_temp,-1); + } + // printf("%f %f\n",renderTarget->texsize*wave_y_temp,wave_y_temp); + glEnd(); + break; + + case 7://dual waveforms + + glTranslatef(.5,.5, 0); + glRotated(-presetOutputs->wave_mystery*90,0,0,1); + + wave_x_temp=-2*0.4142*(fabs(fabs(presetOutputs->wave_mystery)-.5)-.5); + glScalef(1.0+wave_x_temp,1.0,1.0); + glTranslatef(-.5,-.5, -1); + glTranslatef( 0, 0, -1 ); + + wave_y_temp=-1*(presetOutputs->wave_x-1); + + glBegin(GL_LINE_STRIP); + + for ( x=0;xpcm->numsamples;x++) + { + + glVertex2f(x/(float)beatDetect->pcm->numsamples, beatDetect->pcm->pcmdataL[x]*.04*presetOutputs->fWaveScale+(wave_y_temp+(presetOutputs->wave_y*presetOutputs->wave_y*.5))); + } + glEnd(); + + glBegin(GL_LINE_STRIP); + + + for ( x=0;xpcm->numsamples;x++) + { + + glVertex2f(x/(float)beatDetect->pcm->numsamples, beatDetect->pcm->pcmdataR[x]*.04*presetOutputs->fWaveScale+(wave_y_temp-(presetOutputs->wave_y*presetOutputs->wave_y*.5))); + } + glEnd(); + glPopMatrix(); + break; + + default: + glTranslatef( 0, 0, -1 ); + glBegin(GL_LINE_LOOP); + + for ( x=0;x<512;x++) + { + theta=(x)*(6.28/512.0); + r= (0.2+beatDetect->pcm->pcmdataL[x]*.002); + + glVertex2f(r*cos(theta)+presetOutputs->wave_x,r*sin(theta)+presetOutputs->wave_y); + } + glEnd(); + +glBegin(GL_LINE_STRIP); + + for ( x=0;x<512;x++) + { + glVertex3f(x*scale, beatDetect->pcm->pcmdataL[x]*.04*presetOutputs->fWaveScale+((presetOutputs->wave_x+.1)),-1); + } + glEnd(); + + glBegin(GL_LINE_STRIP); + + for ( x=0;x<512;x++) + { + glVertex3f(x*scale, beatDetect->pcm->pcmdataR[x]*.04*presetOutputs->fWaveScale+((presetOutputs->wave_x-.1)),-1); + + } + glEnd(); + break; + if (presetOutputs->bWaveThick==1) glLineWidth( (this->renderTarget->texsize < 512) ? 1 : 2*this->renderTarget->texsize/512); +} + glLineWidth( this->renderTarget->texsize < 512 ? 1 : this->renderTarget->texsize/512); + glDisable(GL_LINE_STIPPLE); + + glPopMatrix(); +} + +void Renderer::maximize_colors(PresetOutputs *presetOutputs) { + + float wave_r_switch=0,wave_g_switch=0,wave_b_switch=0; + //wave color brightening + // + //forces max color value to 1.0 and scales + // the rest accordingly + if(presetOutputs->nWaveMode==2 || presetOutputs->nWaveMode==5) + { + switch(this->renderTarget->texsize) + { + case 256: presetOutputs->wave_o *= 0.07f; break; + case 512: presetOutputs->wave_o *= 0.09f; break; + case 1024: presetOutputs->wave_o *= 0.11f; break; + case 2048: presetOutputs->wave_o *= 0.13f; break; + } + } + + else if(presetOutputs->nWaveMode==3) + { + switch(this->renderTarget->texsize) + { + case 256: presetOutputs->wave_o *= 0.075f; break; + case 512: presetOutputs->wave_o *= 0.15f; break; + case 1024: presetOutputs->wave_o *= 0.22f; break; + case 2048: presetOutputs->wave_o *= 0.33f; break; + } + presetOutputs->wave_o*=1.3f; + presetOutputs->wave_o*=powf(beatDetect->treb ,2.0f); + } + + if (presetOutputs->bMaximizeWaveColor==1) + { + if(presetOutputs->wave_r>=presetOutputs->wave_g && presetOutputs->wave_r>=presetOutputs->wave_b) //red brightest + { + wave_b_switch=presetOutputs->wave_b*(1/presetOutputs->wave_r); + wave_g_switch=presetOutputs->wave_g*(1/presetOutputs->wave_r); + wave_r_switch=1.0; + } + else if (presetOutputs->wave_b>=presetOutputs->wave_g && presetOutputs->wave_b>=presetOutputs->wave_r) //blue brightest + { + wave_r_switch=presetOutputs->wave_r*(1/presetOutputs->wave_b); + wave_g_switch=presetOutputs->wave_g*(1/presetOutputs->wave_b); + wave_b_switch=1.0; + + } + + else if (presetOutputs->wave_g>=presetOutputs->wave_b && presetOutputs->wave_g>=presetOutputs->wave_r) //green brightest + { + wave_b_switch=presetOutputs->wave_b*(1/presetOutputs->wave_g); + wave_r_switch=presetOutputs->wave_r*(1/presetOutputs->wave_g); + wave_g_switch=1.0; + } + + + glColor4f(wave_r_switch, wave_g_switch, wave_b_switch, presetOutputs->wave_o); + } + else + { + glColor4f(presetOutputs->wave_r, presetOutputs->wave_g, presetOutputs->wave_b, presetOutputs->wave_o); + } + +} + +void Renderer::darken_center() { + + float unit=0.05f; + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glTranslatef(0.5,0.5, 0); + + glBegin(GL_TRIANGLE_FAN); + glColor4f(0,0,0,3.0f/32.0f); + glVertex3f(0,0,-1); + glColor4f(0,0,0,-1); + glVertex3f(-unit,0,-1); + glVertex3f(0,-unit,-1); + glVertex3f(unit,0,-1); + glVertex3f(0,unit,-1); + glVertex3f(-unit,0,-1); + glEnd(); + + glPopMatrix(); +} + + +void Renderer::modulate_opacity_by_volume(PresetOutputs *presetOutputs) { + + //modulate volume by opacity + // + //set an upper and lower bound and linearly + //calculate the opacity from 0=lower to 1=upper + //based on current volume + + + if (presetOutputs->bModWaveAlphaByVolume==1) + {if (beatDetect->vol<=presetOutputs->fModWaveAlphaStart) presetOutputs->wave_o=0.0; + else if (beatDetect->vol>=presetOutputs->fModWaveAlphaEnd) presetOutputs->wave_o=presetOutputs->fWaveAlpha; + else presetOutputs->wave_o=presetOutputs->fWaveAlpha*((beatDetect->vol-presetOutputs->fModWaveAlphaStart)/(presetOutputs->fModWaveAlphaEnd-presetOutputs->fModWaveAlphaStart));} + else presetOutputs->wave_o=presetOutputs->fWaveAlpha; +} + +void Renderer::draw_motion_vectors(PresetOutputs *presetOutputs) { + + int x,y; + + float offsetx=presetOutputs->mv_dx, intervalx=1.0/(float)presetOutputs->mv_x; + float offsety=presetOutputs->mv_dy, intervaly=1.0/(float)presetOutputs->mv_y; + + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glPointSize(presetOutputs->mv_l); + glColor4f(presetOutputs->mv_r, presetOutputs->mv_g, presetOutputs->mv_b, presetOutputs->mv_a); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glTranslatef( 0, 0, -1 ); + + glBegin(GL_POINTS); + for (x=0;xmv_x;x++){ + for(y=0;ymv_y;y++){ + float lx, ly, lz; + lx = offsetx+x*intervalx; + ly = offsety+y*intervaly; + lz = -1; + glVertex2f(lx,ly); + } + } + + glEnd(); + + glPopMatrix(); +} + + +void Renderer::draw_borders(PresetOutputs *presetOutputs) { + + //Draw Borders + float of=presetOutputs->ob_size*.5; + float iff=presetOutputs->ib_size*.5; + float texof=1.0-of; + + //no additive drawing for borders + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glColor4d(presetOutputs->ob_r,presetOutputs->ob_g,presetOutputs->ob_b,presetOutputs->ob_a); + + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + glTranslatef( 0, 0, -1 ); + + glRectd(0,0,of,1); + glRectd(of,0,texof,of); + glRectd(texof,0,1,1); + glRectd(of,1,texof,texof); + glColor4d(presetOutputs->ib_r,presetOutputs->ib_g,presetOutputs->ib_b,presetOutputs->ib_a); + glRectd(of,of,of+iff,texof); + glRectd(of+iff,of,texof-iff,of+iff); + glRectd(texof-iff,of,texof,texof); + glRectd(of+iff,texof,texof-iff,texof-iff); + + glPopMatrix(); +} + + + +void Renderer::draw_title_to_texture() { + +#ifdef USE_FTGL + if (this->drawtitle>80) + // if(1) + { + glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + glColor4f(1.0,1.0,1.0,1.0); + glPushMatrix(); + + glTranslatef(0,0.5, -1); + + glScalef(0.0025,-0.0025,30*.0025); + //glTranslatef(0,0, 1.0); + poly_font->FaceSize( 22); + + glRasterPos2f(0.0, 0.0); + + if ( this->title != NULL ) { + poly_font->Render(this->title ); + } else { + poly_font->Render("Unknown" ); + } + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glPopMatrix(); + this->drawtitle=0; + } +#endif /** USE_FTGL */ +} + +void Renderer::draw_title_to_screen() { + +#ifdef USE_FTGL + if(this->drawtitle>0) + { + float easein = ((80-this->drawtitle)*.0125); + float easein2 = easein * easein; + float easein3 = .0025/((-easein2)+1.0); + + glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + glColor4f(1.0,1.0,1.0,1.0); + glPushMatrix(); + + + //glTranslatef(this->vw*.5,this->vh*.5 , -1.0); + glTranslatef(0,0.5 , -1.0); + + glScalef(easein3,easein3,30*.0025); + + glRotatef(easein2*360,1,0,0); + + + //glTranslatef(-.5*this->vw,0, 0.0); + + //poly_font->Depth(1.0); + poly_font->FaceSize(22); + + glRasterPos2f(0.0, 0.0); + if ( this->title != NULL ) { + poly_font->Render(this->title ); + } else { + poly_font->Render("Unknown" ); + } + // poly_font->Depth(0.0); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glPopMatrix(); + + this->drawtitle++; + + } +#endif /** USE_FTGL */ +} + +void Renderer::draw_title() { +#ifdef USE_FTGL + //glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + + glColor4f(1.0,1.0,1.0,1.0); + // glPushMatrix(); + // glTranslatef(this->vw*.001,this->vh*.03, -1); + // glScalef(this->vw*.015,this->vh*.025,0); + + glRasterPos2f(0.01, 0.05); + title_font->FaceSize( (unsigned)(20*(this->vh/512.0))); + + if ( this->title != NULL ) { + title_font->Render(this->title ); + } else { + title_font->Render("Unknown" ); + } + // glPopMatrix(); + //glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + +#endif /** USE_FTGL */ +} +void Renderer::draw_preset() { +#ifdef USE_FTGL + //glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + + glColor4f(1.0,1.0,1.0,1.0); + // glPushMatrix(); + //glTranslatef(this->vw*.001,this->vh*-.01, -1); + //glScalef(this->vw*.003,this->vh*.004,0); + + + glRasterPos2f(0.01, 0.01); + + title_font->FaceSize((unsigned)(12*(this->vh/512.0))); + if(this->noSwitch) title_font->Render("[LOCKED] " ); + title_font->FaceSize((unsigned)(20*(this->vh/512.0))); + if (this->presetName) + title_font->Render(this->presetName ); + + + + //glPopMatrix(); + // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); +#endif /** USE_FTGL */ +} + +void Renderer::draw_help( ) { + +#ifdef USE_FTGL +//glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + DWRITE("pre-help"); + glColor4f(1.0,1.0,1.0,1.0); + glPushMatrix(); + glTranslatef(0,1, 0); + //glScalef(this->vw*.02,this->vh*.02 ,0); + + + title_font->FaceSize((unsigned)( 18*(this->vh/512.0))); + + glRasterPos2f(0.01, -0.05); + title_font->Render("Help"); + + glRasterPos2f(0.01, -0.09); + title_font->Render("----------------------------"); + + glRasterPos2f(0.01, -0.13); + title_font->Render("F1: This help menu"); + + glRasterPos2f(0.01, -0.17); + title_font->Render("F2: Show song title"); + + glRasterPos2f(0.01, -0.21); + title_font->Render("F3: Show preset name"); + + glRasterPos2f(0.01, -0.25); + title_font->Render("F4: Show Rendering Settings"); + + glRasterPos2f(0.01, -0.29); + title_font->Render("F5: Show FPS"); + + glRasterPos2f(0.01, -0.35); + title_font->Render("F: Fullscreen"); + + glRasterPos2f(0.01, -0.39); + title_font->Render("L: Lock/Unlock Preset"); + + glRasterPos2f(0.01, -0.43); + title_font->Render("M: Show Menu"); + + glRasterPos2f(0.01, -0.49); + title_font->Render("R: Random preset"); + glRasterPos2f(0.01, -0.53); + title_font->Render("N: Next preset"); + + glRasterPos2f(0.01, -0.57); + title_font->Render("P: Previous preset"); + + glPopMatrix(); + // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + DWRITE("post-help"); +#endif /** USE_FTGL */ +} + +void Renderer::draw_stats(PresetInputs *presetInputs) { + +#ifdef USE_FTGL + char buffer[128]; + float offset= (this->showfps%2 ? -0.05 : 0.0); + // glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + + glColor4f(1.0,1.0,1.0,1.0); + glPushMatrix(); + glTranslatef(0.01,1, 0); + glRasterPos2f(0, -.05+offset); + other_font->Render(this->correction ? " aspect: corrected" : " aspect: stretched"); +sprintf( buffer, " (%f)", this->aspect); + other_font->Render(buffer); + + + + glRasterPos2f(0, -.09+offset); + other_font->FaceSize((unsigned)(18*(this->vh/512.0))); + + sprintf( buffer, " texsize: %d", this->renderTarget->texsize); + other_font->Render(buffer); + + glRasterPos2f(0, -.13+offset); + sprintf( buffer, "viewport: %d x %d", this->vw, this->vh); + other_font->Render(buffer); + /* REME: FIX + glRasterPos2f(0, -.17+offset); + other_font->Render((this->renderer->renderTarget->usePbuffers ? " FBO: on" : " FBO: off")); + */ + glRasterPos2f(0, -.21+offset); + sprintf( buffer, " mesh: %d x %d", presetInputs->gx,presetInputs->gy); + other_font->Render(buffer); + + + glPopMatrix(); + // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + + +#endif /** USE_FTGL */ +} +void Renderer::draw_fps( float realfps ) { +#ifdef USE_FTGL + char bufferfps[20]; + sprintf( bufferfps, "%.1f fps", realfps); + // glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + + glColor4f(1.0,1.0,1.0,1.0); + glPushMatrix(); + glTranslatef(0.01,1, 0); + glRasterPos2f(0, -0.05); + title_font->FaceSize((unsigned)(20*(this->vh/512.0))); + title_font->Render(bufferfps); + + glPopMatrix(); + // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + +#endif /** USE_FTGL */ +} + + +//Actually draws the texture to the screen +// +//The Video Echo effect is also applied here +void Renderer::render_texture_to_screen(PresetOutputs *presetOutputs) { + + int flipx=1,flipy=1; + //glBindTexture( GL_TEXTURE_2D,this->renderTarget->textureID[0] ); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + + glClear( GL_DEPTH_BUFFER_BIT ); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0, 0, -15); + + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + + // glClear(GL_ACCUM_BUFFER_BIT); + glColor4d(0.0, 0.0, 0.0,1.0f); + + DWRITE( "rendering texture to screen\n" ); + + glBegin(GL_QUADS); + glVertex3d( 0, 0, -1 ); + glVertex4d(-0.5,-0.5,-1,1); + glVertex4d(-0.5, 0.5,-1,1); + glVertex4d(0.5, 0.5,-1,1); + glVertex4d(0.5, -0.5,-1,1); + glEnd(); + + + glEnable(GL_TEXTURE_2D); + //glBindTexture( GL_TEXTURE_2D, this->renderTarget->textureID[0] ); +// glBindTexture( GL_TEXTURE_2D, this->renderTarget->textureID ); + + // glAccum(GL_LOAD,0); + // if (bDarken==1) glBlendFunc(GL_SRC_COLOR,GL_ZERO); + + //Draw giant rectangle and texture it with our texture! + glBegin(GL_QUADS); + glTexCoord4d(0, 1,0,1); glVertex4d(-0.5,-0.5,-1,1); + glTexCoord4d(0, 0,0,1); glVertex4d(-0.5, 0.5,-1,1); + glTexCoord4d(1, 0,0,1); glVertex4d(0.5, 0.5,-1,1); + glTexCoord4d(1, 1,0,1); glVertex4d(0.5, -0.5,-1,1); + glEnd(); + + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + // if (bDarken==1) glBlendFunc(GL_SRC_COLOR,GL_ONE_MINUS_SRC_ALPHA); + + // if (bDarken==1) { glAccum(GL_ACCUM,1-fVideoEchoAlpha); glBlendFunc(GL_SRC_COLOR,GL_ZERO); } + + glMatrixMode(GL_TEXTURE); + + //draw video echo + glColor4f(0.0, 0.0, 0.0,presetOutputs->fVideoEchoAlpha); + glTranslatef(.5,.5,0); + glScalef(1.0/presetOutputs->fVideoEchoZoom,1.0/presetOutputs->fVideoEchoZoom,1); + glTranslatef(-.5,-.5,0); + + switch (((int)presetOutputs->nVideoEchoOrientation)) + { + case 0: flipx=1;flipy=1;break; + case 1: flipx=-1;flipy=1;break; + case 2: flipx=1;flipy=-1;break; + case 3: flipx=-1;flipy=-1;break; + default: flipx=1;flipy=1; break; + } + glBegin(GL_QUADS); + glTexCoord4d(0, 1,0,1); glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glTexCoord4d(0, 0,0,1); glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glTexCoord4d(1, 0,0,1); glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glTexCoord4d(1, 1,0,1); glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + + + glDisable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + + if (presetOutputs->bBrighten==1) + { + glColor4f(1.0, 1.0, 1.0,1.0); + glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + glBegin(GL_QUADS); + glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + glBlendFunc(GL_ZERO, GL_DST_COLOR); + glBegin(GL_QUADS); + glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + glBegin(GL_QUADS); + glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + } + + if (presetOutputs->bDarken==1) + { + + glColor4f(1.0, 1.0, 1.0,1.0); + glBlendFunc(GL_ZERO,GL_DST_COLOR); + glBegin(GL_QUADS); + glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + + + + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + } + + + if (presetOutputs->bSolarize) + { + + glColor4f(1.0, 1.0, 1.0,1.0); + glBlendFunc(GL_ZERO,GL_ONE_MINUS_DST_COLOR); + glBegin(GL_QUADS); + glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + glBlendFunc(GL_DST_COLOR,GL_ONE); + glBegin(GL_QUADS); + glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + + + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + } + + if (presetOutputs->bInvert) + { + glColor4f(1.0, 1.0, 1.0,1.0); + glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + glBegin(GL_QUADS); + glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + } +} +/* +void Renderer::render_texture_to_studio() { + + int x,y; + int flipx=1,flipy=1; + + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + + glClear( GL_DEPTH_BUFFER_BIT ); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0, 0, -15); + + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + + // glClear(GL_ACCUM_BUFFER_BIT); + glColor4f(0.0, 0.0, 0.0,0.04); + + + glBegin(GL_QUADS); + glVertex4d(-0.5,-0.5,-1,1); + glVertex4d(-0.5, 0.5,-1,1); + glVertex4d(0.5, 0.5,-1,1); + glVertex4d(0.5, -0.5,-1,1); + glEnd(); + + + glColor4f(0.0, 0.0, 0.0,1.0); + + glBegin(GL_QUADS); + glVertex4d(-0.5,0,-1,1); + glVertex4d(-0.5, 0.5,-1,1); + glVertex4d(0.5, 0.5,-1,1); + glVertex4d(0.5, 0,-1,1); + glEnd(); + + glBegin(GL_QUADS); + glVertex4d(0,-0.5,-1,1); + glVertex4d(0, 0.5,-1,1); + glVertex4d(0.5, 0.5,-1,1); + glVertex4d(0.5, -0.5,-1,1); + glEnd(); + + glPushMatrix(); + glTranslatef(.25, .25, 0); + glScalef(.5,.5,1); + + glEnable(GL_TEXTURE_2D); + + + //Draw giant rectangle and texture it with our texture! + glBegin(GL_QUADS); + glTexCoord4d(0, 1,0,1); glVertex4d(-0.5,-0.5,-1,1); + glTexCoord4d(0, 0,0,1); glVertex4d(-0.5, 0.5,-1,1); + glTexCoord4d(1, 0,0,1); glVertex4d(0.5, 0.5,-1,1); + glTexCoord4d(1, 1,0,1); glVertex4d(0.5, -0.5,-1,1); + glEnd(); + + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + + glMatrixMode(GL_TEXTURE); + + //draw video echo + glColor4f(0.0, 0.0, 0.0,presetOutputs->fVideoEchoAlpha); + glTranslated(.5,.5,0); + glScaled(1/presetOutputs->fVideoEchoZoom,1/presetOutputs->fVideoEchoZoom,1); + glTranslated(-.5,-.5,0); + + switch (((int)presetOutputs->nVideoEchoOrientation)) + { + case 0: flipx=1;flipy=1;break; + case 1: flipx=-1;flipy=1;break; + case 2: flipx=1;flipy=-1;break; + case 3: flipx=-1;flipy=-1;break; + default: flipx=1;flipy=1; break; + } + glBegin(GL_QUADS); + glTexCoord4d(0, 1,0,1); glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glTexCoord4d(0, 0,0,1); glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glTexCoord4d(1, 0,0,1); glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glTexCoord4d(1, 1,0,1); glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + + + //glDisable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + // if (bDarken==1) { glAccum(GL_ACCUM,fVideoEchoAlpha); glAccum(GL_RETURN,1);} + + + if (presetOutputs->bInvert) + { + glColor4f(1.0, 1.0, 1.0,1.0); + glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + glBegin(GL_QUADS); + glVertex4f(-0.5*flipx,-0.5*flipy,-1,1); + glVertex4f(-0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, 0.5*flipy,-1,1); + glVertex4f(0.5*flipx, -0.5*flipy,-1,1); + glEnd(); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + } + + // glTranslated(.5,.5,0); + // glScaled(1/fVideoEchoZoom,1/fVideoEchoZoom,1); + // glTranslated(-.5,-.5,0); + //glTranslatef(0,.5*vh,0); + + + //glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); + + glDisable(GL_TEXTURE_2D); + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); + glPushMatrix(); + glTranslatef(.25, -.25, 0); + glScalef(.5,.5,1); + glColor4f(1.0,1.0,1.0,1.0); + + for (x=0;xgx;x++){ + glBegin(GL_LINE_STRIP); + for(y=0;ygy;y++){ + glVertex4f((presetInputs->x_mesh[x][y]-.5), (presetInputs->y_mesh[x][y]-.5),-1,1); + //glVertex4f((origx[x+1][y]-.5) * vw, (origy[x+1][y]-.5) *vh ,-1,1); + } + glEnd(); + } + + for (y=0;ygy;y++){ + glBegin(GL_LINE_STRIP); + for(x=0;xgx;x++){ + glVertex4f((presetInputs->x_mesh[x][y]-.5), (presetInputs->y_mesh[x][y]-.5),-1,1); + //glVertex4f((origx[x+1][y]-.5) * vw, (origy[x+1][y]-.5) *vh ,-1,1); + } + glEnd(); + } + + glEnable( GL_TEXTURE_2D ); + + + // glTranslated(-.5,-.5,0); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + // Waveform display -- bottom-left + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glTranslatef(-.5,0, 0); + + glTranslatef(0,-0.10, 0); + glBegin(GL_LINE_STRIP); + glColor4f(0,1.0,1.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)), beatDetect->treb_att*-7,-1); + glColor4f(1.0,1.0,1.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)),0 ,-1); + glColor4f(.5,1.0,1.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)), beatDetect->treb*7,-1); + glEnd(); + + glTranslatef(0,-0.13, 0); + glBegin(GL_LINE_STRIP); + glColor4f(0,1.0,0.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)), beatDetect->mid_att*-7,-1); + glColor4f(1.0,1.0,1.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)),0 ,-1); + glColor4f(.5,1.0,0.0,0.5); + glVertex3f((((this->totalframes%256)/551.0)), beatDetect->mid*7,-1); + glEnd(); + + + glTranslatef(0,-0.13, 0); + glBegin(GL_LINE_STRIP); + glColor4f(1.0,0.0,0.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)), beatDetect->bass_att*-7,-1); + glColor4f(1.0,1.0,1.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)),0 ,-1); + glColor4f(.7,0.2,0.2,1.0); + glVertex3f((((this->totalframes%256)/551.0)), beatDetect->bass*7,-1); + glEnd(); + + glTranslatef(0,-0.13, 0); + glBegin(GL_LINES); + + glColor4f(1.0,1.0,1.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)),0 ,-1); + glColor4f(1.0,0.6,1.0,1.0); + glVertex3f((((this->totalframes%256)/551.0)), beatDetect->vol*7,-1); + glEnd(); + + glPopMatrix(); + + glDisable(GL_TEXTURE_2D); +} + +*/ + diff --git a/src/projectM-engine-backup/Renderer.hpp b/src/projectM-engine-backup/Renderer.hpp new file mode 100644 index 000000000..128ba663a --- /dev/null +++ b/src/projectM-engine-backup/Renderer.hpp @@ -0,0 +1,93 @@ +#ifndef Renderer_HPP +#define Renderer_HPP + +#include "PBuffer.hpp" +#include "PresetFrameIO.hpp" +#include "BeatDetect.hpp" + +#ifdef USE_FTGL +#include +#include +#include +#endif /** USE_FTGL */ + +class BeatDetect; + +class Renderer +{ + RenderTarget *renderTarget; + BeatDetect *beatDetect; + //per pixel equation variables + float **gridx; //grid containing interpolated mesh + float **gridy; + float **origx2; //original mesh + float **origy2; + int gx; + int gy; + + int vw; + int vh; + + float aspect; + + + + public: + /// @bug hack to get glConsol + +#ifdef USE_FTGL +FTGLPixmapFont *title_font; +FTGLPixmapFont *other_font; +FTGLPolygonFont *poly_font; +#endif /** USE_FTGL */ + + int showfps; + int showtitle; + int showpreset; + int showhelp; + int showstats; + + int studio; + int correction; + + char *presetName; + char *fontURL; + + int noSwitch; + + int totalframes; +float realfps; +char *title; + int drawtitle; + + Renderer( int width, int height, int gx, int gy, RenderTarget *renderTarget, BeatDetect *beatDetect, char *fontURL); + ~Renderer(); + void RenderFrame(PresetOutputs *presetOutputs, PresetInputs *presetInputs); + void reset(int w, int h); + +private: + + void PerFrame(PresetOutputs *presetOutputs); + void Interpolation(PresetOutputs *presetOutputs, PresetInputs *presetInputs); + void PerPixelMath(PresetOutputs *presetOutputs, PresetInputs *presetInputs); + void rescale_per_pixel_matrices(); + void maximize_colors(PresetOutputs *presetOutputs); + void render_texture_to_screen(PresetOutputs *presetOutputs); + void draw_fps( float realfps ); + void draw_stats(PresetInputs *presetInputs); + void draw_help( ); + void draw_preset(); + void draw_title(); + void draw_title_to_screen(); + void maximize_colors(); + void draw_title_to_texture(); + void draw_motion_vectors(PresetOutputs *presetOutputs); + void draw_borders(PresetOutputs *presetOutputs); + void draw_shapes(PresetOutputs *presetOutputs); + void draw_custom_waves(PresetOutputs *presetOutputs); + void draw_waveform(PresetOutputs *presetOutputs, PresetInputs *presetInputs); + void modulate_opacity_by_volume(PresetOutputs *presetOutputs) ; + void darken_center(); +}; + +#endif diff --git a/src/projectM-engine-backup/SplayNode.hpp b/src/projectM-engine-backup/SplayNode.hpp new file mode 100644 index 000000000..09fb19ce0 --- /dev/null +++ b/src/projectM-engine-backup/SplayNode.hpp @@ -0,0 +1,91 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * Node of a splay tree + * + * $Log$ + */ + +#ifndef _SPLAYNODE_HPP +#define _SPLAYNODE_HPP + +//#include "projectM.hpp" + +#include "compare.h" + +typedef void Object; +template +class SplayNode { +public: + SplayNode *left, *right; + Data *data; + void *key; + void (*free_key)(void*); + SplayNode(); + SplayNode(void *key, Data *data, void (*free_key)(void*)); + ~SplayNode(); + }; + +/** Create a new default splaynode */ +template +SplayNode::SplayNode() { + this->data = NULL; + this->key = NULL; + this->free_key = free_key; + } + +/* Create a new splay node type */ +template +SplayNode::SplayNode(void * key, Data * data, void (*free_key)(void*)) { + + /* Creates the new splay node struct */ + this->data = data; + this->key = key; + this->free_key = free_key; + } + +/* Recursively free all the splaynodes */ +template +SplayNode::~SplayNode() { + + /* Ok if this happens, a recursive base case */ + /* Free left node */ + if ( left != NULL ) { + delete left; + } + + /* Free right node */ + if ( right != NULL ) { + delete right; + } + + /* Free this node's key */ +// printf( "~SplayNode: %X\t%X\n", key, tree->free_key ); + + this->free_key(key); + + /* Note that the data pointers are not freed here. + Should be freed with a splay traversal function */ + } + +#endif /** !_SPLAYNODE_HPP */ diff --git a/src/projectM-engine-backup/StaticArray.hpp b/src/projectM-engine-backup/StaticArray.hpp new file mode 100644 index 000000000..9593edd68 --- /dev/null +++ b/src/projectM-engine-backup/StaticArray.hpp @@ -0,0 +1,212 @@ +#ifndef PROJECTM_STATIC_ARRAY_HPP +#define PROJECTM_STATIC_ARRAY_HPP +#include +/** +* A simple array implementation with a few important features: + * (1) static array length, resulting in compile time optimizations + * (2) bounds checking when compiling with assertions + * Note that this data structure is generally useful only for smaller sized arrays. +*/ + +template +class StaticArray { +public: + + typedef T * iterator; + typedef const T * const_iterator; + + StaticArray(); + StaticArray(const std::size_t logical_size); + StaticArray(const std::size_t logical_size, const T & defaultValue); + const T & operator[] (std::size_t index) const; + T & operator[] (std::size_t index); + + iterator begin(); + iterator end(); + + const_iterator begin() const; + const_iterator end() const; + + void clear(); + bool empty() const; + + bool operator==(const StaticArray & rhs) const; + bool operator!=(const StaticArray & rhs) const; + bool operator<(const StaticArray & rhs) const; + bool operator>(const StaticArray & rhs) const; + + /// Do nothing implementation that will be optimized out. Bit of a hack to make it interface with vector. + void reserve(const std::size_t amount) const {} + + void push_back(const T & element); + void pop_back(); + + void erase(iterator first, iterator last); + + std::size_t size() const; + std::size_t capacity() const; + +private: + std::size_t m_logical_size; + T m_array[STATIC_ARRAY_MAX_SIZE+1]; +}; + + +template +StaticArray::StaticArray():m_logical_size(0) {} + +template +StaticArray::StaticArray(const std::size_t logical_size):m_logical_size(logical_size) { + assert(logical_size <= STATIC_ARRAY_MAX_SIZE); +} + +template +StaticArray::StaticArray(const std::size_t logical_size, const T & defaultValue):m_logical_size(logical_size) { + assert(logical_size <= STATIC_ARRAY_MAX_SIZE); + for (iterator pos = begin(); pos != end();++pos) + *pos = defaultValue; +} + +template +inline const T & StaticArray::operator[] (std::size_t index) const { + assert(index <= (m_logical_size-1)); + return m_array[index]; +} + +template +inline T & StaticArray::operator[] (std::size_t index) { + assert(index <= (m_logical_size-1)); + return m_array[index]; +} + +template +inline std::size_t StaticArray::size() const { + return m_logical_size; +} + + +template +inline std::size_t StaticArray::capacity() const { + return STATIC_ARRAY_MAX_SIZE; +} + + +template +inline bool StaticArray::empty() const { + return m_logical_size == 0; +} + +template +inline void StaticArray::clear() { + m_logical_size = 0; +} + +template +inline typename StaticArray::const_iterator StaticArray::begin() const { + return m_array; +} + + +template +inline typename StaticArray::iterator StaticArray::begin() { + return m_array; +} + + +template +inline typename StaticArray::const_iterator StaticArray::end() const { + return m_array+m_logical_size; +} + + +template +inline void StaticArray::push_back(const T & element) { + (*this)[m_logical_size++] = element; +} + + +template +inline void StaticArray::pop_back() { + assert(m_logical_size > 0); + m_logical_size--; +} + + +/// @slow worst case is around N^2 + N. +template +inline void StaticArray::erase(iterator first, iterator last) { + + StaticArray tmpArray; + + for (iterator pos = begin(); pos != end();++pos) { + for (iterator spos = first; spos != last;++spos) { + if (pos != spos) + tmpArray.push_back(*pos); + } + } + (*this) =tmpArray; +} + +template +inline typename StaticArray::iterator StaticArray::end() { + return m_array+m_logical_size; +} + + +/// Lexographic comparison +template +inline bool StaticArray::operator< (const StaticArray & rhs) const { + + const StaticArray & lhs = *this; + + std::size_t len = rhs.size() < lhs.size() ? rhs.size(): lhs.size(); + + for (std::size_t i = 0; i < len;i++) { + if (lhs[i] < rhs[i]) + return true; + else if (!(lhs[i] == rhs[i])) + return false; + } + + // rhs has less elements than lhs + if (len < lhs.size()) + return false; + + // lhs has less elements than rhs + if (len < rhs.size()) + return true; + + // Equal + return false; + +} + + +template +inline bool StaticArray::operator!=(const StaticArray & rhs) const { + return !(*this == rhs); +} + +template +inline bool StaticArray::operator==(const StaticArray & rhs) const { + + const StaticArray & lhs = *this; + + if (rhs.size() != lhs.size()) + return false; + + for (std::size_t i = 0; i < rhs.size() ;i++) { + if (!(rhs[i] == lhs[i])) + return false; + } + return true; + +} + + +template +inline bool StaticArray ::operator> (const StaticArray & rhs) const { + return ((!((*this) == rhs)) && (!((*this) < rhs))); +} + +#endif diff --git a/src/projectM-engine-backup/browser.cpp b/src/projectM-engine-backup/browser.cpp new file mode 100755 index 000000000..e8a76a5bd --- /dev/null +++ b/src/projectM-engine-backup/browser.cpp @@ -0,0 +1,145 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +#include +#include +#include + +#include "Common.hpp" +#include "fatal.h" +#include "projectM.hpp" +#include "glConsole.h" +#include "event.h" + +extern interface_t current_interface; + +gl_console_t * browser_console = NULL; +int active_font2 = 0; +char input_buffer[MAX_PATH_SIZE]; +int buf_pos = 0; + +int loadBrowser() { + + + + if ((browser_console = glConsoleCreate(40, 10, 80, 20, 1, 1, active_font2)) < 0) + return PROJECTM_FAILURE; + + glConsoleSetFGColor(CONSOLE_RED, browser_console); + glConsoleSetBGColor(CONSOLE_BLACK, browser_console); + glConsoleSetFlags(CONSOLE_FLAG_CURSOR_BLINKING | CONSOLE_FLAG_ALWAYS_DRAW_BACKGROUND, browser_console); + glConsoleClearBuffer(browser_console); + + buf_pos = 0; + memset(input_buffer, 0, MAX_PATH_SIZE); + + return PROJECTM_SUCCESS; +} + +int closeBrowser() { + + + active_font2 = 0; + + glConsoleDestroy(browser_console); + browser_console = NULL; + + return PROJECTM_SUCCESS; +} + +void browser_key_handler( projectMEvent event, projectMKeycode keycode, projectMModifier modifier ) { + + char s[2]; + + s[0] = 0; + s[1] = 0; + + + switch( event ) { + case PROJECTM_KEYDOWN: + switch(keycode) { + case PROJECTM_K_UP: + glConsoleMoveCursorUp(browser_console); + break; + case PROJECTM_K_RETURN: +//@@ loadPresetByFile(input_buffer); + closeBrowser(); + current_interface = DEFAULT_INTERFACE; + break; + case PROJECTM_K_RIGHT: + glConsoleMoveCursorForward(browser_console); + break; + case PROJECTM_K_LEFT: + printf("CURSOR BACKWARD\n"); + glConsoleMoveCursorBackward(browser_console); + break; + case PROJECTM_K_DOWN: + glConsoleMoveCursorDown(browser_console); + break; + case PROJECTM_K_PAGEUP: + glConsoleAlignCursorUp(browser_console); + break; + case PROJECTM_K_PAGEDOWN: + glConsoleAlignCursorDown(browser_console); + break; + case PROJECTM_K_INSERT: + glConsoleAlignCursorLeft(browser_console); + break; + case PROJECTM_K_DELETE: + glConsoleAlignCursorRight(browser_console); + break; + case PROJECTM_K_LSHIFT: + break; + case PROJECTM_K_RSHIFT: + break; + case PROJECTM_K_CAPSLOCK: + break; + case PROJECTM_K_ESCAPE: + closeBrowser(); + current_interface = DEFAULT_INTERFACE; + break; + + default: /* All regular characters */ + if (buf_pos == MAX_PATH_SIZE) { + buf_pos = 0; + } + input_buffer[buf_pos] = (char)keycode; + if ((modifier == PROJECTM_KMOD_LSHIFT) || (modifier == PROJECTM_KMOD_RSHIFT) || (modifier == PROJECTM_KMOD_CAPS)) + input_buffer[buf_pos] -= 32; + + *s = input_buffer[buf_pos]; + glConsolePrintString(s, browser_console); + buf_pos++; + break; + } + } + + +} + +void refreshBrowser() { + + // glConsoleClearBuffer(browser_console); + // glConsoleSetCursorPos(1, 1, browser_console); + //glConsolePrintString("Enter a file to load:\n", browser_console); + //glConsolePrintString(input_buffer, browser_console); + glConsoleDraw(browser_console); +} + diff --git a/src/projectM-engine-backup/browser.h b/src/projectM-engine-backup/browser.h new file mode 100755 index 000000000..958719b6f --- /dev/null +++ b/src/projectM-engine-backup/browser.h @@ -0,0 +1,45 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * + * + * $Log$ + */ +/** + * $Id: browser.h,v 1.1.1.1 2005/12/23 18:05:03 psperl Exp $ + * + * Browser interface + * + */ + +#ifndef _BROWSER_H +#define _BROWSER_H + +#include "event.h" + +void browser_key_handler( projectMEvent event, projectMKeycode keycode, projectMModifier modifier ); +int loadBrowser(); +int closeBrowser(); +void refreshBrowser(); + +#endif /** !_BROWSER_H */ diff --git a/src/projectM-engine-backup/carbontoprojectM.h b/src/projectM-engine-backup/carbontoprojectM.h new file mode 100755 index 000000000..68f2567d6 --- /dev/null +++ b/src/projectM-engine-backup/carbontoprojectM.h @@ -0,0 +1,104 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: carbontoprojectM.hpp,v 1.2 2004/11/12 15:12:58 cvs Exp $ + * + * Translates CARBON -> projectM variables + * + * $Log$ + */ + +#ifndef _CARBONTOPROJECTM_H +#define _CARBONTOPROJECTM_H + +#include "projectM.hpp" +#ifdef WIN32 +#else +#endif + +projectMEvent carbon2pmEvent( EventRecord *event ) { \ +\ + switch ( event->what ) { \ + case updateEvt: \ + return PROJECTM_VIDEORESIZE; \ + case keyUp: \ + return PROJECTM_KEYUP; \ + case keyDown: \ + return PROJECTM_KEYDOWN; \ + default: + return PROJECTM_KEYUP; \ + } \ + } \ + +projectMKeycode carbon2pmKeycode( EventRecord *event ) { \ + projectMKeycode char_code = (projectMKeycode)(event->message & charCodeMask); \ + switch ( char_code ) { \ + case kFunctionKeyCharCode: { \ + switch ( ( event->message << 16 ) >> 24 ) { \ + case 111: { \ + return PROJECTM_K_F12; \ + } \ + case 103: { \ + return PROJECTM_K_F11; \ + } \ + case 109: { \ + return PROJECTM_K_F10; \ + } \ + case 101: { \ + return PROJECTM_K_F9; \ + } \ + case 100: { \ + return PROJECTM_K_F8; \ + } \ + case 98: { \ + return PROJECTM_K_F7; \ + } \ + case 97: { \ + return PROJECTM_K_F6; \ + } \ + case 96: { \ + return PROJECTM_K_F5; \ + } \ + case 118: { \ + return PROJECTM_K_F4; \ + } \ + case 99: { \ + return PROJECTM_K_F3; \ + } \ + case 120: { \ + return PROJECTM_K_F2; \ + } \ + case 122: { \ + return PROJECTM_K_F1; \ + } \ + } \ + } \ + default: { \ + return char_code; \ + } \ + } \ + } \ + +projectMModifier carbon2pmModifier( EventRecord *event ) { \ + return (projectMModifier)PROJECTM_K_LSHIFT; \ + } \ + +#endif /** _CARBONTOPROJECTM_H */ diff --git a/src/projectM-engine-backup/compare.h b/src/projectM-engine-backup/compare.h new file mode 100755 index 000000000..b5b64b977 --- /dev/null +++ b/src/projectM-engine-backup/compare.h @@ -0,0 +1,114 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * $Log$ + */ + +#ifndef _COMPARE_H +#define _COMPARE_H +#include "wipemalloc.h" +#include "Common.hpp" + +/// @bug this will be ripped away when splaytree is more standardly written or its removed in favor of stl-esque data structure +class SplayKeyFunctions { +public: +static int compare_int(const int * num1, const int * num2); +static int compare_string(const char * string1, const char * string2); + +static void free_int(int * num); +static void free_string(char * string); +static void * copy_int(int * num); +static void * copy_string(char * string); +static int compare_string_version(const char * str1, const char * str2); +}; + + +/** tree_types.cpp */ +/* Compares integer value numbers in 32 bit range */ +inline int SplayKeyFunctions::compare_int(const int * num1, const int * num2) { + + if ((*num1) < (*num2)) + return -1; + if ((*num1) > (*num2)) + return 1; + + return 0; +} + +/* Compares strings in lexographical order */ +inline int SplayKeyFunctions::compare_string(const char * str1, const char * str2) { + + // printf("comparing \"%s\" to \"%s\"\n", str1, str2); + //return strcmp(str1, str2); + return strncmp(str1, str2, MAX_TOKEN_SIZE-1); + +} + +/* Compares a string in version order. That is, file1 < file2 < file10 */ +inline int SplayKeyFunctions::compare_string_version(const char * str1, const char * str2) { + + return strcmp( str1, str2 ); +#ifdef PANTS + return strverscmp(str1, str2); +#endif +} + + +inline void SplayKeyFunctions::free_int(int * num) { + free(num); +} + + + + inline void SplayKeyFunctions::free_string(char * string) { + free(string); +} + + + + inline void * SplayKeyFunctions::copy_int(int * num) { + + int * new_num; + + if ((new_num = (int*)wipemalloc(sizeof(int))) == NULL) + return NULL; + + *new_num = *num; + + return (void*)new_num; +} + + +inline void * SplayKeyFunctions::copy_string(char * string) { + + char * new_string; + + if ((new_string = (char*)wipemalloc(MAX_TOKEN_SIZE)) == NULL) + return NULL; + + strncpy(new_string, string, MAX_TOKEN_SIZE-1); + + return (void*)new_string; +} + +#endif /** !_COMPARE_H */ diff --git a/src/projectM-engine-backup/config b/src/projectM-engine-backup/config new file mode 100644 index 000000000..bf066ae2f --- /dev/null +++ b/src/projectM-engine-backup/config @@ -0,0 +1,22 @@ +projectM Config file (ONLY CHANGE THE NUMBERS!!!!!!) +------------------------------------------------------ +Texture Size (Must be power of 2) [256,512,1024,2048, etc] +512 +Grid X Dimension (Higher is Better but much slower) 12-60 +32 +Grid Y Dimension (Higher is Better but much slower) 8-45 +24 +Windowed Width (Initial window width) +512 +Windowed Height (Initial window width) +512 +Fullscreen Width (set to your native screen resolution) +1024 +Fullscreen Height (set to your native screen resolution) +768 +FPS (Higher the Better) 30-90 is realisitc +35 +Fullscreen on Startup (1=yes, 0=no) +0 +X Server to Display projectM default is ":0.0" +:0.0 diff --git a/src/projectM-engine-backup/console_interface.cpp b/src/projectM-engine-backup/console_interface.cpp new file mode 100755 index 000000000..0e9959bd3 --- /dev/null +++ b/src/projectM-engine-backup/console_interface.cpp @@ -0,0 +1,230 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include + +#include "projectM.hpp" +#include "Common.hpp" +#include "fatal.h" +//#include "menu.h" +#include "console_interface.h" +#include "Preset.hpp" +#include "browser.h" +#include "editor.h" +#include "event.h" +#include "BeatDetect.hpp" +#include "PresetChooser.hpp" + + +interface_t current_interface = DEFAULT_INTERFACE; + +void refreshConsole() { + + switch (current_interface) { + + case MENU_INTERFACE: +// refreshMenu(); + break; + case SHELL_INTERFACE: + break; + case EDITOR_INTERFACE: + refreshEditor(); + break; + case DEFAULT_INTERFACE: + break; + case BROWSER_INTERFACE: + refreshBrowser(); + break; + default: + break; + } + +} + +void projectM::key_handler( projectMEvent event, + projectMKeycode keycode, projectMModifier modifier ) { + + switch( event ) { + + + case PROJECTM_KEYDOWN: + + //default_key_handler(); + switch (current_interface) + { + + case MENU_INTERFACE: +// menu_key_handler(this, event, keycode); + break; + case SHELL_INTERFACE: + //shell_key_handler(); + break; + case EDITOR_INTERFACE: + editor_key_handler(event,keycode); + break; + case BROWSER_INTERFACE: + browser_key_handler(event,keycode,modifier); + break; + case DEFAULT_INTERFACE: + default_key_handler(event,keycode); + break; + default: + default_key_handler(event,keycode); + break; + + } + break; + } +} + +void projectM::default_key_handler( projectMEvent event, projectMKeycode keycode) { + + switch( event ) { + + case PROJECTM_KEYDOWN: + + switch( keycode ) + { + case PROJECTM_K_UP: + beatDetect->beat_sensitivity += 0.25; + if (beatDetect->beat_sensitivity > 5.0) beatDetect->beat_sensitivity = 5.0; + break; + case PROJECTM_K_DOWN: + beatDetect->beat_sensitivity -= 0.25; + if (beatDetect->beat_sensitivity < 0) beatDetect->beat_sensitivity = 0; + break; + case PROJECTM_K_F1: + renderer->showhelp++; + renderer->showstats=0; + renderer->showfps=0; + break; + case PROJECTM_K_F5: + if(renderer->showhelp%2==0) renderer->showfps++; + break; + case PROJECTM_K_F4: + if(renderer->showhelp%2==0) renderer->showstats++; + break; + case PROJECTM_K_F3: { + renderer->showpreset++; + printf( "F3 pressed: %d\n", renderer->showpreset ); + break; + } + case PROJECTM_K_F2: + renderer->showtitle++; + break; +#ifndef MACOS + case PROJECTM_K_F9: +#else + case PROJECTM_K_F8: +#endif + renderer->studio++; + break; + + case PROJECTM_K_ESCAPE: { +// exit( 1 ); + break; + } + case PROJECTM_K_f: + + break; + case PROJECTM_K_a: + if (renderer->correction) { + renderer->correction = 0; + } else { + renderer->correction = 1; + } + break; + case PROJECTM_K_b: + break; + case PROJECTM_K_n: + // paranoia but could be useful if directory is empty + /// @bug implement == operator + if (!(*m_presetPos != m_presetChooser->end())) + return; + m_presetChooser->getNumPresets(); + ++(*m_presetPos); + /// @bug implement == operator + if (!((*m_presetPos) != m_presetChooser->end())) + --(*m_presetPos); + m_activePreset = m_presetPos->allocate(this->presetInputs, this->presetOutputs); + break; + case PROJECTM_K_r: +// if (PresetSwitcher::switchPreset(RANDOM_NEXT, HARD_CUT) < 0) { + printf("WARNING: Bad preset file, loading idle preset\n"); + abort(); +// } + break; + case PROJECTM_K_p: + if (*m_presetPos != m_presetChooser->begin()) { + --(*m_presetPos); + // ...mroe + } + + +// if ((PresetSwitcher::switchPreset(ALPHA_PREVIOUS, HARD_CUT)) < 0){ + printf("WARNING: Bad preset file, loading idle preset\n"); + abort(); +// } + break; + case PROJECTM_K_l: + if (renderer->noSwitch==0)renderer->noSwitch=1; else renderer->noSwitch=0; + // current_interface = BROWSER_INTERFACE; + // loadBrowser(); + break; + case PROJECTM_K_e: + current_interface = EDITOR_INTERFACE; +// loadEditor(active_preset->per_frame_eqn_string_buffer,(void (*)()) reloadPerFrame, +// 80, 24, 140, 60, 0, 0); + break; + case PROJECTM_K_s: + renderer->studio++; +// current_interface = EDITOR_INTERFACE; +// loadEditor("[FILE NAME HERE]", (void (*)())savePreset, +// 50, 1, 100, 5, 0, .92); + case PROJECTM_K_i: + DWRITE( "PROJECTM_K_i\n" ); + + break; + case PROJECTM_K_z: + break; + case PROJECTM_K_0: +// nWaveMode=0; + break; + case PROJECTM_K_6: +// nWaveMode=6; + break; + case PROJECTM_K_7: +// nWaveMode=7; + break; + case PROJECTM_K_m: + renderer->showhelp=0; + renderer->showstats=0; + renderer->showfps=0; +// current_interface = MENU_INTERFACE; +// showMenu(); + break; + case PROJECTM_K_t: + break; + default: + break; + } + } +} diff --git a/src/projectM-engine-backup/console_interface.h b/src/projectM-engine-backup/console_interface.h new file mode 100755 index 000000000..ca9c5221d --- /dev/null +++ b/src/projectM-engine-backup/console_interface.h @@ -0,0 +1,39 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: console_interface.h,v 1.1.1.1 2005/12/23 18:05:03 psperl Exp $ + * + * $Log$ + */ + +#ifndef _CONSOLE_INTERFACE_H +#define _CONSOLE_INTERFACE_H + +#include "event.h" + +void default_key_handler(projectM *PM, projectMEvent event, projectMKeycode keycode); +void refreshConsole(); +#if defined(__CPLUSPLUS) && !defined(MACOS) +xtern "C" void key_handler(projectM *PM, projectMEvent event, projectMKeycode keycode, projectMModifier modifier ); +#else +extern void key_handler(projectM *PM, projectMEvent event, projectMKeycode keycode, projectMModifier modifier ); +#endif +#endif /** !_CONSOLE_INTERFACE_H */ diff --git a/src/projectM-engine-backup/dlldefs.h b/src/projectM-engine-backup/dlldefs.h new file mode 100755 index 000000000..b944fe730 --- /dev/null +++ b/src/projectM-engine-backup/dlldefs.h @@ -0,0 +1,40 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * DLL definitions for exporting symbols on various platforms + * + * $Log$ + */ + +#ifndef _DLLDEFS_H +#define _DLLDEFS_H + +#ifndef DLLEXPORT +#ifdef WIN32 +#define DLLEXPORT __declspec(dllexport) +#else /** !WIN32 */ +#define DLLEXPORT +#endif /** WIN32 */ +#endif /** !DLLEXPORT */ + +#endif /** !_DLLDEFS_H */ diff --git a/src/projectM-engine-backup/editor.cpp b/src/projectM-engine-backup/editor.cpp new file mode 100755 index 000000000..fbc97dfce --- /dev/null +++ b/src/projectM-engine-backup/editor.cpp @@ -0,0 +1,870 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/* Editor written on top of glConsole */ +#include +#include +#include + +#include "projectM.hpp" + +#ifdef MACOS +#include +#else +#include +#endif /** MACOS */ +#include "Common.hpp" +#include "fatal.h" +#include "event.h" + +//#include "preset_types.h" +#include "Preset.hpp" + +#include "glConsole.h" + +#include "editor.h" + +#define MAX_BUFFER_SIZE 50000 +#define KEY_REFRESH_RATE 2 +#define KEY_DELAY_TIME 15 + +extern interface_t current_interface; + +typedef enum { + OVERWRITE, + INSERT +} edit_mode_t; + +edit_mode_t edit_mode = OVERWRITE; + +void refresh_from_cursor(char * s); +void save_cursor_pos(); +void restore_cursor_pos(); +void writeChar(char c); +void replace_char(char c); +void insert_char(char c); +void shift_buffer_right(); +void insert_newline(); +void shift_buffer_left(); +void delete_newline(); +void complete_refresh(); + +void moveCursorLeft(); +void moveCursorRight(); + +int moveCursorUp(); +int moveCursorDown(); + +int get_prev_newline_dist(); +int get_next_newline_dist(); +int key_delay_cnt = 0; +int move_to_next_newline(); +int move_to_prev_newline(); +void handle_home(); +void handle_end(); +void handle_pageup(); +void handle_pagedown(); + +gl_console_t * editor_console = NULL; +int current_font = 0; +char editor_buffer[MAX_BUFFER_SIZE]; +int key_refresh_cnt = 0; +int cursor_pos = 0; +int backup_pos = -1; +int cursorx = 0; +int cursory = 0; +int key_held_down = 0; +projectMKeycode last_sdl_key = (projectMKeycode) 0; +projectMEvent last_sdl_event; + +void (*callfunc)(void*, void*) = NULL; + +int loadEditor(char * string, void (*func)(), int screen_width, int screen_height, + int scroll_width, int scroll_height, float start_x, float start_y) { + + if (string == NULL) + return PROJECTM_FAILURE; + + + + if ((editor_console = + glConsoleCreate(screen_width, screen_height, scroll_width, scroll_height, start_x, start_y, current_font)) < 0) + return PROJECTM_FAILURE; + + /* Set colors */ + glConsoleSetFGColor(CONSOLE_GREEN, editor_console); + glConsoleSetBGColor(CONSOLE_BLACK, editor_console); + glConsoleSetCursorColor(CONSOLE_RED, editor_console); + + /* Set flags */ + glConsoleSetFlags(CONSOLE_FLAG_CURSOR_BLINKING|CONSOLE_FLAG_ALWAYS_DRAW_BACKGROUND, editor_console); + + /* Clear the console buffer */ + // glConsoleClearBuffer(editor_console); + + /* Print the characters of the passed string, realign cursor to top left */ + glConsolePrintString(string, editor_console); + glConsoleAlignCursorLeft(editor_console); + glConsoleAlignCursorUp(editor_console); + + /* Copy string into editor buffer */ + strncpy(editor_buffer, string, MAX_BUFFER_SIZE-1); + cursor_pos = 0; + + callfunc = (void (*)(void*, void*))func; + backup_pos = -1; + edit_mode = OVERWRITE; + glConsoleSetCursorStyle(BAR_STYLE, editor_console); + return PROJECTM_SUCCESS; +} + +int closeEditor() { + + + current_font = 0; + key_held_down = 0; + + glConsoleDestroy(editor_console); + editor_console = NULL; + callfunc = NULL; + return PROJECTM_SUCCESS; +} + + +void key_helper( projectMKeycode key, projectMEvent event, projectMModifier modifier) { + char c; + + switch(key) { + case PROJECTM_K_INSERT: + if (edit_mode == OVERWRITE) { + edit_mode = INSERT; + glConsoleSetCursorStyle(UNDERLINE_STYLE, editor_console); + } + else { + edit_mode = OVERWRITE; + glConsoleSetCursorStyle(BAR_STYLE, editor_console); + } + break; + case PROJECTM_K_RETURN: + if (modifier== PROJECTM_KMOD_LCTRL) { +/// @bug editor is busted +// callfunc(editor_buffer, active_preset); + } + else { + writeChar('\n'); + } + break; + case PROJECTM_K_LCTRL: + break; + case PROJECTM_K_RIGHT: + moveCursorRight(); + // glConsoleMoveCursorForward(editor_console); + break; + case PROJECTM_K_LEFT: + moveCursorLeft(); + // glConsoleMoveCursorBackward(editor_console); + break; + case PROJECTM_K_UP: + moveCursorUp(); + break; + case PROJECTM_K_DOWN: + moveCursorDown(); + // glConsoleMoveCursorDown(editor_console); + break; + case PROJECTM_K_PAGEUP: + handle_pageup(); + // glConsoleAlignCursorUp(editor_console); + break; + case PROJECTM_K_PAGEDOWN: + handle_pagedown(); + // glConsoleAlignCursorDown(editor_console); + break; + case PROJECTM_K_HOME: + handle_home(); + // glConsoleAlignCursorLeft(editor_console); + break; + case PROJECTM_K_END: + handle_end(); + // glConsoleAlignCursorRight(editor_console); + break; + case PROJECTM_K_LSHIFT: + break; + case PROJECTM_K_RSHIFT: + break; + case PROJECTM_K_CAPSLOCK: + break; + case PROJECTM_K_BACKSPACE: + writeChar('\b'); + break; + + case PROJECTM_K_ESCAPE: + closeEditor(); + current_interface = DEFAULT_INTERFACE; + break; + + default: + /* All regular characters */ + c = (char)key; + + writeChar(c); + break; + } +} + + +void editor_key_handler( projectMEvent event, projectMKeycode keycode ) { + + switch( event ) { + + case PROJECTM_KEYUP: + // printf("KEY UP\n"); + key_held_down = 0; + return; + + case PROJECTM_KEYDOWN: + // printf("KEY DOWN FIRST\n"); + key_held_down = 1; + last_sdl_key = keycode; + last_sdl_event = event; + key_helper(last_sdl_key, event, (projectMModifier)0); + key_delay_cnt = KEY_DELAY_TIME; + return; + + default: + + break; + } + + + + + + +} + +void refreshEditor() { + + /* Refresh the editor console */ + glConsoleDraw(editor_console); + + /* Update keyboard related events */ + if (key_delay_cnt > 0) + key_delay_cnt--; + else if ((key_held_down) && ((key_refresh_cnt % KEY_REFRESH_RATE) == 0)) { + key_helper(last_sdl_key, last_sdl_event, (projectMModifier)0); + } + + key_refresh_cnt++; + +} + +void moveCursorRight() { + + /* Out of bounds check */ + if (cursor_pos >= (MAX_BUFFER_SIZE-1)) + return; + + if (editor_buffer[cursor_pos+1] == 0) + return; + + /* If we are at a new line character jump down to next line */ + if (editor_buffer[cursor_pos] == '\n') { + glConsoleAlignCursorLeft(editor_console); + glConsoleMoveCursorDown(editor_console); + + } + + /* Otherwise just advance cursor forward */ + else + glConsoleMoveCursorForward(editor_console); + + //printf("editor: %c\n", editor_buffer[cursor_pos]); + /* Move cursor forward in editor buffer */ + cursor_pos++; + +} + +void moveCursorLeft() { + + /* Out of bounds check */ + if (cursor_pos <= 0) + return; + + /* If the previous (left) character is a new line jump up a line and all the way to the end of character string */ + if (editor_buffer[cursor_pos-1] == '\n') { + glConsoleMoveCursorUp(editor_console); + glConsoleCursorToNextChar('\n', editor_console); + } + + /* Otherwise just move cursor back a space */ + else + glConsoleMoveCursorBackward(editor_console); + + /* Move cursor forward in editor buffer */ + cursor_pos--; + +} + + +int moveCursorUp() { + + + int dist1, dist2; + int return_flag = PROJECTM_SUCCESS; + + /* We need this distance to: + 1) move the cursor back to the previous new line + 2) position the cursor at the same column on the previous line + */ + + /* Move cursor to previous newline character */ + if (cursor_pos == 0) + return PROJECTM_FAILURE; + + dist1 = move_to_prev_newline(); + + if (cursor_pos == 0) + return_flag = PROJECTM_FAILURE; + else { + moveCursorLeft(); + /* Again move to previous newline */ + dist2 = move_to_prev_newline(); + } + + /* Move cursor forward appropiately, stopping prematurely if new line is reached */ + while ((dist1 > 1) && (editor_buffer[cursor_pos] !='\n') && (cursor_pos <= (MAX_BUFFER_SIZE-1))) { + cursor_pos++; + glConsoleMoveCursorForward(editor_console); + dist1--; + } + return return_flag; +} + + +int moveCursorDown() { + + int dist1, dist2; + + dist2 = get_prev_newline_dist(); + + //printf("prev new line distance: %d\n", dist2); + /* Move cursor to next line, store the distance + away from the newline. If this distance is + less than (error value) or equal to zero do nothing */ + if ((dist1 = move_to_next_newline()) <= 0) { + return PROJECTM_FAILURE; + } + // printf("distance away from next newline: %d\n", dist1); + while ((cursor_pos != (MAX_BUFFER_SIZE-1)) && (editor_buffer[cursor_pos] != '\n') && (dist2 > 0)) { + cursor_pos++; + glConsoleMoveCursorForward(editor_console); + dist2--; + } + + return PROJECTM_SUCCESS; +; +} + +int get_prev_newline_dist() { + + int cnt = 0; + + if (cursor_pos == 0) + return 0; + + /* If we are already at the newline, then skip the first character + and increment cnt */ + if (editor_buffer[cursor_pos] == '\n') { + /* Top of buffer, return 0 */ + if (cursor_pos == 0) + return 0; + /* Otherwise set count to one */ + cnt++; + } + while (editor_buffer[cursor_pos-cnt] != '\n') { + + /* In this case we are the top of the editor buffer, so stop */ + if ((cursor_pos-cnt) <= 0) + return cnt; + + cnt++; + + } + + //printf("Returning %d\n", cnt-1); + return cnt-1; +} + + +int get_next_newline_dist() { + + int cnt = 0; + + + while (editor_buffer[cursor_pos+cnt] != '\n') { + + /* In this case we have exceeded the cursor buffer, so abort action */ + if ((cursor_pos+cnt) >= (MAX_BUFFER_SIZE-1)) + return 0; + + cnt++; + + } + + return cnt; +} + +/* Moves cursor to next line, returns length away from next one. + If this is the last line, returns 0. + On error returns -1 (PROJECTM_FAILURE) +*/ + +int move_to_next_newline() { + + int cnt = 0; + + + while (editor_buffer[cursor_pos+cnt] != '\n') { + + /* In this case we have exceeded the cursor buffer, so abort action */ + if ((cursor_pos+cnt) >= (MAX_BUFFER_SIZE-1)) + return 0; + + cnt++; + + } + + + /* New line is the last character in buffer, so quit */ + if ((cursor_pos+cnt+1) > (MAX_BUFFER_SIZE-1)) + return 0; + + if (editor_buffer[cursor_pos+cnt+1] == 0) + return 0; + + /* One more time to skip past new line character */ + cnt++; + + /* Now we can move the cursor position accordingly */ + cursor_pos += cnt; + + /* Now move the console cursor to beginning of next line + These functions are smart enough to not exceed the console + without bounds checking */ + glConsoleMoveCursorDown(editor_console); + glConsoleAlignCursorLeft(editor_console); + + /* Finally, return distance cursor was away from the new line */ + return cnt; +} + +/* Moves cursor to previous line, returns length away from previous one. + If this is the first line, returns 0. + On error returns -1 (PROJECTM_FAILURE) + More specifically, the cursor will be exactly at the new line character + of the previous line. + Now its the beginning of the line, not the newline +*/ + +int move_to_prev_newline() { + + int cnt = 0; + + if (editor_buffer[cursor_pos] == '\n') { + if (cursor_pos == 0) + return 0; + else { + cnt++; + glConsoleMoveCursorBackward(editor_console); + } + } + while (((cursor_pos - cnt) > -1) && (editor_buffer[cursor_pos-cnt] != '\n')) { + + + glConsoleMoveCursorBackward(editor_console); + + cnt++; + + } + + //for (i=0;i < cnt; i++) + + + /* New line is the last character in buffer, so quit */ + // if ((cursor_pos-cnt-1) <= 0) + // return 0; + + + /* Now we can move the cursor position accordingly */ + cursor_pos -= cnt-1; + + /* Now move the console cursor to end of previous line + These functions are smart enough to not exceed the console + without bounds checking */ ; + // glConsoleMoveCursorUp(editor_console); + // glConsoleCursorToNextChar('\n', editor_console); + + /* Finally, return distance cursor was away from the new line */ + return cnt; + +} + +void handle_return() { + + +} + + +void handle_backspace() { + + +} + +void handle_home() { + + while ((cursor_pos > 0) && (editor_buffer[cursor_pos-1] != '\n')) { + cursor_pos--; + } + + glConsoleAlignCursorLeft(editor_console); + +} + +void handle_end() { + + while ((cursor_pos < (MAX_BUFFER_SIZE-1)) && (editor_buffer[cursor_pos+1] != 0) && (editor_buffer[cursor_pos] != '\n')) { + cursor_pos++; + glConsoleMoveCursorForward(editor_console); + } + + // glConsoleCursorToNextChar('\n', editor_console); + +} + +void handle_pageup() { + + int dist1; + + dist1 = move_to_prev_newline(); + + while (cursor_pos != 0) + moveCursorLeft(); + + while ((dist1 > 1) && (cursor_pos < (MAX_BUFFER_SIZE-1)) && (editor_buffer[cursor_pos+1] != 0) && (editor_buffer[cursor_pos] != '\n')) { + cursor_pos++; + glConsoleMoveCursorForward(editor_console); + dist1--; + } + +} + + +void handle_pagedown() { + + int dist1; + + dist1 = get_prev_newline_dist(); + + while (cursor_pos < (MAX_BUFFER_SIZE-2) && (editor_buffer[cursor_pos+1] != 0)) + moveCursorRight(); + + move_to_prev_newline(); + moveCursorRight(); + + while ((dist1 > 1) && (cursor_pos < (MAX_BUFFER_SIZE-1)) && (editor_buffer[cursor_pos+1] != 0) && (editor_buffer[cursor_pos] != '\n')) { + cursor_pos++; + glConsoleMoveCursorForward(editor_console); + dist1--; + } + +} + + +/* Writes a character to console and editor according to editor mode */ +void writeChar(char c) { + + switch (edit_mode) { + /* Overwrite mode, replaces cursor character with passed character. + Cursor remains standing */ + case OVERWRITE: + + /* Case on c to catch special characters */ + switch (c) { + + case '\b': /* Backspace */ + // printf("backspace case, overwrite mode:\n"); + /* At beginning of buffer, do nothing */ + if (cursor_pos == 0) + return; + + /* At first character of current line. + Default behavior is to delete the new line, + and squeeze the rest of the editor buffer back one character */ + if (editor_buffer[cursor_pos-1] == '\n') { + delete_newline(); + return; + } + + /* Normal overwrite back space case. + Here the previous character is replaced with a space, + and the cursor moves back one */ + + editor_buffer[--cursor_pos]= ' '; + (editor_console->cursor_ptr-1)->symbol = ' '; + glConsoleMoveCursorBackward(editor_console); + return; + case '\n': /* New line character */ + insert_newline(); + return; + default: /* not a special character, do typical behavior */ + // printf("DEFAULT CASE: char = %c\n", c); + + /* If cursor is sitting on the new line, then we + squeeze the pressed character between the last character + and the new line */ + if (editor_buffer[cursor_pos] == '\n') { + insert_char(c); + return; + } + + /* Otherwise, replace character in editor buffer */ + replace_char(c); + return; + } + + return; + + case INSERT: /* Insert Mode */ + switch (c) { + case '\b': /* Backspace case */ + + + if (editor_buffer[cursor_pos-1] == '\n') { + delete_newline(); + return; + } + + shift_buffer_left(); + cursor_pos--; + glConsoleMoveCursorBackward(editor_console); + refresh_from_cursor(editor_buffer+cursor_pos); + return; + + case '\n': + insert_newline(); + return; + + default: + // printf("insert_char: char = %c\n", c); + insert_char(c); + return; + } + default: /* Shouldn't happen */ + return; + + + + + } + + + + +} + +void delete_newline() { + + + if (cursor_pos == 0) + return; + + /* Move console cursor to previous line's end of character */ + glConsoleMoveCursorUp(editor_console); + glConsoleCursorToNextChar('\n', editor_console); + + shift_buffer_left(); + cursor_pos--; + + /* Lazy unoptimal refresh here */ + complete_refresh(); + return; + + + +} + +/* Refreshes entire console but retains initial cursor position */ +void complete_refresh() { + + int sx, sy; + + glConsoleGetCursorPos(&sx, &sy, editor_console); + + glConsoleSetCursorPos(0, 0, editor_console); + + glConsoleClearBuffer(editor_console); + glConsolePrintString(editor_buffer, editor_console); + glConsoleSetCursorPos(sx, sy, editor_console); + + +} +/* Helper function to insert a newline and adjust the graphical console + accordingly. Behavior is same regardless of edit mode type */ +void insert_newline() { + + + /* End of buffer, deny request */ + if (cursor_pos == (MAX_BUFFER_SIZE-1)) + return; + + shift_buffer_right(); + editor_buffer[cursor_pos] = '\n'; + + /* Lazy unoptimal refresh */ + complete_refresh(); + + cursor_pos++; + glConsoleAlignCursorLeft(editor_console); + glConsoleMoveCursorDown(editor_console); +} + +/* Helper function to insert a character. Updates the console and editor buffer + by inserting character at cursor position with passed argument, and moving + the cursor forward if possible */ +void insert_char(char c) { + + /* End of editor buffer, just replace the character instead */ + if (cursor_pos == (MAX_BUFFER_SIZE-1)) { + editor_buffer[cursor_pos] = c; + editor_console->cursor_ptr->symbol = c; + return; + } + + //printf("EDITOR BUFFER WAS:\n%s\n-----------------------------------\n", editor_buffer+cursor_pos); + + /* Shift contents of editor buffer right */ + shift_buffer_right(); + + + /* Now place the passed character at the desired location */ + editor_buffer[cursor_pos] = c; + + // printf("EDITOR BUFFER IS NOW:\n%s\n-----------------------------------\n", editor_buffer+cursor_pos); + + /* Refresh console from current cursor position */ + refresh_from_cursor(editor_buffer+cursor_pos); + + /* Move cursor forward */ + cursor_pos++; + glConsoleMoveCursorForward(editor_console); + +} + +/* Helper function to replace a character. Updates the console and editor buffer + by replacing character at cursor position with passed argument, and + moving the cursor forward if possible */ +void replace_char(char c) { + + /* End of buffer, replace character but dont go forward */ + if (cursor_pos == (MAX_BUFFER_SIZE-1)) { + editor_buffer[cursor_pos] = c; + editor_console->cursor_ptr->symbol = c; + return; + } + + /* Replace character, move cursor forward one */ + editor_buffer[cursor_pos++] = c; + editor_console->cursor_ptr->symbol = c; + glConsoleMoveCursorForward(editor_console); + +} + + +void save_cursor_pos() { + + backup_pos = cursor_pos; + glConsoleGetCursorPos(&cursorx, &cursory, editor_console); + // printf("cursor_x: %d, cursor_y: %d\n", cursorx, cursory); +} + +void restore_cursor_pos() { + + if (backup_pos == -1) + return; + cursor_pos = backup_pos; + glConsoleSetCursorPos(cursorx, cursory, editor_console); + backup_pos = -1; +} + +/* Primarily for optimization, this function refreshs the editor console from the cursor position onward + rather than the entire screen buffer */ +void refresh_from_cursor(char * s) { + + if (s == NULL) + return; + + save_cursor_pos(); + glConsolePrintString(s, editor_console); + restore_cursor_pos(); +} + + +/* Shifts editor buffer right from current cursor position */ +void shift_buffer_right() { + + int i; + char backup, backup2; + + if (cursor_pos == (MAX_BUFFER_SIZE-1)) + return; + + backup = editor_buffer[cursor_pos]; + + for (i = cursor_pos; i < (MAX_BUFFER_SIZE-1); i++) { + backup2 = editor_buffer[i+1]; + editor_buffer[i+1] = backup; + backup = backup2; + } + +} + +/* Shifts editor buffer left from current position */ +void shift_buffer_left() { + + + int i; + char backup, backup2; + + if (cursor_pos == 0) + return; + + //printf("cursor at: %c\n", editor_buffer[cursor_pos]); + backup = editor_buffer[MAX_BUFFER_SIZE-1]; + + //printf("shift_buffer_left: [before]\n%s\n", editor_buffer); + + for (i = MAX_BUFFER_SIZE-1; i >= cursor_pos; i--) { + backup2 = editor_buffer[i-1]; + editor_buffer[i-1] = backup; + backup = backup2; + } + // printf("shift_buffer_left: [after]\n%s\n", editor_buffer); + +} diff --git a/src/projectM-engine-backup/editor.h b/src/projectM-engine-backup/editor.h new file mode 100755 index 000000000..697b872df --- /dev/null +++ b/src/projectM-engine-backup/editor.h @@ -0,0 +1,43 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: editor.h,v 1.1.1.1 2005/12/23 18:05:00 psperl Exp $ + * + * $Log: editor.h,v $ + * Revision 1.1.1.1 2005/12/23 18:05:00 psperl + * Imported + */ + +#ifndef _EDITOR_H +#define _EDITOR_H + +#include "event.h" + +void editor_key_handler( projectMEvent event, projectMKeycode keycode ); +void key_helper( projectMKeycode key, projectMEvent event, projectMModifier modifier); +int loadEditor(char * s, void (*func)(), int screen_width, int screen_height, + int scroll_width, int scroll_height, float start_x, float start_y); +int closeEditor(); +void refreshEditor(); + + + +#endif /** !_EDITOR_H */ diff --git a/src/projectM-engine-backup/event.h b/src/projectM-engine-backup/event.h new file mode 100755 index 000000000..c480926e3 --- /dev/null +++ b/src/projectM-engine-backup/event.h @@ -0,0 +1,151 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: event.h,v 1.2 2004/10/08 10:54:27 cvs Exp $ + * + * projectM keycodes. Enables translation from various event schemes such as Win32, SDL + * &c. + * + * $Log: event.h,v $ + */ + +#ifndef _PROJECTM_EVENT_H +#define _PROJECTM_EVENT_H + +typedef enum { + /** Event types */ + PROJECTM_KEYUP, + PROJECTM_KEYDOWN, + PROJECTM_VIDEORESIZE, + PROJECTM_VIDEOQUIT, + } projectMEvent; + +typedef enum { + /** Keycodes */ + PROJECTM_K_RETURN, + PROJECTM_K_RIGHT, + PROJECTM_K_LEFT, + PROJECTM_K_UP, + PROJECTM_K_DOWN, + PROJECTM_K_PAGEUP, + PROJECTM_K_PAGEDOWN, + PROJECTM_K_INSERT, + PROJECTM_K_DELETE, + PROJECTM_K_ESCAPE, + PROJECTM_K_LSHIFT, + PROJECTM_K_RSHIFT, + PROJECTM_K_CAPSLOCK, + PROJECTM_K_LCTRL, + PROJECTM_K_HOME, + PROJECTM_K_END, + PROJECTM_K_BACKSPACE, + + PROJECTM_K_F1, + PROJECTM_K_F2, + PROJECTM_K_F3, + PROJECTM_K_F4, + PROJECTM_K_F5, + PROJECTM_K_F6, + PROJECTM_K_F7, + PROJECTM_K_F8, + PROJECTM_K_F9, + PROJECTM_K_F10, + PROJECTM_K_F11, + PROJECTM_K_F12, + + PROJECTM_K_0 = 48, + PROJECTM_K_1, + PROJECTM_K_2, + PROJECTM_K_3, + PROJECTM_K_4, + PROJECTM_K_5, + PROJECTM_K_6, + PROJECTM_K_7, + PROJECTM_K_8, + PROJECTM_K_9, + + PROJECTM_K_A = 65, + PROJECTM_K_B, + PROJECTM_K_C, + PROJECTM_K_D, + PROJECTM_K_E, + PROJECTM_K_F, + PROJECTM_K_G, + PROJECTM_K_H, + PROJECTM_K_I, + PROJECTM_K_J, + PROJECTM_K_K, + PROJECTM_K_L, + PROJECTM_K_M, + PROJECTM_K_N, + PROJECTM_K_O, + PROJECTM_K_P, + PROJECTM_K_Q, + PROJECTM_K_R, + PROJECTM_K_S, + PROJECTM_K_T, + PROJECTM_K_U, + PROJECTM_K_V, + PROJECTM_K_W, + PROJECTM_K_X, + PROJECTM_K_Y, + PROJECTM_K_Z, + + PROJECTM_K_a = 97, + PROJECTM_K_b, + PROJECTM_K_c, + PROJECTM_K_d, + PROJECTM_K_e, + PROJECTM_K_f, + PROJECTM_K_g, + PROJECTM_K_h, + PROJECTM_K_i, + PROJECTM_K_j, + PROJECTM_K_k, + PROJECTM_K_l, + PROJECTM_K_m, + PROJECTM_K_n, + PROJECTM_K_o, + PROJECTM_K_p, + PROJECTM_K_q, + PROJECTM_K_r, + PROJECTM_K_s, + PROJECTM_K_t, + PROJECTM_K_u, + PROJECTM_K_v, + PROJECTM_K_w, + PROJECTM_K_x, + PROJECTM_K_y, + PROJECTM_K_z, + PROJECTM_K_NONE, + } projectMKeycode; + +typedef enum { + /** Modifiers */ + PROJECTM_KMOD_LSHIFT, + PROJECTM_KMOD_RSHIFT, + PROJECTM_KMOD_CAPS, + PROJECTM_KMOD_LCTRL, + PROJECTM_KMOD_RCTRL, + } projectMModifier; + +#endif /** !_PROJECTM_EVENT_H */ + diff --git a/src/projectM-engine-backup/fatal.h b/src/projectM-engine-backup/fatal.h new file mode 100755 index 000000000..57a62850e --- /dev/null +++ b/src/projectM-engine-backup/fatal.h @@ -0,0 +1,43 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: fatal.h,v 1.1.1.1 2005/12/23 18:05:05 psperl Exp $ + * + * Error codes + * + * $Log$ + */ + +#ifndef _FATAL_H +#define _FATAL_H + +/* Fatal Error Definitions */ + +#define PROJECTM_OUTOFMEM_ERROR -7; /* out of memory */ +#define PROJECTM_ERROR -1 /* non specific error */ +#define PROJECTM_SUCCESS 1 +#define PROJECTM_FAILURE -1 +#define PROJECTM_PARSE_ERROR -11 +#define PROJECTM_DIV_BY_ZERO -3 +#define PROJECTM_OK 2 + +#endif /** !_FATAL_H */ + diff --git a/src/projectM-engine-backup/fftsg.cpp b/src/projectM-engine-backup/fftsg.cpp new file mode 100755 index 000000000..d005f77c5 --- /dev/null +++ b/src/projectM-engine-backup/fftsg.cpp @@ -0,0 +1,3314 @@ +/* +Fast Fourier/Cosine/Sine Transform + dimension :one + data length :power of 2 + decimation :frequency + radix :split-radix + data :inplace + table :use +functions + cdft: Complex Discrete Fourier Transform + rdft: Real Discrete Fourier Transform + ddct: Discrete Cosine Transform + ddst: Discrete Sine Transform + dfct: Cosine Transform of RDFT (Real Symmetric DFT) + dfst: Sine Transform of RDFT (Real Anti-symmetric DFT) +function prototypes + void cdft(int, int, double *, int *, double *); + void rdft(int, int, double *, int *, double *); + void ddct(int, int, double *, int *, double *); + void ddst(int, int, double *, int *, double *); + void dfct(int, double *, double *, int *, double *); + void dfst(int, double *, double *, int *, double *); +macro definitions + USE_CDFT_PTHREADS : default=not defined + CDFT_THREADS_BEGIN_N : must be >= 512, default=8192 + CDFT_4THREADS_BEGIN_N : must be >= 512, default=65536 + USE_CDFT_WINTHREADS : default=not defined + CDFT_THREADS_BEGIN_N : must be >= 512, default=32768 + CDFT_4THREADS_BEGIN_N : must be >= 512, default=524288 + + +-------- Complex DFT (Discrete Fourier Transform) -------- + [definition] + + X[k] = sum_j=0^n-1 x[j]*exp(2*pi*i*j*k/n), 0<=k + X[k] = sum_j=0^n-1 x[j]*exp(-2*pi*i*j*k/n), 0<=k + ip[0] = 0; // first time only + cdft(2*n, 1, a, ip, w); + + ip[0] = 0; // first time only + cdft(2*n, -1, a, ip, w); + [parameters] + 2*n :data length (int) + n >= 1, n = power of 2 + a[0...2*n-1] :input/output data (double *) + input data + a[2*j] = Re(x[j]), + a[2*j+1] = Im(x[j]), 0<=j= 2+sqrt(n) + strictly, + length of ip >= + 2+(1<<(int)(log(n+0.5)/log(2))/2). + ip[0],ip[1] are pointers of the cos/sin table. + w[0...n/2-1] :cos/sin table (double *) + w[],ip[] are initialized if ip[0] == 0. + [remark] + Inverse of + cdft(2*n, -1, a, ip, w); + is + cdft(2*n, 1, a, ip, w); + for (j = 0; j <= 2 * n - 1; j++) { + a[j] *= 1.0 / n; + } + . + + +-------- Real DFT / Inverse of Real DFT -------- + [definition] + RDFT + R[k] = sum_j=0^n-1 a[j]*cos(2*pi*j*k/n), 0<=k<=n/2 + I[k] = sum_j=0^n-1 a[j]*sin(2*pi*j*k/n), 0 IRDFT (excluding scale) + a[k] = (R[0] + R[n/2]*cos(pi*k))/2 + + sum_j=1^n/2-1 R[j]*cos(2*pi*j*k/n) + + sum_j=1^n/2-1 I[j]*sin(2*pi*j*k/n), 0<=k + ip[0] = 0; // first time only + rdft(n, 1, a, ip, w); + + ip[0] = 0; // first time only + rdft(n, -1, a, ip, w); + [parameters] + n :data length (int) + n >= 2, n = power of 2 + a[0...n-1] :input/output data (double *) + + output data + a[2*k] = R[k], 0<=k + input data + a[2*j] = R[j], 0<=j= 2+sqrt(n/2) + strictly, + length of ip >= + 2+(1<<(int)(log(n/2+0.5)/log(2))/2). + ip[0],ip[1] are pointers of the cos/sin table. + w[0...n/2-1] :cos/sin table (double *) + w[],ip[] are initialized if ip[0] == 0. + [remark] + Inverse of + rdft(n, 1, a, ip, w); + is + rdft(n, -1, a, ip, w); + for (j = 0; j <= n - 1; j++) { + a[j] *= 2.0 / n; + } + . + + +-------- DCT (Discrete Cosine Transform) / Inverse of DCT -------- + [definition] + IDCT (excluding scale) + C[k] = sum_j=0^n-1 a[j]*cos(pi*j*(k+1/2)/n), 0<=k DCT + C[k] = sum_j=0^n-1 a[j]*cos(pi*(j+1/2)*k/n), 0<=k + ip[0] = 0; // first time only + ddct(n, 1, a, ip, w); + + ip[0] = 0; // first time only + ddct(n, -1, a, ip, w); + [parameters] + n :data length (int) + n >= 2, n = power of 2 + a[0...n-1] :input/output data (double *) + output data + a[k] = C[k], 0<=k= 2+sqrt(n/2) + strictly, + length of ip >= + 2+(1<<(int)(log(n/2+0.5)/log(2))/2). + ip[0],ip[1] are pointers of the cos/sin table. + w[0...n*5/4-1] :cos/sin table (double *) + w[],ip[] are initialized if ip[0] == 0. + [remark] + Inverse of + ddct(n, -1, a, ip, w); + is + a[0] *= 0.5; + ddct(n, 1, a, ip, w); + for (j = 0; j <= n - 1; j++) { + a[j] *= 2.0 / n; + } + . + + +-------- DST (Discrete Sine Transform) / Inverse of DST -------- + [definition] + IDST (excluding scale) + S[k] = sum_j=1^n A[j]*sin(pi*j*(k+1/2)/n), 0<=k DST + S[k] = sum_j=0^n-1 a[j]*sin(pi*(j+1/2)*k/n), 0 + ip[0] = 0; // first time only + ddst(n, 1, a, ip, w); + + ip[0] = 0; // first time only + ddst(n, -1, a, ip, w); + [parameters] + n :data length (int) + n >= 2, n = power of 2 + a[0...n-1] :input/output data (double *) + + input data + a[j] = A[j], 0 + output data + a[k] = S[k], 0= 2+sqrt(n/2) + strictly, + length of ip >= + 2+(1<<(int)(log(n/2+0.5)/log(2))/2). + ip[0],ip[1] are pointers of the cos/sin table. + w[0...n*5/4-1] :cos/sin table (double *) + w[],ip[] are initialized if ip[0] == 0. + [remark] + Inverse of + ddst(n, -1, a, ip, w); + is + a[0] *= 0.5; + ddst(n, 1, a, ip, w); + for (j = 0; j <= n - 1; j++) { + a[j] *= 2.0 / n; + } + . + + +-------- Cosine Transform of RDFT (Real Symmetric DFT) -------- + [definition] + C[k] = sum_j=0^n a[j]*cos(pi*j*k/n), 0<=k<=n + [usage] + ip[0] = 0; // first time only + dfct(n, a, t, ip, w); + [parameters] + n :data length - 1 (int) + n >= 2, n = power of 2 + a[0...n] :input/output data (double *) + output data + a[k] = C[k], 0<=k<=n + t[0...n/2] :work area (double *) + ip[0...*] :work area for bit reversal (int *) + length of ip >= 2+sqrt(n/4) + strictly, + length of ip >= + 2+(1<<(int)(log(n/4+0.5)/log(2))/2). + ip[0],ip[1] are pointers of the cos/sin table. + w[0...n*5/8-1] :cos/sin table (double *) + w[],ip[] are initialized if ip[0] == 0. + [remark] + Inverse of + a[0] *= 0.5; + a[n] *= 0.5; + dfct(n, a, t, ip, w); + is + a[0] *= 0.5; + a[n] *= 0.5; + dfct(n, a, t, ip, w); + for (j = 0; j <= n; j++) { + a[j] *= 2.0 / n; + } + . + + +-------- Sine Transform of RDFT (Real Anti-symmetric DFT) -------- + [definition] + S[k] = sum_j=1^n-1 a[j]*sin(pi*j*k/n), 0= 2, n = power of 2 + a[0...n-1] :input/output data (double *) + output data + a[k] = S[k], 0= 2+sqrt(n/4) + strictly, + length of ip >= + 2+(1<<(int)(log(n/4+0.5)/log(2))/2). + ip[0],ip[1] are pointers of the cos/sin table. + w[0...n*5/8-1] :cos/sin table (double *) + w[],ip[] are initialized if ip[0] == 0. + [remark] + Inverse of + dfst(n, a, t, ip, w); + is + dfst(n, a, t, ip, w); + for (j = 1; j <= n - 1; j++) { + a[j] *= 2.0 / n; + } + . + + +Appendix : + The cos/sin table is recalculated when the larger table required. + w[] and ip[] are compatible with all routines. +*/ + + +void cdft(int n, int isgn, double *a, int *ip, double *w) +{ + void makewt(int nw, int *ip, double *w); + void cftfsub(int n, double *a, int *ip, int nw, double *w); + void cftbsub(int n, double *a, int *ip, int nw, double *w); + int nw; + + nw = ip[0]; + if (n > (nw << 2)) { + nw = n >> 2; + makewt(nw, ip, w); + } + if (isgn >= 0) { + cftfsub(n, a, ip, nw, w); + } else { + cftbsub(n, a, ip, nw, w); + } +} + + +void rdft(int n, int isgn, double *a, int *ip, double *w) +{ + void makewt(int nw, int *ip, double *w); + void makect(int nc, int *ip, double *c); + void cftfsub(int n, double *a, int *ip, int nw, double *w); + void cftbsub(int n, double *a, int *ip, int nw, double *w); + void rftfsub(int n, double *a, int nc, double *c); + void rftbsub(int n, double *a, int nc, double *c); + int nw, nc; + double xi; + + nw = ip[0]; + if (n > (nw << 2)) { + nw = n >> 2; + makewt(nw, ip, w); + } + nc = ip[1]; + if (n > (nc << 2)) { + nc = n >> 2; + makect(nc, ip, w + nw); + } + if (isgn >= 0) { + if (n > 4) { + cftfsub(n, a, ip, nw, w); + rftfsub(n, a, nc, w + nw); + } else if (n == 4) { + cftfsub(n, a, ip, nw, w); + } + xi = a[0] - a[1]; + a[0] += a[1]; + a[1] = xi; + } else { + a[1] = 0.5 * (a[0] - a[1]); + a[0] -= a[1]; + if (n > 4) { + rftbsub(n, a, nc, w + nw); + cftbsub(n, a, ip, nw, w); + } else if (n == 4) { + cftbsub(n, a, ip, nw, w); + } + } +} + + +void ddct(int n, int isgn, double *a, int *ip, double *w) +{ + void makewt(int nw, int *ip, double *w); + void makect(int nc, int *ip, double *c); + void cftfsub(int n, double *a, int *ip, int nw, double *w); + void cftbsub(int n, double *a, int *ip, int nw, double *w); + void rftfsub(int n, double *a, int nc, double *c); + void rftbsub(int n, double *a, int nc, double *c); + void dctsub(int n, double *a, int nc, double *c); + int j, nw, nc; + double xr; + + nw = ip[0]; + if (n > (nw << 2)) { + nw = n >> 2; + makewt(nw, ip, w); + } + nc = ip[1]; + if (n > nc) { + nc = n; + makect(nc, ip, w + nw); + } + if (isgn < 0) { + xr = a[n - 1]; + for (j = n - 2; j >= 2; j -= 2) { + a[j + 1] = a[j] - a[j - 1]; + a[j] += a[j - 1]; + } + a[1] = a[0] - xr; + a[0] += xr; + if (n > 4) { + rftbsub(n, a, nc, w + nw); + cftbsub(n, a, ip, nw, w); + } else if (n == 4) { + cftbsub(n, a, ip, nw, w); + } + } + dctsub(n, a, nc, w + nw); + if (isgn >= 0) { + if (n > 4) { + cftfsub(n, a, ip, nw, w); + rftfsub(n, a, nc, w + nw); + } else if (n == 4) { + cftfsub(n, a, ip, nw, w); + } + xr = a[0] - a[1]; + a[0] += a[1]; + for (j = 2; j < n; j += 2) { + a[j - 1] = a[j] - a[j + 1]; + a[j] += a[j + 1]; + } + a[n - 1] = xr; + } +} + + +void ddst(int n, int isgn, double *a, int *ip, double *w) +{ + void makewt(int nw, int *ip, double *w); + void makect(int nc, int *ip, double *c); + void cftfsub(int n, double *a, int *ip, int nw, double *w); + void cftbsub(int n, double *a, int *ip, int nw, double *w); + void rftfsub(int n, double *a, int nc, double *c); + void rftbsub(int n, double *a, int nc, double *c); + void dstsub(int n, double *a, int nc, double *c); + int j, nw, nc; + double xr; + + nw = ip[0]; + if (n > (nw << 2)) { + nw = n >> 2; + makewt(nw, ip, w); + } + nc = ip[1]; + if (n > nc) { + nc = n; + makect(nc, ip, w + nw); + } + if (isgn < 0) { + xr = a[n - 1]; + for (j = n - 2; j >= 2; j -= 2) { + a[j + 1] = -a[j] - a[j - 1]; + a[j] -= a[j - 1]; + } + a[1] = a[0] + xr; + a[0] -= xr; + if (n > 4) { + rftbsub(n, a, nc, w + nw); + cftbsub(n, a, ip, nw, w); + } else if (n == 4) { + cftbsub(n, a, ip, nw, w); + } + } + dstsub(n, a, nc, w + nw); + if (isgn >= 0) { + if (n > 4) { + cftfsub(n, a, ip, nw, w); + rftfsub(n, a, nc, w + nw); + } else if (n == 4) { + cftfsub(n, a, ip, nw, w); + } + xr = a[0] - a[1]; + a[0] += a[1]; + for (j = 2; j < n; j += 2) { + a[j - 1] = -a[j] - a[j + 1]; + a[j] -= a[j + 1]; + } + a[n - 1] = -xr; + } +} + + +void dfct(int n, double *a, double *t, int *ip, double *w) +{ + void makewt(int nw, int *ip, double *w); + void makect(int nc, int *ip, double *c); + void cftfsub(int n, double *a, int *ip, int nw, double *w); + void rftfsub(int n, double *a, int nc, double *c); + void dctsub(int n, double *a, int nc, double *c); + int j, k, l, m, mh, nw, nc; + double xr, xi, yr, yi; + + nw = ip[0]; + if (n > (nw << 3)) { + nw = n >> 3; + makewt(nw, ip, w); + } + nc = ip[1]; + if (n > (nc << 1)) { + nc = n >> 1; + makect(nc, ip, w + nw); + } + m = n >> 1; + yi = a[m]; + xi = a[0] + a[n]; + a[0] -= a[n]; + t[0] = xi - yi; + t[m] = xi + yi; + if (n > 2) { + mh = m >> 1; + for (j = 1; j < mh; j++) { + k = m - j; + xr = a[j] - a[n - j]; + xi = a[j] + a[n - j]; + yr = a[k] - a[n - k]; + yi = a[k] + a[n - k]; + a[j] = xr; + a[k] = yr; + t[j] = xi - yi; + t[k] = xi + yi; + } + t[mh] = a[mh] + a[n - mh]; + a[mh] -= a[n - mh]; + dctsub(m, a, nc, w + nw); + if (m > 4) { + cftfsub(m, a, ip, nw, w); + rftfsub(m, a, nc, w + nw); + } else if (m == 4) { + cftfsub(m, a, ip, nw, w); + } + a[n - 1] = a[0] - a[1]; + a[1] = a[0] + a[1]; + for (j = m - 2; j >= 2; j -= 2) { + a[2 * j + 1] = a[j] + a[j + 1]; + a[2 * j - 1] = a[j] - a[j + 1]; + } + l = 2; + m = mh; + while (m >= 2) { + dctsub(m, t, nc, w + nw); + if (m > 4) { + cftfsub(m, t, ip, nw, w); + rftfsub(m, t, nc, w + nw); + } else if (m == 4) { + cftfsub(m, t, ip, nw, w); + } + a[n - l] = t[0] - t[1]; + a[l] = t[0] + t[1]; + k = 0; + for (j = 2; j < m; j += 2) { + k += l << 2; + a[k - l] = t[j] - t[j + 1]; + a[k + l] = t[j] + t[j + 1]; + } + l <<= 1; + mh = m >> 1; + for (j = 0; j < mh; j++) { + k = m - j; + t[j] = t[m + k] - t[m + j]; + t[k] = t[m + k] + t[m + j]; + } + t[mh] = t[m + mh]; + m = mh; + } + a[l] = t[0]; + a[n] = t[2] - t[1]; + a[0] = t[2] + t[1]; + } else { + a[1] = a[0]; + a[2] = t[0]; + a[0] = t[1]; + } +} + + +void dfst(int n, double *a, double *t, int *ip, double *w) +{ + void makewt(int nw, int *ip, double *w); + void makect(int nc, int *ip, double *c); + void cftfsub(int n, double *a, int *ip, int nw, double *w); + void rftfsub(int n, double *a, int nc, double *c); + void dstsub(int n, double *a, int nc, double *c); + int j, k, l, m, mh, nw, nc; + double xr, xi, yr, yi; + + nw = ip[0]; + if (n > (nw << 3)) { + nw = n >> 3; + makewt(nw, ip, w); + } + nc = ip[1]; + if (n > (nc << 1)) { + nc = n >> 1; + makect(nc, ip, w + nw); + } + if (n > 2) { + m = n >> 1; + mh = m >> 1; + for (j = 1; j < mh; j++) { + k = m - j; + xr = a[j] + a[n - j]; + xi = a[j] - a[n - j]; + yr = a[k] + a[n - k]; + yi = a[k] - a[n - k]; + a[j] = xr; + a[k] = yr; + t[j] = xi + yi; + t[k] = xi - yi; + } + t[0] = a[mh] - a[n - mh]; + a[mh] += a[n - mh]; + a[0] = a[m]; + dstsub(m, a, nc, w + nw); + if (m > 4) { + cftfsub(m, a, ip, nw, w); + rftfsub(m, a, nc, w + nw); + } else if (m == 4) { + cftfsub(m, a, ip, nw, w); + } + a[n - 1] = a[1] - a[0]; + a[1] = a[0] + a[1]; + for (j = m - 2; j >= 2; j -= 2) { + a[2 * j + 1] = a[j] - a[j + 1]; + a[2 * j - 1] = -a[j] - a[j + 1]; + } + l = 2; + m = mh; + while (m >= 2) { + dstsub(m, t, nc, w + nw); + if (m > 4) { + cftfsub(m, t, ip, nw, w); + rftfsub(m, t, nc, w + nw); + } else if (m == 4) { + cftfsub(m, t, ip, nw, w); + } + a[n - l] = t[1] - t[0]; + a[l] = t[0] + t[1]; + k = 0; + for (j = 2; j < m; j += 2) { + k += l << 2; + a[k - l] = -t[j] - t[j + 1]; + a[k + l] = t[j] - t[j + 1]; + } + l <<= 1; + mh = m >> 1; + for (j = 1; j < mh; j++) { + k = m - j; + t[j] = t[m + k] + t[m + j]; + t[k] = t[m + k] - t[m + j]; + } + t[0] = t[m + mh]; + m = mh; + } + a[l] = t[0]; + } + a[0] = 0; +} + + +/* -------- initializing routines -------- */ + + +#include + +void makewt(int nw, int *ip, double *w) +{ + void makeipt(int nw, int *ip); + int j, nwh, nw0, nw1; + double delta, wn4r, wk1r, wk1i, wk3r, wk3i; + + ip[0] = nw; + ip[1] = 1; + if (nw > 2) { + nwh = nw >> 1; + delta = atan(1.0) / nwh; + wn4r = cos(delta * nwh); + w[0] = 1; + w[1] = wn4r; + if (nwh == 4) { + w[2] = cos(delta * 2); + w[3] = sin(delta * 2); + } else if (nwh > 4) { + makeipt(nw, ip); + w[2] = 0.5 / cos(delta * 2); + w[3] = 0.5 / cos(delta * 6); + for (j = 4; j < nwh; j += 4) { + w[j] = cos(delta * j); + w[j + 1] = sin(delta * j); + w[j + 2] = cos(3 * delta * j); + w[j + 3] = -sin(3 * delta * j); + } + } + nw0 = 0; + while (nwh > 2) { + nw1 = nw0 + nwh; + nwh >>= 1; + w[nw1] = 1; + w[nw1 + 1] = wn4r; + if (nwh == 4) { + wk1r = w[nw0 + 4]; + wk1i = w[nw0 + 5]; + w[nw1 + 2] = wk1r; + w[nw1 + 3] = wk1i; + } else if (nwh > 4) { + wk1r = w[nw0 + 4]; + wk3r = w[nw0 + 6]; + w[nw1 + 2] = 0.5 / wk1r; + w[nw1 + 3] = 0.5 / wk3r; + for (j = 4; j < nwh; j += 4) { + wk1r = w[nw0 + 2 * j]; + wk1i = w[nw0 + 2 * j + 1]; + wk3r = w[nw0 + 2 * j + 2]; + wk3i = w[nw0 + 2 * j + 3]; + w[nw1 + j] = wk1r; + w[nw1 + j + 1] = wk1i; + w[nw1 + j + 2] = wk3r; + w[nw1 + j + 3] = wk3i; + } + } + nw0 = nw1; + } + } +} + + +void makeipt(int nw, int *ip) +{ + int j, l, m, m2, p, q; + + ip[2] = 0; + ip[3] = 16; + m = 2; + for (l = nw; l > 32; l >>= 2) { + m2 = m << 1; + q = m2 << 3; + for (j = m; j < m2; j++) { + p = ip[j] << 2; + ip[m + j] = p; + ip[m2 + j] = p + q; + } + m = m2; + } +} + + +void makect(int nc, int *ip, double *c) +{ + int j, nch; + double delta; + + ip[1] = nc; + if (nc > 1) { + nch = nc >> 1; + delta = atan(1.0) / nch; + c[0] = cos(delta * nch); + c[nch] = 0.5 * c[0]; + for (j = 1; j < nch; j++) { + c[j] = 0.5 * cos(delta * j); + c[nc - j] = 0.5 * sin(delta * j); + } + } +} + + +/* -------- child routines -------- */ + + +#ifdef USE_CDFT_PTHREADS +#define USE_CDFT_THREADS +#ifndef CDFT_THREADS_BEGIN_N +#define CDFT_THREADS_BEGIN_N 8192 +#endif +#ifndef CDFT_4THREADS_BEGIN_N +#define CDFT_4THREADS_BEGIN_N 65536 +#endif +#include +#include +#include +#define cdft_thread_t pthread_t +#define cdft_thread_create(thp,func,argp) { \ + if (pthread_create(thp, NULL, func, (void *) argp) != 0) { \ + fprintf(stderr, "cdft thread error\n"); \ + exit(1); \ + } \ +} +#define cdft_thread_wait(th) { \ + if (pthread_join(th, NULL) != 0) { \ + fprintf(stderr, "cdft thread error\n"); \ + exit(1); \ + } \ +} +#endif /* USE_CDFT_PTHREADS */ + + +#ifdef USE_CDFT_WINTHREADS +#define USE_CDFT_THREADS +#ifndef CDFT_THREADS_BEGIN_N +#define CDFT_THREADS_BEGIN_N 32768 +#endif +#ifndef CDFT_4THREADS_BEGIN_N +#define CDFT_4THREADS_BEGIN_N 524288 +#endif +#include +#include +#include +#define cdft_thread_t HANDLE +#define cdft_thread_create(thp,func,argp) { \ + DWORD thid; \ + *(thp) = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) func, (LPVOID) argp, 0, &thid); \ + if (*(thp) == 0) { \ + fprintf(stderr, "cdft thread error\n"); \ + exit(1); \ + } \ +} +#define cdft_thread_wait(th) { \ + WaitForSingleObject(th, INFINITE); \ + CloseHandle(th); \ +} +#endif /* USE_CDFT_WINTHREADS */ + + +void cftfsub(int n, double *a, int *ip, int nw, double *w) +{ + void bitrv2(int n, int *ip, double *a); + void bitrv216(double *a); + void bitrv208(double *a); + void cftf1st(int n, double *a, double *w); + void cftrec4(int n, double *a, int nw, double *w); + void cftleaf(int n, int isplt, double *a, int nw, double *w); + void cftfx41(int n, double *a, int nw, double *w); + void cftf161(double *a, double *w); + void cftf081(double *a, double *w); + void cftf040(double *a); + void cftx020(double *a); +#ifdef USE_CDFT_THREADS + void cftrec4_th(int n, double *a, int nw, double *w); +#endif /* USE_CDFT_THREADS */ + + if (n > 8) { + if (n > 32) { + cftf1st(n, a, &w[nw - (n >> 2)]); +#ifdef USE_CDFT_THREADS + if (n > CDFT_THREADS_BEGIN_N) { + cftrec4_th(n, a, nw, w); + } else +#endif /* USE_CDFT_THREADS */ + if (n > 512) { + cftrec4(n, a, nw, w); + } else if (n > 128) { + cftleaf(n, 1, a, nw, w); + } else { + cftfx41(n, a, nw, w); + } + bitrv2(n, ip, a); + } else if (n == 32) { + cftf161(a, &w[nw - 8]); + bitrv216(a); + } else { + cftf081(a, w); + bitrv208(a); + } + } else if (n == 8) { + cftf040(a); + } else if (n == 4) { + cftx020(a); + } +} + + +void cftbsub(int n, double *a, int *ip, int nw, double *w) +{ + void bitrv2conj(int n, int *ip, double *a); + void bitrv216neg(double *a); + void bitrv208neg(double *a); + void cftb1st(int n, double *a, double *w); + void cftrec4(int n, double *a, int nw, double *w); + void cftleaf(int n, int isplt, double *a, int nw, double *w); + void cftfx41(int n, double *a, int nw, double *w); + void cftf161(double *a, double *w); + void cftf081(double *a, double *w); + void cftb040(double *a); + void cftx020(double *a); +#ifdef USE_CDFT_THREADS + void cftrec4_th(int n, double *a, int nw, double *w); +#endif /* USE_CDFT_THREADS */ + + if (n > 8) { + if (n > 32) { + cftb1st(n, a, &w[nw - (n >> 2)]); +#ifdef USE_CDFT_THREADS + if (n > CDFT_THREADS_BEGIN_N) { + cftrec4_th(n, a, nw, w); + } else +#endif /* USE_CDFT_THREADS */ + if (n > 512) { + cftrec4(n, a, nw, w); + } else if (n > 128) { + cftleaf(n, 1, a, nw, w); + } else { + cftfx41(n, a, nw, w); + } + bitrv2conj(n, ip, a); + } else if (n == 32) { + cftf161(a, &w[nw - 8]); + bitrv216neg(a); + } else { + cftf081(a, w); + bitrv208neg(a); + } + } else if (n == 8) { + cftb040(a); + } else if (n == 4) { + cftx020(a); + } +} + + +void bitrv2(int n, int *ip, double *a) +{ + int j, j1, k, k1, l, m, nh, nm; + double xr, xi, yr, yi; + + m = 1; + for (l = n >> 2; l > 8; l >>= 2) { + m <<= 1; + } + nh = n >> 1; + nm = 4 * m; + if (l == 8) { + for (k = 0; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = 4 * j + 2 * ip[m + k]; + k1 = 4 * k + 2 * ip[m + j]; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 -= nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nh; + k1 += 2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 += nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += 2; + k1 += nh; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 -= nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nh; + k1 -= 2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 += nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + k1 = 4 * k + 2 * ip[m + k]; + j1 = k1 + 2; + k1 += nh; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 -= nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= 2; + k1 -= nh; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nh + 2; + k1 += nh + 2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nh - nm; + k1 += 2 * nm - 2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + } else { + for (k = 0; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = 4 * j + ip[m + k]; + k1 = 4 * k + ip[m + j]; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nh; + k1 += 2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += 2; + k1 += nh; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nh; + k1 -= 2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + k1 = 4 * k + ip[m + k]; + j1 = k1 + 2; + k1 += nh; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += nm; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + } +} + + +void bitrv2conj(int n, int *ip, double *a) +{ + int j, j1, k, k1, l, m, nh, nm; + double xr, xi, yr, yi; + + m = 1; + for (l = n >> 2; l > 8; l >>= 2) { + m <<= 1; + } + nh = n >> 1; + nm = 4 * m; + if (l == 8) { + for (k = 0; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = 4 * j + 2 * ip[m + k]; + k1 = 4 * k + 2 * ip[m + j]; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 -= nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nh; + k1 += 2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 += nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += 2; + k1 += nh; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 -= nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nh; + k1 -= 2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 += nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + k1 = 4 * k + 2 * ip[m + k]; + j1 = k1 + 2; + k1 += nh; + a[j1 - 1] = -a[j1 - 1]; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + a[k1 + 3] = -a[k1 + 3]; + j1 += nm; + k1 += 2 * nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 -= nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= 2; + k1 -= nh; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nh + 2; + k1 += nh + 2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nh - nm; + k1 += 2 * nm - 2; + a[j1 - 1] = -a[j1 - 1]; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + a[k1 + 3] = -a[k1 + 3]; + } + } else { + for (k = 0; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = 4 * j + ip[m + k]; + k1 = 4 * k + ip[m + j]; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nh; + k1 += 2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += 2; + k1 += nh; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += nm; + k1 += nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nh; + k1 -= 2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 -= nm; + k1 -= nm; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + k1 = 4 * k + ip[m + k]; + j1 = k1 + 2; + k1 += nh; + a[j1 - 1] = -a[j1 - 1]; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + a[k1 + 3] = -a[k1 + 3]; + j1 += nm; + k1 += nm; + a[j1 - 1] = -a[j1 - 1]; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + a[k1 + 3] = -a[k1 + 3]; + } + } +} + + +void bitrv216(double *a) +{ + double x1r, x1i, x2r, x2i, x3r, x3i, x4r, x4i, + x5r, x5i, x7r, x7i, x8r, x8i, x10r, x10i, + x11r, x11i, x12r, x12i, x13r, x13i, x14r, x14i; + + x1r = a[2]; + x1i = a[3]; + x2r = a[4]; + x2i = a[5]; + x3r = a[6]; + x3i = a[7]; + x4r = a[8]; + x4i = a[9]; + x5r = a[10]; + x5i = a[11]; + x7r = a[14]; + x7i = a[15]; + x8r = a[16]; + x8i = a[17]; + x10r = a[20]; + x10i = a[21]; + x11r = a[22]; + x11i = a[23]; + x12r = a[24]; + x12i = a[25]; + x13r = a[26]; + x13i = a[27]; + x14r = a[28]; + x14i = a[29]; + a[2] = x8r; + a[3] = x8i; + a[4] = x4r; + a[5] = x4i; + a[6] = x12r; + a[7] = x12i; + a[8] = x2r; + a[9] = x2i; + a[10] = x10r; + a[11] = x10i; + a[14] = x14r; + a[15] = x14i; + a[16] = x1r; + a[17] = x1i; + a[20] = x5r; + a[21] = x5i; + a[22] = x13r; + a[23] = x13i; + a[24] = x3r; + a[25] = x3i; + a[26] = x11r; + a[27] = x11i; + a[28] = x7r; + a[29] = x7i; +} + + +void bitrv216neg(double *a) +{ + double x1r, x1i, x2r, x2i, x3r, x3i, x4r, x4i, + x5r, x5i, x6r, x6i, x7r, x7i, x8r, x8i, + x9r, x9i, x10r, x10i, x11r, x11i, x12r, x12i, + x13r, x13i, x14r, x14i, x15r, x15i; + + x1r = a[2]; + x1i = a[3]; + x2r = a[4]; + x2i = a[5]; + x3r = a[6]; + x3i = a[7]; + x4r = a[8]; + x4i = a[9]; + x5r = a[10]; + x5i = a[11]; + x6r = a[12]; + x6i = a[13]; + x7r = a[14]; + x7i = a[15]; + x8r = a[16]; + x8i = a[17]; + x9r = a[18]; + x9i = a[19]; + x10r = a[20]; + x10i = a[21]; + x11r = a[22]; + x11i = a[23]; + x12r = a[24]; + x12i = a[25]; + x13r = a[26]; + x13i = a[27]; + x14r = a[28]; + x14i = a[29]; + x15r = a[30]; + x15i = a[31]; + a[2] = x15r; + a[3] = x15i; + a[4] = x7r; + a[5] = x7i; + a[6] = x11r; + a[7] = x11i; + a[8] = x3r; + a[9] = x3i; + a[10] = x13r; + a[11] = x13i; + a[12] = x5r; + a[13] = x5i; + a[14] = x9r; + a[15] = x9i; + a[16] = x1r; + a[17] = x1i; + a[18] = x14r; + a[19] = x14i; + a[20] = x6r; + a[21] = x6i; + a[22] = x10r; + a[23] = x10i; + a[24] = x2r; + a[25] = x2i; + a[26] = x12r; + a[27] = x12i; + a[28] = x4r; + a[29] = x4i; + a[30] = x8r; + a[31] = x8i; +} + + +void bitrv208(double *a) +{ + double x1r, x1i, x3r, x3i, x4r, x4i, x6r, x6i; + + x1r = a[2]; + x1i = a[3]; + x3r = a[6]; + x3i = a[7]; + x4r = a[8]; + x4i = a[9]; + x6r = a[12]; + x6i = a[13]; + a[2] = x4r; + a[3] = x4i; + a[6] = x6r; + a[7] = x6i; + a[8] = x1r; + a[9] = x1i; + a[12] = x3r; + a[13] = x3i; +} + + +void bitrv208neg(double *a) +{ + double x1r, x1i, x2r, x2i, x3r, x3i, x4r, x4i, + x5r, x5i, x6r, x6i, x7r, x7i; + + x1r = a[2]; + x1i = a[3]; + x2r = a[4]; + x2i = a[5]; + x3r = a[6]; + x3i = a[7]; + x4r = a[8]; + x4i = a[9]; + x5r = a[10]; + x5i = a[11]; + x6r = a[12]; + x6i = a[13]; + x7r = a[14]; + x7i = a[15]; + a[2] = x7r; + a[3] = x7i; + a[4] = x3r; + a[5] = x3i; + a[6] = x5r; + a[7] = x5i; + a[8] = x1r; + a[9] = x1i; + a[10] = x6r; + a[11] = x6i; + a[12] = x2r; + a[13] = x2i; + a[14] = x4r; + a[15] = x4i; +} + + +void cftf1st(int n, double *a, double *w) +{ + int j, j0, j1, j2, j3, k, m, mh; + double wn4r, csc1, csc3, wk1r, wk1i, wk3r, wk3i, + wd1r, wd1i, wd3r, wd3i; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, + y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i; + + mh = n >> 3; + m = 2 * mh; + j1 = m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[0] + a[j2]; + x0i = a[1] + a[j2 + 1]; + x1r = a[0] - a[j2]; + x1i = a[1] - a[j2 + 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + a[0] = x0r + x2r; + a[1] = x0i + x2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i - x2i; + a[j2] = x1r - x3i; + a[j2 + 1] = x1i + x3r; + a[j3] = x1r + x3i; + a[j3 + 1] = x1i - x3r; + wn4r = w[1]; + csc1 = w[2]; + csc3 = w[3]; + wd1r = 1; + wd1i = 0; + wd3r = 1; + wd3i = 0; + k = 0; + for (j = 2; j < mh - 2; j += 4) { + k += 4; + wk1r = csc1 * (wd1r + w[k]); + wk1i = csc1 * (wd1i + w[k + 1]); + wk3r = csc3 * (wd3r + w[k + 2]); + wk3i = csc3 * (wd3i + w[k + 3]); + wd1r = w[k]; + wd1i = w[k + 1]; + wd3r = w[k + 2]; + wd3i = w[k + 3]; + j1 = j + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j] + a[j2]; + x0i = a[j + 1] + a[j2 + 1]; + x1r = a[j] - a[j2]; + x1i = a[j + 1] - a[j2 + 1]; + y0r = a[j + 2] + a[j2 + 2]; + y0i = a[j + 3] + a[j2 + 3]; + y1r = a[j + 2] - a[j2 + 2]; + y1i = a[j + 3] - a[j2 + 3]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + y2r = a[j1 + 2] + a[j3 + 2]; + y2i = a[j1 + 3] + a[j3 + 3]; + y3r = a[j1 + 2] - a[j3 + 2]; + y3i = a[j1 + 3] - a[j3 + 3]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + a[j + 2] = y0r + y2r; + a[j + 3] = y0i + y2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i - x2i; + a[j1 + 2] = y0r - y2r; + a[j1 + 3] = y0i - y2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j2] = wk1r * x0r - wk1i * x0i; + a[j2 + 1] = wk1r * x0i + wk1i * x0r; + x0r = y1r - y3i; + x0i = y1i + y3r; + a[j2 + 2] = wd1r * x0r - wd1i * x0i; + a[j2 + 3] = wd1r * x0i + wd1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = wk3r * x0r + wk3i * x0i; + a[j3 + 1] = wk3r * x0i - wk3i * x0r; + x0r = y1r + y3i; + x0i = y1i - y3r; + a[j3 + 2] = wd3r * x0r + wd3i * x0i; + a[j3 + 3] = wd3r * x0i - wd3i * x0r; + j0 = m - j; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j0] + a[j2]; + x0i = a[j0 + 1] + a[j2 + 1]; + x1r = a[j0] - a[j2]; + x1i = a[j0 + 1] - a[j2 + 1]; + y0r = a[j0 - 2] + a[j2 - 2]; + y0i = a[j0 - 1] + a[j2 - 1]; + y1r = a[j0 - 2] - a[j2 - 2]; + y1i = a[j0 - 1] - a[j2 - 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + y2r = a[j1 - 2] + a[j3 - 2]; + y2i = a[j1 - 1] + a[j3 - 1]; + y3r = a[j1 - 2] - a[j3 - 2]; + y3i = a[j1 - 1] - a[j3 - 1]; + a[j0] = x0r + x2r; + a[j0 + 1] = x0i + x2i; + a[j0 - 2] = y0r + y2r; + a[j0 - 1] = y0i + y2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i - x2i; + a[j1 - 2] = y0r - y2r; + a[j1 - 1] = y0i - y2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j2] = wk1i * x0r - wk1r * x0i; + a[j2 + 1] = wk1i * x0i + wk1r * x0r; + x0r = y1r - y3i; + x0i = y1i + y3r; + a[j2 - 2] = wd1i * x0r - wd1r * x0i; + a[j2 - 1] = wd1i * x0i + wd1r * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = wk3i * x0r + wk3r * x0i; + a[j3 + 1] = wk3i * x0i - wk3r * x0r; + x0r = y1r + y3i; + x0i = y1i - y3r; + a[j3 - 2] = wd3i * x0r + wd3r * x0i; + a[j3 - 1] = wd3i * x0i - wd3r * x0r; + } + wk1r = csc1 * (wd1r + wn4r); + wk1i = csc1 * (wd1i + wn4r); + wk3r = csc3 * (wd3r - wn4r); + wk3i = csc3 * (wd3i - wn4r); + j0 = mh; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j0 - 2] + a[j2 - 2]; + x0i = a[j0 - 1] + a[j2 - 1]; + x1r = a[j0 - 2] - a[j2 - 2]; + x1i = a[j0 - 1] - a[j2 - 1]; + x2r = a[j1 - 2] + a[j3 - 2]; + x2i = a[j1 - 1] + a[j3 - 1]; + x3r = a[j1 - 2] - a[j3 - 2]; + x3i = a[j1 - 1] - a[j3 - 1]; + a[j0 - 2] = x0r + x2r; + a[j0 - 1] = x0i + x2i; + a[j1 - 2] = x0r - x2r; + a[j1 - 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j2 - 2] = wk1r * x0r - wk1i * x0i; + a[j2 - 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3 - 2] = wk3r * x0r + wk3i * x0i; + a[j3 - 1] = wk3r * x0i - wk3i * x0r; + x0r = a[j0] + a[j2]; + x0i = a[j0 + 1] + a[j2 + 1]; + x1r = a[j0] - a[j2]; + x1i = a[j0 + 1] - a[j2 + 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + a[j0] = x0r + x2r; + a[j0 + 1] = x0i + x2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j2] = wn4r * (x0r - x0i); + a[j2 + 1] = wn4r * (x0i + x0r); + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = -wn4r * (x0r + x0i); + a[j3 + 1] = -wn4r * (x0i - x0r); + x0r = a[j0 + 2] + a[j2 + 2]; + x0i = a[j0 + 3] + a[j2 + 3]; + x1r = a[j0 + 2] - a[j2 + 2]; + x1i = a[j0 + 3] - a[j2 + 3]; + x2r = a[j1 + 2] + a[j3 + 2]; + x2i = a[j1 + 3] + a[j3 + 3]; + x3r = a[j1 + 2] - a[j3 + 2]; + x3i = a[j1 + 3] - a[j3 + 3]; + a[j0 + 2] = x0r + x2r; + a[j0 + 3] = x0i + x2i; + a[j1 + 2] = x0r - x2r; + a[j1 + 3] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j2 + 2] = wk1i * x0r - wk1r * x0i; + a[j2 + 3] = wk1i * x0i + wk1r * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3 + 2] = wk3i * x0r + wk3r * x0i; + a[j3 + 3] = wk3i * x0i - wk3r * x0r; +} + + +void cftb1st(int n, double *a, double *w) +{ + int j, j0, j1, j2, j3, k, m, mh; + double wn4r, csc1, csc3, wk1r, wk1i, wk3r, wk3i, + wd1r, wd1i, wd3r, wd3i; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, + y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i; + + mh = n >> 3; + m = 2 * mh; + j1 = m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[0] + a[j2]; + x0i = -a[1] - a[j2 + 1]; + x1r = a[0] - a[j2]; + x1i = -a[1] + a[j2 + 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + a[0] = x0r + x2r; + a[1] = x0i - x2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i + x2i; + a[j2] = x1r + x3i; + a[j2 + 1] = x1i + x3r; + a[j3] = x1r - x3i; + a[j3 + 1] = x1i - x3r; + wn4r = w[1]; + csc1 = w[2]; + csc3 = w[3]; + wd1r = 1; + wd1i = 0; + wd3r = 1; + wd3i = 0; + k = 0; + for (j = 2; j < mh - 2; j += 4) { + k += 4; + wk1r = csc1 * (wd1r + w[k]); + wk1i = csc1 * (wd1i + w[k + 1]); + wk3r = csc3 * (wd3r + w[k + 2]); + wk3i = csc3 * (wd3i + w[k + 3]); + wd1r = w[k]; + wd1i = w[k + 1]; + wd3r = w[k + 2]; + wd3i = w[k + 3]; + j1 = j + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j] + a[j2]; + x0i = -a[j + 1] - a[j2 + 1]; + x1r = a[j] - a[j2]; + x1i = -a[j + 1] + a[j2 + 1]; + y0r = a[j + 2] + a[j2 + 2]; + y0i = -a[j + 3] - a[j2 + 3]; + y1r = a[j + 2] - a[j2 + 2]; + y1i = -a[j + 3] + a[j2 + 3]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + y2r = a[j1 + 2] + a[j3 + 2]; + y2i = a[j1 + 3] + a[j3 + 3]; + y3r = a[j1 + 2] - a[j3 + 2]; + y3i = a[j1 + 3] - a[j3 + 3]; + a[j] = x0r + x2r; + a[j + 1] = x0i - x2i; + a[j + 2] = y0r + y2r; + a[j + 3] = y0i - y2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i + x2i; + a[j1 + 2] = y0r - y2r; + a[j1 + 3] = y0i + y2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[j2] = wk1r * x0r - wk1i * x0i; + a[j2 + 1] = wk1r * x0i + wk1i * x0r; + x0r = y1r + y3i; + x0i = y1i + y3r; + a[j2 + 2] = wd1r * x0r - wd1i * x0i; + a[j2 + 3] = wd1r * x0i + wd1i * x0r; + x0r = x1r - x3i; + x0i = x1i - x3r; + a[j3] = wk3r * x0r + wk3i * x0i; + a[j3 + 1] = wk3r * x0i - wk3i * x0r; + x0r = y1r - y3i; + x0i = y1i - y3r; + a[j3 + 2] = wd3r * x0r + wd3i * x0i; + a[j3 + 3] = wd3r * x0i - wd3i * x0r; + j0 = m - j; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j0] + a[j2]; + x0i = -a[j0 + 1] - a[j2 + 1]; + x1r = a[j0] - a[j2]; + x1i = -a[j0 + 1] + a[j2 + 1]; + y0r = a[j0 - 2] + a[j2 - 2]; + y0i = -a[j0 - 1] - a[j2 - 1]; + y1r = a[j0 - 2] - a[j2 - 2]; + y1i = -a[j0 - 1] + a[j2 - 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + y2r = a[j1 - 2] + a[j3 - 2]; + y2i = a[j1 - 1] + a[j3 - 1]; + y3r = a[j1 - 2] - a[j3 - 2]; + y3i = a[j1 - 1] - a[j3 - 1]; + a[j0] = x0r + x2r; + a[j0 + 1] = x0i - x2i; + a[j0 - 2] = y0r + y2r; + a[j0 - 1] = y0i - y2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i + x2i; + a[j1 - 2] = y0r - y2r; + a[j1 - 1] = y0i + y2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[j2] = wk1i * x0r - wk1r * x0i; + a[j2 + 1] = wk1i * x0i + wk1r * x0r; + x0r = y1r + y3i; + x0i = y1i + y3r; + a[j2 - 2] = wd1i * x0r - wd1r * x0i; + a[j2 - 1] = wd1i * x0i + wd1r * x0r; + x0r = x1r - x3i; + x0i = x1i - x3r; + a[j3] = wk3i * x0r + wk3r * x0i; + a[j3 + 1] = wk3i * x0i - wk3r * x0r; + x0r = y1r - y3i; + x0i = y1i - y3r; + a[j3 - 2] = wd3i * x0r + wd3r * x0i; + a[j3 - 1] = wd3i * x0i - wd3r * x0r; + } + wk1r = csc1 * (wd1r + wn4r); + wk1i = csc1 * (wd1i + wn4r); + wk3r = csc3 * (wd3r - wn4r); + wk3i = csc3 * (wd3i - wn4r); + j0 = mh; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j0 - 2] + a[j2 - 2]; + x0i = -a[j0 - 1] - a[j2 - 1]; + x1r = a[j0 - 2] - a[j2 - 2]; + x1i = -a[j0 - 1] + a[j2 - 1]; + x2r = a[j1 - 2] + a[j3 - 2]; + x2i = a[j1 - 1] + a[j3 - 1]; + x3r = a[j1 - 2] - a[j3 - 2]; + x3i = a[j1 - 1] - a[j3 - 1]; + a[j0 - 2] = x0r + x2r; + a[j0 - 1] = x0i - x2i; + a[j1 - 2] = x0r - x2r; + a[j1 - 1] = x0i + x2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[j2 - 2] = wk1r * x0r - wk1i * x0i; + a[j2 - 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r - x3i; + x0i = x1i - x3r; + a[j3 - 2] = wk3r * x0r + wk3i * x0i; + a[j3 - 1] = wk3r * x0i - wk3i * x0r; + x0r = a[j0] + a[j2]; + x0i = -a[j0 + 1] - a[j2 + 1]; + x1r = a[j0] - a[j2]; + x1i = -a[j0 + 1] + a[j2 + 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + a[j0] = x0r + x2r; + a[j0 + 1] = x0i - x2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i + x2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[j2] = wn4r * (x0r - x0i); + a[j2 + 1] = wn4r * (x0i + x0r); + x0r = x1r - x3i; + x0i = x1i - x3r; + a[j3] = -wn4r * (x0r + x0i); + a[j3 + 1] = -wn4r * (x0i - x0r); + x0r = a[j0 + 2] + a[j2 + 2]; + x0i = -a[j0 + 3] - a[j2 + 3]; + x1r = a[j0 + 2] - a[j2 + 2]; + x1i = -a[j0 + 3] + a[j2 + 3]; + x2r = a[j1 + 2] + a[j3 + 2]; + x2i = a[j1 + 3] + a[j3 + 3]; + x3r = a[j1 + 2] - a[j3 + 2]; + x3i = a[j1 + 3] - a[j3 + 3]; + a[j0 + 2] = x0r + x2r; + a[j0 + 3] = x0i - x2i; + a[j1 + 2] = x0r - x2r; + a[j1 + 3] = x0i + x2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[j2 + 2] = wk1i * x0r - wk1r * x0i; + a[j2 + 3] = wk1i * x0i + wk1r * x0r; + x0r = x1r - x3i; + x0i = x1i - x3r; + a[j3 + 2] = wk3i * x0r + wk3r * x0i; + a[j3 + 3] = wk3i * x0i - wk3r * x0r; +} + + +#ifdef USE_CDFT_THREADS +struct cdft_arg_st { + int n0; + int n; + double *a; + int nw; + double *w; +}; +typedef struct cdft_arg_st cdft_arg_t; + + +void cftrec4_th(int n, double *a, int nw, double *w) +{ + void *cftrec1_th(void *p); + void *cftrec2_th(void *p); + int i, idiv4, m, nthread; + cdft_thread_t th[4]; + cdft_arg_t ag[4]; + + nthread = 2; + idiv4 = 0; + m = n >> 1; + if (n > CDFT_4THREADS_BEGIN_N) { + nthread = 4; + idiv4 = 1; + m >>= 1; + } + for (i = 0; i < nthread; i++) { + ag[i].n0 = n; + ag[i].n = m; + ag[i].a = &a[i * m]; + ag[i].nw = nw; + ag[i].w = w; + if (i != idiv4) { + cdft_thread_create(&th[i], cftrec1_th, &ag[i]); + } else { + cdft_thread_create(&th[i], cftrec2_th, &ag[i]); + } + } + for (i = 0; i < nthread; i++) { + cdft_thread_wait(th[i]); + } +} + + +void *cftrec1_th(void *p) +{ + int cfttree(int n, int j, int k, double *a, int nw, double *w); + void cftleaf(int n, int isplt, double *a, int nw, double *w); + void cftmdl1(int n, double *a, double *w); + int isplt, j, k, m, n, n0, nw; + double *a, *w; + + n0 = ((cdft_arg_t *) p)->n0; + n = ((cdft_arg_t *) p)->n; + a = ((cdft_arg_t *) p)->a; + nw = ((cdft_arg_t *) p)->nw; + w = ((cdft_arg_t *) p)->w; + m = n0; + while (m > 512) { + m >>= 2; + cftmdl1(m, &a[n - m], &w[nw - (m >> 1)]); + } + cftleaf(m, 1, &a[n - m], nw, w); + k = 0; + for (j = n - m; j > 0; j -= m) { + k++; + isplt = cfttree(m, j, k, a, nw, w); + cftleaf(m, isplt, &a[j - m], nw, w); + } + return (void *) 0; +} + + +void *cftrec2_th(void *p) +{ + int cfttree(int n, int j, int k, double *a, int nw, double *w); + void cftleaf(int n, int isplt, double *a, int nw, double *w); + void cftmdl2(int n, double *a, double *w); + int isplt, j, k, m, n, n0, nw; + double *a, *w; + + n0 = ((cdft_arg_t *) p)->n0; + n = ((cdft_arg_t *) p)->n; + a = ((cdft_arg_t *) p)->a; + nw = ((cdft_arg_t *) p)->nw; + w = ((cdft_arg_t *) p)->w; + k = 1; + m = n0; + while (m > 512) { + m >>= 2; + k <<= 2; + cftmdl2(m, &a[n - m], &w[nw - m]); + } + cftleaf(m, 0, &a[n - m], nw, w); + k >>= 1; + for (j = n - m; j > 0; j -= m) { + k++; + isplt = cfttree(m, j, k, a, nw, w); + cftleaf(m, isplt, &a[j - m], nw, w); + } + return (void *) 0; +} +#endif /* USE_CDFT_THREADS */ + + +void cftrec4(int n, double *a, int nw, double *w) +{ + int cfttree(int n, int j, int k, double *a, int nw, double *w); + void cftleaf(int n, int isplt, double *a, int nw, double *w); + void cftmdl1(int n, double *a, double *w); + int isplt, j, k, m; + + m = n; + while (m > 512) { + m >>= 2; + cftmdl1(m, &a[n - m], &w[nw - (m >> 1)]); + } + cftleaf(m, 1, &a[n - m], nw, w); + k = 0; + for (j = n - m; j > 0; j -= m) { + k++; + isplt = cfttree(m, j, k, a, nw, w); + cftleaf(m, isplt, &a[j - m], nw, w); + } +} + + +int cfttree(int n, int j, int k, double *a, int nw, double *w) +{ + void cftmdl1(int n, double *a, double *w); + void cftmdl2(int n, double *a, double *w); + int i, isplt, m; + + if ((k & 3) != 0) { + isplt = k & 1; + if (isplt != 0) { + cftmdl1(n, &a[j - n], &w[nw - (n >> 1)]); + } else { + cftmdl2(n, &a[j - n], &w[nw - n]); + } + } else { + m = n; + for (i = k; (i & 3) == 0; i >>= 2) { + m <<= 2; + } + isplt = i & 1; + if (isplt != 0) { + while (m > 128) { + cftmdl1(m, &a[j - m], &w[nw - (m >> 1)]); + m >>= 2; + } + } else { + while (m > 128) { + cftmdl2(m, &a[j - m], &w[nw - m]); + m >>= 2; + } + } + } + return isplt; +} + + +void cftleaf(int n, int isplt, double *a, int nw, double *w) +{ + void cftmdl1(int n, double *a, double *w); + void cftmdl2(int n, double *a, double *w); + void cftf161(double *a, double *w); + void cftf162(double *a, double *w); + void cftf081(double *a, double *w); + void cftf082(double *a, double *w); + + if (n == 512) { + cftmdl1(128, a, &w[nw - 64]); + cftf161(a, &w[nw - 8]); + cftf162(&a[32], &w[nw - 32]); + cftf161(&a[64], &w[nw - 8]); + cftf161(&a[96], &w[nw - 8]); + cftmdl2(128, &a[128], &w[nw - 128]); + cftf161(&a[128], &w[nw - 8]); + cftf162(&a[160], &w[nw - 32]); + cftf161(&a[192], &w[nw - 8]); + cftf162(&a[224], &w[nw - 32]); + cftmdl1(128, &a[256], &w[nw - 64]); + cftf161(&a[256], &w[nw - 8]); + cftf162(&a[288], &w[nw - 32]); + cftf161(&a[320], &w[nw - 8]); + cftf161(&a[352], &w[nw - 8]); + if (isplt != 0) { + cftmdl1(128, &a[384], &w[nw - 64]); + cftf161(&a[480], &w[nw - 8]); + } else { + cftmdl2(128, &a[384], &w[nw - 128]); + cftf162(&a[480], &w[nw - 32]); + } + cftf161(&a[384], &w[nw - 8]); + cftf162(&a[416], &w[nw - 32]); + cftf161(&a[448], &w[nw - 8]); + } else { + cftmdl1(64, a, &w[nw - 32]); + cftf081(a, &w[nw - 8]); + cftf082(&a[16], &w[nw - 8]); + cftf081(&a[32], &w[nw - 8]); + cftf081(&a[48], &w[nw - 8]); + cftmdl2(64, &a[64], &w[nw - 64]); + cftf081(&a[64], &w[nw - 8]); + cftf082(&a[80], &w[nw - 8]); + cftf081(&a[96], &w[nw - 8]); + cftf082(&a[112], &w[nw - 8]); + cftmdl1(64, &a[128], &w[nw - 32]); + cftf081(&a[128], &w[nw - 8]); + cftf082(&a[144], &w[nw - 8]); + cftf081(&a[160], &w[nw - 8]); + cftf081(&a[176], &w[nw - 8]); + if (isplt != 0) { + cftmdl1(64, &a[192], &w[nw - 32]); + cftf081(&a[240], &w[nw - 8]); + } else { + cftmdl2(64, &a[192], &w[nw - 64]); + cftf082(&a[240], &w[nw - 8]); + } + cftf081(&a[192], &w[nw - 8]); + cftf082(&a[208], &w[nw - 8]); + cftf081(&a[224], &w[nw - 8]); + } +} + + +void cftmdl1(int n, double *a, double *w) +{ + int j, j0, j1, j2, j3, k, m, mh; + double wn4r, wk1r, wk1i, wk3r, wk3i; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + mh = n >> 3; + m = 2 * mh; + j1 = m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[0] + a[j2]; + x0i = a[1] + a[j2 + 1]; + x1r = a[0] - a[j2]; + x1i = a[1] - a[j2 + 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + a[0] = x0r + x2r; + a[1] = x0i + x2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i - x2i; + a[j2] = x1r - x3i; + a[j2 + 1] = x1i + x3r; + a[j3] = x1r + x3i; + a[j3 + 1] = x1i - x3r; + wn4r = w[1]; + k = 0; + for (j = 2; j < mh; j += 2) { + k += 4; + wk1r = w[k]; + wk1i = w[k + 1]; + wk3r = w[k + 2]; + wk3i = w[k + 3]; + j1 = j + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j] + a[j2]; + x0i = a[j + 1] + a[j2 + 1]; + x1r = a[j] - a[j2]; + x1i = a[j + 1] - a[j2 + 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j2] = wk1r * x0r - wk1i * x0i; + a[j2 + 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = wk3r * x0r + wk3i * x0i; + a[j3 + 1] = wk3r * x0i - wk3i * x0r; + j0 = m - j; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j0] + a[j2]; + x0i = a[j0 + 1] + a[j2 + 1]; + x1r = a[j0] - a[j2]; + x1i = a[j0 + 1] - a[j2 + 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + a[j0] = x0r + x2r; + a[j0 + 1] = x0i + x2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j2] = wk1i * x0r - wk1r * x0i; + a[j2 + 1] = wk1i * x0i + wk1r * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = wk3i * x0r + wk3r * x0i; + a[j3 + 1] = wk3i * x0i - wk3r * x0r; + } + j0 = mh; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j0] + a[j2]; + x0i = a[j0 + 1] + a[j2 + 1]; + x1r = a[j0] - a[j2]; + x1i = a[j0 + 1] - a[j2 + 1]; + x2r = a[j1] + a[j3]; + x2i = a[j1 + 1] + a[j3 + 1]; + x3r = a[j1] - a[j3]; + x3i = a[j1 + 1] - a[j3 + 1]; + a[j0] = x0r + x2r; + a[j0 + 1] = x0i + x2i; + a[j1] = x0r - x2r; + a[j1 + 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j2] = wn4r * (x0r - x0i); + a[j2 + 1] = wn4r * (x0i + x0r); + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = -wn4r * (x0r + x0i); + a[j3 + 1] = -wn4r * (x0i - x0r); +} + + +void cftmdl2(int n, double *a, double *w) +{ + int j, j0, j1, j2, j3, k, kr, m, mh; + double wn4r, wk1r, wk1i, wk3r, wk3i, wd1r, wd1i, wd3r, wd3i; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, y0r, y0i, y2r, y2i; + + mh = n >> 3; + m = 2 * mh; + wn4r = w[1]; + j1 = m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[0] - a[j2 + 1]; + x0i = a[1] + a[j2]; + x1r = a[0] + a[j2 + 1]; + x1i = a[1] - a[j2]; + x2r = a[j1] - a[j3 + 1]; + x2i = a[j1 + 1] + a[j3]; + x3r = a[j1] + a[j3 + 1]; + x3i = a[j1 + 1] - a[j3]; + y0r = wn4r * (x2r - x2i); + y0i = wn4r * (x2i + x2r); + a[0] = x0r + y0r; + a[1] = x0i + y0i; + a[j1] = x0r - y0r; + a[j1 + 1] = x0i - y0i; + y0r = wn4r * (x3r - x3i); + y0i = wn4r * (x3i + x3r); + a[j2] = x1r - y0i; + a[j2 + 1] = x1i + y0r; + a[j3] = x1r + y0i; + a[j3 + 1] = x1i - y0r; + k = 0; + kr = 2 * m; + for (j = 2; j < mh; j += 2) { + k += 4; + wk1r = w[k]; + wk1i = w[k + 1]; + wk3r = w[k + 2]; + wk3i = w[k + 3]; + kr -= 4; + wd1i = w[kr]; + wd1r = w[kr + 1]; + wd3i = w[kr + 2]; + wd3r = w[kr + 3]; + j1 = j + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j] - a[j2 + 1]; + x0i = a[j + 1] + a[j2]; + x1r = a[j] + a[j2 + 1]; + x1i = a[j + 1] - a[j2]; + x2r = a[j1] - a[j3 + 1]; + x2i = a[j1 + 1] + a[j3]; + x3r = a[j1] + a[j3 + 1]; + x3i = a[j1 + 1] - a[j3]; + y0r = wk1r * x0r - wk1i * x0i; + y0i = wk1r * x0i + wk1i * x0r; + y2r = wd1r * x2r - wd1i * x2i; + y2i = wd1r * x2i + wd1i * x2r; + a[j] = y0r + y2r; + a[j + 1] = y0i + y2i; + a[j1] = y0r - y2r; + a[j1 + 1] = y0i - y2i; + y0r = wk3r * x1r + wk3i * x1i; + y0i = wk3r * x1i - wk3i * x1r; + y2r = wd3r * x3r + wd3i * x3i; + y2i = wd3r * x3i - wd3i * x3r; + a[j2] = y0r + y2r; + a[j2 + 1] = y0i + y2i; + a[j3] = y0r - y2r; + a[j3 + 1] = y0i - y2i; + j0 = m - j; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j0] - a[j2 + 1]; + x0i = a[j0 + 1] + a[j2]; + x1r = a[j0] + a[j2 + 1]; + x1i = a[j0 + 1] - a[j2]; + x2r = a[j1] - a[j3 + 1]; + x2i = a[j1 + 1] + a[j3]; + x3r = a[j1] + a[j3 + 1]; + x3i = a[j1 + 1] - a[j3]; + y0r = wd1i * x0r - wd1r * x0i; + y0i = wd1i * x0i + wd1r * x0r; + y2r = wk1i * x2r - wk1r * x2i; + y2i = wk1i * x2i + wk1r * x2r; + a[j0] = y0r + y2r; + a[j0 + 1] = y0i + y2i; + a[j1] = y0r - y2r; + a[j1 + 1] = y0i - y2i; + y0r = wd3i * x1r + wd3r * x1i; + y0i = wd3i * x1i - wd3r * x1r; + y2r = wk3i * x3r + wk3r * x3i; + y2i = wk3i * x3i - wk3r * x3r; + a[j2] = y0r + y2r; + a[j2 + 1] = y0i + y2i; + a[j3] = y0r - y2r; + a[j3 + 1] = y0i - y2i; + } + wk1r = w[m]; + wk1i = w[m + 1]; + j0 = mh; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + x0r = a[j0] - a[j2 + 1]; + x0i = a[j0 + 1] + a[j2]; + x1r = a[j0] + a[j2 + 1]; + x1i = a[j0 + 1] - a[j2]; + x2r = a[j1] - a[j3 + 1]; + x2i = a[j1 + 1] + a[j3]; + x3r = a[j1] + a[j3 + 1]; + x3i = a[j1 + 1] - a[j3]; + y0r = wk1r * x0r - wk1i * x0i; + y0i = wk1r * x0i + wk1i * x0r; + y2r = wk1i * x2r - wk1r * x2i; + y2i = wk1i * x2i + wk1r * x2r; + a[j0] = y0r + y2r; + a[j0 + 1] = y0i + y2i; + a[j1] = y0r - y2r; + a[j1 + 1] = y0i - y2i; + y0r = wk1i * x1r - wk1r * x1i; + y0i = wk1i * x1i + wk1r * x1r; + y2r = wk1r * x3r - wk1i * x3i; + y2i = wk1r * x3i + wk1i * x3r; + a[j2] = y0r - y2r; + a[j2 + 1] = y0i - y2i; + a[j3] = y0r + y2r; + a[j3 + 1] = y0i + y2i; +} + + +void cftfx41(int n, double *a, int nw, double *w) +{ + void cftf161(double *a, double *w); + void cftf162(double *a, double *w); + void cftf081(double *a, double *w); + void cftf082(double *a, double *w); + + if (n == 128) { + cftf161(a, &w[nw - 8]); + cftf162(&a[32], &w[nw - 32]); + cftf161(&a[64], &w[nw - 8]); + cftf161(&a[96], &w[nw - 8]); + } else { + cftf081(a, &w[nw - 8]); + cftf082(&a[16], &w[nw - 8]); + cftf081(&a[32], &w[nw - 8]); + cftf081(&a[48], &w[nw - 8]); + } +} + + +void cftf161(double *a, double *w) +{ + double wn4r, wk1r, wk1i, + x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, + y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, + y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i, + y8r, y8i, y9r, y9i, y10r, y10i, y11r, y11i, + y12r, y12i, y13r, y13i, y14r, y14i, y15r, y15i; + + wn4r = w[1]; + wk1r = w[2]; + wk1i = w[3]; + x0r = a[0] + a[16]; + x0i = a[1] + a[17]; + x1r = a[0] - a[16]; + x1i = a[1] - a[17]; + x2r = a[8] + a[24]; + x2i = a[9] + a[25]; + x3r = a[8] - a[24]; + x3i = a[9] - a[25]; + y0r = x0r + x2r; + y0i = x0i + x2i; + y4r = x0r - x2r; + y4i = x0i - x2i; + y8r = x1r - x3i; + y8i = x1i + x3r; + y12r = x1r + x3i; + y12i = x1i - x3r; + x0r = a[2] + a[18]; + x0i = a[3] + a[19]; + x1r = a[2] - a[18]; + x1i = a[3] - a[19]; + x2r = a[10] + a[26]; + x2i = a[11] + a[27]; + x3r = a[10] - a[26]; + x3i = a[11] - a[27]; + y1r = x0r + x2r; + y1i = x0i + x2i; + y5r = x0r - x2r; + y5i = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + y9r = wk1r * x0r - wk1i * x0i; + y9i = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + y13r = wk1i * x0r - wk1r * x0i; + y13i = wk1i * x0i + wk1r * x0r; + x0r = a[4] + a[20]; + x0i = a[5] + a[21]; + x1r = a[4] - a[20]; + x1i = a[5] - a[21]; + x2r = a[12] + a[28]; + x2i = a[13] + a[29]; + x3r = a[12] - a[28]; + x3i = a[13] - a[29]; + y2r = x0r + x2r; + y2i = x0i + x2i; + y6r = x0r - x2r; + y6i = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + y10r = wn4r * (x0r - x0i); + y10i = wn4r * (x0i + x0r); + x0r = x1r + x3i; + x0i = x1i - x3r; + y14r = wn4r * (x0r + x0i); + y14i = wn4r * (x0i - x0r); + x0r = a[6] + a[22]; + x0i = a[7] + a[23]; + x1r = a[6] - a[22]; + x1i = a[7] - a[23]; + x2r = a[14] + a[30]; + x2i = a[15] + a[31]; + x3r = a[14] - a[30]; + x3i = a[15] - a[31]; + y3r = x0r + x2r; + y3i = x0i + x2i; + y7r = x0r - x2r; + y7i = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + y11r = wk1i * x0r - wk1r * x0i; + y11i = wk1i * x0i + wk1r * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + y15r = wk1r * x0r - wk1i * x0i; + y15i = wk1r * x0i + wk1i * x0r; + x0r = y12r - y14r; + x0i = y12i - y14i; + x1r = y12r + y14r; + x1i = y12i + y14i; + x2r = y13r - y15r; + x2i = y13i - y15i; + x3r = y13r + y15r; + x3i = y13i + y15i; + a[24] = x0r + x2r; + a[25] = x0i + x2i; + a[26] = x0r - x2r; + a[27] = x0i - x2i; + a[28] = x1r - x3i; + a[29] = x1i + x3r; + a[30] = x1r + x3i; + a[31] = x1i - x3r; + x0r = y8r + y10r; + x0i = y8i + y10i; + x1r = y8r - y10r; + x1i = y8i - y10i; + x2r = y9r + y11r; + x2i = y9i + y11i; + x3r = y9r - y11r; + x3i = y9i - y11i; + a[16] = x0r + x2r; + a[17] = x0i + x2i; + a[18] = x0r - x2r; + a[19] = x0i - x2i; + a[20] = x1r - x3i; + a[21] = x1i + x3r; + a[22] = x1r + x3i; + a[23] = x1i - x3r; + x0r = y5r - y7i; + x0i = y5i + y7r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + x0r = y5r + y7i; + x0i = y5i - y7r; + x3r = wn4r * (x0r - x0i); + x3i = wn4r * (x0i + x0r); + x0r = y4r - y6i; + x0i = y4i + y6r; + x1r = y4r + y6i; + x1i = y4i - y6r; + a[8] = x0r + x2r; + a[9] = x0i + x2i; + a[10] = x0r - x2r; + a[11] = x0i - x2i; + a[12] = x1r - x3i; + a[13] = x1i + x3r; + a[14] = x1r + x3i; + a[15] = x1i - x3r; + x0r = y0r + y2r; + x0i = y0i + y2i; + x1r = y0r - y2r; + x1i = y0i - y2i; + x2r = y1r + y3r; + x2i = y1i + y3i; + x3r = y1r - y3r; + x3i = y1i - y3i; + a[0] = x0r + x2r; + a[1] = x0i + x2i; + a[2] = x0r - x2r; + a[3] = x0i - x2i; + a[4] = x1r - x3i; + a[5] = x1i + x3r; + a[6] = x1r + x3i; + a[7] = x1i - x3r; +} + + +void cftf162(double *a, double *w) +{ + double wn4r, wk1r, wk1i, wk2r, wk2i, wk3r, wk3i, + x0r, x0i, x1r, x1i, x2r, x2i, + y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, + y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i, + y8r, y8i, y9r, y9i, y10r, y10i, y11r, y11i, + y12r, y12i, y13r, y13i, y14r, y14i, y15r, y15i; + + wn4r = w[1]; + wk1r = w[4]; + wk1i = w[5]; + wk3r = w[6]; + wk3i = -w[7]; + wk2r = w[8]; + wk2i = w[9]; + x1r = a[0] - a[17]; + x1i = a[1] + a[16]; + x0r = a[8] - a[25]; + x0i = a[9] + a[24]; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + y0r = x1r + x2r; + y0i = x1i + x2i; + y4r = x1r - x2r; + y4i = x1i - x2i; + x1r = a[0] + a[17]; + x1i = a[1] - a[16]; + x0r = a[8] + a[25]; + x0i = a[9] - a[24]; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + y8r = x1r - x2i; + y8i = x1i + x2r; + y12r = x1r + x2i; + y12i = x1i - x2r; + x0r = a[2] - a[19]; + x0i = a[3] + a[18]; + x1r = wk1r * x0r - wk1i * x0i; + x1i = wk1r * x0i + wk1i * x0r; + x0r = a[10] - a[27]; + x0i = a[11] + a[26]; + x2r = wk3i * x0r - wk3r * x0i; + x2i = wk3i * x0i + wk3r * x0r; + y1r = x1r + x2r; + y1i = x1i + x2i; + y5r = x1r - x2r; + y5i = x1i - x2i; + x0r = a[2] + a[19]; + x0i = a[3] - a[18]; + x1r = wk3r * x0r - wk3i * x0i; + x1i = wk3r * x0i + wk3i * x0r; + x0r = a[10] + a[27]; + x0i = a[11] - a[26]; + x2r = wk1r * x0r + wk1i * x0i; + x2i = wk1r * x0i - wk1i * x0r; + y9r = x1r - x2r; + y9i = x1i - x2i; + y13r = x1r + x2r; + y13i = x1i + x2i; + x0r = a[4] - a[21]; + x0i = a[5] + a[20]; + x1r = wk2r * x0r - wk2i * x0i; + x1i = wk2r * x0i + wk2i * x0r; + x0r = a[12] - a[29]; + x0i = a[13] + a[28]; + x2r = wk2i * x0r - wk2r * x0i; + x2i = wk2i * x0i + wk2r * x0r; + y2r = x1r + x2r; + y2i = x1i + x2i; + y6r = x1r - x2r; + y6i = x1i - x2i; + x0r = a[4] + a[21]; + x0i = a[5] - a[20]; + x1r = wk2i * x0r - wk2r * x0i; + x1i = wk2i * x0i + wk2r * x0r; + x0r = a[12] + a[29]; + x0i = a[13] - a[28]; + x2r = wk2r * x0r - wk2i * x0i; + x2i = wk2r * x0i + wk2i * x0r; + y10r = x1r - x2r; + y10i = x1i - x2i; + y14r = x1r + x2r; + y14i = x1i + x2i; + x0r = a[6] - a[23]; + x0i = a[7] + a[22]; + x1r = wk3r * x0r - wk3i * x0i; + x1i = wk3r * x0i + wk3i * x0r; + x0r = a[14] - a[31]; + x0i = a[15] + a[30]; + x2r = wk1i * x0r - wk1r * x0i; + x2i = wk1i * x0i + wk1r * x0r; + y3r = x1r + x2r; + y3i = x1i + x2i; + y7r = x1r - x2r; + y7i = x1i - x2i; + x0r = a[6] + a[23]; + x0i = a[7] - a[22]; + x1r = wk1i * x0r + wk1r * x0i; + x1i = wk1i * x0i - wk1r * x0r; + x0r = a[14] + a[31]; + x0i = a[15] - a[30]; + x2r = wk3i * x0r - wk3r * x0i; + x2i = wk3i * x0i + wk3r * x0r; + y11r = x1r + x2r; + y11i = x1i + x2i; + y15r = x1r - x2r; + y15i = x1i - x2i; + x1r = y0r + y2r; + x1i = y0i + y2i; + x2r = y1r + y3r; + x2i = y1i + y3i; + a[0] = x1r + x2r; + a[1] = x1i + x2i; + a[2] = x1r - x2r; + a[3] = x1i - x2i; + x1r = y0r - y2r; + x1i = y0i - y2i; + x2r = y1r - y3r; + x2i = y1i - y3i; + a[4] = x1r - x2i; + a[5] = x1i + x2r; + a[6] = x1r + x2i; + a[7] = x1i - x2r; + x1r = y4r - y6i; + x1i = y4i + y6r; + x0r = y5r - y7i; + x0i = y5i + y7r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + a[8] = x1r + x2r; + a[9] = x1i + x2i; + a[10] = x1r - x2r; + a[11] = x1i - x2i; + x1r = y4r + y6i; + x1i = y4i - y6r; + x0r = y5r + y7i; + x0i = y5i - y7r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + a[12] = x1r - x2i; + a[13] = x1i + x2r; + a[14] = x1r + x2i; + a[15] = x1i - x2r; + x1r = y8r + y10r; + x1i = y8i + y10i; + x2r = y9r - y11r; + x2i = y9i - y11i; + a[16] = x1r + x2r; + a[17] = x1i + x2i; + a[18] = x1r - x2r; + a[19] = x1i - x2i; + x1r = y8r - y10r; + x1i = y8i - y10i; + x2r = y9r + y11r; + x2i = y9i + y11i; + a[20] = x1r - x2i; + a[21] = x1i + x2r; + a[22] = x1r + x2i; + a[23] = x1i - x2r; + x1r = y12r - y14i; + x1i = y12i + y14r; + x0r = y13r + y15i; + x0i = y13i - y15r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + a[24] = x1r + x2r; + a[25] = x1i + x2i; + a[26] = x1r - x2r; + a[27] = x1i - x2i; + x1r = y12r + y14i; + x1i = y12i - y14r; + x0r = y13r - y15i; + x0i = y13i + y15r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + a[28] = x1r - x2i; + a[29] = x1i + x2r; + a[30] = x1r + x2i; + a[31] = x1i - x2r; +} + + +void cftf081(double *a, double *w) +{ + double wn4r, x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, + y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, + y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i; + + wn4r = w[1]; + x0r = a[0] + a[8]; + x0i = a[1] + a[9]; + x1r = a[0] - a[8]; + x1i = a[1] - a[9]; + x2r = a[4] + a[12]; + x2i = a[5] + a[13]; + x3r = a[4] - a[12]; + x3i = a[5] - a[13]; + y0r = x0r + x2r; + y0i = x0i + x2i; + y2r = x0r - x2r; + y2i = x0i - x2i; + y1r = x1r - x3i; + y1i = x1i + x3r; + y3r = x1r + x3i; + y3i = x1i - x3r; + x0r = a[2] + a[10]; + x0i = a[3] + a[11]; + x1r = a[2] - a[10]; + x1i = a[3] - a[11]; + x2r = a[6] + a[14]; + x2i = a[7] + a[15]; + x3r = a[6] - a[14]; + x3i = a[7] - a[15]; + y4r = x0r + x2r; + y4i = x0i + x2i; + y6r = x0r - x2r; + y6i = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + x2r = x1r + x3i; + x2i = x1i - x3r; + y5r = wn4r * (x0r - x0i); + y5i = wn4r * (x0r + x0i); + y7r = wn4r * (x2r - x2i); + y7i = wn4r * (x2r + x2i); + a[8] = y1r + y5r; + a[9] = y1i + y5i; + a[10] = y1r - y5r; + a[11] = y1i - y5i; + a[12] = y3r - y7i; + a[13] = y3i + y7r; + a[14] = y3r + y7i; + a[15] = y3i - y7r; + a[0] = y0r + y4r; + a[1] = y0i + y4i; + a[2] = y0r - y4r; + a[3] = y0i - y4i; + a[4] = y2r - y6i; + a[5] = y2i + y6r; + a[6] = y2r + y6i; + a[7] = y2i - y6r; +} + + +void cftf082(double *a, double *w) +{ + double wn4r, wk1r, wk1i, x0r, x0i, x1r, x1i, + y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, + y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i; + + wn4r = w[1]; + wk1r = w[2]; + wk1i = w[3]; + y0r = a[0] - a[9]; + y0i = a[1] + a[8]; + y1r = a[0] + a[9]; + y1i = a[1] - a[8]; + x0r = a[4] - a[13]; + x0i = a[5] + a[12]; + y2r = wn4r * (x0r - x0i); + y2i = wn4r * (x0i + x0r); + x0r = a[4] + a[13]; + x0i = a[5] - a[12]; + y3r = wn4r * (x0r - x0i); + y3i = wn4r * (x0i + x0r); + x0r = a[2] - a[11]; + x0i = a[3] + a[10]; + y4r = wk1r * x0r - wk1i * x0i; + y4i = wk1r * x0i + wk1i * x0r; + x0r = a[2] + a[11]; + x0i = a[3] - a[10]; + y5r = wk1i * x0r - wk1r * x0i; + y5i = wk1i * x0i + wk1r * x0r; + x0r = a[6] - a[15]; + x0i = a[7] + a[14]; + y6r = wk1i * x0r - wk1r * x0i; + y6i = wk1i * x0i + wk1r * x0r; + x0r = a[6] + a[15]; + x0i = a[7] - a[14]; + y7r = wk1r * x0r - wk1i * x0i; + y7i = wk1r * x0i + wk1i * x0r; + x0r = y0r + y2r; + x0i = y0i + y2i; + x1r = y4r + y6r; + x1i = y4i + y6i; + a[0] = x0r + x1r; + a[1] = x0i + x1i; + a[2] = x0r - x1r; + a[3] = x0i - x1i; + x0r = y0r - y2r; + x0i = y0i - y2i; + x1r = y4r - y6r; + x1i = y4i - y6i; + a[4] = x0r - x1i; + a[5] = x0i + x1r; + a[6] = x0r + x1i; + a[7] = x0i - x1r; + x0r = y1r - y3i; + x0i = y1i + y3r; + x1r = y5r - y7r; + x1i = y5i - y7i; + a[8] = x0r + x1r; + a[9] = x0i + x1i; + a[10] = x0r - x1r; + a[11] = x0i - x1i; + x0r = y1r + y3i; + x0i = y1i - y3r; + x1r = y5r + y7r; + x1i = y5i + y7i; + a[12] = x0r - x1i; + a[13] = x0i + x1r; + a[14] = x0r + x1i; + a[15] = x0i - x1r; +} + + +void cftf040(double *a) +{ + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + x0r = a[0] + a[4]; + x0i = a[1] + a[5]; + x1r = a[0] - a[4]; + x1i = a[1] - a[5]; + x2r = a[2] + a[6]; + x2i = a[3] + a[7]; + x3r = a[2] - a[6]; + x3i = a[3] - a[7]; + a[0] = x0r + x2r; + a[1] = x0i + x2i; + a[2] = x1r - x3i; + a[3] = x1i + x3r; + a[4] = x0r - x2r; + a[5] = x0i - x2i; + a[6] = x1r + x3i; + a[7] = x1i - x3r; +} + + +void cftb040(double *a) +{ + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + x0r = a[0] + a[4]; + x0i = a[1] + a[5]; + x1r = a[0] - a[4]; + x1i = a[1] - a[5]; + x2r = a[2] + a[6]; + x2i = a[3] + a[7]; + x3r = a[2] - a[6]; + x3i = a[3] - a[7]; + a[0] = x0r + x2r; + a[1] = x0i + x2i; + a[2] = x1r + x3i; + a[3] = x1i - x3r; + a[4] = x0r - x2r; + a[5] = x0i - x2i; + a[6] = x1r - x3i; + a[7] = x1i + x3r; +} + + +void cftx020(double *a) +{ + double x0r, x0i; + + x0r = a[0] - a[2]; + x0i = a[1] - a[3]; + a[0] += a[2]; + a[1] += a[3]; + a[2] = x0r; + a[3] = x0i; +} + + +void rftfsub(int n, double *a, int nc, double *c) +{ + int j, k, kk, ks, m; + double wkr, wki, xr, xi, yr, yi; + + m = n >> 1; + ks = 2 * nc / m; + kk = 0; + for (j = 2; j < m; j += 2) { + k = n - j; + kk += ks; + wkr = 0.5 - c[nc - kk]; + wki = c[kk]; + xr = a[j] - a[k]; + xi = a[j + 1] + a[k + 1]; + yr = wkr * xr - wki * xi; + yi = wkr * xi + wki * xr; + a[j] -= yr; + a[j + 1] -= yi; + a[k] += yr; + a[k + 1] -= yi; + } +} + + +void rftbsub(int n, double *a, int nc, double *c) +{ + int j, k, kk, ks, m; + double wkr, wki, xr, xi, yr, yi; + + m = n >> 1; + ks = 2 * nc / m; + kk = 0; + for (j = 2; j < m; j += 2) { + k = n - j; + kk += ks; + wkr = 0.5 - c[nc - kk]; + wki = c[kk]; + xr = a[j] - a[k]; + xi = a[j + 1] + a[k + 1]; + yr = wkr * xr + wki * xi; + yi = wkr * xi - wki * xr; + a[j] -= yr; + a[j + 1] -= yi; + a[k] += yr; + a[k + 1] -= yi; + } +} + + +void dctsub(int n, double *a, int nc, double *c) +{ + int j, k, kk, ks, m; + double wkr, wki, xr; + + m = n >> 1; + ks = nc / n; + kk = 0; + for (j = 1; j < m; j++) { + k = n - j; + kk += ks; + wkr = c[kk] - c[nc - kk]; + wki = c[kk] + c[nc - kk]; + xr = wki * a[j] - wkr * a[k]; + a[j] = wkr * a[j] + wki * a[k]; + a[k] = xr; + } + a[m] *= c[0]; +} + + +void dstsub(int n, double *a, int nc, double *c) +{ + int j, k, kk, ks, m; + double wkr, wki, xr; + + m = n >> 1; + ks = nc / n; + kk = 0; + for (j = 1; j < m; j++) { + k = n - j; + kk += ks; + wkr = c[kk] - c[nc - kk]; + wki = c[kk] + c[nc - kk]; + xr = wki * a[k] - wkr * a[j]; + a[k] = wkr * a[k] + wki * a[j]; + a[j] = xr; + } + a[m] *= c[0]; +} + diff --git a/src/projectM-engine-backup/fftsg.h b/src/projectM-engine-backup/fftsg.h new file mode 100755 index 000000000..ff9da6e41 --- /dev/null +++ b/src/projectM-engine-backup/fftsg.h @@ -0,0 +1,35 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: fftsg.h,v 1.1.1.1 2005/12/23 18:05:00 psperl Exp $ + * + * Wrapper for rdft() and friends + * + * $Log$ + */ + +#ifndef _FFTSG_H +#define _FFTSG_H + +extern void rdft(int n, int isgn, double *a, int *ip, double *w); + +#endif /** !_FFTSG_H */ + diff --git a/src/projectM-engine-backup/fonts b/src/projectM-engine-backup/fonts new file mode 120000 index 000000000..8b289e24f --- /dev/null +++ b/src/projectM-engine-backup/fonts @@ -0,0 +1 @@ +../../fonts \ No newline at end of file diff --git a/src/projectM-engine-backup/glConsole.cpp b/src/projectM-engine-backup/glConsole.cpp new file mode 100755 index 000000000..580d6b354 --- /dev/null +++ b/src/projectM-engine-backup/glConsole.cpp @@ -0,0 +1,1028 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: glConsole.c,v 1.2 2005/12/28 18:51:18 psperl Exp $ + * + * Encapsulation of an OpenGL-based console + * + */ + +#include +#include +#include +#include +#ifdef MACOS +#include +#endif /** MACOS */ +#include + +#include "projectM.hpp" + +#ifdef MACOS +#include +#else +#include +#endif /** MACOS */ +#include "glConsole.h" +#include "Common.hpp" +#include "fatal.h" + +#include "wipemalloc.h" + +#ifdef USE_FTGL +#include +#include +#endif /** USE_FTGL */ + +#define HEIGHT_SPACE 8 /* pixel space between lines */ +#define DEFAULT_CONSOLE_FOREGROUND_COLOR CONSOLE_WHITE +#define DEFAULT_CONSOLE_BACKGROUND_COLOR CONSOLE_BLACK +#define DEFAULT_CURSOR_COLOR CONSOLE_GREEN +#define CURSOR_REFRESH_RATE 10 + +static int gl_console_set_color(color_t color); +int clear_console_screen_buffer(gl_console_t * gl_console); +int clear_console_scroll_buffer(gl_console_t * gl_console); +//float screen_width = 800; +//float screen_height = 600; + +extern projectM *PM; +int refresh_count = 0; + +/* Creates a new console of (width X height) with left corner at + (x, y) */ +gl_console_t * glConsoleCreate(int screen_width, int screen_height, int scroll_width, int scroll_height, + float start_x, float start_y, int Font_Descriptor) { + + console_char_t * buffer; + gl_console_t * gl_console; + + if ((screen_width > MAX_CONSOLE_WIDTH) || (screen_width < 1)) + return NULL; + + if ((screen_height > MAX_CONSOLE_HEIGHT) || (screen_height < 1)) + return NULL; + + if ((gl_console = (gl_console_t*)wipemalloc(sizeof(gl_console_t))) == NULL) + return NULL; + + if ((scroll_height < screen_height)) + return NULL; + + if ((scroll_width < screen_width)) + return NULL; + + if ((buffer = (console_char_t*)wipemalloc(scroll_width*scroll_height*sizeof(console_char_t))) == NULL) + return NULL; + /* Need to know height and width of screen so we can see if the + if x and y are valid, will do later */ + + /* Set struct parameters */ + gl_console->screen_buffer = buffer; + gl_console->font_descriptor = Font_Descriptor; + gl_console->screen_width = screen_width; + gl_console->screen_height = screen_height; + gl_console->scroll_width = scroll_width; + gl_console->scroll_height = scroll_height; + gl_console->start_x = start_x; /* x coordinate of console's upper left corner */ + gl_console->start_y = start_y; /* y coordinate of console's upper left corner */ + gl_console->screen_start_x = gl_console->screen_start_y = 0; + gl_console->screen_x = gl_console->screen_y = 0; /* set cursor positions to zero */ + gl_console->cursor_ptr = buffer; /* start cursor pointer at beginning of buffer */ + gl_console->current_fg = DEFAULT_CONSOLE_FOREGROUND_COLOR; + gl_console->current_bg = DEFAULT_CONSOLE_BACKGROUND_COLOR; + gl_console->scroll_buffer = buffer; + gl_console->cursor_color = DEFAULT_CURSOR_COLOR; + gl_console->cursor_style = BAR_STYLE; + gl_console->flags = 0; + /* Clears the console buffer */ + clear_console_scroll_buffer(gl_console); + + if (GL_CONSOLE_DEBUG) printf("glConsoleCreate: finished initializing\n"); + + /* Finished, return new console */ + return gl_console; +} + +/* Destroy the passed console */ +int glConsoleDestroy(gl_console_t * console) { + + if (console == NULL) + return PROJECTM_FAILURE; + + free(console->scroll_buffer); + free(console); + + console = NULL; + + return PROJECTM_SUCCESS; + +} + + +int glConsoleClearScreen(gl_console_t * console) { + + if (console == NULL) + return PROJECTM_FAILURE; + + clear_console_screen_buffer(console); + + return PROJECTM_SUCCESS; +} + + +int glConsoleClearBuffer(gl_console_t * console) { + + if (console == NULL) + return PROJECTM_FAILURE; + + clear_console_scroll_buffer(console); + glConsoleAlignCursorLeft(console); + glConsoleAlignCursorUp(console); + + return PROJECTM_SUCCESS; +} + +/* Aligns cursor to the next character 'c' */ +int glConsoleCursorToNextChar(char c, gl_console_t * gl_console) { + + console_char_t * endofbuf; + if (gl_console == NULL) + return PROJECTM_FAILURE; + + endofbuf = gl_console->scroll_buffer + (gl_console->scroll_width*gl_console->scroll_height) - 1; + + while ((gl_console->cursor_ptr != endofbuf) && (gl_console->cursor_ptr->symbol != c)) + glConsoleMoveCursorForward(gl_console); + + return PROJECTM_SUCCESS; + +} + +int glConsoleMoveCursorUp(gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* The screen buffer is at the top and so is the screen cursor */ + if ((gl_console->screen_start_y == 0) && (gl_console->screen_y == 0)) { + + /* Wrap up flag specified, move cursor to bottom of screen */ + if (gl_console->flags & CONSOLE_FLAG_SCROLL_WRAP_UP) { + glConsoleAlignCursorDown(gl_console); + } + + + /* Do nothing instead */ + + } + /* The screen cursor is at the top but not the screen buffer */ + else if (gl_console->screen_y == 0){ + + /* screen_y stays the same, since it scrolls up one */ + + /* Decrement the cursor_ptr by one line */ + gl_console->cursor_ptr -= gl_console->scroll_width; + + /* Decrement starting 'y' position of the screen buffer */ + gl_console->screen_start_y--; + + /* Decrement the screen buffer by one line */ + gl_console->screen_buffer -= gl_console->scroll_width; + + + } + /* General case, not at top or bottoom */ + else { + gl_console->screen_y--; + gl_console->cursor_ptr -= gl_console->scroll_width; + } + + return PROJECTM_SUCCESS; +} + + +int glConsoleMoveCursorDown(gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* The screen buffer is at the bottom and so is the screen cursor, this may not ever + happen */ + if (gl_console->screen_start_y == (gl_console->scroll_height - gl_console->screen_height)) { + if (gl_console->screen_y == (gl_console->screen_height - 1)) { + // printf("BOTTOM AND END\n"); + /* Wrap down to up enabled */ + if (gl_console->flags & CONSOLE_FLAG_SCROLL_WRAP_DOWN) { + glConsoleAlignCursorUp(gl_console); + } + + /* Otherwise, do nothing */ + } + } + + /* The screen cursor is at the bottom but not the end of the scroll buffer */ + else if (gl_console->screen_y == (gl_console->screen_height - 1)) { + + // printf("BOTTOM BUT NOT END\n"); + /* screen_y stays the same, since it scrolls down one */ + + /* Increment the cursor_ptr by one line */ + gl_console->cursor_ptr += gl_console->scroll_width; + + /* Increment starting 'y' position of the screen buffer */ + gl_console->screen_start_y++; + + /* Increment the screen buffer by one line */ + gl_console->screen_buffer += gl_console->scroll_width; + + + } + + /* General case, not at top or bottoom */ + else { + // printf("GENERAL CASE\n"); + gl_console->screen_y++; + gl_console->cursor_ptr += gl_console->scroll_width; + } + + return PROJECTM_SUCCESS; +} + +/* Move the console forward one character, wrap around is the current behavior */ +int glConsoleMoveCursorForward(gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + + /* The case where the end of the screen is reached and the end of the scroll buffer */ + if ((gl_console->screen_start_x + gl_console->screen_width) == (gl_console->scroll_width)) { + if ((gl_console->screen_x) == (gl_console->screen_width - 1)) { + + /* Wrap around to next line if this flag is enabled */ + if (gl_console->flags & CONSOLE_FLAG_SCROLL_WRAP_RIGHT) { + /* Down one and to the left */ + glConsoleMoveCursorDown(gl_console); + glConsoleAlignCursorLeft(gl_console); + } + + /* Otherwise do nothing */ + } + } + + /* The case where the end of the screen is reach, but the not end of the scroll buffer */ + else if (gl_console->screen_x == (gl_console->screen_width - 1)) { + + /* screen_x doesn't change because the whole console is shifted left */ + /* screen_y doesn't change because we haven't reached the end of the scroll buffer */ + + gl_console->cursor_ptr++; /* increment cursor pointer */ + gl_console->screen_buffer++; /* move the screen buffer right one */ + gl_console->screen_start_x++; /* incrementing the start of the screen 'x' variable */ + } + + /* The most common case, no scrolling required. In other words, the cursor is at some + arbitrary non end point position */ + else { + gl_console->screen_x++; /* increment x variable */ + gl_console->cursor_ptr++; /* increment cursor pointer */ + } + + return PROJECTM_SUCCESS; +} + + +/* Moves the cursor backward one space */ +int glConsoleMoveCursorBackward(gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* The case where the beginning of the screen is reached and the beginning of the scroll buffer */ + if ((gl_console->screen_start_x == 0) && (gl_console->screen_x == 0)) { + if (gl_console->flags & CONSOLE_FLAG_SCROLL_WRAP_LEFT) { + glConsoleMoveCursorUp(gl_console); + glConsoleAlignCursorRight(gl_console); + } + + } + + /* The case where the beginning of the screen is reach, but the not beginning of the scroll buffer */ + else if (gl_console->screen_x == 0) { + gl_console->cursor_ptr--; /* decrement cursor pointer */ + gl_console->screen_buffer--; /* move the screen buffer left one */ + gl_console->screen_start_x--; /* decrement the start of the screen 'x' variable */ + } + + /* The most common case, no scrolling required. In other words, the cursor is at some + arbitrary non end point position */ + else { + gl_console->screen_x--; /* increment x variable */ + gl_console->cursor_ptr--; /* increment cursor pointer */ + } + + /* Finised, return success */ + return PROJECTM_SUCCESS; +} + +/* Sets the cursor position to (x,y) of the passed console */ +int glConsoleSetCursorPos(int x, int y, gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* Bound checks */ + if ((x < 0) || (x > (gl_console->scroll_width-1))) + return PROJECTM_FAILURE; + + if ((y < 0) || (y > (gl_console->scroll_height-1))) + return PROJECTM_FAILURE; + + + /* Set cursor ptr to new screen location. This variable does not depend on if the + screen needs to be scrolled */ + gl_console->cursor_ptr = gl_console->scroll_buffer + (y * gl_console->scroll_width) + x; + + /* Goal 1: Determine what needs to be changed on the X axis */ + + + /* Case (i): x coordinate is less than the starting screen buffer x coordinate. Must + shift the screen buffer left by difference of the two coordinates */ + if (x < gl_console->screen_start_x) { + // printf("X: case (i)\n"); + + /* Align x offset to new x corodinate */ + gl_console->screen_start_x = x; + + /* Set screen_x to zero because we are left edge aligned in the screen buffer */ + gl_console->screen_x = 0; + + } + + /* Case (ii): x coordinate is greater than farthest screen buffer x coordinate. Must + shift the screen buffer right by difference of the two coordinates */ + else if (x > (gl_console->screen_start_x+gl_console->screen_width-1)) { + // printf("X: case (ii)\n"); + + /* Align end of screen buffer X coordinate space to new x coordinate */ + gl_console->screen_start_x = x - (gl_console->screen_width - 1); + + /* Set screen_x to right edge of screen buffer because we are right aligned to the new x coordinate */ + gl_console->screen_x = gl_console->screen_width - 1; + } + + /* CASE (iii): x coordinate must lie within the current screen buffer rectangle. No need to + shift the screen buffer on the X axis */ + else { + // printf("X: case (iii)\n"); + + /* Set the new screen coordinate to the passed in x coordinate minus the starting screen buffer distance */ + gl_console->screen_x = x - gl_console->screen_start_x; + + } + + + /* Goal 2: Determine what needs to be changed on the Y axis */ + + /* Case (i): y coordinate is less than the starting screen buffer y coordinate. Must + shift the screen buffer up by difference of the two coordinates */ + if (y < gl_console->screen_start_y) { + // printf("Y: case (i) y = %d, start_y = %d\n", y, gl_console->screen_start_y); + + /* Align y offset to new y corodinate */ + gl_console->screen_start_y = y; + + /* Set screen_y to zero because we are top aligned in the screen buffer */ + gl_console->screen_y = 0; + + } + + /* Case (ii): y coordinate is greater than loweest screen buffer y coordinate. Must + shift the screen buffer down by difference of the two coordinates */ + else if (y > (gl_console->screen_start_y+gl_console->screen_height-1)) { + // printf("Y: case (ii)\n"); + + /* Align end of screen buffer Y coordinate space to new y coordinate */ + gl_console->screen_start_y = y - (gl_console->screen_height-1); + + /* Set screen_y to bottom edge of screen buffer because we are bottom aligned to the new y coordinate */ + gl_console->screen_y = gl_console->screen_height - 1; + } + + /* CASE (iii): y coordinate must lie within the current screen buffer rectangle. No need to + shift the screen buffer on the Y axis */ + + else { + // printf("Y: case (iii)\n"); + /* Set the new screen coordinate to the passed in y coordinate minus the starting screen buffer distance */ + gl_console->screen_y = y - gl_console->screen_start_y; + + } + + + /* Re-adjust screen buffer ptr based on computed screen starting coordinates */ + gl_console->screen_buffer = gl_console->scroll_buffer + (gl_console->screen_start_y*gl_console->screen_width) + + gl_console->screen_start_x; + + + return PROJECTM_SUCCESS; +} + +/* Sets 'x' and 'y' to the console coordinates of the current cursor position */ +int glConsoleGetCursorPos(int * x, int * y, gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* Null arguments passed, bail */ + if ((x == NULL) || (y == NULL)) + return PROJECTM_FAILURE; + + /* Set coordinates with appropiate offset */ + *x = gl_console->screen_x + gl_console->screen_start_x; + *y = gl_console->screen_y + gl_console->screen_start_y; + + return PROJECTM_SUCCESS; +} + +/* Helper function that changes the current color */ +static int gl_console_set_color(color_t color) { + + switch (color) { + + case CONSOLE_BLACK: + glColor4f(0, 0, 0, 1); + break; + case CONSOLE_RED: + glColor4f(1, 0, 0, 1); + break; + case CONSOLE_GREEN: + glColor4f(0, 1, 0, 1); + break; + case CONSOLE_WHITE: + glColor4f(1, 1, 1, 1); + break; + case CONSOLE_BLUE: + glColor4f(0, 0, 1, 1); + break; + case CONSOLE_TRANS: + glColor4f(0, 0, 0, 0); + break; + default: /* hmm, use white I guess */ + glColor4f(1, 1, 1, 1); + } + + return PROJECTM_SUCCESS; +} + +/* Sets the passed console to a new foreground */ +int glConsoleSetFGColor(color_t color, gl_console_t * gl_console) { + + if (gl_console == NULL) + return PROJECTM_FAILURE; + + gl_console->current_fg = color; + + return PROJECTM_SUCCESS; +} + +/* Sets the passed console to a new background */ +int glConsoleSetBGColor(color_t color, gl_console_t * gl_console) { + + if (gl_console == NULL) + return PROJECTM_FAILURE; + + gl_console->current_bg = color; + + return PROJECTM_SUCCESS; +} + +/* Sets the cursor color */ +int glConsoleSetCursorColor(color_t color, gl_console_t * gl_console) { + + if (gl_console == NULL) + return PROJECTM_FAILURE; + + gl_console->cursor_color = color; + + return PROJECTM_SUCCESS; +} + +/* Prints a string starting from the current cursor position */ +int glConsolePrintString(char * s, gl_console_t * gl_console) { + + int len; + int i; + console_char_t console_char; + char symbol; + + /* Null argument checks */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + if (s == NULL) + return PROJECTM_FAILURE; + + /* Set the console struct to correct fg and bg values. + The character value will change in the for loop */ + console_char.fg_color = gl_console->current_fg; + console_char.bg_color = gl_console->current_bg; + console_char.symbol = 0; + + /* Calculate length of the string */ + len = strlen(s); + + + for (i = 0; i < len; i++) { + + /* Case on the type of character */ + + switch (symbol = *(s+i)) { + + case '\r': + case '\n': + console_char.symbol = symbol; + *gl_console->cursor_ptr = console_char; + glConsoleMoveCursorDown(gl_console); + glConsoleAlignCursorLeft(gl_console); + break; + case '\b': + glConsoleMoveCursorBackward(gl_console); + break; + default: + /* Change the screen_buffer value */ + console_char.symbol = symbol; + *gl_console->cursor_ptr = console_char; + glConsoleMoveCursorForward(gl_console); + + } + } + + return PROJECTM_SUCCESS; +} + + +/* Clears the console screen_buffer, using current fg and bg values */ +int clear_console_screen_buffer(gl_console_t * gl_console) { + + int i, console_size; + console_char_t console_char; + + /* Set console struct to current fg and bg values */ + console_char.fg_color = gl_console->current_fg; + console_char.bg_color = gl_console->current_bg; + console_char.symbol = 0; /* empty symbol */ + + if (gl_console == NULL) + return PROJECTM_FAILURE; + + console_size = gl_console->scroll_width * gl_console->scroll_height; + + for (i = 0; i < console_size; i++) + *(gl_console->screen_buffer + i) = console_char; + + return PROJECTM_SUCCESS; +} + +/* Clears the entire buffer */ +int clear_console_scroll_buffer(gl_console_t * gl_console) { + + int i, console_size; + console_char_t console_char; + + /* Set console struct to current fg and bg values */ + console_char.fg_color = gl_console->current_fg; + console_char.bg_color = gl_console->current_bg; + console_char.symbol = 0; /* empty symbol */ + + if (gl_console == NULL) + return PROJECTM_FAILURE; + + console_size = gl_console->scroll_width * gl_console->scroll_height; + + for (i = 0; i < console_size; i++) + *(gl_console->scroll_buffer + i) = console_char; + + return PROJECTM_SUCCESS; +} + +/* Align the cursor all the way to the right of the passed console */ +int glConsoleAlignCursorRight(gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* Set the cursor pointer to the rightmost end of the scroll buffer */ + gl_console->cursor_ptr += gl_console->scroll_width - (gl_console->screen_start_x + gl_console->screen_x) - 1; + + /* Move the screen buffer to the farthest right as possible */ + gl_console->screen_buffer += gl_console->scroll_width - gl_console->screen_start_x - gl_console->screen_width; + + /* Set the screen start 'x' value to length of the scroll buffer minus the length + of the screen buffer with a -1 offset to access the array correctly */ + gl_console->screen_start_x = gl_console->scroll_width - gl_console->screen_width; + + /* Set the screen_x cursor value to the screen width length minus an array adjustment offset */ + gl_console->screen_x = gl_console->screen_width - 1; + + + return PROJECTM_SUCCESS; +} + +/* Align the cursor all the way to the right of the passed console */ +int glConsoleAlignCursorLeft(gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* Set the cursor pointer to the left most end of the scroll buffer */ + gl_console->cursor_ptr -= (gl_console->screen_start_x + gl_console->screen_x); + + /* Set the screen buffer all the way to left */ + gl_console->screen_buffer -= gl_console->screen_start_x; + + /* Set the screen start x to the leftmost end of the scroll buffer */ + gl_console->screen_start_x = 0; + + /* Set the screen_x cursor value to the leftmost end of the screne buffer */ + gl_console->screen_x = 0; + + + /* Finished, return success */ + return PROJECTM_SUCCESS; +} + +/* Align the cursor to the top of the screen of the passed console */ +int glConsoleAlignCursorUp(gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* Set the cursor pointer to the top of the buffer plus the x offset */ + gl_console->cursor_ptr = gl_console->scroll_buffer + gl_console->screen_start_x + gl_console->screen_x; + + /* Set the screen start y to the top of the scroll buffer */ + gl_console->screen_start_y = 0; + + /* Set the screen_y cursor value to the top of the screen buffer */ + gl_console->screen_y = 0; + + /* Set screen buffer to the top shifted lefted by the screen start value */ + gl_console->screen_buffer = gl_console->scroll_buffer + gl_console->screen_start_x; + + /* Finished, return success */ + return PROJECTM_SUCCESS; +} + + +/* Align the cursor to the top of the screen of the passed console */ +int glConsoleAlignCursorDown(gl_console_t * gl_console) { + + /* Null argument check */ + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* Set the cursor pointer to the bottom of the buffer plus the x offset */ + gl_console->cursor_ptr = gl_console->scroll_buffer + + ((gl_console->scroll_height-1)*gl_console->scroll_width) + + gl_console->screen_start_x + gl_console->screen_x; + + /* Set the screen start y to the bottom of the scroll buffer mi screen_height */ + gl_console->screen_start_y = gl_console->scroll_height - gl_console->screen_height; + + /* Set the screen_y cursor value to the bottom of the screen buffer */ + gl_console->screen_y = gl_console->screen_height - 1; + + /* Set screen buffer to the bottom minus the height of the screen + shifted left by the screen start value */ + + gl_console->screen_buffer = gl_console->scroll_buffer + + ((gl_console->scroll_height - gl_console->screen_height) + *gl_console->scroll_width) + gl_console->screen_start_x; + + /* Finished, return success */ + return PROJECTM_SUCCESS; +} + + + +int glConsoleDraw( gl_console_t * console) { + +#ifdef USE_FTGL + int vw = 512; + int vh=512; + int x,y; + //float minx, miny, maxx, maxy; + char * symbol; + console_char_t * console_char; + float start_x, start_y; + + //REMOVE SOON + //int width=800,height=600; + + + // console->start_x=0; + // console->start_y=1; + + + int width=1; + int height=1; + + + + start_y = -(console->start_y - 1.0); + start_x = console->start_x; + + /* Null argument check */ + if (console == NULL) + return PROJECTM_FAILURE; + + symbol = (char*)wipemalloc(sizeof(char)+1); + *symbol = *(symbol+1) = 0; + + /* First, push the gl matrix to save data */ + glPushMatrix(); + + + /* Start rendering at the console's start position */ + glTranslatef(start_x,start_y,-1); + //glTranslatef(0,0.5,-1); + /* Assign a pointer to the start of the console buffer */ + console_char = console->screen_buffer; + + /* Iterate through entire console buffer, drawing each + character one at a time with appropiate foreground and + background values. May not be the most efficient. */ + + // glScalef(8.0,8.0,0); + + + + float llx; // The bottom left near most ?? in the x axis + float lly; // The bottom left near most ?? in the y axis + float llz; // The bottom left near most ?? in the z axis + float urx; // The top right far most ?? in the x axis + float ury; // The top right far most ?? in the y axis + float urz; // The top right far most ?? in the z axis + float advance; + + + //Figure out size of one console unit + PM->renderer->other_font->FaceSize((unsigned)(16*(vh/512.0))); + + /// @bug commented out to get projectM working + //advance=PM->renderer->other_font->Advance("W"); + PM->renderer->other_font->BBox("qpg_XT[",llx,lly,llx,urx,ury,urz); + + + float invfix=1.0/512; + llx*=invfix;lly*=invfix;llz*=invfix; + urx*=invfix;ury*=invfix;urz*=invfix; + advance=advance/vw; + + glTranslatef(advance*0.5,lly-ury,0); + + for (y = 0; y < console->screen_height; y++) { + + glPushMatrix(); + char buffer[console->screen_width+1]; + memset( buffer, '\0',sizeof(char) * (console->screen_width+1)); + + + + for (x = 0; x < console->screen_width; x++) { + + console_char = console->screen_buffer + (y*console->scroll_width) + x; + *symbol = console_char->symbol; + + + /* Draw the background color */ + if ((console->flags & CONSOLE_FLAG_ALWAYS_DRAW_BACKGROUND) || (*symbol != 0)) { + + /* Draw the background by drawing a rectangle */ + gl_console_set_color(console_char->bg_color); + glRectf(llx, lly ,llx+advance, ury); + + } + + /* We are at the cursor position. See if the cursor is hidden or not and act accordingly */ + if ((console_char == console->cursor_ptr) && (!(console->flags & CONSOLE_FLAG_CURSOR_HIDDEN))) { + + /* Cursor is not hidden and blinking */ + if (console->flags & CONSOLE_FLAG_CURSOR_BLINKING) { + if (refresh_count % CURSOR_REFRESH_RATE) + gl_console_set_color(console->cursor_color); + else + gl_console_set_color(console_char->bg_color); + } + + /* Cursor is not hidden, and not blinking */ + else { + gl_console_set_color(console->cursor_color); + } + + /* Draw the cursor according to the set style */ + if (console->cursor_style == BAR_STYLE) + glRectf(llx, lly, llx+advance, ury); + else if (console->cursor_style == UNDERLINE_STYLE) { + glRectf(llx, lly, llx+advance, ury); + } + } + + /* The cursor is not here or hidden, draw regular background (OLD COMMENT) */ + + /* Instead of the above, do nothing because we always draw the background before + printing the cursor to the screen */ + else { + +// if ((console->flags & CONSOLE_FLAG_ALWAYS_DRAW_BACKGROUND) || (*symbol != 0)) { + + /* Draw the background by drawing a rectangle */ +// gl_console_set_color(console_char->bg_color); +// glRectf(-0.5, 1.0 ,1.0, -1.0); + + //} + } + + /* If the symbol is nonzero draw it */ + if (*symbol != 0 && *symbol != '\n') { + buffer[x]=*symbol; + //gl_console_set_color(console_char->fg_color); + } + /* Now shift to the right by the size of the character space */ + glTranslatef(advance,0,0); + + // console_char++; + } + + + // glColor4f(0.0,1.0,1.0,1.0); + //glTranslatef(((lly-ury)*console->screen_width),0,0); + //glRasterPos2f(50,-50); + + glPopMatrix(); + + console_char = console->screen_buffer + (y*console->scroll_width + 1); + gl_console_set_color(console_char->fg_color); + glRasterPos2f(0,0); + + PM->renderer->other_font->Render(buffer); + + + /* New line, shift down the size of the symbol plus some extra space */ + + + glTranslatef(0,(lly-ury), 0); + } + //glColor4f(1,1,1,1); + + /* Finished, pop the gl matrix and return success */ + glPopMatrix(); + + + free(symbol); + refresh_count++; +#endif /** USE_FTGL */ + + return PROJECTM_SUCCESS; +} + + + +int glConsoleSetFlags(int flags, gl_console_t * gl_console) { + + if (gl_console == NULL) + return PROJECTM_FAILURE; + + gl_console->flags = gl_console->flags | flags; + + return PROJECTM_SUCCESS; +} + +#ifdef NOGOOD +int glConsoleStartShell(gl_console_t * gl_console) { + + int pid1, pid2; + char * s; + char c; + FILE * fs; + + if (gl_console == NULL) + return PROJECTM_FAILURE; + + if ((s = wipemalloc(sizeof(char) + 512)) == NULL) + return PROJECTM_FAILURE; + + memset(s, 0, 512); + +#if !defined(MACOS) && !defined(WIN32) + if ((pid1 = fork()) == 0) { + printf("bash starting\n"); + execve("/bin/bash", NULL, NULL); + printf("bash exiting..\n"); + exit(0); + } + + if ((pid2 = fork()) == 0) { + //fs = fopen("tempfile", "r"); + printf("about to loop on stdout\n"); + while (1) { + //printf("^");//fflush(stdout); + //ungetc(c, stdin); + fread(s, 1, 1, stdout); + *s = 'a'; + //printf("%c", *s);fflush(stdout); + glConsolePrintString(s, gl_console); + } + //fclose(fs); + printf("waiting for pid1 to exit\n"); + waitpid(pid1, NULL, 0); + free(s); + printf("pid1 exited\n"); + return PROJECTM_SUCCESS; + } + + printf("bash should have started\n"); +#endif /** !MACOS */ + return PROJECTM_SUCCESS; +} +#endif +/* Copies the console buffer into a character array */ +int glConsoleCopyBuffer(char * src, int len, gl_console_t * gl_console) { + + int i; + int j = 0; + int size; + char c; + if (src == NULL) + return PROJECTM_FAILURE; + if (len < 0) + return PROJECTM_FAILURE; + if (gl_console == NULL) + return PROJECTM_FAILURE; + + /* Clear the character space */ + memset(src, 0, len); + + size = gl_console->scroll_width*gl_console->scroll_height; + + for (i=0; ((i - j) < len) && (i < size); i++) { + c = (gl_console->scroll_buffer + i)->symbol; + + /* We don't want to accidentally null terminate the string...*/ + if (c != 0) + src[i - j] = c; + else + j++; + + // if (c != 0) + // src[i] = c; + // else + // src[i] = '\n'; + } + + /* Ensure the string actually ends */ + src[len - 1] = 0; + + return PROJECTM_SUCCESS; +} + +/* Sets the cursor draw style */ +int glConsoleSetCursorStyle(int style_num, gl_console_t * gl_console) { + + if (gl_console == NULL) + return PROJECTM_FAILURE; + + gl_console->cursor_style = style_num; + + return PROJECTM_SUCCESS; +} + diff --git a/src/projectM-engine-backup/glConsole.h b/src/projectM-engine-backup/glConsole.h new file mode 100755 index 000000000..ecded4c00 --- /dev/null +++ b/src/projectM-engine-backup/glConsole.h @@ -0,0 +1,114 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * + * $Log$ + */ + +#ifndef _GLCONSOLE_H +#define _GLCONSOLE_H + +#define GL_CONSOLE_DEBUG 0 +#define MAX_CONSOLE_HEIGHT 500 +#define MAX_CONSOLE_WIDTH 500 + +#define CONSOLE_FLAG_NONE 0 +#define CONSOLE_FLAG_CURSOR_HIDDEN 1 +#define CONSOLE_FLAG_CURSOR_BLINKING (1 << 1) +#define CONSOLE_FLAG_SCROLL_WRAP_RIGHT (1 << 3) +#define CONSOLE_FLAG_SCROLL_WRAP_LEFT (1 << 4) +#define CONSOLE_FLAG_SCROLL_WRAP_UP (1 << 5) +#define CONSOLE_FLAG_SCROLL_WRAP_DOWN (1 << 6) +#define CONSOLE_FLAG_ALWAYS_DRAW_BACKGROUND (1 << 7) + +#define BAR_STYLE 0 +#define UNDERLINE_STYLE 1 + +typedef enum { + CONSOLE_RED, + CONSOLE_BLACK, + CONSOLE_BLUE, + CONSOLE_WHITE, + CONSOLE_GREEN, + CONSOLE_TRANS +} color_t; + +typedef struct CONSOLE_CHAR_T { + char symbol; + color_t fg_color; + color_t bg_color; +} console_char_t; + + +typedef struct GL_CONSOLE_T { + float start_x; + float start_y; + int screen_width; + int screen_height; + int scroll_width; + int scroll_height; + console_char_t * screen_buffer; /* start of current screen buffer */ + console_char_t * scroll_buffer; /* pointer to very top of buffer */ + int font_descriptor; + int screen_x; + int screen_y; + int screen_start_x; + int screen_start_y; + int cursor_style; + color_t current_fg; + color_t current_bg; + color_t cursor_color; + console_char_t * cursor_ptr; /* pointer to position in console buffer */ + short int flags; +} gl_console_t; + +int glConsoleSetFGColor(color_t color, gl_console_t * gl_console); +int glConsoleSetBGColor(color_t color, gl_console_t * gl_console); +int glConsoleSetCursorColor(color_t color, gl_console_t * gl_console); +int glConsoleSetCursorPos(int x, int y, gl_console_t * gl_console); +int glConsoleGetCursorPos(int * x, int * y, gl_console_t * gl_console); +int glConsoleShowCursor(gl_console_t * console); +int glConsoleHideCursor(gl_console_t * console); +int glConsoleDraw( gl_console_t * console); +int glConsoleClearScreen(gl_console_t * console); +int glConsoleClearBuffer(gl_console_t * console); +int glConsolePrintString(char * s, gl_console_t * console); +int glConsoleSetFlags(int flags, gl_console_t * console); +int glConsoleSetCursorStyle(int style_num, gl_console_t * console); +int glConsoleAlignCursorRight(gl_console_t * gl_console); +int glConsoleAlignCursorLeft(gl_console_t * gl_console); +int glConsoleAlignCursorUp(gl_console_t * gl_console); +int glConsoleAlignCursorDown(gl_console_t * gl_console); + +int glConsoleMoveCursorForward(gl_console_t * gl_console); +int glConsoleMoveCursorBackward(gl_console_t * gl_console); +int glConsoleMoveCursorUp(gl_console_t * gl_console); +int glConsoleMoveCursorDown(gl_console_t * gl_console); +int glConsoleStartShell(gl_console_t * gl_console); +int glConsoleCopyBuffer(char * src, int len, gl_console_t * gl_console); +int glConsoleCursorToNextChar(char c, gl_console_t * gl_console); +gl_console_t * glConsoleCreate(int screen_width, int screen_height, int scroll_width, int scroll_height, + float start_x, float start_y, int font_descriptor); +int glConsoleDestroy(gl_console_t * console); + +#endif /** !_GLCONSOLE_H */ diff --git a/src/projectM-engine-backup/libprojectM.dsp b/src/projectM-engine-backup/libprojectM.dsp new file mode 100755 index 000000000..a7ffbd35f --- /dev/null +++ b/src/projectM-engine-backup/libprojectM.dsp @@ -0,0 +1,348 @@ +# Microsoft Developer Studio Project File - Name="libprojectM" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libprojectM - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libprojectM.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libprojectM.mak" CFG="libprojectM - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libprojectM - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libprojectM - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libprojectM - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libprojectM - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "DEBUG" /YX /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libprojectM - Win32 Release" +# Name "libprojectM - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\BeatDetect.cpp +# End Source File +# Begin Source File + +SOURCE=.\browser.cpp +# End Source File +# Begin Source File + +SOURCE=.\builtin_funcs.cpp +# End Source File +# Begin Source File + +SOURCE=.\console_interface.cpp +# End Source File +# Begin Source File + +SOURCE=.\CustomShape.cpp +# End Source File +# Begin Source File + +SOURCE=.\CustomWave.cpp +# End Source File +# Begin Source File + +SOURCE=.\editor.cpp +# End Source File +# Begin Source File + +SOURCE=.\Eval.cpp +# End Source File +# Begin Source File + +SOURCE=.\Expr.cpp +# End Source File +# Begin Source File + +SOURCE=.\fftsg.cpp +# End Source File +# Begin Source File + +SOURCE=.\Func.cpp +# End Source File +# Begin Source File + +SOURCE=.\glConsole.cpp +# End Source File +# Begin Source File + +SOURCE=.\InitCond.cpp +# End Source File +# Begin Source File + +SOURCE=.\menu.cpp +# End Source File +# Begin Source File + +SOURCE=.\Param.cpp +# End Source File +# Begin Source File + +SOURCE=.\Parser.cpp +# End Source File +# Begin Source File + +SOURCE=.\pbuffer.cpp +# End Source File +# Begin Source File + +SOURCE=.\PCM.cpp +# End Source File +# Begin Source File + +SOURCE=.\PerFrameEqn.cpp +# End Source File +# Begin Source File + +SOURCE=.\PerPixelEqn.cpp +# End Source File +# Begin Source File + +SOURCE=.\PerPointEqn.cpp +# End Source File +# Begin Source File + +SOURCE=.\Preset.cpp +# End Source File +# Begin Source File + +SOURCE=.\projectM.cpp +# End Source File +# Begin Source File + +SOURCE=.\SplayTree.cpp +# End Source File +# Begin Source File + +SOURCE=.\timer.cpp +# End Source File +# Begin Source File + +SOURCE=".\win32-dirent.cpp" +# End Source File +# Begin Source File + +SOURCE=.\wipemalloc.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\BeatDetect.h +# End Source File +# Begin Source File + +SOURCE=.\browser.h +# End Source File +# Begin Source File + +SOURCE=.\builtin_funcs.h +# End Source File +# Begin Source File + +SOURCE=.\carbontoprojectM.h +# End Source File +# Begin Source File + +SOURCE=.\common.h +# End Source File +# Begin Source File + +SOURCE=.\compare.h +# End Source File +# Begin Source File + +SOURCE=.\console_interface.h +# End Source File +# Begin Source File + +SOURCE=.\CustomShape.h +# End Source File +# Begin Source File + +SOURCE=.\CustomWave.h +# End Source File +# Begin Source File + +SOURCE=.\CValue.h +# End Source File +# Begin Source File + +SOURCE=.\dlldefs.h +# End Source File +# Begin Source File + +SOURCE=.\editor.h +# End Source File +# Begin Source File + +SOURCE=.\Eval.h +# End Source File +# Begin Source File + +SOURCE=.\event.h +# End Source File +# Begin Source File + +SOURCE=.\Expr.h +# End Source File +# Begin Source File + +SOURCE=.\fatal.h +# End Source File +# Begin Source File + +SOURCE=.\fftsg.h +# End Source File +# Begin Source File + +SOURCE=.\Func.h +# End Source File +# Begin Source File + +SOURCE=.\glConsole.h +# End Source File +# Begin Source File + +SOURCE=.\glf.h +# End Source File +# Begin Source File + +SOURCE=.\InitCond.h +# End Source File +# Begin Source File + +SOURCE=.\lvtoprojectM.h +# End Source File +# Begin Source File + +SOURCE=.\menu.h +# End Source File +# Begin Source File + +SOURCE=.\Param.h +# End Source File +# Begin Source File + +SOURCE=.\Parser.h +# End Source File +# Begin Source File + +SOURCE=.\pbuffer.h +# End Source File +# Begin Source File + +SOURCE=.\PCM.h +# End Source File +# Begin Source File + +SOURCE=.\PerFrameEqn.h +# End Source File +# Begin Source File + +SOURCE=.\PerPixelEqn.h +# End Source File +# Begin Source File + +SOURCE=.\PerPointEqn.h +# End Source File +# Begin Source File + +SOURCE=.\Preset.h +# End Source File +# Begin Source File + +SOURCE=.\projectM.h +# End Source File +# Begin Source File + +SOURCE=.\sdltoprojectM.h +# End Source File +# Begin Source File + +SOURCE=.\SplayTree.h +# End Source File +# Begin Source File + +SOURCE=.\timer.h +# End Source File +# Begin Source File + +SOURCE=".\win32-dirent.h" +# End Source File +# Begin Source File + +SOURCE=.\wipemalloc.h +# End Source File +# End Group +# End Target +# End Project diff --git a/src/projectM-engine-backup/libprojectM.ncb b/src/projectM-engine-backup/libprojectM.ncb new file mode 100755 index 0000000000000000000000000000000000000000..eed9399a58275a1e821e98b149044d1d7b0f200e GIT binary patch literal 254976 zcmeEv2VfOd_Wrr^(t84g9$rFAfI#S>KN3Rk%>oJmLT^&7fLOrZ1$0rdp{}ld(Vq=h z#qMHR+lr#>+Ff0{E6V@-&dglKETD_x-!e0~nfd12a_)I^?>*@?PK}6*3gWEdq<575o z5(p*mYnH&by8=fq2IkwEDji z(|uyUz7E*EG*hI_+{!ss3vrn|sm-Fw1=Fe)&6qoNo{Q(qo3eOz)o#3S(Yyr#IAg}# zg^Q+CP4z;%zT1>{9lvPK{PEaVXlB*qMMH|)Vn3nr3l~ftKYPX`|Ka$hGv-&#shmA~ z-sINPgK7P+&}CJXi~3Y8LiGC+deVYUP_=(S=PsN#yK2IWxr?e6 zOs$+;wSNMfJg<5*`ys^g#V81KMoq7rzn@$LBiQfs52{@9qmtL~`;+?E%Grze>o=^L zG6NOJ{{3)X*!|$QVoBxf{Yz6r?njDMORDDXSIty$9?zHqcP#eh$7RLkU zNiFL?0r5qppT&tl1=0veG3!AkG{sYGiUsGy|_8*9gb0t@_|G?{Cs3ol9$myq{R0-*%{Hwmb|A92e++yCr%wEtdx!1h_&bFclbEw$bD-1E=& zd;_mqJPy7a%7l{kZr`X$xlt`D+AjZtLP|mTqR5r@B@)@z_zpE^l0e#_VYt(5$BeFw`w_5JV& zB@jyB_alLfM6~x_dro`#U|_dBaA04zktP<$Nn4pHi;2~KPmo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kDiw9EPYcjJsNd*rXr0NYyII-(o9(~P4;pKdJatCe>N|4(5AOf74L%Wd+I?;G zaL5mW5Am}5F+kS8Dn?RfnU->2ng?_)UppY~A5 z4+8v&vAgffi%1{s^#JpKfh~NP|Lb4)@&4bv+icjrKY9Oe-v68T|EBv-Dkk-AMDl)` zU22+v&HAhOfArL*4c+457tkL1HE;~AP_b&zj#ydg6$SLlt4jU=ue|$#oguGus6C|h zfu?k0I!0k{tUSL|Z*=O-$^u4!9oP^^p>Tp?Jnj#<6Y`M$E#L&&q+%pxzz`@@En8TD zN#8`d1ofw{9U)6kW-rI3ti9O%N{d~2^9RHC_;3B~Axo}9%*TOAPmH7t55>x6t7*3y zq5@+#VJ%?0=)i^m?RP*>dmc=L+!3_;85H)d))B#s2S5Ke9&$JA!W?i2z<(J}c=`lp zAl*knP|U9?{zs^gnBTFG<k)Q1dg8{ZWQJT|r=y88*=M7PL^>W#W)rDsJf4gjXXDwk>CAKQ zX&TLS6i7E&=|+Ep#8-fS+;0n6`ah$Mf2YPGsMz_YY1`%Vueuo6+@}gwgMMqs!kOCrOV0G}Eh?j#0psccl+z)ca|^NXW92-{76DE7{tnPW?ts7GmXBcQ<4)|xssljqdplsWcRxy%#rmIk{&yZ# zofF5#BU?sxjcLELz8TYIKZ~#)0P6vGN64_rVAcab@3S5N>jAJH0P6wBiJ0{Oy7~a> z!Nhhzn_V1I&#gv>_}9n#LS7%UA1L+%MYI4>p%kmY`#|Ewc&>UixW9w=Ng=iax}^r2 WjEDW=^D=5xfB#ppYS2B@1NaZ^puJ20 literal 0 HcmV?d00001 diff --git a/src/projectM-engine-backup/libprojectM.plg b/src/projectM-engine-backup/libprojectM.plg new file mode 100755 index 000000000..a3e36679c --- /dev/null +++ b/src/projectM-engine-backup/libprojectM.plg @@ -0,0 +1,78 @@ + + +
+

Build Log

+

+--------------------Configuration: libprojectM - Win32 Debug-------------------- +

+

Command Lines

+Creating temporary file "C:\DOCUME~1\descarte\LOCALS~1\Temp\RSP2E1.tmp" with contents +[ +/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "DEBUG" /Fp"Debug/libprojectM.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"C:\tmp\projectM-1.00\src\libprojectM\browser.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\builtin_funcs.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\console_interface.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\CustomShape.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\CustomWave.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\editor.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\Eval.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\Expr.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\Func.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\glConsole.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\InitCond.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\menu.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\Param.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\Parser.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\PerFrameEqn.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\PerPixelEqn.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\PerPointEqn.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\Preset.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\projectM.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\SplayTree.cpp" +"C:\tmp\projectM-1.00\src\libprojectM\win32-dirent.cpp" +] +Creating command line "cl.exe @C:\DOCUME~1\descarte\LOCALS~1\Temp\RSP2E1.tmp" +Creating temporary file "C:\DOCUME~1\descarte\LOCALS~1\Temp\RSP2E2.tmp" with contents +[ +/nologo /out:"Debug\libprojectM.lib" +".\Debug\BeatDetect.obj" +".\Debug\browser.obj" +".\Debug\builtin_funcs.obj" +".\Debug\console_interface.obj" +".\Debug\CustomShape.obj" +".\Debug\CustomWave.obj" +".\Debug\editor.obj" +".\Debug\Eval.obj" +".\Debug\Expr.obj" +".\Debug\fftsg.obj" +".\Debug\Func.obj" +".\Debug\glConsole.obj" +".\Debug\InitCond.obj" +".\Debug\menu.obj" +".\Debug\Param.obj" +".\Debug\Parser.obj" +".\Debug\pbuffer.obj" +".\Debug\PCM.obj" +".\Debug\PerFrameEqn.obj" +".\Debug\PerPixelEqn.obj" +".\Debug\PerPointEqn.obj" +".\Debug\Preset.obj" +".\Debug\projectM.obj" +".\Debug\SplayTree.obj" +".\Debug\timer.obj" +".\Debug\win32-dirent.obj" +".\Debug\wipemalloc.obj" +] +Creating command line "link.exe -lib @C:\DOCUME~1\descarte\LOCALS~1\Temp\RSP2E2.tmp" +

Output Window

+Compiling... +browser.cpp +builtin_funcs.cpp +console_interface.cpp +CustomShape.cpp +CustomWave.cpp +cl.exe terminated at user request. + +
+ + diff --git a/src/projectM-engine-backup/libprojectM/Debug/libprojectM.pch b/src/projectM-engine-backup/libprojectM/Debug/libprojectM.pch new file mode 100755 index 0000000000000000000000000000000000000000..e8c8d9c278102680b2664a6c218a0596efa0bfa4 GIT binary patch literal 186940 zcmeHw4_sVVmH$ga(rFuzR@A83?X;yWwltCyYg*Hm1kxrgBs7_%SkYm^3}ISerZA+8 zMny$UH7Y8rQL`>8D%!YWi!N$ZRIG80ii#TDs90Gy{xQX(dH}zPiF=yF#jkmps9oDLE_@KEPUUW$`;UcUVtgX!eLR)UWq1-jepE0Qk zZ>U>!!_6-#D{~8;XSE(W4xDS-6Fb@?t-;&kEwPUJns{S-q9f6i3T}&cbVgc&TT-3Tc%pt=<&CTA zH*Bn|-deTJjc}7!{V7DKxvlanL|GH6o{2I;HMfU`!3?L!lRk4mSp$VIyGGBjVl$S3 zGh)EBMpM9^p@Q@QB!BR+7Xus3Pmf(%ke=r96CcY@JN^0T@xuk_08-DL1?h?Eg7g^D zz#RqY+P3`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%y=g?}sjtN1hM zcTgTgGOg3(f4$~E2LHqGZ`1t$mHjh6UjxKJ{^gMFZ*O@QITP?7`DsBq0sji-?z<=t zBAM2BwZ2|7v%V(b*UWy0;4}C7n&~&de%~iQB=3-QQr1`HSBQ2}ed6~6IAqo*ezLwQ zzj63c>~2W4zFy?6uk<%m6z>qXF>5^tkC(U zb0!jF!r=Xszd5S!t)`u?TH=jk=EdC@s?OeeNDWvJ<*Y9N(HyYJ31pR!7ZuIXgpEB zt@6fI^&2);R&T9ZhoGnCS94qCY5T4TRcpQ%@{@l@(DuBa&93h2|cVaRA3Q`^P5~SUXS8d)BEJOZr90Zxh08aJH@kHBGMgJdO CD2JB- literal 0 HcmV?d00001 diff --git a/src/projectM-engine-backup/libprojectM/Debug/vc60.idb b/src/projectM-engine-backup/libprojectM/Debug/vc60.idb new file mode 100755 index 0000000000000000000000000000000000000000..0f48fc1bb8f202cbb8ca2e8cc6a194549f1debc9 GIT binary patch literal 246784 zcmeEv1#}eK(r$M=A?}`u5clAg5G)yn+Q2oDYoH8FCGttSYAjvyEcuZ698g77MEwYXQAOoa1w-X;ONG`F{t+Gn7SSD8FezI?ks$Ui-KT;&n%r@ zVUO?q>}k+KC;#00Tg&%&7<_n}KgYV}bn|bg@&iQ!tL{JEyoE3>`kzP(|78{wzGyl5 zkmznsh#=&G!a?PU!SzE|CXzkfX?j89T)B zT$YOn&G?t3Zh}BW@ag=LC*;F?q@{kvawZuUQf@EtREjs=O6M2m+D1tZCbSEqesN z6RFF--0-hu9Z(60)cyTqN~!F_GJ^02XY17#1R{023;UMJ(l?dA0dayrq%IqSvQfWO zvJFfGfr#p)qVksKRCf}2-Jv=;02rE$@_OG@5QxZblNn}8*#oGv>X*vy5K}=Ql6|P{ z`*_L@vALVNWU0UH^aX*4e7Ie<>hyN-!FsSPOFj$(){v|2G867|mL*i8_KNOrZy+wI*Ev$21x z4=|;?&Ls*05y=j?*`Zup$iCwBjEe{=*^GEWAX4|C8@-oF?Na$LwvHeW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ptB)V}EvY?cR=bemw|0mEY}qC%10EXDH+e zH!kUYp(^xqF`xGPD$)C&O#E5o`S^;2SLV3m+Q5+SMtGjU81Mfu^=G{oOzyQA z_yGQV^c>H*!%4r8^npiT&Nxc=Fpjqw^Ye8pI5Nf%g+JeHJK>x;`4^2%2@&|ik^|0!*W&o}@nhxl>( z9iy`t^4;+F1jPHL@lE4@U%>6)rxrVaXF{IvDI@HTbpfBt^#iTatM&%po6>*a&yubm zO(DDw$1UD}3aE?p2hiUic<9ee2H!co75EhHU*?tUm>b}W$v$vn&(=1P;1`(4?b~kO zpigHJpCu;2g7l~~{};Lbp3~MXDE~Jp{l}&Gzoo);n(0hO`j1SU1+m1R9lLn!eH`Sq zP38PItkP#C`EP)S5C|Xm`FsrFh8!RAvFFVg=$o3N{XHr5-^)~<|70y5Cs2L@Aum4l zXI2%Sbch8X#-A@=UpM(v7WndHAGpOQg%RNuINtfHQ`a+SA5~1zzMhrpH|BWDD{d0$ zHz)n)rTQ&6-qti!w*&g}Hm3Ci2{=SGmnH(52>gdffY$#w_Jeb}^V_yW|AII8DcApF zEw^|_VLtDLzv79Xg=^j+y*A>rBJRhFFED-^<(0jP{-TDUP~x2*5B8`9yd#}|d+E;t zPnC&Qu6M9sNcssno9vPxpFrmaUiq_L>l^N;`EhT)zc{eXjumym=aWA06~ixk(R^
+

Build Log

+

+--------------------Configuration: libprojectM - Win32 Debug-------------------- +

+

Command Lines

+ + + +

Results

+libprojectM.lib - 0 error(s), 0 warning(s) +
+ + diff --git a/src/projectM-engine-backup/lvtoprojectM.h b/src/projectM-engine-backup/lvtoprojectM.h new file mode 100755 index 000000000..4215b8abe --- /dev/null +++ b/src/projectM-engine-backup/lvtoprojectM.h @@ -0,0 +1,156 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: sdltoprojectM.hpp,v 1.1 2004/10/08 00:35:28 cvs Exp $ + * + * Translates SDL -> projectM variables + * + * $Log: sdltoprojectM.hpp,v $ + * Revision 1.1 2004/10/08 00:35:28 cvs + * Moved and imported + * + * Revision 1.1.1.1 2004/10/04 12:56:00 cvs + * Imported + * + */ + +#include + +projectMEvent lv2pmEvent( VisEventType event ) { + + switch ( event ) { + case VISUAL_EVENT_RESIZE: + return PROJECTM_VIDEORESIZE; + case VISUAL_EVENT_KEYUP: + return PROJECTM_KEYUP; + case VISUAL_EVENT_KEYDOWN: + return PROJECTM_KEYDOWN; + default: + return PROJECTM_KEYUP; + } + } +projectMKeycode lv2pmKeycode( VisKey keysym ) +{ + switch ( keysym ) + { + case VKEY_F1: + return PROJECTM_K_F1; + case VKEY_F2: + return PROJECTM_K_F2; + case VKEY_F3: + return PROJECTM_K_F3; + case VKEY_F4: + return PROJECTM_K_F4; + case VKEY_F5: + return PROJECTM_K_F5; + case VKEY_F6: + return PROJECTM_K_F6; + case VKEY_F7: + return PROJECTM_K_F7; + case VKEY_F8: + return PROJECTM_K_F8; + case VKEY_F9: + return PROJECTM_K_F9; + case VKEY_F10: + return PROJECTM_K_F10; + case VKEY_F11: + return PROJECTM_K_F11; + case VKEY_F12: + return PROJECTM_K_F12; + case VKEY_ESCAPE: + return PROJECTM_K_ESCAPE; + case VKEY_a: + return PROJECTM_K_a; + case VKEY_b: + return PROJECTM_K_b; + case VKEY_c: + return PROJECTM_K_c; + case VKEY_d: + return PROJECTM_K_d; + case VKEY_e: + return PROJECTM_K_e; + case VKEY_f: + return PROJECTM_K_f; + case VKEY_g: + return PROJECTM_K_g; + case VKEY_h: + return PROJECTM_K_h; + case VKEY_i: + return PROJECTM_K_i; + case VKEY_j: + return PROJECTM_K_j; + case VKEY_k: + return PROJECTM_K_k; + case VKEY_l: + return PROJECTM_K_l; + case VKEY_m: + return PROJECTM_K_m; + case VKEY_n: + return PROJECTM_K_n; + case VKEY_o: + return PROJECTM_K_o; + case VKEY_p: + return PROJECTM_K_p; + case VKEY_q: + return PROJECTM_K_q; + case VKEY_r: + return PROJECTM_K_r; + case VKEY_s: + return PROJECTM_K_s; + case VKEY_t: + return PROJECTM_K_t; + case VKEY_u: + return PROJECTM_K_u; + case VKEY_v: + return PROJECTM_K_v; + case VKEY_w: + return PROJECTM_K_w; + case VKEY_x: + return PROJECTM_K_x; + case VKEY_y: + return PROJECTM_K_y; + case VKEY_z: + return PROJECTM_K_z; + case VKEY_UP: + return PROJECTM_K_UP; + case VKEY_RETURN: + return PROJECTM_K_RETURN; + case VKEY_RIGHT: + return PROJECTM_K_RIGHT; + case VKEY_LEFT: + return PROJECTM_K_LEFT; + case VKEY_DOWN: + return PROJECTM_K_DOWN; + case VKEY_PAGEUP: + return PROJECTM_K_PAGEUP; + case VKEY_PAGEDOWN: + return PROJECTM_K_PAGEDOWN; + + + default: + return PROJECTM_K_NONE; + break; + } + } + +projectMModifier lv2pmModifier( int mod ) { + return mod && VKMOD_LSHIFT; + } diff --git a/src/projectM-engine-backup/menu.cpp b/src/projectM-engine-backup/menu.cpp new file mode 100755 index 000000000..26c3f7930 --- /dev/null +++ b/src/projectM-engine-backup/menu.cpp @@ -0,0 +1,1033 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ + +#include +#include +#include + +#include "projectM.hpp" + +#ifdef MACOS +#include +#else +#include +#endif /** MACOS */ +#include "Common.hpp" +#include "fatal.h" +#include "Param.hpp" +#include + +#include "InitCond.hpp" + +#include "glConsole.h" + +#include "Preset.hpp" +#include "editor.h" +#include "menu.h" +#include "wipemalloc.h" + +#define HIGHLIGHT_COLOR 1 +#define DEFAULT_COLOR 0 +#define LOCKED_COLOR 2 +#if 0 +extern Preset *activePreset; +extern interface_t current_interface; + +menu_t * load_waveform_menu(); +menu_t * load_augmentations_menu(); +menu_t * load_postprocessing_menu(); +menu_t * load_motion_menu(); +int load_main_menu(); + +int edit_per_frame_init(); +int edit_per_frame_eqn(); +int edit_per_pixel_eqn(); +int run_bash_shell(); + + +int print_menu_item(menu_item_t * menu_item); +int switch_bool_param(Param * param); +int adj_float_param(Param * param, adj_t adj); +int adj_int_param(Param * param, adj_t adj); +int pursue_menu_link(menu_link_t * menu_link); + +int append_menu_item(menu_t * menu, menu_item_t * new_menu_item); + +menu_t * new_menu(menu_t * top_menu); +menu_item_t * new_menu_item(int menu_entry_type, menu_entry_t * menu_entry); +menu_entry_t * new_menu_link(char * print_string, menu_t * menu_ptr); + + +menu_entry_t * new_param_adj(char * print_string, Param * param); + +menu_entry_t * new_function_mode(char * print_string, int (*func_ptr)()); + +int free_menu_entry(menu_entry_t * menu_entry); +int free_menu_item(menu_item_t * menu_item); +int free_menu(menu_t * menu); + +int menu_lprint(char * string, int col); +int init_main_menu(); +int destroy_main_menu(); + +int width, height; + +float xmin,ymin,xmax,ymax; + + +CValue saved_init_val; /* backups the value of an initial condition */ + +menu_t * main_menu = NULL; /* Global menu structure */ + +menu_t * active_menu = NULL; /* the currently loaded menu */ + +gl_console_t * menu_console = NULL; + + +display_state menu_display_state = HIDE; + +int initMenu() { + if (MENU_DEBUG) { + printf("initMenu: loading menu:"); + fflush(stdout); + } + + load_main_menu(); + if (MENU_DEBUG) printf(" [done]\n"); + active_menu = main_menu; + return PROJECTM_SUCCESS; +} + +int showMenu() { + + if ((menu_console = glConsoleCreate(80,24, 81, 25, width*.05, height * .90,0)) == NULL) + return PROJECTM_FAILURE; + + glConsoleSetFlags(CONSOLE_FLAG_CURSOR_HIDDEN|CONSOLE_FLAG_SCROLL_WRAP_DOWN|CONSOLE_FLAG_SCROLL_WRAP_RIGHT, menu_console); + + active_menu = main_menu; + main_menu->start_item = main_menu->selected_item; + menu_display_state = SHOW; + return PROJECTM_SUCCESS; +} + +int hideMenu() { + menu_display_state = HIDE; + active_menu = main_menu; + active_menu->selected_item = active_menu->start_item; + + if (active_menu->locked_item != NULL) { + // if (active_menu->locked_item->menu_entry_type == PARAM_ADJ_TYPE) + // active_menu->locked_item->menu_entry->param_adj.param->init_val = saved_init_val; + active_menu->locked_item = NULL; + } + + glConsoleDestroy(menu_console); + menu_console = NULL; + + return PROJECTM_SUCCESS; +} + +int load_main_menu() { + + menu_t * waveform_menu; + menu_t * augmentations_menu; + menu_t * motion_menu; + menu_t * postprocessing_menu; + + if ((main_menu = new_menu(NULL)) == NULL) + return PROJECTM_OUTOFMEM_ERROR; + + if (MENU_DEBUG) { printf(" [waveform:"); fflush(stdout); } + waveform_menu = load_waveform_menu(); + + if (waveform_menu == NULL) { + free_menu(main_menu); + if (MENU_DEBUG) { printf(" failure]\n"); fflush(stdout); } + return PROJECTM_FAILURE; + } + + if (MENU_DEBUG) { printf(" success]"); fflush(stdout); } + + if (MENU_DEBUG) { printf(" [augmentations:"); fflush(stdout); } + augmentations_menu = load_augmentations_menu(); + + if (augmentations_menu == NULL) { + free_menu(main_menu); + free_menu(waveform_menu); + if (MENU_DEBUG) { printf(" failure]\n"); fflush(stdout); } + return PROJECTM_FAILURE; + } + + if (MENU_DEBUG) { printf(" success]"); fflush(stdout); } + + if (MENU_DEBUG) { printf(" [postprocessing:"); fflush(stdout); } + postprocessing_menu = load_postprocessing_menu(); + + if (postprocessing_menu == NULL) { + free_menu(main_menu); + free_menu(waveform_menu); + free_menu(augmentations_menu); + if (MENU_DEBUG) { printf(" failure]\n"); fflush(stdout); } + return PROJECTM_FAILURE; + } + + if (MENU_DEBUG) { printf(" success]"); fflush(stdout); } + + if (MENU_DEBUG) { printf(" [motion:"); fflush(stdout); } + motion_menu = load_motion_menu(); + + if (motion_menu == NULL) { + free_menu(main_menu); + free_menu(waveform_menu); + free_menu(augmentations_menu); + free_menu(postprocessing_menu); + if (MENU_DEBUG) { printf(" failure]\n"); fflush(stdout); } + return PROJECTM_FAILURE; + } + + if (MENU_DEBUG) { printf(" success]"); fflush(stdout); } + + append_menu_item(main_menu, new_menu_item(MENU_LINK_TYPE, new_menu_link("--waveform", waveform_menu))); + append_menu_item(main_menu, new_menu_item(MENU_LINK_TYPE, new_menu_link("--augmentations", augmentations_menu))); + append_menu_item(main_menu, new_menu_item(MENU_LINK_TYPE, new_menu_link("--motion", motion_menu))); + append_menu_item(main_menu, new_menu_item(MENU_LINK_TYPE, new_menu_link("--post processing, global effects", postprocessing_menu))); + + append_menu_item(main_menu, new_menu_item(FUNCTION_MODE_TYPE, new_function_mode("edit per_frame equations", edit_per_frame_eqn))); + append_menu_item(main_menu, new_menu_item(FUNCTION_MODE_TYPE, new_function_mode("edit per_pixel equations", edit_per_pixel_eqn))); + append_menu_item(main_menu, new_menu_item(FUNCTION_MODE_TYPE, new_function_mode("edit preset initialization code", edit_per_frame_init))); + //append_menu_item(main_menu, new_menu_item(FUNCTION_MODE_TYPE, new_function_mode("bash shell", run_bash_shell))); + + main_menu->selected_item = main_menu->start_item; + + return PROJECTM_SUCCESS; +} + + +menu_t * load_waveform_menu() { + menu_t * waveform_menu; + + if ((waveform_menu = new_menu(main_menu)) == NULL) + return NULL; + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("wave type", ParamUtils::find("nWaveMode", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("size", ParamUtils::find("fWaveScale", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("smoothing", ParamUtils::find("fWaveSmoothing", activePreset, P_CREATE)))); + + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("mystery parameter", ParamUtils::find("wave_mystery", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("opacity", ParamUtils::find("fWaveAlpha", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("position (x)", ParamUtils::find("wave_x", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("position (y)", ParamUtils::find("wave_y", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("color (red)", ParamUtils::find("wave_r", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("color (green)", ParamUtils::find("wave_g", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("color (blue)", ParamUtils::find("wave_b", activePreset, P_CREATE)))); + + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("use dots", ParamUtils::find("bWaveDots", activePreset, P_CREATE)))); + + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("draw thick", ParamUtils::find("bWaveThick", activePreset, P_CREATE)))); + + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("modulate opacity by volume", ParamUtils::find("bModWaveAlphaByVolume", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("mod. lower threshold", ParamUtils::find("fModWaveAlphaStart", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("mod. uppper threshold", ParamUtils::find("fModWaveAlphaEnd", activePreset, P_CREATE)))); + + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("additive drawing", ParamUtils::find("bAdditiveWaves", activePreset, P_CREATE)))); + append_menu_item(waveform_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("color brightening", ParamUtils::find("bMaximizeWaveColor", activePreset, P_CREATE)))); + waveform_menu->selected_item = waveform_menu->start_item; + + return waveform_menu; +} + + +menu_t * load_augmentations_menu() { + menu_t * augmentations_menu; + + if ((augmentations_menu = new_menu(main_menu)) == NULL) + return NULL; + + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("outer border thickness", ParamUtils::find("ob_size", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj(" color (red)", ParamUtils::find("ob_r", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj(" color (green)", ParamUtils::find("ob_g", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj(" color (blue)", ParamUtils::find("ob_b", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj(" opacity", ParamUtils::find("ob_a", activePreset, P_CREATE)))); + + + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("inner border thickness", ParamUtils::find("ib_size", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj(" color (red)", ParamUtils::find("ib_r", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj(" color (green)", ParamUtils::find("ib_g", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj(" color (blue)", ParamUtils::find("ib_b", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj(" opacity", ParamUtils::find("ib_a", activePreset, P_CREATE)))); + + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("motion vector opacity", ParamUtils::find("mv_a", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("num. mot. vector (X)", ParamUtils::find("mv_x", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("num. mot. vector (Y)", ParamUtils::find("mv_y", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("offset (X)", ParamUtils::find("mv_dx", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("offset (Y)", ParamUtils::find("mv_dy", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("trail length", ParamUtils::find("mv_l", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("color (red)", ParamUtils::find("mv_r", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("color (green)", ParamUtils::find("mv_g", activePreset, P_CREATE)))); + append_menu_item(augmentations_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("color (blue)", ParamUtils::find("mv_b", activePreset, P_CREATE)))); + + + augmentations_menu->selected_item = augmentations_menu->start_item; + + return augmentations_menu; +} + +/* Loads the motion menu, a sub menu of the main menu */ +menu_t * load_motion_menu() { + menu_t * motion_menu; + + if ((motion_menu = new_menu(main_menu)) == NULL) + return NULL; + + + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("zoom amount", ParamUtils::find("zoom", activePreset, P_CREATE)))); + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("zoom exponent", ParamUtils::find("zoomexp", activePreset, P_CREATE)))); + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("rotation amount", ParamUtils::find("rot", activePreset, P_CREATE)))); + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("rot., center of (X)", ParamUtils::find("cx", activePreset, P_CREATE)))); + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("rot., center of (Y)", ParamUtils::find("cy", activePreset, P_CREATE)))); + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("translation (X)", ParamUtils::find("dx", activePreset, P_CREATE)))); + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("translation (Y)", ParamUtils::find("dy", activePreset, P_CREATE)))); + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("scaling (X)", ParamUtils::find("sx", activePreset, P_CREATE)))); + append_menu_item(motion_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("scaling (Y)", ParamUtils::find("sy", activePreset, P_CREATE)))); + + motion_menu->selected_item = motion_menu->start_item; + + return motion_menu; +} + +/* Loads the post processing menu, a sub menu of the main, menu */ +menu_t * load_postprocessing_menu() { + menu_t * postprocessing_menu; + if ((postprocessing_menu = new_menu(main_menu)) == NULL) + return NULL; + + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("sustain level", ParamUtils::find("fDecay", activePreset, P_CREATE)))); + + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("darken center", ParamUtils::find("bDarkenCenter", activePreset, P_CREATE)))); + + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("gamma adjustment", ParamUtils::find("fDecay", activePreset, P_CREATE)))); + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("video echo: alpha", ParamUtils::find("fVideoEchoAlpha", activePreset, P_CREATE)))); + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("video echo: scale", ParamUtils::find("fVideoEchoZoom", activePreset, P_CREATE)))); + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("video echo: orientation", ParamUtils::find("nVideoEchoOrientation", activePreset, P_CREATE)))); + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("texture wrapping", ParamUtils::find("bTexWrap", activePreset, P_CREATE)))); + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("darken filter", ParamUtils::find("bDarken", activePreset, P_CREATE)))); + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("brighten filter", ParamUtils::find("bBrighten", activePreset, P_CREATE)))); + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("solarize filter", ParamUtils::find("bSolarize", activePreset, P_CREATE)))); + append_menu_item(postprocessing_menu, new_menu_item(PARAM_ADJ_TYPE, new_param_adj("invert filter", ParamUtils::find("bInvert", activePreset, P_CREATE)))); + + + postprocessing_menu->selected_item = postprocessing_menu->start_item; + + return postprocessing_menu; +} + +int refreshMenu() { + + menu_item_t * menu_item; + + if (menu_display_state == HIDE) { + return PROJECTM_SUCCESS; + } + + if (menu_display_state == SPECIAL) { + glConsoleDraw(menu_console); + glConsoleClearBuffer(menu_console); + return PROJECTM_SUCCESS; + } + + menu_item = active_menu->start_item; + + glConsoleClearBuffer(menu_console); + + while (menu_item) { + print_menu_item(menu_item); + menu_item = menu_item->down; + } + + glConsoleDraw(menu_console); + return PROJECTM_SUCCESS; +} + +int destroyMenu() { + + if (main_menu != NULL) + free_menu(main_menu); + + main_menu = NULL; + return PROJECTM_SUCCESS; +} + +/* Prints a line to the opengl screen, second entry is the color, work in progress */ +int menu_lprint(char * string, int col) { + + if (active_menu == NULL) + return PROJECTM_FAILURE; + + if (string == NULL) + return PROJECTM_FAILURE; + + if (col == HIGHLIGHT_COLOR) { + glConsoleSetBGColor(CONSOLE_WHITE, menu_console); + glConsoleSetFGColor(CONSOLE_BLUE, menu_console); + } + else if (col == LOCKED_COLOR) { + glConsoleSetBGColor(CONSOLE_WHITE, menu_console); + glConsoleSetFGColor(CONSOLE_RED, menu_console); + } + else { + glConsoleSetBGColor(CONSOLE_BLACK, menu_console); + glConsoleSetFGColor(CONSOLE_WHITE, menu_console); + } + + glConsolePrintString(string, menu_console); + glConsolePrintString("\n", menu_console); + return PROJECTM_SUCCESS; +} + + + +int print_menu_item(menu_item_t * menu_item) { + + param_adj_t param_adj; + char string[MAX_TOKEN_SIZE]; + int col; + InitCond * init_cond; + + if (menu_item == NULL) + return PROJECTM_FAILURE; + if (active_menu == NULL) + return PROJECTM_FAILURE; + + if (active_menu->locked_item == menu_item) + col = LOCKED_COLOR; + else if (active_menu->selected_item == menu_item) + col = HIGHLIGHT_COLOR; + else + col = DEFAULT_COLOR; + switch (menu_item->menu_entry_type) { + + case PARAM_ADJ_TYPE: + param_adj = menu_item->menu_entry->param_adj; + + switch(param_adj.param->type) { + + case P_TYPE_BOOL: + + if ((init_cond = projectM::activePreset->get_init_cond(param_adj.param)) == NULL) + sprintf(string, "%s ?", param_adj.print_string); + else if (init_cond->init_val.bool_val) + sprintf(string, "%s [ON]", param_adj.print_string); + else + sprintf(string, "%s [OFF]", param_adj.print_string); + break; + case P_TYPE_INT: + if ((init_cond = projectM::activePreset->get_init_cond(param_adj.param)) == NULL) + sprintf(string, "%s ?", param_adj.print_string); + else + sprintf(string, "%s %d", param_adj.print_string, init_cond->init_val.int_val); + break; + case P_TYPE_DOUBLE: + if ((init_cond = projectM::activePreset->get_init_cond(param_adj.param)) == NULL) + sprintf(string, "%s ?", param_adj.print_string); + else + sprintf(string, "%s %f", param_adj.print_string, init_cond->init_val.float_val); + break; + + default: /* unknown paramater type */ + return PROJECTM_FAILURE; + } + return menu_lprint(string, col); + case FUNCTION_MODE_TYPE: + return menu_lprint(menu_item->menu_entry->function_mode.print_string, col); + case MENU_LINK_TYPE: + return menu_lprint(menu_item->menu_entry->menu_link.print_string, col); + default: + if (MENU_DEBUG) printf("print_menu_item: invalid menu entry type, val = %d\n", + menu_item->menu_entry_type); + return PROJECTM_FAILURE; + } + + return PROJECTM_SUCCESS; +} + +/* switchMenuState: changes to another menu item according to the passed direction */ +int switchMenuState(dir_t dir) { + + menu_item_t * new_menu_item; + param_adj_t param_adj; + InitCond * init_cond; + + if (active_menu == NULL) + return PROJECTM_FAILURE; + + /* Case on the direction of the key press */ + switch (dir) { + + case PAGEUP: + if(active_menu->locked_item != NULL) { + if (active_menu->locked_item->menu_entry_type == PARAM_ADJ_TYPE) + return adj_float_param(active_menu->locked_item->menu_entry->param_adj.param, BIG_INC); + } + + /* Force to top of menu */ + active_menu->selected_item = active_menu->start_item; + return PROJECTM_SUCCESS; + case PAGEDOWN: + if(active_menu->locked_item != NULL) { + if (active_menu->locked_item->menu_entry_type == PARAM_ADJ_TYPE) + return adj_float_param(active_menu->locked_item->menu_entry->param_adj.param, BIG_DEC); + } + + /* Force to bottom of menu */ + while((new_menu_item = active_menu->selected_item->down) != NULL) + active_menu->selected_item = new_menu_item; + return PROJECTM_SUCCESS; + + case UP: + if(active_menu->locked_item != NULL) { + if (active_menu->locked_item->menu_entry_type == PARAM_ADJ_TYPE) + return adj_float_param(active_menu->locked_item->menu_entry->param_adj.param, SMALL_INC); + } + + /* Is this the first item of the menu ? */ + if ((new_menu_item = active_menu->selected_item->up) == NULL) + return PROJECTM_SUCCESS; + active_menu->selected_item = new_menu_item; + return PROJECTM_SUCCESS; + case DOWN: + if(active_menu->locked_item != NULL) { + if (active_menu->locked_item->menu_entry_type == PARAM_ADJ_TYPE) + return adj_float_param(active_menu->locked_item->menu_entry->param_adj.param, SMALL_DEC); + } + + /* Is this the last item of the menu ? */ + if ((new_menu_item = active_menu->selected_item->down) == NULL) + return PROJECTM_SUCCESS; + active_menu->selected_item = new_menu_item; + return PROJECTM_SUCCESS; + case LEFT: + /* Left key unlocks the highlighted item */ + if (active_menu->locked_item != NULL) { + /* The left arrow cancels the initial condition adjustment */ + if (active_menu->locked_item->menu_entry_type == PARAM_ADJ_TYPE) { + //active_menu->locked_item->menu_entry->param_adj.param->init_val = saved_init_val; + } + active_menu->locked_item = NULL; + return PROJECTM_SUCCESS; + } + /* Otherwise go up a menu if it isn't the top menu */ + if (active_menu->top_menu == NULL) + return PROJECTM_SUCCESS; + active_menu = active_menu->top_menu; + return PROJECTM_SUCCESS; + case RIGHT: + switch (active_menu->selected_item->menu_entry_type) { + case MENU_LINK_TYPE: + return pursue_menu_link(&active_menu->selected_item->menu_entry->menu_link); + case PARAM_ADJ_TYPE: + param_adj = active_menu->selected_item->menu_entry->param_adj; + + + + if (active_menu->locked_item == NULL) { + + if ((init_cond = projectM::activePreset->get_init_cond(param_adj.param)) == NULL) + return PROJECTM_FAILURE; + + + /* Save previous initial condition value */ + //saved_init_val = init_cond->init_val; + + /* If a bool parameter, just switch its value and quit */ + if (param_adj.param->type == P_TYPE_BOOL) { + init_cond->init_val.bool_val = !init_cond->init_val.bool_val; + return PROJECTM_SUCCESS; + } + + /* Otherwise, lock this parameter so the user can adjust it */ + active_menu->locked_item = active_menu->selected_item; + + } + + /* Unlock the item, but keep the changed initial value intact */ + else { + active_menu->locked_item = NULL; + } + + break; + case FUNCTION_MODE_TYPE: + return active_menu->selected_item->menu_entry->function_mode.func_ptr(); + default: + return PROJECTM_FAILURE; + } + default: + return PROJECTM_FAILURE; +} + +return PROJECTM_SUCCESS; +} + +/* Creates a new menu */ +menu_t * new_menu(menu_t * top_menu) { + + menu_t * menu; + + if ((menu = (menu_t*)wipemalloc(sizeof(menu_t))) == NULL) + return NULL; + + menu->top_menu = top_menu; + menu->start_item = menu->selected_item = NULL; + menu->locked_item = NULL; + return menu; +} + +/* Frees a menu */ +int free_menu(menu_t * menu) { + menu_item_t * menu_item, * backup; + + if (menu == NULL) + return PROJECTM_SUCCESS; + + menu_item = menu->start_item; + + /* Now we free every entry in this menu */ + while (menu_item) { + backup = menu_item->down; + + /* If a menu link, free the sub menu it points to */ + if (menu_item->menu_entry_type == MENU_LINK_TYPE) { + free_menu(menu_item->menu_entry->menu_link.sub_menu); + } + + /* Now free the menu item */ + free_menu_item(menu_item); + + /* Set menu item to the next item in the list */ + menu_item = backup; + } + + /* Finally, we free the menu struct itself */ + free(menu); + menu = NULL; + + /* Finished, return success */ + return PROJECTM_SUCCESS; +} + +/* Creates a new menu link type */ +menu_entry_t * new_menu_link(char * print_string, menu_t * menu_ptr) { + + menu_entry_t * menu_entry; + menu_link_t menu_link; + + /* Argument Checks */ + if (print_string == NULL) + return NULL; + if (menu_ptr == NULL) + return NULL; + + + /* Allocate memory for the menu entry */ + if ((menu_entry = (menu_entry_t*)wipemalloc(sizeof(menu_entry_t))) == NULL) + return NULL; + + + /* Copy the string parameter */ + memset(menu_link.print_string, 0, MAX_TOKEN_SIZE); + strncpy(menu_link.print_string, print_string, MAX_TOKEN_SIZE); + + menu_link.sub_menu = menu_ptr; + + menu_entry->menu_link = menu_link; + + return menu_entry; +} + + +/* Creates a new parameter adjustment entry */ +menu_entry_t * new_param_adj(char * print_string, Param * param) { + + menu_entry_t * menu_entry; + param_adj_t param_adj; + + /* Argument Checks */ + if (print_string == NULL) + return NULL; + + if (param == NULL) { + if (MENU_DEBUG) printf("new_param_adj: passed a null parameter!\n"); + return NULL; + } + + /* Allocate memory for the menu entry */ + if ((menu_entry = (menu_entry_t*)wipemalloc(sizeof(menu_entry_t))) == NULL) + return NULL; + + /* Copy the string parameter */ + memset(param_adj.print_string, 0, MAX_TOKEN_SIZE); + strncpy(param_adj.print_string, print_string, MAX_TOKEN_SIZE); + + param_adj.param = param; + menu_entry->param_adj = param_adj; + + return menu_entry; +} + +/* Appends a menu item */ +int append_menu_item(menu_t * menu, menu_item_t * new_menu_item) { + + menu_item_t * menu_item; + + /* Argument checks */ + if (menu == NULL) + return PROJECTM_FAILURE; + + if (new_menu_item == NULL) + return PROJECTM_FAILURE; + + + /* Menu is empty, insert here */ + if (menu->start_item == NULL) { + menu->start_item = new_menu_item; + new_menu_item->up = NULL; + return PROJECTM_SUCCESS; + } + + menu_item = menu->start_item; + + /* Traverse down the menu */ + while (menu_item->down) { + menu_item = menu_item->down; + } + + /* Insert the item at the end */ + menu_item->down = new_menu_item; + new_menu_item->up = menu_item; + + return PROJECTM_SUCCESS; + +} + +/* Creates a new menu item, up and down entries are null by default */ +menu_item_t * new_menu_item(int menu_entry_type, menu_entry_t * menu_entry) { + + menu_item_t * menu_item; + + /* Argument check */ + if (menu_entry == NULL) + return NULL; + + /* Out of memory check */ + if ((menu_item = (menu_item_t*)wipemalloc(sizeof(menu_item_t))) == NULL) { + return NULL; + } + + menu_item->menu_entry_type = menu_entry_type; + menu_item->menu_entry = menu_entry; + menu_item->up = NULL; + menu_item->down = NULL; + + return menu_item; +} + +/* Frees a menu item */ +int free_menu_item(menu_item_t * menu_item) { + + if (menu_item == NULL) + return PROJECTM_OK; + + free(menu_item->menu_entry); + free(menu_item); + + menu_item = NULL; + + return PROJECTM_SUCCESS; +} + + +/* Creates a new editor mode */ +menu_entry_t * new_function_mode(char * print_string, int (*func_ptr)()) { + + menu_entry_t * menu_entry; + function_mode_t function_mode; + + /* Argument Checks */ + if (print_string == NULL) + return NULL; + + /* Allocate memory for the menu entry */ + if ((menu_entry = (menu_entry_t*)wipemalloc(sizeof(menu_entry_t))) == NULL) + return NULL; + + + /* Copy the string parameter */ + memset(function_mode.print_string, 0, MAX_TOKEN_SIZE); + strncpy(function_mode.print_string, print_string, MAX_TOKEN_SIZE); + + function_mode.func_ptr = func_ptr; + menu_entry->function_mode = function_mode; + + return menu_entry; +} + + +/* Pursues a link in a menu */ +int pursue_menu_link(menu_link_t * menu_link) { + + if (menu_link == NULL) + return PROJECTM_FAILURE; + + active_menu = menu_link->sub_menu; + + return PROJECTM_SUCCESS; +} + + +int edit_per_pixel_eqn() { + hideMenu(); + current_interface = EDITOR_INTERFACE; +// loadEditor(activePreset->per_pixel_eqn_string_buffer,(void (*)()) reloadPerPixel, 80, 24, 140, 60, 0, 0); + return PROJECTM_SUCCESS; +} + +int edit_per_frame_eqn() { + hideMenu(); + current_interface = EDITOR_INTERFACE; +// loadEditor(activePreset->per_frame_eqn_string_buffer, (void (*)())reloadPerFrame,80,24,140,60,0,0); + return PROJECTM_SUCCESS; +} + +int edit_per_frame_init() { + hideMenu(); + current_interface = EDITOR_INTERFACE; +// loadEditor(activePreset->per_frame_init_eqn_string_buffer,(void (*)()) reloadPerFrameInit,80,24,140,60,0,0); + return PROJECTM_SUCCESS; +} + + +int run_bash_shell() { + + printf("setting menu state to special\n"); + menu_display_state = SPECIAL; + // glConsoleStartShell(menu_console); + + //menu_display_state = SHOW; + + return PROJECTM_SUCCESS; +} + + + +/* Adjust a float parameter */ +int adj_float_param(Param * param, adj_t adj) { + + float inc_val; + InitCond * init_cond = NULL; + + if (param == NULL) + return PROJECTM_FAILURE; + + if (param->type == P_TYPE_INT) + return (adj_int_param(param, adj)); + + if ((init_cond = (InitCond*)projectM::activePreset->init_cond_tree->splay_find(param->name)) == NULL) + return PROJECTM_FAILURE; + + switch (adj) { + + case VERY_SMALL_INC: + inc_val = .001; + break; + case SMALL_INC: + inc_val = .01; + break; + case BIG_INC: + inc_val = .1; + break; + case VERY_BIG_INC: + inc_val = 1.0; + break; + case VERY_SMALL_DEC: + inc_val = -.001; + break; + case SMALL_DEC: + inc_val = -.01; + break; + case BIG_DEC: + inc_val = -0.1; + break; + case VERY_BIG_DEC: + inc_val = -1.0; + break; + + default: + return PROJECTM_FAILURE; + } + + /* Beyond upper bounds, normalize to maximum value */ + if ((init_cond->init_val.float_val + inc_val) > param->upper_bound.float_val) + init_cond->init_val.float_val = param->upper_bound.float_val; + + else if ((init_cond->init_val.float_val + inc_val) < param->lower_bound.float_val) + init_cond->init_val.float_val = param->lower_bound.float_val; + + else + init_cond->init_val.float_val += inc_val; + + return PROJECTM_SUCCESS; +} + +/* Adjust an integer parameter */ +int adj_int_param(Param * param, adj_t adj) { + + int inc_val; + InitCond * init_cond = NULL; + + if (param == NULL) + return PROJECTM_FAILURE; + + if ((init_cond = (InitCond*)activePreset->init_cond_tree->splay_find(param->name)) == NULL) + return PROJECTM_FAILURE; + + switch (adj) { + + + case VERY_SMALL_INC: + inc_val = 1; + break; + case SMALL_INC: + inc_val = 1; + break; + case BIG_INC: + inc_val = 1; + break; + case VERY_BIG_INC: + inc_val = 5; + break; + + case VERY_SMALL_DEC: + inc_val = -1; + break; + case SMALL_DEC: + inc_val = -1; + break; + case BIG_DEC: + inc_val = -1; + break; + case VERY_BIG_DEC: + inc_val = -5; + break; + + default: + return PROJECTM_FAILURE; + } + + /* Beyond upper bounds, normalize to maximum value */ + if ((init_cond->init_val.int_val + inc_val) > param->upper_bound.int_val) + init_cond->init_val.int_val = param->upper_bound.int_val; + + /* Below lower bounds, normalize to lowest value */ + else if ((init_cond->init_val.int_val + inc_val) < param->lower_bound.int_val) + init_cond->init_val.int_val = param->lower_bound.int_val; + + else + init_cond->init_val.int_val += inc_val; + + return PROJECTM_SUCCESS; +} + +void menu_key_handler( projectMEvent event, projectMKeycode key ) { + + switch( event ) { + case PROJECTM_KEYDOWN: + switch(key) + { + case PROJECTM_K_f: + + if (projectM::currentEngine->fullscreen==1) + {projectM::currentEngine->renderer->reset(projectM::currentEngine->wvw,projectM::currentEngine->wvh); +projectM::currentEngine->fullscreen=0;} + else{projectM::currentEngine->renderer->reset(projectM::currentEngine->fvw,projectM::currentEngine->fvh); +projectM::currentEngine->fullscreen=1; +} + +// init_display(projectM::currentEngine->vw,projectM::currentEngine->vh,projectM::currentEngine->fullscreen); + + + break; + case PROJECTM_K_n: + //projectM::currentEngine->switchPreset(ALPHA_NEXT, HARD_CUT); + break; + case PROJECTM_K_r: + //projectM::currentEngine->switchPreset(RANDOM_NEXT, HARD_CUT); + break; + case PROJECTM_K_p: + //projectM::currentEngine->switchPreset(ALPHA_PREVIOUS, HARD_CUT); + break; + case PROJECTM_K_a: + break; + case PROJECTM_K_z: + break; + case PROJECTM_K_0: + //nWaveMode=0; + break; + case PROJECTM_K_6: + //nWaveMode=6; + break; + case PROJECTM_K_7: + //nWaveMode=7; + break; + case PROJECTM_K_UP: + switchMenuState(UP); + break; + case PROJECTM_K_RETURN: + case PROJECTM_K_RIGHT: + switchMenuState(RIGHT); + break; + case PROJECTM_K_LEFT: + switchMenuState(LEFT); + break; + case PROJECTM_K_DOWN: + switchMenuState(DOWN); + break; + case PROJECTM_K_PAGEUP: + switchMenuState(PAGEUP); + break; + case PROJECTM_K_PAGEDOWN: + switchMenuState(PAGEDOWN); + break; + case PROJECTM_K_ESCAPE: + case PROJECTM_K_m: + hideMenu(); + current_interface = DEFAULT_INTERFACE; + break; + case PROJECTM_K_t: + break; + default: + break; + } + } + + + + +} +#endif diff --git a/src/projectM-engine-backup/menu.h b/src/projectM-engine-backup/menu.h new file mode 100755 index 000000000..22f020e69 --- /dev/null +++ b/src/projectM-engine-backup/menu.h @@ -0,0 +1,118 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id$ + * + * + * + * $Log$ + */ + +#ifndef _MENU_H +#define _MENU_H + +#include "event.h" +#include "Common.hpp" +#include "Param.hpp" + +#define MENU_DEBUG 0 + +#define PARAM_ADJ_TYPE 0 +#define MENU_LINK_TYPE 1 +#define FUNCTION_MODE_TYPE 2 + +typedef struct MENU_LINK_T { + char print_string[MAX_TOKEN_SIZE]; + struct MENU_T * sub_menu; +} menu_link_t; + +typedef struct PARAM_ADJ_T { + char print_string[MAX_TOKEN_SIZE]; + Param * param; +} param_adj_t; + +typedef struct FUNCTION_MODE_T { + char print_string[MAX_TOKEN_SIZE]; + int (*func_ptr)(); +} function_mode_t; + +typedef union MENU_ENTRY_T { + menu_link_t menu_link; + param_adj_t param_adj; + function_mode_t function_mode; +} menu_entry_t; + + +typedef struct MENU_ITEM_T { + int menu_entry_type; + menu_entry_t * menu_entry; + struct MENU_ITEM_T * up; + struct MENU_ITEM_T * down; +} menu_item_t; + + +typedef struct MENU_T { + menu_item_t * selected_item; + menu_item_t * start_item; + menu_item_t * locked_item; + struct MENU_T * top_menu; +} menu_t; + +/* Direction types */ +typedef enum { + UP, + DOWN, + LEFT, + RIGHT, + PAGEUP, + PAGEDOWN +} dir_t; + +/* Adjustment types */ +typedef enum { + BIG_INC, + BIG_DEC, + SMALL_INC, + SMALL_DEC, + VERY_BIG_INC, + VERY_BIG_DEC, + VERY_SMALL_INC, + VERY_SMALL_DEC +} adj_t; + +typedef enum { + SHOW, + HIDE, + SPECIAL +} display_state; + + + +int switchMenuState(dir_t dir); + +int initMenu(); +int refreshMenu(); +int clearMenu(); +int showMenu(); +int hideMenu(); +void menu_key_handler( projectM *PM, projectMEvent event, projectMKeycode key ); + +#endif /** !_MENU_H */ diff --git a/src/projectM-engine-backup/presets b/src/projectM-engine-backup/presets new file mode 120000 index 000000000..840871fb9 --- /dev/null +++ b/src/projectM-engine-backup/presets @@ -0,0 +1 @@ +../../presets \ No newline at end of file diff --git a/src/projectM-engine-backup/projectM.cpp b/src/projectM-engine-backup/projectM.cpp new file mode 100755 index 000000000..ef74c2a15 --- /dev/null +++ b/src/projectM-engine-backup/projectM.cpp @@ -0,0 +1,705 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +#include "wipemalloc.h" +#include "BuiltinFuncs.hpp" +#include "fatal.h" +#include "Common.hpp" +#include "compare.h" +#ifdef WIN32 +#include "win32-dirent.h" +#endif + +#include "timer.h" +#include +#ifdef LINUX +#include "time.h" +#endif + +//#include +#include "projectM.hpp" +#include "BeatDetect.hpp" +#include "Eval.hpp" +#include "Param.hpp" +#include "Parser.hpp" +#include "Preset.hpp" +#include "PerPixelEqn.hpp" +//#include "menu.h" +#include "PCM.hpp" //Sound data handler (buffering, FFT, etc.) +#include "CustomWave.hpp" +#include "CustomShape.hpp" +#include +#include "Renderer.hpp" +#include "PresetChooser.hpp" + +#ifdef LINUX +const std::string projectM::PROJECTM_PRESET_PATH("/usr/share/projectM/presets/"); +#endif + +#ifdef MACOS +const std::string projectM::PROJECTM_PRESET_PATH("/usr/share/projectM/presets/"); +#endif + + +#ifdef WIN32 +const std::string projectM::PROJECTM_PRESET_PATH("C:\\Program Files\\ProjectM\\presets"); +#endif + +/** Stash current engine */ +projectM *projectM::currentEngine = NULL; + +/** Static variable initialization involving the render. */ +/// @bug These probably shouldn't be static! +RenderTarget * projectM::renderTarget = NULL; +Renderer * projectM::renderer = NULL; + + +DLLEXPORT projectM::projectM() { + beatDetect = NULL; +} + + +DLLEXPORT void projectM::renderFrame() { + +#ifdef DEBUG + char fname[1024]; + FILE *f = NULL; + int index = 0; + int x, y; +#endif + +// printf("Start of loop at %d\n",timestart); + + mspf=(int)(1000.0/(float)presetInputs.fps); //milliseconds per frame + + +#ifndef WIN32 + presetInputs.time = getTicks( &startTime ) * 0.001; +#else + presetInputs.time = getTicks( startTime ) * 0.001; +#endif /** !WIN32 */ + + presetInputs.frame++; //number of frames for current preset + presetInputs.progress= presetInputs.frame/(float)avgtime; + DWRITE( "frame: %d\ttime: %f\tprogress: %f\tavgtime: %d\tang: %f\trot: %f\n", + this->presetInputs.frame, presetInputs.time, this->presetInputs.progress, this->avgtime, this->presetInputs.ang_per_pixel, + this->presetOutputs.rot ); + if (presetInputs.progress>1.0) presetInputs.progress=1.0; + +// printf("start:%d at:%d min:%d stop:%d on:%d %d\n",startframe, frame frame-startframe,avgtime, noSwitch,progress); + presetInputs.ResetMesh(); + + + // assert(m_activePreset.get()); + m_activePreset->evaluateFrame(); + + +// printf("%f %d\n",Time,frame); + + + beatDetect->detectFromSamples(); + DWRITE( "=== vol: %f\tbass: %f\tmid: %f\ttreb: %f ===\n", + beatDetect->vol,beatDetect->bass,beatDetect->mid,beatDetect->treb); + DWRITE( "=== bass_att: %f ===\n", + beatDetect->bass_att ); + + if (renderer->noSwitch==0) { + nohard--; + if ((beatDetect->bass-beatDetect->bass_old>beatDetect->beat_sensitivity || + avgtime ) && nohard<0) { +// printf("%f %d %d\n", beatDetect->bass-beatDetect->bass_old,this->frame,this->avgtime); +// switchPreset(RANDOM_NEXT, HARD_CUT); + nohard=presetInputs.fps*5; + } + } + + count++; + + renderer->RenderFrame(&presetOutputs, &presetInputs); + +#ifndef WIN32 + /** Frame-rate limiter */ + /** Compute once per preset */ + if (this->count%100==0) { + this->renderer->realfps=100.0/((getTicks(&this->startTime)-this->fpsstart)/1000); + this->fpsstart=getTicks(&this->startTime); + } + + int timediff = getTicks(&this->startTime)-this->timestart; + + if ( timediff < this->mspf) { + // printf("%s:",this->mspf-timediff); + int sleepTime = (unsigned int)( this->mspf-timediff ) * 1000; + DWRITE( "usleep: %d\n", sleepTime ); + if ( sleepTime > 0 && sleepTime < 100000 ) { + if ( usleep( sleepTime ) != 0 ) {} + } + } + this->timestart=getTicks(&this->startTime); +#endif /** !WIN32 */ + + DWRITE( "exiting renderFrame()\n" ); +} + +DLLEXPORT void projectM::projectM_reset() { + + DWRITE( "projectM_reset(): in\n" ); + + /// @bug it's very possible this is a hack + m_activePreset = std::auto_ptr(0); + + this->presetURL = NULL; + this->fontURL = NULL; + + /** Default variable settings */ + this->hasInit = 0; + + this->pcmframes = 1; + this->freqframes = 0; + + + + this->fvw = 800; + this->fvh = 600; + this->wvw = 512; + this->wvh = 512; + this->fullscreen = 0; + + /** Frames per preset */ + this->avgtime = 500; + + + + /** More other stuff */ + this->mspf = 0; + this->timed = 0; + this->timestart = 0; + this->nohard = 0; + this->count = 0; + + this->fpsstart = 0; + + projectM_resetengine(); +} + +DLLEXPORT void projectM::projectM_init(int gx, int gy, int fps, int texsize, int width, int height) { + + + + /** Initialise engine variables */ + + + projectM_initengine(); + presetInputs.Initialize(gx, gy); + presetOutputs.Initialize(gx, gy); + + DWRITE("projectM plugin: Initializing\n"); + + /** Initialise start time */ +#ifndef WIN32 + gettimeofday(&this->startTime, NULL); +#else + startTime = GetTickCount(); +#endif /** !WIN32 */ + + /** Nullify frame stash */ + fbuffer = NULL; + + /** Initialise per-pixel matrix calculations */ + + + presetInputs.fps = fps; + + /** We need to initialise this before the builtin param db otherwise bass/mid etc won't bind correctly */ + beatDetect = new BeatDetect(); + + /* Preset loading function */ + initPresetTools(); + + /* Load default preset directory */ +#ifdef MACOS2 + /** Probe the bundle for info */ + CFBundleRef bundle = CFBundleGetMainBundle(); + char msg[1024]; + sprintf( msg, "bundle: %X\n", bundle ); + DWRITE( msg ); + if ( bundle != NULL ) { + CFPlugInRef pluginRef = CFBundleGetPlugIn( bundle ); + if ( pluginRef != NULL ) { + DWRITE( "located plugin ref\n" ); + } else { + DWRITE( "failed to find plugin ref\n" ); + } + + CFURLRef bundleURL = CFBundleCopyBundleURL( bundle ); + if ( bundleURL == NULL ) { + DWRITE( "bundleURL failed\n" ); + } else { + DWRITE( "bundleURL OK\n" ); + } + char *bundleName = + (char *)CFStringGetCStringPtr( CFURLGetString( bundleURL ), kCFStringEncodingMacRoman ); + DWRITE( "bundleURL: %s\n", bundleName ); + + presetURL = CFBundleCopyResourceURL( bundle, purl, NULL, NULL ); + if ( presetURL != NULL ) { + this->presetURL = (char *)CFStringGetCStringPtr( CFURLCopyPath( presetURL ), kCFStringEncodingMacRoman); + sprintf( msg, "Preset: %s\n", presetURL ); + DWRITE( msg ); + printf( msg ); + + /** Stash the short preset name */ + + } else { + DWRITE( "Failed to probe 'presets' bundle ref\n" ); + this->presetURL = NULL; + } + + fontURL = CFBundleCopyResourceURL( bundle, furl, NULL, NULL ); + if ( fontURL != NULL ) { + fontURL = (char *)CFStringGetCStringPtr( CFURLCopyPath( fontURL ), kCFStringEncodingMacRoman); + sprintf( msg, "Font: %s\n", fontURL ); + DWRITE( msg ); + printf( msg ); + } else { + DWRITE( "Failed to probe 'fonts' bundle ref\n" ); + fontURL = NULL; + } + } + + /** Sanity check */ + if ( bundle == NULL || presetURL == NULL || fontURL == NULL ) { + sprintf( msg, "defaulting presets\n" ); + DWRITE( msg ); + this->fontURL = (char *)wipemalloc( sizeof( char ) * 512 ); +// strcpy( this->fontURL, "../../fonts/" ); + strcpy( fontURL, "/Users/descarte/tmp/projectM/fonts" ); + this->fontURL[34] = '\0'; +// loadPresetDir( "../../presets/" ); +// loadPresetDir( "/Users/descarte/tmp/projectM-1.00/presets_projectM" ); + } else { + printf( "PresetDir: %s\n", this->presetURL ); + loadPresetDir( presetURL ); + } +#else + if ( presetURL == NULL || fontURL == NULL ) { + char msg[1024]; + sprintf( msg, "defaulting presets\n" ); + DWRITE( msg ); + fontURL = (char *)wipemalloc( sizeof( char ) * 512 ); +#ifdef WIN32 + strcpy( this->fontURL, "c:\\tmp\\projectM\\fonts" ); + fontURL[24] = '\0'; +#else + strcpy( this->fontURL, "/Users/descarte/tmp/projectM/fonts" ); + fontURL[34] = '\0'; +#endif + DWRITE( "loading font URL directly: %s\n", this->fontURL ); +#ifdef WIN32 + // loadPresetDir( "c:\\tmp\\projectM\\presets_projectM" ); +#else + // loadPresetDir( "/Users/descarte/tmp/projectM-1.00/presets_projectM" ); +#endif + } else { + printf( "PresetDir: %s\n", this->presetURL ); + //loadPresetDir( presetURL ); + } + +#endif + + + mspf=(int)(1000.0/(float)presetInputs.fps); + + +// initMenu(); +//DWRITE( "post initMenu()\n" ); + + printf("mesh: %d %d\n", gx,gy ); + +#ifdef PANTS + printf( "maxsamples: %d\n", this->maxsamples ); + initPCM(this->maxsamples); + DWRITE( "post PCM init\n" ); +#endif + + this->avgtime=this->presetInputs.fps*20; + + this->hasInit = 1; + + this->renderTarget = new RenderTarget(texsize, width, height); + this->presetInputs.gx = gx; + this->presetInputs.gy = gy; + + this->renderer = new Renderer(width, height, gx, gy, renderTarget, beatDetect, fontURL); + + printf( "exiting projectM_init()\n" ); +} + + + + +//calculate matrices for per_pixel + + + + +DLLEXPORT void projectM::projectM_initengine() { + + /* PER FRAME CONSTANTS BEGIN */ + this->presetOutputs.zoom=1.0; + this->presetOutputs.zoomexp= 1.0; + this->presetOutputs.rot= 0.0; + this->presetOutputs.warp= 0.0; + + this->presetOutputs.sx= 1.0; + this->presetOutputs.sy= 1.0; + this->presetOutputs.dx= 0.0; + this->presetOutputs.dy= 0.0; + this->presetOutputs.cx= 0.5; + this->presetOutputs.cy= 0.5; + + this->presetOutputs.decay=.98; + + this->presetOutputs.wave_r= 1.0; + this->presetOutputs.wave_g= 0.2; + this->presetOutputs.wave_b= 0.0; + this->presetOutputs.wave_x= 0.5; + this->presetOutputs.wave_y= 0.5; + this->presetOutputs.wave_mystery= 0.0; + + this->presetOutputs.ob_size= 0.0; + this->presetOutputs.ob_r= 0.0; + this->presetOutputs.ob_g= 0.0; + this->presetOutputs.ob_b= 0.0; + this->presetOutputs.ob_a= 0.0; + + this->presetOutputs.ib_size = 0.0; + this->presetOutputs.ib_r = 0.0; + this->presetOutputs.ib_g = 0.0; + this->presetOutputs.ib_b = 0.0; + this->presetOutputs.ib_a = 0.0; + + this->presetOutputs.mv_a = 0.0; + this->presetOutputs.mv_r = 0.0; + this->presetOutputs.mv_g = 0.0; + this->presetOutputs.mv_b = 0.0; + this->presetOutputs.mv_l = 1.0; + this->presetOutputs.mv_x = 16.0; + this->presetOutputs.mv_y = 12.0; + this->presetOutputs.mv_dy = 0.02; + this->presetOutputs.mv_dx = 0.02; + +//this->presetInputs.meshx = 0; +//this->presetInputs.meshy = 0; + + + this->presetInputs.progress = 0; + this->presetInputs.frame = 0; + + this->avgtime = 600; +//bass_thresh = 0; + + /* PER_FRAME CONSTANTS END */ + this->presetOutputs.fRating = 0; + this->presetOutputs.fGammaAdj = 1.0; + this->presetOutputs.fVideoEchoZoom = 1.0; + this->presetOutputs.fVideoEchoAlpha = 0; + this->presetOutputs.nVideoEchoOrientation = 0; + + this->presetOutputs.nWaveMode = 7; + this->presetOutputs.bAdditiveWaves = 0; + this->presetOutputs.bWaveDots = 0; + this->presetOutputs.bWaveThick = 0; + this->presetOutputs.bModWaveAlphaByVolume = 0; + this->presetOutputs.bMaximizeWaveColor = 0; + this->presetOutputs.bTexWrap = 0; + this->presetOutputs.bDarkenCenter = 0; + this->presetOutputs.bRedBlueStereo = 0; + this->presetOutputs.bBrighten = 0; + this->presetOutputs.bDarken = 0; + this->presetOutputs.bSolarize = 0; + this->presetOutputs.bInvert = 0; + this->presetOutputs.bMotionVectorsOn = 1; + + this->presetOutputs.fWaveAlpha =1.0; + this->presetOutputs.fWaveScale = 1.0; + this->presetOutputs.fWaveSmoothing = 0; + this->presetOutputs.fWaveParam = 0; + this->presetOutputs.fModWaveAlphaStart = 0; + this->presetOutputs.fModWaveAlphaEnd = 0; + this->presetOutputs.fWarpAnimSpeed = 0; + this->presetOutputs.fWarpScale = 0; + this->presetOutputs.fShader = 0; + + + /* PER_PIXEL CONSTANTS BEGIN */ + this->presetInputs.x_per_pixel = 0; + this->presetInputs.y_per_pixel = 0; + this->presetInputs.rad_per_pixel = 0; + this->presetInputs.ang_per_pixel = 0; + + /* PER_PIXEL CONSTANT END */ + + + /* Q AND T VARIABLES START */ + + this->presetOutputs.q1 = 0; + this->presetOutputs.q2 = 0; + this->presetOutputs.q3 = 0; + this->presetOutputs.q4 = 0; + this->presetOutputs.q5 = 0; + this->presetOutputs.q6 = 0; + this->presetOutputs.q7 = 0; + this->presetOutputs.q8 = 0; + + + /* Q AND T VARIABLES END */ + +//per pixel meshes +/* + // this->presetOutputs.zoom_mesh = NULL; + // this->presetOutputs.zoomexp_mesh = NULL; + //this->presetOutputs.rot_mesh = NULL; + + + // this->presetOutputs.sx_mesh = NULL; + // this->presetOutputs.sy_mesh = NULL; + // this->presetOutputs.dx_mesh = NULL; + // this->presetOutputs.dy_mesh = NULL; + // this->presetOutputs.cx_mesh = NULL; + // this->presetOutputs.cy_mesh = NULL; + + // this->presetInputs.x_mesh = NULL; + / this->presetInputs.y_mesh = NULL; + // this->presetInputs.rad_mesh = NULL; + // this->presetInputs.theta_mesh = NULL; +*/ + +//custom wave per point meshes +} + +/* Reinitializes the engine variables to a default (conservative and sane) value */ +DLLEXPORT void projectM::projectM_resetengine() { + + this->presetOutputs.zoom=1.0; + this->presetOutputs.zoomexp= 1.0; + this->presetOutputs.rot= 0.0; + this->presetOutputs.warp= 0.0; + + this->presetOutputs.sx= 1.0; + this->presetOutputs.sy= 1.0; + this->presetOutputs.dx= 0.0; + this->presetOutputs.dy= 0.0; + this->presetOutputs.cx= 0.5; + this->presetOutputs.cy= 0.5; + + this->presetOutputs.decay=.98; + + this->presetOutputs.wave_r= 1.0; + this->presetOutputs.wave_g= 0.2; + this->presetOutputs.wave_b= 0.0; + this->presetOutputs.wave_x= 0.5; + this->presetOutputs.wave_y= 0.5; + this->presetOutputs.wave_mystery= 0.0; + + this->presetOutputs.ob_size= 0.0; + this->presetOutputs.ob_r= 0.0; + this->presetOutputs.ob_g= 0.0; + this->presetOutputs.ob_b= 0.0; + this->presetOutputs.ob_a= 0.0; + + this->presetOutputs.ib_size = 0.0; + this->presetOutputs.ib_r = 0.0; + this->presetOutputs.ib_g = 0.0; + this->presetOutputs.ib_b = 0.0; + this->presetOutputs.ib_a = 0.0; + + this->presetOutputs.mv_a = 0.0; + this->presetOutputs.mv_r = 0.0; + this->presetOutputs.mv_g = 0.0; + this->presetOutputs.mv_b = 0.0; + this->presetOutputs.mv_l = 1.0; + this->presetOutputs.mv_x = 16.0; + this->presetOutputs.mv_y = 12.0; + this->presetOutputs.mv_dy = 0.02; + this->presetOutputs.mv_dx = 0.02; + + + if ( beatDetect != NULL ) { + beatDetect->reset(); + } + this->presetInputs.progress = 0; + this->presetInputs.frame = 0; + +// bass_thresh = 0; + + /* PER_FRAME CONSTANTS END */ + this->presetOutputs.fRating = 0; + this->presetOutputs.fGammaAdj = 1.0; + this->presetOutputs.fVideoEchoZoom = 1.0; + this->presetOutputs.fVideoEchoAlpha = 0; + this->presetOutputs.nVideoEchoOrientation = 0; + + this->presetOutputs.nWaveMode = 7; + this->presetOutputs.bAdditiveWaves = 0; + this->presetOutputs.bWaveDots = 0; + this->presetOutputs.bWaveThick = 0; + this->presetOutputs.bModWaveAlphaByVolume = 0; + this->presetOutputs.bMaximizeWaveColor = 0; + this->presetOutputs.bTexWrap = 0; + this->presetOutputs.bDarkenCenter = 0; + this->presetOutputs.bRedBlueStereo = 0; + this->presetOutputs.bBrighten = 0; + this->presetOutputs.bDarken = 0; + this->presetOutputs.bSolarize = 0; + this->presetOutputs.bInvert = 0; + this->presetOutputs.bMotionVectorsOn = 1; + + this->presetOutputs.fWaveAlpha =1.0; + this->presetOutputs.fWaveScale = 1.0; + this->presetOutputs.fWaveSmoothing = 0; + this->presetOutputs.fWaveParam = 0; + this->presetOutputs.fModWaveAlphaStart = 0; + this->presetOutputs.fModWaveAlphaEnd = 0; + this->presetOutputs.fWarpAnimSpeed = 0; + this->presetOutputs.fWarpScale = 0; + this->presetOutputs.fShader = 0; + + + /* PER_PIXEL CONSTANTS BEGIN */ + this->presetInputs.x_per_pixel = 0; + this->presetInputs.y_per_pixel = 0; + this->presetInputs.rad_per_pixel = 0; + this->presetInputs.ang_per_pixel = 0; + + /* PER_PIXEL CONSTANT END */ + + + /* Q VARIABLES START */ + + this->presetOutputs.q1 = 0; + this->presetOutputs.q2 = 0; + this->presetOutputs.q3 = 0; + this->presetOutputs.q4 = 0; + this->presetOutputs.q5 = 0; + this->presetOutputs.q6 = 0; + this->presetOutputs.q7 = 0; + this->presetOutputs.q8 = 0; + + + /* Q VARIABLES END */ + + /** Stash the current engine */ + currentEngine = this; +} + +/** Resets OpenGL state */ +DLLEXPORT void projectM::projectM_resetGL( int w, int h ) { + + + int mindim, origtexsize; + + DWRITE( "projectM_resetGL(): in: %d x %d\n", w, h ); + + /** Stash the new dimensions */ + + + + renderer->reset(w,h); +} + +/** Sets the title to display */ +DLLEXPORT void projectM::projectM_setTitle( char *title ) { + /* + if (strcmp(this->title, title)!=0) + {printf("new title\n"); + this->drawtitle=1; + + if ( this->title != NULL ) { + free( this->title ); + this->title = NULL; + } + + this->title = (char *)wipemalloc( sizeof( char ) * ( strlen( title ) + 1 ) ); + strcpy( this->title, title ); + + } + */ +} + + +int projectM::initPresetTools() { + + /* Initializes the builtin function database */ + BuiltinFuncs::init_builtin_func_db(); + + /* Initializes all infix operators */ + Eval::init_infix_ops(); + + /* Set the seed to the current time in seconds */ +#ifdef WIN32 + srand(time(NULL)); +#endif + + if ((m_presetLoader = new PresetLoader(PROJECTM_PRESET_PATH)) == 0) { + m_presetLoader = 0; + std::cerr << "[projectM] error allocating preset loader" << std::endl; + return PROJECTM_FAILURE; + } + + if ((m_presetChooser = new PresetChooser(*m_presetLoader)) == 0) { + delete(m_presetLoader); + m_presetChooser = 0; + std::cerr << "[projectM] error allocating preset chooser" << std::endl; + return PROJECTM_FAILURE; + } + +// Start the iterator + m_presetPos = new PresetIterator(); + *m_presetPos = m_presetChooser->begin(); + if (*m_presetPos == m_presetChooser->end()) { + std::cerr << "[projectM] error: no valid files found in preset directory \"" << PROJECTM_PRESET_PATH << "\"" << std::endl; + } + + std::cerr << "[projectM] Allocating first preset..." << std::endl; + m_activePreset = m_presetPos->allocate(presetInputs, presetOutputs); + + std::cerr << "[projectM] First preset allocated. Name is \"" << m_activePreset->name << "\"" << std::endl; + projectM_resetengine(); + + /* Done */ +#ifdef PRESET_DEBUG + printf("initPresetLoader: finished\n"); +#endif + return PROJECTM_SUCCESS; +} + +void projectM::destroyPresetTools() { + + if (m_presetChooser) + delete(m_presetChooser); + + if (m_presetLoader) + delete(m_presetLoader); + + Eval::destroy_infix_ops(); + BuiltinFuncs::destroy_builtin_func_db(); + +} diff --git a/src/projectM-engine-backup/projectM.dsp b/src/projectM-engine-backup/projectM.dsp new file mode 100755 index 000000000..06efa3d37 --- /dev/null +++ b/src/projectM-engine-backup/projectM.dsp @@ -0,0 +1,381 @@ +# Microsoft Developer Studio Project File - Name="projectM" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=projectM - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "projectM.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "projectM.mak" CFG="projectM - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "projectM - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "projectM - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "projectM - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "projectM - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "DEBUG" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "projectM - Win32 Release" +# Name "projectM - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\beat_detect.c +# End Source File +# Begin Source File + +SOURCE=.\browser.c +# End Source File +# Begin Source File + +SOURCE=.\builtin_funcs.c +# End Source File +# Begin Source File + +SOURCE=.\console_interface.c +# End Source File +# Begin Source File + +SOURCE=.\custom_shape.c +# End Source File +# Begin Source File + +SOURCE=.\custom_wave.c +# End Source File +# Begin Source File + +SOURCE=.\editor.c +# End Source File +# Begin Source File + +SOURCE=.\eval.c +# End Source File +# Begin Source File + +SOURCE=.\fftsg.c +# End Source File +# Begin Source File + +SOURCE=.\func.c +# End Source File +# Begin Source File + +SOURCE=.\glConsole.c +# End Source File +# Begin Source File + +SOURCE=.\glf.c +# End Source File +# Begin Source File + +SOURCE=.\init_cond.c +# End Source File +# Begin Source File + +SOURCE=.\menu.c +# End Source File +# Begin Source File + +SOURCE=.\param.c +# End Source File +# Begin Source File + +SOURCE=.\parser.c +# End Source File +# Begin Source File + +SOURCE=.\PCM.c +# End Source File +# Begin Source File + +SOURCE=.\per_frame_eqn.c +# End Source File +# Begin Source File + +SOURCE=.\per_pixel_eqn.c +# End Source File +# Begin Source File + +SOURCE=.\preset.c +# End Source File +# Begin Source File + +SOURCE=.\projectm.c +# End Source File +# Begin Source File + +SOURCE=.\pbuffer.c +# End Source File +# Begin Source File + +SOURCE=.\splaytree.c +# End Source File +# Begin Source File + +SOURCE=.\timer.c +# End Source File +# Begin Source File + +SOURCE=.\tree_types.c +# End Source File +# Begin Source File + +SOURCE=".\win32-dirent.c" +# End Source File +# Begin Source File + +SOURCE=.\wipemalloc.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\beat_detect.h +# End Source File +# Begin Source File + +SOURCE=.\browser.h +# End Source File +# Begin Source File + +SOURCE=.\builtin_funcs.h +# End Source File +# Begin Source File + +SOURCE=.\common.h +# End Source File +# Begin Source File + +SOURCE=.\compare.h +# End Source File +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=.\console_interface.h +# End Source File +# Begin Source File + +SOURCE=.\custom_shape.h +# End Source File +# Begin Source File + +SOURCE=.\custom_shape_types.h +# End Source File +# Begin Source File + +SOURCE=.\custom_wave.h +# End Source File +# Begin Source File + +SOURCE=.\custom_wave_types.h +# End Source File +# Begin Source File + +SOURCE=.\editor.h +# End Source File +# Begin Source File + +SOURCE=.\eval.h +# End Source File +# Begin Source File + +SOURCE=.\event.h +# End Source File +# Begin Source File + +SOURCE=.\expr_types.h +# End Source File +# Begin Source File + +SOURCE=.\fatal.h +# End Source File +# Begin Source File + +SOURCE=.\fftsg.h +# End Source File +# Begin Source File + +SOURCE=.\func.h +# End Source File +# Begin Source File + +SOURCE=.\func_types.h +# End Source File +# Begin Source File + +SOURCE=.\glConsole.h +# End Source File +# Begin Source File + +SOURCE=.\glf.h +# End Source File +# Begin Source File + +SOURCE=.\idle_preset.h +# End Source File +# Begin Source File + +SOURCE=.\init_cond.h +# End Source File +# Begin Source File + +SOURCE=.\init_cond_types.h +# End Source File +# Begin Source File + +SOURCE=.\interface_types.h +# End Source File +# Begin Source File + +SOURCE=.\menu.h +# End Source File +# Begin Source File + +SOURCE=.\param.h +# End Source File +# Begin Source File + +SOURCE=.\param_types.h +# End Source File +# Begin Source File + +SOURCE=.\parser.h +# End Source File +# Begin Source File + +SOURCE=.\PCM.h +# End Source File +# Begin Source File + +SOURCE=.\per_frame_eqn.h +# End Source File +# Begin Source File + +SOURCE=.\per_frame_eqn_types.h +# End Source File +# Begin Source File + +SOURCE=.\per_pixel_eqn.h +# End Source File +# Begin Source File + +SOURCE=.\per_pixel_eqn_types.h +# End Source File +# Begin Source File + +SOURCE=.\per_point_types.h +# End Source File +# Begin Source File + +SOURCE=.\preset.h +# End Source File +# Begin Source File + +SOURCE=.\preset_types.h +# End Source File +# Begin Source File + +SOURCE=.\projectM.h +# End Source File +# Begin Source File + +SOURCE=.\pbuffer.h +# End Source File +# Begin Source File + +SOURCE=.\splaytree.h +# End Source File +# Begin Source File + +SOURCE=.\splaytree_types.h +# End Source File +# Begin Source File + +SOURCE=.\timer.h +# End Source File +# Begin Source File + +SOURCE=.\tree_types.h +# End Source File +# Begin Source File + +SOURCE=".\win32-dirent.h" +# End Source File +# Begin Source File + +SOURCE=.\wipemalloc.h +# End Source File +# End Group +# End Target +# End Project diff --git a/src/projectM-engine-backup/projectM.hpp b/src/projectM-engine-backup/projectM.hpp new file mode 100755 index 000000000..843674dfc --- /dev/null +++ b/src/projectM-engine-backup/projectM.hpp @@ -0,0 +1,242 @@ +/* + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: projectM.hpp,v 1.1.1.1 2005/12/23 18:05:11 psperl Exp $ + * + * Encapsulation of ProjectM engine + * + * $Log$ + */ + +#ifndef _PROJECTM_H +#define _PROJECTM_H + +#include "PBuffer.hpp" + +#ifdef WIN32 +#include "win32-dirent.h" +#else +#include +#endif /** WIN32 */ +#include +#include +#include +#include +#ifndef WIN32 +#include +#endif +#include + +#ifdef MACOS +#include +#include +#include +#else +#ifdef WIN32 +#include +#endif /** WIN32 */ +#include +#include +#endif /** MACOS */ +#ifdef WIN322 +#define inline +#endif /** WIN32 */ +#ifndef WIN32 +#include +#else +#endif /** !WIN32 */ + +#include "dlldefs.h" +#include "event.h" +#include "fatal.h" +#include "PresetFrameIO.hpp" +#include "Renderer.hpp" +//#include "PresetChooser.hpp" + +#include + +class BeatDetect; +class Func; +class Renderer; +class Preset; +class PresetIterator; +class PresetChooser; +class PresetLoader; + +#include +#ifdef WIN32 +#pragma warning (disable:4244) +#pragma warning (disable:4305) +#endif /** WIN32 */ + +#ifdef MACOS2 +#define inline +#endif + +/** KEEP THIS UP TO DATE! */ +#define PROJECTM_VERSION "1.02.00" +#define PROJECTM_TITLE "projectM 1.02.00" + +/** Per-platform path separators */ +#define WIN32_PATH_SEPARATOR '\\' +#define UNIX_PATH_SEPARATOR '/' +#ifdef WIN32 +#define PATH_SEPARATOR WIN32_PATH_SEPARATOR +#else +#define PATH_SEPARATOR UNIX_PATH_SEPARATOR +#endif /** WIN32 */ + +/** Thread state */ +typedef enum { GO, STOP } PMThreadState; + +/** Interface types */ +typedef enum { + MENU_INTERFACE, + SHELL_INTERFACE, + EDITOR_INTERFACE, + DEFAULT_INTERFACE, + BROWSER_INTERFACE + } interface_t; + + +class projectM { +public: + static const std::string PROJECTM_PRESET_PATH; + + static projectM *currentEngine; + static Renderer *renderer; + static RenderTarget *renderTarget; + + char *presetURL; + + char *fontURL; + + int hasInit; + + int pcmframes; + int freqframes; + + + GLubyte *fbuffer; + +#ifndef WIN32 + /* The first ticks value of the application */ + struct timeval startTime; +#else + long startTime; +#endif /** !WIN32 */ + + /** Render target texture ID */ + + char disp[80]; + + float wave_o; + + //int texsize=1024; //size of texture to do actual graphics + int fvw; //fullscreen dimensions + int fvh; + int wvw; //windowed dimensions + int wvh; + + int fullscreen; + + int avgtime; //# frames per preset + + /** Timing information */ + int mspf; + int timed; + int timestart; + int nohard; + int count; + float fpsstart; + + /** Various toggles */ + /* PER_FRAME CONSTANTS END */ + + /** Beat detection engine */ + BeatDetect *beatDetect; + + /** All readonly variables + * which are passed as inputs + * to presets. See struct definitition above */ + PresetInputs presetInputs; + + /** The presets modify these values. For now this is declared on stack + * but might be better on heap for sake of smooth preset switching */ + PresetOutputs presetOutputs; + + /** Functions */ + DLLEXPORT projectM(); + + DLLEXPORT void projectM_init(int gx, int gy, int fps, int texsize, int width, int height); + DLLEXPORT void projectM_reset(); + DLLEXPORT void projectM_resetGL( int width, int height ); + DLLEXPORT void projectM_setTitle( char *title ); + DLLEXPORT void renderFrame(); + + DLLEXPORT void projectM_initengine(); + DLLEXPORT void projectM_resetengine(); + void draw_help(); + void draw_fps(float fps); + void draw_preset(); + void draw_title(); + void draw_stats(); + + void do_per_pixel_math(); + void do_per_frame(); + + void render_interpolation(); + void render_texture_to_screen(); + void render_texture_to_studio(); + + void get_title(); + + void reset_per_pixel_matrices(); + void init_per_pixel_matrices(); + void rescale_per_pixel_matrices(); + void free_per_pixel_matrices(); + + void key_handler( projectMEvent event, + projectMKeycode keycode, projectMModifier modifier ); + void default_key_handler( projectMEvent event, projectMKeycode keycode ); + + /// Initializes preset loading / management libraries + int initPresetTools(); + + /// Deinitialize all preset related tools. Usually done before projectM cleanup + void destroyPresetTools(); + + private: + + // The current position of the directory iterator + PresetIterator * m_presetPos; + + // Required by the preset chooser. Manages a loaded preset directory + PresetLoader * m_presetLoader; + + // Provides accessor functions to choose presets + PresetChooser * m_presetChooser; + + // Currently loaded preset- will be fancier when smooth preset switching + std::auto_ptr m_activePreset; + }; + +#endif /** !_PROJECTM_H */ diff --git a/src/projectM-engine-backup/sdltoprojectM.h b/src/projectM-engine-backup/sdltoprojectM.h new file mode 100755 index 000000000..d2a974db0 --- /dev/null +++ b/src/projectM-engine-backup/sdltoprojectM.h @@ -0,0 +1,165 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: sdltoprojectM.hpp,v 1.1 2004/10/08 00:35:28 cvs Exp $ + * + * Translates SDL -> projectM variables + * + * $Log: sdltoprojectM.hpp,v $ + * Revision 1.1 2004/10/08 00:35:28 cvs + * Moved and imported + * + * Revision 1.1.1.1 2004/10/04 12:56:00 cvs + * Imported + * + */ + +#ifndef _SDLTOPROJECTM_H +#define _SDLTOPROJECTM_H + +#include "event.h" + + //#include "projectM/projectM.hpp" +#ifdef WIN32 +#include +#else +#include +#endif + +inline projectMEvent sdl2pmEvent( SDL_Event event ) { \ + + switch ( event.type ) { \ + case SDL_VIDEORESIZE: + return PROJECTM_VIDEORESIZE; \ + case SDL_KEYUP: \ + return PROJECTM_KEYUP; \ + case SDL_KEYDOWN: \ + return PROJECTM_KEYDOWN; \ + default: + return PROJECTM_KEYUP; \ + } \ + } \ + +inline projectMKeycode sdl2pmKeycode( SDLKey keysym ) { \ + switch ( keysym ) { \ + case SDLK_F1: \ + return PROJECTM_K_F1; \ + case SDLK_F2: \ + return PROJECTM_K_F2; \ + case SDLK_F3: \ + return PROJECTM_K_F3; \ + case SDLK_F4: \ + return PROJECTM_K_F4; \ + case SDLK_F5: \ + return PROJECTM_K_F5; \ + case SDLK_F6: \ + return PROJECTM_K_F6; \ + case SDLK_F7: \ + return PROJECTM_K_F7; \ + case SDLK_F8: \ + return PROJECTM_K_F8; \ + case SDLK_F9: \ + return PROJECTM_K_F9; \ + case SDLK_F10: \ + return PROJECTM_K_F10; \ + case SDLK_F11: \ + return PROJECTM_K_F11; \ + case SDLK_F12: \ + return PROJECTM_K_F12; \ + case SDLK_ESCAPE: \ + return PROJECTM_K_ESCAPE; + case SDLK_a: + return PROJECTM_K_a; + case SDLK_b: + return PROJECTM_K_b; + case SDLK_c: + return PROJECTM_K_c; + case SDLK_d: + return PROJECTM_K_d; + case SDLK_e: + return PROJECTM_K_e; + case SDLK_f: + return PROJECTM_K_f; + case SDLK_g: + return PROJECTM_K_g; + case SDLK_h: + return PROJECTM_K_h; + case SDLK_i: + return PROJECTM_K_i; + case SDLK_j: + return PROJECTM_K_j; + case SDLK_k: + return PROJECTM_K_k; + case SDLK_l: + return PROJECTM_K_l; + case SDLK_m: + return PROJECTM_K_m; + case SDLK_n: + return PROJECTM_K_n; + case SDLK_o: + return PROJECTM_K_o; + case SDLK_p: + return PROJECTM_K_p; + case SDLK_q: + return PROJECTM_K_q; + case SDLK_r: + return PROJECTM_K_r; + case SDLK_s: + return PROJECTM_K_s; + case SDLK_t: + return PROJECTM_K_t; + case SDLK_u: + return PROJECTM_K_u; + case SDLK_v: + return PROJECTM_K_v; + case SDLK_w: + return PROJECTM_K_w; + case SDLK_x: + return PROJECTM_K_x; + case SDLK_y: + return PROJECTM_K_y; + case SDLK_z: + return PROJECTM_K_z; + case SDLK_UP: + return PROJECTM_K_UP; + case SDLK_RETURN: + return PROJECTM_K_RETURN; + case SDLK_RIGHT: + return PROJECTM_K_RIGHT; + case SDLK_LEFT: + return PROJECTM_K_LEFT; + case SDLK_DOWN: + return PROJECTM_K_DOWN; + case SDLK_PAGEUP: + return PROJECTM_K_PAGEUP; + case SDLK_PAGEDOWN: + return PROJECTM_K_PAGEDOWN; + + default: \ + return PROJECTM_K_NONE; \ + } \ + } \ + +inline projectMModifier sdl2pmModifier( SDLMod mod ) { \ + return PROJECTM_KMOD_LSHIFT; \ + } \ + +#endif /** _SDLTOPROJECTM_H */ diff --git a/src/projectM-engine-backup/timer.cpp b/src/projectM-engine-backup/timer.cpp new file mode 100755 index 000000000..e9e1dafc7 --- /dev/null +++ b/src/projectM-engine-backup/timer.cpp @@ -0,0 +1,44 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: timer.c,v 1.1.1.1 2005/12/23 18:05:05 psperl Exp $ + * + * Platform-independent timer + */ + +#include "timer.h" +#include + +#ifndef WIN32 +/** Get number of ticks since the given timestamp */ +unsigned int getTicks( struct timeval *start ) { + struct timeval now; + unsigned int ticks; + + gettimeofday(&now, NULL); + ticks=(now.tv_sec-start->tv_sec)*1000+(now.tv_usec-start->tv_usec)/1000; + return(ticks); + } +#else +unsigned int getTicks( long start ) { + return GetTickCount() - start; + } +#endif /** !WIN32 */ diff --git a/src/projectM-engine-backup/timer.h b/src/projectM-engine-backup/timer.h new file mode 100755 index 000000000..2c797593f --- /dev/null +++ b/src/projectM-engine-backup/timer.h @@ -0,0 +1,49 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: timer.h,v 1.1.1.1 2005/12/23 18:05:00 psperl Exp $ + * + * Platform-independent timer + * + * $Log: timer.h,v $ + * Revision 1.1.1.1 2005/12/23 18:05:00 psperl + * Imported + * + * Revision 1.2 2004/10/05 09:19:40 cvs + * Fixed header include defines + * + * Revision 1.1.1.1 2004/10/04 12:56:00 cvs + * Imported + * + */ + +#ifndef _TIMER_H +#define _TIMER_H + +#ifndef WIN32 +#include +unsigned int getTicks( struct timeval *start ); +#else +#include +unsigned int getTicks( long start ); +#endif /** !WIN32 */ + +#endif /** _TIMER_H */ diff --git a/src/projectM-engine-backup/win32-dirent.cpp b/src/projectM-engine-backup/win32-dirent.cpp new file mode 100755 index 000000000..a5397603e --- /dev/null +++ b/src/projectM-engine-backup/win32-dirent.cpp @@ -0,0 +1,231 @@ +/* + + Implementation of POSIX directory browsing functions and types for Win32. + + Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com) + History: Created March 1997. Updated June 2003. + Rights: See end of file. + +*/ + +#include "win32-dirent.h" +#include +#include /* _findfirst and _findnext set errno iff they return -1 */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct DIR +{ + long handle; /* -1 for failed rewind */ + struct _finddata_t info; + struct dirent result; /* d_name null iff first time */ + char *name; /* null-terminated char string */ +}; + +DIR *opendir(const char *name) +{ + DIR *dir = 0; + + if(name && name[0]) + { + size_t base_length = strlen(name); + const char *all = /* search pattern must end with suitable wildcard */ + strchr("/\\", name[base_length - 1]) ? "*" : "/*"; + + if((dir = (DIR *) malloc(sizeof *dir)) != 0 && + (dir->name = (char *) malloc(base_length + strlen(all) + 1)) != 0) + { + strcat(strcpy(dir->name, name), all); + + if((dir->handle = (long) _findfirst(dir->name, &dir->info)) != -1) + { + dir->result.d_name = 0; + } + else /* rollback */ + { + free(dir->name); + free(dir); + dir = 0; + } + } + else /* rollback */ + { + free(dir); + dir = 0; + errno = ENOMEM; + } + } + else + { + errno = EINVAL; + } + + return dir; +} + +int closedir(DIR *dir) +{ + int result = -1; + + if(dir) + { + if(dir->handle != -1) + { + result = _findclose(dir->handle); + } + + free(dir->name); + free(dir); + } + + if(result == -1) /* map all errors to EBADF */ + { + errno = EBADF; + } + + return result; +} + +struct dirent *readdir(DIR *dir) +{ + struct dirent *result = 0; + + if(dir && dir->handle != -1) + { + if(!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1) + { + result = &dir->result; + result->d_name = dir->info.name; + } + } + else + { + errno = EBADF; + } + + return result; +} + +void rewinddir(DIR *dir) +{ + if(dir && dir->handle != -1) + { + _findclose(dir->handle); + dir->handle = (long) _findfirst(dir->name, &dir->info); + dir->result.d_name = 0; + } + else + { + errno = EBADF; + } +} + +// helper for scandir below +static void scandir_free_dir_entries(struct dirent*** namelist, int entries) { + int i; + if (!*namelist) return; + for (i = 0; i < entries; ++i) { + free((*namelist)[i]); + } + free(*namelist); + *namelist = 0; +} + +// returns the number of directory entries select or -1 if an error occurs +int scandir( + const char* dir, + struct dirent*** namelist, + int(*filter)(const struct dirent*), + int(*compar)(const void*, const void*) +) { + int entries = 0; + int max_entries = 512; // assume 2*512 = 1024 entries (used for allocation) + DIR* d; + + *namelist = 0; + + // open directory + d = opendir(dir); + if (!d) return -1; + + // iterate + while (1) { + struct dirent* ent = readdir(d); + if (!ent) break; + + // add if no filter or filter returns non-zero + if (filter && (0 == filter(ent))) continue; + + // resize our buffer if there is not enough room + if (!*namelist || entries >= max_entries) { + struct dirent** new_entries; + + max_entries *= 2; + new_entries = (struct dirent **)realloc(*namelist, max_entries); + if (!new_entries) { + scandir_free_dir_entries(namelist, entries); + closedir(d); + errno = ENOMEM; + return -1; + } + + *namelist = new_entries; + } + + // allocate new entry + (*namelist)[entries] = (struct dirent *)malloc(sizeof(struct dirent) + strlen(ent->d_name) + 1); + if (!(*namelist)[entries]) { + scandir_free_dir_entries(namelist, entries); + closedir(d); + errno = ENOMEM; + return -1; + } + + // copy entry info + *(*namelist)[entries] = *ent; + + // and then we tack the string onto the end + { + char* dest = (char*)((*namelist)[entries]) + sizeof(struct dirent); + strcpy(dest, ent->d_name); + (*namelist)[entries]->d_name = dest; + } + + ++entries; + } + + // sort + if (*namelist && compar) qsort(*namelist, entries, sizeof((*namelist)[0]), compar); + + return entries; +} + +int alphasort(const void* lhs, const void* rhs) { + const struct dirent* lhs_ent = *(struct dirent**)lhs; + const struct dirent* rhs_ent = *(struct dirent**)rhs; + return _strcmpi(lhs_ent->d_name, rhs_ent->d_name); +} + +#ifdef __cplusplus +} +#endif + +/* + + Copyright Kevlin Henney, 1997, 2003. All rights reserved. + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose is hereby granted without fee, provided + that this copyright and permissions notice appear in all copies and + derivatives. + + This software is supplied "as is" without express or implied warranty. + + But that said, if there are any problems please get in touch. + +*/ diff --git a/src/projectM-engine-backup/win32-dirent.h b/src/projectM-engine-backup/win32-dirent.h new file mode 100755 index 000000000..7893d0bc4 --- /dev/null +++ b/src/projectM-engine-backup/win32-dirent.h @@ -0,0 +1,59 @@ + +#ifndef DIRENT_INCLUDED +#define DIRENT_INCLUDED + +/* + + Declaration of POSIX directory browsing functions and types for Win32. + + Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com) + History: Created March 1997. Updated June 2003. + Rights: See end of file. + +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct DIR DIR; + +static int errno; + +struct dirent +{ + char *d_name; +}; + +DIR *opendir(const char *); +int closedir(DIR *); +struct dirent *readdir(DIR *); +void rewinddir(DIR *); +int scandir( + const char* dir, + struct dirent*** namelist, + int(*filter)(const struct dirent*), + int(*compar)(const void*, const void*) ); +int alphasort(const void* lhs, const void* rhs); + +/* + + Copyright Kevlin Henney, 1997, 2003. All rights reserved. + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose is hereby granted without fee, provided + that this copyright and permissions notice appear in all copies and + derivatives. + + This software is supplied "as is" without express or implied warranty. + + But that said, if there are any problems please get in touch. + +*/ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/projectM-engine-backup/wipemalloc.cpp b/src/projectM-engine-backup/wipemalloc.cpp new file mode 100755 index 000000000..14bcf7816 --- /dev/null +++ b/src/projectM-engine-backup/wipemalloc.cpp @@ -0,0 +1,44 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2004 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: wipemalloc.c,v 1.1.1.1 2005/12/23 18:05:05 psperl Exp $ + * + * Clean memory allocator + */ + +#include "wipemalloc.h" + + void *wipemalloc( size_t count ) { + void *mem = malloc( count ); + if ( mem != NULL ) { + memset( mem, 0, count ); + } else { + printf( "wipemalloc() failed to allocate %d bytes\n", (int)count ); + } + return mem; + } + +/** Safe memory deallocator */ + void wipefree( void *ptr ) { + if ( ptr != NULL ) { + free( ptr ); + } + } diff --git a/src/projectM-engine-backup/wipemalloc.h b/src/projectM-engine-backup/wipemalloc.h new file mode 100755 index 000000000..6ff625d36 --- /dev/null +++ b/src/projectM-engine-backup/wipemalloc.h @@ -0,0 +1,60 @@ +/** + * projectM -- Milkdrop-esque visualisation SDK + * Copyright (C)2003-2007 projectM Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * See 'LICENSE.txt' included within this release + * + */ +/** + * $Id: wipemalloc.h,v 1.1.1.1 2005/12/23 18:05:03 psperl Exp $ + * + * Contains an inline function which can replace malloc() that also + * call memset( ..., 0, sizeof( ... ) ) on the allocated block for + * safe initialization + * + * $Log$ + */ + +#ifndef _WIPEMALLOC_H +#define _WIPEMALLOC_H + +#ifndef MACOS +#ifndef HAVE_AIX /** AIX has malloc() defined in a strange place... */ +#ifdef WIN32 +#include +#endif +#include +#include +#else +#include +#endif /** !HAVE_AIX */ +#else +#include +#include +#endif /** !MACOS */ +#include + +#ifdef PANTS +#if defined(WIN32) && !defined(inline) +#define inline +#endif +#endif + +/** Safe memory allocator */ + void *wipemalloc( size_t count ); + void wipefree( void *ptr ); + +#endif /** !_WIPEMALLOC_H */ diff --git a/src/projectM-xmms/main.cpp b/src/projectM-xmms/main.cpp index d0fc27b61..242041257 100755 --- a/src/projectM-xmms/main.cpp +++ b/src/projectM-xmms/main.cpp @@ -210,11 +210,14 @@ int worker_func(void*) while ( SDL_PollEvent( &event ) ) { /** Translate into projectM codes and process */ evt = sdl2pmEvent( event ); + if (!((event.type == SDL_KEYDOWN) || (event.type == SDL_KEYUP))) + continue; + key = sdl2pmKeycode( event.key.keysym.sym ); mod = sdl2pmModifier( event.key.keysym.mod ); if ( evt == PROJECTM_KEYDOWN ) { - + printf("menu-imp\n"); if(key == PROJECTM_K_f) {

p=FKP^aGuPKn9yTK$3*hZIK_I=; z^lu1_=K3EH0c!td$j9o8!p1geUn2JVX#cM;aEfs~{I0tHHs(q1Lo^?Er}k4eke#?N zcL(i1dGhu*uWY}Iw0`miP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9O%n|z8vVwfxaB* j%YnWe=*xk=9O%n|z8vVwfxaB*%YnWe=*xkf=D`00S$rrP literal 0 HcmV?d00001 diff --git a/src/projectM-engine-backup/libprojectM/Debug/vc60.pdb b/src/projectM-engine-backup/libprojectM/Debug/vc60.pdb new file mode 100755 index 0000000000000000000000000000000000000000..6e47e71d2a792b32ce06b1b0004834062982ce64 GIT binary patch literal 110592 zcmeFad3@Ye)jxjcGoNLWnIzLREv2mxO2GmJS}2PG+BBIofovq{hUhp+CJRh5VP?_= zL93!5B7&l#qM)Jz4=yO~_y}%~3+_AO^0?uS#RV0Y-}`-+&oVQq`uqL<`F>xSSEreK z&bjBFd+xpG?&tQ;jF*b#;$)@0^VH6hPHLYo6{kwM+4hNCB{!BU=i5&^Wz(jn#?|L< z7eb_kh>11gBK*AJ)+@!4_`CF3(!i1imNc-Wfh7$rX<$hMOBz_xz>)@*G_a(BB@HZT z;Qs&(9Q^p-{<-v7(!i1imNc-Wfh7$rX<$hMOBz_xz>)@*G_a(BB@HZT;Qwk32(jt^ z>ijKbZb<`68d%c6k_MJEu%v+{4J>J3Ndrq7Skl0f29`9iq=A3_^I6N)8HLrNA^oFP zA^sO%^Em_O{rMrTg1_}}>%4fY(-s#G$$0i$ZZ?02;b$|h)i60z$Y z$VEELN0Wxmm-6L&N0XnTo0*%b)DWvYk>}dho=>Zc58+1J~EOCcuUAHnuQ1nJ=kyNM|4HyTlTbwkCgdXg_X? z_BwKD#itleKkA3h4 z*aBB+3jCTytknXN_CIc`KDQP0%ltT&n9#o)g_S0}v5IaIuq5J#`|Yg=leQj?X)T6} zrX3T%(c=P+1*&mJX}Ow3BF*%8OK>Opf67^)oPh8*@TVOy#G%)pLpW?*!9Pj>Xs^_u@YbO&s9zEYC9q;8?h?D$+o zhKWxIC(ApaX55iNm_rE@PBV-Fo(Z>!M0R{SS3+0s^IRpoEW+iP%T+%~zH3E8wlX_E zNlS2)aMB5+y%5qzyKu8JMZ`k+t%kmYI0%aH$L>ac53x>t1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