2 * Copyright (C) <2003> iOS-Software
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 #ifndef _PLUGIN_INFO_H
20 #define _PLUGIN_INFO_H
22 #include "goom_typedefs.h"
24 #include "goom_config.h"
26 #include "goom_graphic.h"
27 #include "goom_config_param.h"
28 #include "goom_visual_fx.h"
29 #include "goom_filters.h"
30 #include "goom_tools.h"
44 #define STATES_MAX_NB 128
47 * Gives informations about the sound.
51 /* nota : a Goom is just a sound event... */
53 int timeSinceLastGoom; /* >= 0 */
54 float goomPower; /* power of the last Goom [0..1] */
56 int timeSinceLastBigGoom; /* >= 0 */
58 float volume; /* [0..1] */
59 short samples[2][512];
61 /* other "internal" datas for the sound_tester */
62 float goom_limit; /* auto-updated limit of goom_detection */
64 float accelvar; /* acceleration of the sound - [0..1] */
65 float speedvar; /* speed of the sound - [0..100] */
67 int totalgoom; /* number of goom since last reset
68 * (a reset every 64 cycles) */
70 float prov_max; /* accel max since last reset */
78 PluginParam goom_limit_p;
79 PluginParam goom_power_p;
80 PluginParam last_goom_p;
81 PluginParam last_biggoom_p;
82 PluginParam biggoom_speed_limit_p;
83 PluginParam biggoom_factor_p;
85 PluginParameters params; /* contains the previously defined parameters. */
90 * Allows FXs to know the current state of the plugin.
97 PluginParameters *params;
104 int size; /* == screen.height * screen.width. */
110 VisualFX **visuals; /* pointers on all the visual fx */
113 VisualFX convolve_fx;
115 VisualFX zoomFilter_fx;
116 VisualFX tentacles_fx;
128 GoomState states[STATES_MAX_NB];
132 GoomState *curGState;
134 /** effet de ligne.. */
139 int sintable[0x10000];
143 /** goom_update internals.
144 * I took all static variables from goom_update and put them here.. for the moment.
147 int lockvar; /* pour empecher de nouveaux changements */
148 int goomvar; /* boucle des gooms */
149 int loopvar; /* mouvement des points */
151 int ifs_incr; /* dessiner l'ifs (0 = non: > = increment) */
152 int decay_ifs; /* disparition de l'ifs */
153 int recay_ifs; /* dedisparition de l'ifs */
154 int cyclesSinceLastChange; /* nombre de Cycle Depuis Dernier Changement */
155 int drawLinesDuration; /* duree de la transition entre afficher les lignes ou pas */
156 int lineMode; /* l'effet lineaire a dessiner */
157 float switchMultAmount; /* SWITCHMULT (29.0f/30.0f) */
158 int switchIncrAmount; /* 0x7f */
159 float switchMult; /* 1.0f */
160 int switchIncr; /* = SWITCHINCR; */
161 int stateSelectionRnd;
162 int stateSelectionBlocker;
163 int previousZoomSpeed;
164 ZoomFilterData zoomFilterData;
168 void (*draw_line) (Pixel *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny);
169 void (*zoom_filter) (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]);
175 void plugin_info_init(PluginInfo *p, int nbVisual);
176 void plugin_info_free(PluginInfo *p);
178 /* i = [0..p->nbVisual-1] */
179 void plugin_info_add_visual(PluginInfo *p, int i, VisualFX *visual);