//Takes sound data from wherever and hands it back out.
//Returns PCM Data or spectrum data, or the derivative of the PCM data
+#include <stdlib.h>
+#include <stdio.h>
#include <inttypes.h>
+#include "fftsg.h"
+
double **PCMd; //data structure to store PCM data PCM[channels][maxsamples]
int maxsamples; //size of PCM buffer
int start; //where to add data next
//
//Some stuff was taken from Frederic Patin's beat-detection article, you'll find it online
+#include <stdlib.h>
+#include <stdio.h>
#include "engine_vars.h"
double beat_buffer[32][80],beat_instant[32],beat_history[32];
#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
/* Values to optimize the sigmoid function */
#define R 32767
#define RR 65534
-inline double int_wrapper(double * arg_list) {
+static inline double int_wrapper(double * arg_list) {
return floor(arg_list[0]);
}
-inline double sqr_wrapper(double * arg_list) {
+static inline double sqr_wrapper(double * arg_list) {
return pow(2, arg_list[0]);
}
-inline double sign_wrapper(double * arg_list) {
+static inline double sign_wrapper(double * arg_list) {
return -arg_list[0];
}
-inline double min_wrapper(double * arg_list) {
+static inline double min_wrapper(double * arg_list) {
if (arg_list[0] > arg_list[1])
return arg_list[1];
return arg_list[0];
}
-inline double max_wrapper(double * arg_list) {
+static inline double max_wrapper(double * arg_list) {
if (arg_list[0] > arg_list[1])
return arg_list[0];
}
/* consult your AI book */
-inline double sigmoid_wrapper(double * arg_list) {
+static inline double sigmoid_wrapper(double * arg_list) {
return (RR / (1 + exp( -(((double)(arg_list[0])) * arg_list[1]) / R) - R));
}
-inline double bor_wrapper(double * arg_list) {
+static inline double bor_wrapper(double * arg_list) {
return (double)((int)arg_list[0] || (int)arg_list[1]);
}
-inline double band_wrapper(double * arg_list) {
+static inline double band_wrapper(double * arg_list) {
return (double)((int)arg_list[0] && (int)arg_list[1]);
}
-inline double bnot_wrapper(double * arg_list) {
+static inline double bnot_wrapper(double * arg_list) {
return (double)(!(int)arg_list[0]);
}
-inline double if_wrapper(double * arg_list) {
+static inline double if_wrapper(double * arg_list) {
if ((int)arg_list[0] == 0)
return arg_list[2];
}
-inline double rand_wrapper(double * arg_list) {
+static inline double rand_wrapper(double * arg_list) {
double l;
// printf("RAND ARG:(%d)\n", (int)arg_list[0]);
return l;
}
-inline double equal_wrapper(double * arg_list) {
+static inline double equal_wrapper(double * arg_list) {
return (arg_list[0] == arg_list[1]);
}
-inline double above_wrapper(double * arg_list) {
+static inline double above_wrapper(double * arg_list) {
return (arg_list[0] > arg_list[1]);
}
-inline double below_wrapper(double * arg_list) {
+static inline double below_wrapper(double * arg_list) {
return (arg_list[0] < arg_list[1]);
}
-inline double sin_wrapper(double * arg_list) {
+static inline double sin_wrapper(double * arg_list) {
return (sin (arg_list[0]));
}
-inline double cos_wrapper(double * arg_list) {
+static inline double cos_wrapper(double * arg_list) {
return (cos (arg_list[0]));
}
-inline double tan_wrapper(double * arg_list) {
+static inline double tan_wrapper(double * arg_list) {
return (tan(arg_list[0]));
}
-inline double asin_wrapper(double * arg_list) {
+static inline double asin_wrapper(double * arg_list) {
return (asin (arg_list[0]));
}
-inline double acos_wrapper(double * arg_list) {
+static inline double acos_wrapper(double * arg_list) {
return (acos (arg_list[0]));
}
-inline double atan_wrapper(double * arg_list) {
+static inline double atan_wrapper(double * arg_list) {
return (atan (arg_list[0]));
}
-inline double atan2_wrapper(double * arg_list) {
+static inline double atan2_wrapper(double * arg_list) {
return (atan2 (arg_list[0], arg_list[1]));
}
-inline double pow_wrapper(double * arg_list) {
+static inline double pow_wrapper(double * arg_list) {
return (pow (arg_list[0], arg_list[1]));
}
-inline double exp_wrapper(double * arg_list) {
+static inline double exp_wrapper(double * arg_list) {
return (exp(arg_list[0]));
}
-inline double abs_wrapper(double * arg_list) {
+static inline double abs_wrapper(double * arg_list) {
return (fabs(arg_list[0]));
}
-inline double log_wrapper(double *arg_list) {
+static inline double log_wrapper(double *arg_list) {
return (log (arg_list[0]));
}
-inline double log10_wrapper(double * arg_list) {
+static inline double log10_wrapper(double * arg_list) {
return (log10 (arg_list[0]));
}
-inline double sqrt_wrapper(double * arg_list) {
+static inline double sqrt_wrapper(double * arg_list) {
return (sqrt (arg_list[0]));
}
-inline double nchoosek_wrapper(double * arg_list) {
+static inline double nchoosek_wrapper(double * arg_list) {
unsigned long cnm = 1UL;
int i, f;
int n, m;
}
-inline double fact_wrapper(double * arg_list) {
+static inline double fact_wrapper(double * arg_list) {
int result = 1;
*****************************************************************************/
#include <stdio.h>
+#include <stdlib.h>
#include "common.h"
#include "fatal.h"
custom_shape_t * interface_shape = NULL;
int cwave_interface_id = 0;
extern preset_t * active_preset;
-inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape);
+static inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape);
void load_unspec_init_cond_shape(param_t * param);
void destroy_param_db_tree_shape(splaytree_t * tree);
return custom_shape;
}
-inline void evalCustomShapeInitConditions() {
+static inline void evalCustomShapeInitConditions() {
splay_traverse(eval_custom_shape_init_conds, active_preset->custom_shape_tree);
}
-inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape) {
+static inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape) {
splay_traverse(eval_init_cond, custom_shape->init_cond_tree);
splay_traverse(eval_init_cond, custom_shape->per_frame_init_eqn_tree);
}
/* Interface function. Makes another custom shape the current
concern for per frame / point equations */
-inline custom_shape_t * nextCustomShape() {
+static inline custom_shape_t * nextCustomShape() {
if ((interface_shape = splay_find(&cwave_interface_id, active_preset->custom_shape_tree)) == NULL) {
cwave_interface_id = 0;
*****************************************************************************/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "common.h"
#include "fatal.h"
custom_wave_t * interface_wave = NULL;
int interface_id = 0;
extern preset_t * active_preset;
-inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave);
+static inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave);
void load_unspec_init_cond(param_t * param);
void destroy_per_point_eqn_tree(splaytree_t * tree);
void destroy_param_db_tree(splaytree_t * tree);
void destroy_per_frame_eqn_tree(splaytree_t * tree);
void destroy_per_frame_init_eqn_tree(splaytree_t * tree);
void destroy_init_cond_tree(splaytree_t * tree);
-inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn);
+static inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn);
custom_wave_t * new_custom_wave(int id) {
return custom_wave;
}
-inline void evalCustomWaveInitConditions() {
+static inline void evalCustomWaveInitConditions() {
splay_traverse(eval_custom_wave_init_conds, active_preset->custom_wave_tree);
}
-inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave) {
+static inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave) {
splay_traverse(eval_init_cond, custom_wave->init_cond_tree);
splay_traverse(eval_init_cond, custom_wave->per_frame_init_eqn_tree);
}
/* Interface function. Makes another custom wave the current
concern for per frame / point equations */
-inline custom_wave_t * nextCustomWave() {
+static inline custom_wave_t * nextCustomWave() {
if ((interface_wave = splay_find(&interface_id, active_preset->custom_wave_tree)) == NULL) {
interface_id = 0;
}
-inline void evalPerPointEqns() {
+static inline void evalPerPointEqns() {
int x;
}
/* Evaluates a per point equation for the current custom wave given by interface_wave ptr */
-inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn) {
+static inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn) {
int samples, size;
/* Evaluation Code */
+#include <stdio.h>
#include "common.h"
#include "fatal.h"
static inline double eval_val_expr(val_expr_t * val_expr);
-inline double eval_gen_expr(gen_expr_t * gen_expr) {
+static inline double eval_gen_expr(gen_expr_t * gen_expr) {
double l;
if (gen_expr == NULL)
#define CDFT_4THREADS_BEGIN_N 65536
#endif
#include <pthread.h>
+#include <stdlib.h>
+#include <stdio.h>
#define cdft_thread_t pthread_t
#define cdft_thread_create(thp,func,argp) { \
if (pthread_create(thp, NULL, func, (void *) argp) != 0) { \
#define CDFT_4THREADS_BEGIN_N 524288
#endif
#include <windows.h>
+<<<<<<< .working
+#include <stdlib.h>
+=======
+#include <stdio.h>
+>>>>>>> .merge-right.r21326
#define cdft_thread_t HANDLE
#define cdft_thread_create(thp,func,argp) { \
DWORD thid; \
--- /dev/null
+/*****************************************************************************
+ * fftsg.c:
+ *****************************************************************************
+ * Copyright (C) 2004 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ * code from projectM http://xmms-projectm.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+ 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 *);
/* Function management */
#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
#include "common.h"
#include "fatal.h"
/* Library functions to manipulate initial condition values */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "common.h"
#include "fatal.h"
#include <GL/glu.h>
#include <unistd.h>
#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
#include "common.h"
#include "preset_types.h"
#include "preset.h"
/* Basic Parameter Functions */
#include <stdio.h>
-
+#include <string.h>
+#include <stdlib.h>
#include <math.h>
#include "fatal.h"
#include "common.h"
/* parser.c */
#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
#include "common.h"
#include "fatal.h"
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "fatal.h"
#include "common.h"
+#include "param.h"
#include "per_frame_eqn_types.h"
#include "per_frame_eqn.h"
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#include <stdio.h>
+#include <string.h>
#include <stdlib.h>
#include "fatal.h"
/* Evaluates a per pixel equation */
-inline void evalPerPixelEqn(per_pixel_eqn_t * per_pixel_eqn) {
+static inline void evalPerPixelEqn(per_pixel_eqn_t * per_pixel_eqn) {
double ** param_matrix = NULL;
gen_expr_t * eqn_ptr = NULL;
per_pixel_eqn->param->matrix_flag = 1;
}
-inline void evalPerPixelEqns() {
+static inline void evalPerPixelEqns() {
/* Evaluate all per pixel equations using splay traversal */
splay_traverse(evalPerPixelEqn, active_preset->per_pixel_eqn_tree);
return;
}
-inline int isPerPixelEqn(int op) {
+static inline int isPerPixelEqn(int op) {
return active_preset->per_pixel_flag[op];
}
-inline int resetPerPixelEqnFlags(preset_t * preset) {
+static inline int resetPerPixelEqnFlags(preset_t * preset) {
int i;
for (i = 0; i < NUM_OPS;i++)
*****************************************************************************/
#include <vlc/vlc.h>
+#include <vlc_charset.h>
-
+#include <stdlib.h>
+#include <stdio.h>
#include <dirent.h>
#include <time.h>
#include "common.h"
*/
#include <stdlib.h>
+#include <stdio.h>
#include "common.h"
#include "fatal.h"
/* Creates a splay tree given a compare key function, copy key function, and free key function.
Ah yes, the wonders of procedural programming */
-inline splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), void (*free_key)()) {
+static inline splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), void (*free_key)()) {
splaytree_t * splaytree;
}
/* Destroys a splay tree */
-inline int destroy_splaytree(splaytree_t * splaytree) {
+static inline int destroy_splaytree(splaytree_t * splaytree) {
/* Null argument check */
if (splaytree == NULL)
}
/* Traverses the entire splay tree with the given function func_ptr */
-inline void splay_traverse(void (*func_ptr)(), splaytree_t * splaytree) {
+static inline void splay_traverse(void (*func_ptr)(), splaytree_t * splaytree) {
/* Null argument check */
}
/* Find the node corresponding to the given key in splaytree, return its data pointer */
-inline void * splay_find(void * key, splaytree_t * splaytree) {
+static inline void * splay_find(void * key, splaytree_t * splaytree) {
splaynode_t * splaynode;
int match_type;
}
/* Gets the splaynode that the given key points to */
-inline splaynode_t * get_splaynode_of(void * key, splaytree_t * splaytree) {
+static inline splaynode_t * get_splaynode_of(void * key, splaytree_t * splaytree) {
splaynode_t * splaynode;
int match_type;
/* Deletes a splay node from a splay tree. If the node doesn't exist
then nothing happens */
-inline int splay_delete(void * key, splaytree_t * splaytree) {
+static inline int splay_delete(void * key, splaytree_t * splaytree) {
splaynode_t * splaynode;
}
/* Inserts a link into the splay tree */
-inline int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * splaytree) {
+static inline int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * splaytree) {
splaynode_t * splaynode, * data_node;
void * key_clone;
}
/* Inserts 'data' into the 'splaytree' paired with the passed 'key' */
-inline int splay_insert(void * data, void * key, splaytree_t * splaytree) {
+static inline int splay_insert(void * data, void * key, splaytree_t * splaytree) {
splaynode_t * splaynode;
void * key_clone;
}
/* Returns the 'maximum' key that is less than the given key in the splaytree */
-inline void * splay_find_below_max(void * key, splaytree_t * splaytree) {
+static inline void * splay_find_below_max(void * key, splaytree_t * splaytree) {
void * closest_key;
/* Returns the 'minimum' key that is greater than the given key in the splaytree */
-inline void * splay_find_above_min(void * key, splaytree_t * splaytree) {
+static inline void * splay_find_above_min(void * key, splaytree_t * splaytree) {
void * closest_key;
}
/* Find the minimum entry of the splay tree */
-inline void * splay_find_min(splaytree_t * t) {
+static inline void * splay_find_min(splaytree_t * t) {
splaynode_t * splaynode;
/* Find the maximum entry of the splay tree */
-inline void * splay_find_max(splaytree_t * t) {
+static inline void * splay_find_max(splaytree_t * t) {
splaynode_t * splaynode;
return splaynode->data;
}
-inline int splay_size(splaytree_t * t) {
+static inline int splay_size(splaytree_t * t) {
if (t == NULL)
return 0;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#define _GNU_SOURCE
+#include <stdio.h>
#include <stdlib.h>
-
+#include <string.h>
#include "common.h"
/* Compares integer value numbers in 32 bit range */
//also able to handle resizing and fullscreening of windows
//just call init_display again with differant variables
+#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "video_init.h"