PageRenderTime 106ms CodeModel.GetById 10ms app.highlight 89ms RepoModel.GetById 1ms app.codeStats 1ms

/xbmc/visualizations/XBMCProjectM/libprojectM/BuiltinParams.cpp

http://github.com/xbmc/xbmc
C++ | 393 lines | 276 code | 95 blank | 22 comment | 37 complexity | 2b4d719c2ce87567c8a18236b1b3d1cf MD5 | raw file
  1#include <algorithm>
  2#include <cassert>
  3#include <iostream>
  4#include <stdio.h>
  5
  6#include "fatal.h"
  7#include "BuiltinParams.hpp"
  8#include "Algorithms.hpp"
  9#include "InitCondUtils.hpp"
 10
 11
 12using namespace Algorithms;
 13
 14BuiltinParams::BuiltinParams() {}
 15
 16BuiltinParams::BuiltinParams(const PresetInputs & presetInputs, PresetOutputs & presetOutputs)
 17{
 18
 19 int ret;
 20  if ((ret = init_builtin_param_db(presetInputs, presetOutputs)) != PROJECTM_SUCCESS)
 21  {
 22	std::cout << "failed to allocate builtin parameter database with error " << ret << std::endl;;
 23    throw ret;
 24  }
 25
 26}
 27
 28BuiltinParams::~BuiltinParams()
 29{
 30  destroy_builtin_param_db();
 31}
 32
 33/* Loads a float parameter into the builtin database */
 34int BuiltinParams::load_builtin_param_float(const std::string & name, void * engine_val, void * matrix, short int flags,
 35    float init_val, float upper_bound, float lower_bound, const std::string & alt_name)
 36{
 37
 38  Param * param = NULL;
 39  CValue iv, ub, lb;
 40
 41  iv.float_val = init_val;
 42  ub.float_val = upper_bound;
 43  lb.float_val = lower_bound;
 44
 45  /* Create new parameter of type float */
 46  if (BUILTIN_PARAMS_DEBUG == 2)
 47  {
 48    printf("load_builtin_param_float: (name \"%s\") (alt_name = \"%s\") ", name.c_str(), alt_name.c_str());
 49    fflush(stdout);
 50  }
 51
 52std::string lowerName(name);
 53std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), tolower);
 54
 55  if ((param = new Param(lowerName, P_TYPE_DOUBLE, flags, engine_val, matrix, iv, ub, lb)) == NULL)
 56  {
 57    return PROJECTM_OUTOFMEM_ERROR;
 58  }
 59
 60  if (BUILTIN_PARAMS_DEBUG == 2)
 61  {
 62    printf("created...");
 63    fflush(stdout);
 64  }
 65
 66  /* Insert the paremeter into the database */
 67
 68  if (insert_builtin_param( param ) < 0)
 69  {
 70    delete param;
 71    return PROJECTM_ERROR;
 72  }
 73
 74  if (BUILTIN_PARAMS_DEBUG == 2)
 75  {
 76    printf("inserted...");
 77    fflush(stdout);
 78  }
 79
 80  /* If this parameter has an alternate name, insert it into the database as link */
 81
 82  if (alt_name != "")
 83  {
 84    std::string alt_lower_name(alt_name);
 85    std::transform(alt_lower_name.begin(), alt_lower_name.end(), alt_lower_name.begin(), tolower);
 86    insert_param_alt_name(param,alt_lower_name);
 87 
 88    if (BUILTIN_PARAMS_DEBUG == 2)
 89    {
 90      printf("alt_name inserted...");
 91      fflush(stdout);
 92    }
 93
 94
 95  }
 96
 97  if (BUILTIN_PARAMS_DEBUG == 2) printf("finished\n");
 98
 99  /* Finished, return success */
100  return PROJECTM_SUCCESS;
101}
102
103
104
105/* Destroy the builtin parameter database.
106   Generally, do this on projectm exit */
107int BuiltinParams::destroy_builtin_param_db()
108{
109
110  Algorithms::traverse<TraverseFunctors::DeleteFunctor<Param> >(builtin_param_tree);
111  return PROJECTM_SUCCESS;
112}
113
114
115/* Insert a parameter into the database with an alternate name */
116int BuiltinParams::insert_param_alt_name(Param * param, const std::string & alt_name)
117{
118
119  assert(param);
120  
121  aliasMap.insert(std::make_pair(alt_name, param->name));
122
123  return PROJECTM_SUCCESS;
124}
125
126Param * BuiltinParams::find_builtin_param(const std::string & name)
127{
128
129
130  
131  AliasMap::iterator pos = aliasMap.find(name);
132  Param * param = 0;
133  //std::cerr << "[BuiltinParams] find_builtin_param: name is " << name << std::endl;
134  if (pos == aliasMap.end())
135  {
136    std::map<std::string, Param*>::iterator builtinPos = builtin_param_tree.find(name);
137
138    if (builtinPos != builtin_param_tree.end()) {
139    //  std::cerr << "[BuiltinParams] find_builtin_param: found it directly." << std::endl;
140      param = builtinPos->second;
141     }
142  }
143  else
144  {
145
146    std::map<std::string, Param*>::iterator builtinPos = builtin_param_tree.find(pos->second);
147	
148    if (builtinPos != builtin_param_tree.end()) {
149      //std::cerr << "[BuiltinParams] find_builtin_param: found it indirectly." << std::endl;
150      param = builtinPos->second;
151
152}
153  }
154  return param;
155}
156
157
158/* Loads a integer parameter into the builtin database */
159int BuiltinParams::load_builtin_param_int(const std::string & name, void * engine_val, short int flags,
160    int init_val, int upper_bound, int lower_bound, const std::string &alt_name)
161{
162
163  Param * param;
164  CValue iv, ub, lb;
165
166  iv.int_val = init_val;
167  ub.int_val = upper_bound;
168  lb.int_val = lower_bound;
169
170std::string lowerName(name);
171std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), tolower);
172  param = new Param(lowerName, P_TYPE_INT, flags, engine_val, NULL, iv, ub, lb);
173
174  if (param == NULL)
175  {
176    return PROJECTM_OUTOFMEM_ERROR;
177  }
178
179  if (insert_builtin_param( param ) < 0)
180  {
181    delete param;
182    return PROJECTM_ERROR;
183  }
184
185  if (alt_name != "")
186  {
187    std::string alt_lower_name(alt_name);
188    std::transform(alt_lower_name.begin(), alt_lower_name.end(), alt_lower_name.begin(), tolower);
189    insert_param_alt_name(param,alt_lower_name);
190 
191  }
192
193  return PROJECTM_SUCCESS;
194
195}
196
197/* Loads a boolean parameter */
198int BuiltinParams::load_builtin_param_bool(const std:: string & name, void * engine_val, short int flags,
199    int init_val, const std::string &alt_name)
200{
201
202  Param * param;
203  CValue iv, ub, lb;
204
205  iv.int_val = init_val;
206  ub.int_val = TRUE;
207  lb.int_val = false;
208
209std::string lowerName(name);
210std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), tolower);
211
212  param = new Param(lowerName, P_TYPE_BOOL, flags, engine_val, NULL, iv, ub, lb);
213
214  if (param == NULL)
215  {
216    return PROJECTM_OUTOFMEM_ERROR;
217  }
218
219  if (insert_builtin_param(param) < 0)
220  {
221    delete param;
222    return PROJECTM_ERROR;
223  }
224
225  if (alt_name != "")
226  {
227    std::string alt_lower_name(alt_name);
228    std::transform(alt_lower_name.begin(), alt_lower_name.end(), alt_lower_name.begin(), tolower);
229    insert_param_alt_name(param,alt_lower_name);
230  }
231
232  return PROJECTM_SUCCESS;
233
234}
235
236/* Inserts a parameter into the builtin database */
237int BuiltinParams::insert_builtin_param( Param *param )
238{
239  std::pair<std::map<std::string, Param*>::iterator, bool> inserteePos = builtin_param_tree.insert(std::make_pair(param->name, param));
240
241  return inserteePos.second;
242}
243
244
245
246/* Initialize the builtin parameter database.
247   Should only be necessary once */
248int BuiltinParams::init_builtin_param_db(const PresetInputs & presetInputs, PresetOutputs & presetOutputs)
249{
250
251  if (BUILTIN_PARAMS_DEBUG)
252  {
253    printf("init_builtin_param: loading database...");
254    fflush(stdout);
255  }
256
257  /* Loads all builtin parameters into the database */
258  if (load_all_builtin_param(presetInputs, presetOutputs) < 0)
259  {
260    if (BUILTIN_PARAMS_DEBUG) printf("failed loading builtin parameters (FATAL)\n");
261    return PROJECTM_ERROR;
262  }
263
264  if (BUILTIN_PARAMS_DEBUG) printf("success!\n");
265
266  /* Finished, no errors */
267  return PROJECTM_SUCCESS;
268}
269
270
271
272/* Loads all builtin parameters, limits are also defined here */
273int BuiltinParams::load_all_builtin_param(const PresetInputs & presetInputs, PresetOutputs & presetOutputs)
274{
275
276  load_builtin_param_float("frating", (void*)&presetOutputs.fRating, NULL, P_FLAG_NONE, 0.0 , 5.0, 0.0, "");
277  load_builtin_param_float("fwavescale", (void*)&presetOutputs.fWaveScale, NULL, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
278  load_builtin_param_float("gamma", (void*)&presetOutputs.fGammaAdj, NULL, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, "fGammaAdj");
279  load_builtin_param_float("echo_zoom", (void*)&presetOutputs.fVideoEchoZoom, NULL, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, "fVideoEchoZoom");
280  load_builtin_param_float("echo_alpha", (void*)&presetOutputs.fVideoEchoAlpha, NULL, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, "fvideoechoalpha");
281  load_builtin_param_float("wave_a", (void*)&presetOutputs.fWaveAlpha, NULL, P_FLAG_NONE, 0.0, 1.0, 0, "fwavealpha");
282  load_builtin_param_float("fwavesmoothing", (void*)&presetOutputs.fWaveSmoothing, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "");
283  load_builtin_param_float("fmodwavealphastart", (void*)&presetOutputs.fModWaveAlphaStart, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "");
284  load_builtin_param_float("fmodwavealphaend", (void*)&presetOutputs.fModWaveAlphaEnd, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "");
285  load_builtin_param_float("fWarpAnimSpeed",  (void*)&presetOutputs.fWarpAnimSpeed, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "");
286  load_builtin_param_float("fWarpScale",  (void*)&presetOutputs.fWarpScale, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "");
287  //  load_builtin_param_float("warp", (void*)&presetOutputs.warp, warp_mesh, P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, 0, "");
288
289  load_builtin_param_float("fshader", (void*)&presetOutputs.fShader, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "");
290  load_builtin_param_float("decay", (void*)&presetOutputs.decay, NULL, P_FLAG_NONE, 0.0, 1.0, 0, "fdecay");
291
292  load_builtin_param_int("echo_orient", (void*)&presetOutputs.nVideoEchoOrientation, P_FLAG_NONE, 0, 3, 0, "nVideoEchoOrientation");
293  load_builtin_param_int("wave_mode", (void*)&presetOutputs.nWaveMode, P_FLAG_NONE, 0, 7, 0, "nwavemode");
294
295  load_builtin_param_bool("wave_additive", (void*)&presetOutputs.bAdditiveWaves, P_FLAG_NONE, false, "bAdditiveWaves");
296  load_builtin_param_bool("bmodwavealphabyvolume", (void*)&presetOutputs.bModWaveAlphaByVolume, P_FLAG_NONE, false, "");
297  load_builtin_param_bool("wave_brighten", (void*)&presetOutputs.bMaximizeWaveColor, P_FLAG_NONE, false, "bMaximizeWaveColor");
298  load_builtin_param_bool("wrap", (void*)&presetOutputs.bTexWrap, P_FLAG_NONE, false, "btexwrap");
299  load_builtin_param_bool("darken_center", (void*)&presetOutputs.bDarkenCenter, P_FLAG_NONE, false, "bdarkencenter");
300  load_builtin_param_bool("bredbluestereo", (void*)&presetOutputs.bRedBlueStereo, P_FLAG_NONE, false, "");
301  load_builtin_param_bool("brighten", (void*)&presetOutputs.bBrighten, P_FLAG_NONE, false, "bbrighten");
302  load_builtin_param_bool("darken", (void*)&presetOutputs.bDarken, P_FLAG_NONE, false, "bdarken");
303  load_builtin_param_bool("solarize", (void*)&presetOutputs.bSolarize, P_FLAG_NONE, false, "bsolarize");
304  load_builtin_param_bool("invert", (void*)&presetOutputs.bInvert, P_FLAG_NONE, false, "binvert");
305  load_builtin_param_bool("bmotionvectorson", (void*)&presetOutputs.bMotionVectorsOn, P_FLAG_NONE, false, "");
306  load_builtin_param_bool("wave_dots", (void*)&presetOutputs.bWaveDots, P_FLAG_NONE, false, "bwavedots");
307  load_builtin_param_bool("wave_thick", (void*)&presetOutputs.bWaveThick, P_FLAG_NONE, false, "bwavethick");
308  load_builtin_param_float("warp", (void*)&presetOutputs.warp, presetOutputs.warp_mesh,  P_FLAG_PER_PIXEL |P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
309  load_builtin_param_float("zoom", (void*)&presetOutputs.zoom, presetOutputs.zoom_mesh,  P_FLAG_PER_PIXEL |P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
310  load_builtin_param_float("rot", (void*)&presetOutputs.rot, presetOutputs.rot_mesh,  P_FLAG_PER_PIXEL |P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
311  /// @note added huge bug fix here potentially by prevening zoomexp_mesh from being freed when presets dealloc
312  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");
313
314  load_builtin_param_float("cx", (void*)&presetOutputs.cx, presetOutputs.cx_mesh, P_FLAG_PER_PIXEL | P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
315  load_builtin_param_float("cy", (void*)&presetOutputs.cy, presetOutputs.cy_mesh, P_FLAG_PER_PIXEL | P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
316  load_builtin_param_float("dx", (void*)&presetOutputs.dx, presetOutputs.dx_mesh,  P_FLAG_PER_PIXEL | P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
317  load_builtin_param_float("dy", (void*)&presetOutputs.dy, presetOutputs.dy_mesh,  P_FLAG_PER_PIXEL |P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
318  load_builtin_param_float("sx", (void*)&presetOutputs.sx, presetOutputs.sx_mesh,  P_FLAG_PER_PIXEL |P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
319  load_builtin_param_float("sy", (void*)&presetOutputs.sy, presetOutputs.sy_mesh,  P_FLAG_PER_PIXEL |P_FLAG_NONE, 0.0, MAX_DOUBLE_SIZE, MIN_DOUBLE_SIZE, "");
320
321  load_builtin_param_float("wave_r", (void*)&presetOutputs.wave_r, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
322  load_builtin_param_float("wave_g", (void*)&presetOutputs.wave_g, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
323  load_builtin_param_float("wave_b", (void*)&presetOutputs.wave_b, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
324  load_builtin_param_float("wave_x", (void*)&presetOutputs.wave_x, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
325  load_builtin_param_float("wave_y", (void*)&presetOutputs.wave_y, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
326  load_builtin_param_float("wave_mystery", (void*)&presetOutputs.wave_mystery, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "fWaveParam");
327
328  load_builtin_param_float("ob_size", (void*)&presetOutputs.ob_size, NULL, P_FLAG_NONE, 0.0, 0.5, 0, "");
329  load_builtin_param_float("ob_r", (void*)&presetOutputs.ob_r, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
330  load_builtin_param_float("ob_g", (void*)&presetOutputs.ob_g, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
331  load_builtin_param_float("ob_b", (void*)&presetOutputs.ob_b, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
332  load_builtin_param_float("ob_a", (void*)&presetOutputs.ob_a, NULL, P_FLAG_NONE, 0.0, 1.0, 0.0, "");
333
334  load_builtin_param_float("ib_size", (void*)&presetOutputs.ib_size,  NULL,P_FLAG_NONE, 0.0, .5, 0.0, "");
335  load_builtin_param_float("ib_r", (void*)&presetOutputs.ib_r,  NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, "");
336  load_builtin_param_float("ib_g", (void*)&presetOutputs.ib_g,  NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, "");
337  load_builtin_param_float("ib_b", (void*)&presetOutputs.ib_b,  NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, "");
338  load_builtin_param_float("ib_a", (void*)&presetOutputs.ib_a,  NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, "");
339
340  load_builtin_param_float("mv_r", (void*)&presetOutputs.mv_r,  NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, "");
341  load_builtin_param_float("mv_g", (void*)&presetOutputs.mv_g,  NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, "");
342  load_builtin_param_float("mv_b", (void*)&presetOutputs.mv_b,  NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, "");
343  load_builtin_param_float("mv_x", (void*)&presetOutputs.mv_x,  NULL,P_FLAG_NONE, 0.0, 64.0, 0.0, "nmotionvectorsx");
344  load_builtin_param_float("mv_y", (void*)&presetOutputs.mv_y,  NULL,P_FLAG_NONE, 0.0, 48.0, 0.0, "nmotionvectorsy");
345  load_builtin_param_float("mv_l", (void*)&presetOutputs.mv_l,  NULL,P_FLAG_NONE, 0.0, 5.0, 0.0, "");
346  load_builtin_param_float("mv_dy", (void*)&presetOutputs.mv_dy, NULL, P_FLAG_NONE, 0.0, 1.0, -1.0, "");
347  load_builtin_param_float("mv_dx", (void*)&presetOutputs.mv_dx,  NULL,P_FLAG_NONE, 0.0, 1.0, -1.0, "");
348  load_builtin_param_float("mv_a", (void*)&presetOutputs.mv_a,  NULL,P_FLAG_NONE, 0.0, 1.0, 0.0, "");
349
350  load_builtin_param_float("time", (void*)&presetInputs.time,  NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0.0, "");
351  load_builtin_param_float("bass", (void*)&presetInputs.bass,  NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0.0, "");
352  load_builtin_param_float("mid", (void*)&presetInputs.mid,  NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, "");
353
354  load_builtin_param_float("treb", (void*)&presetInputs.treb,  NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, "");
355
356
357  load_builtin_param_float("mood_r", (void*)&presetInputs.mood_r,  NULL,P_FLAG_READONLY, 0.0, 1.0, 0.0, "");
358  load_builtin_param_float("mood_g", (void*)&presetInputs.mood_g,  NULL,P_FLAG_READONLY, 0.0, 1.0, 0, "");
359  load_builtin_param_float("mood_b", (void*)&presetInputs.mood_b,  NULL,P_FLAG_READONLY, 0.0, 1.0, 0, "");
360
361  load_builtin_param_float("bass_att", (void*)&presetInputs.bass_att,  NULL,P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, "");
362  load_builtin_param_float("mid_att", (void*)&presetInputs.mid_att,  NULL, P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, "");
363  load_builtin_param_float("treb_att", (void*)&presetInputs.treb_att,  NULL, P_FLAG_READONLY, 0.0, MAX_DOUBLE_SIZE, 0, "");
364  load_builtin_param_int("frame", (void*)&presetInputs.frame, P_FLAG_READONLY, 0, MAX_INT_SIZE, 0, "");
365  load_builtin_param_float("progress", (void*)&presetInputs.progress,  NULL,P_FLAG_READONLY, 0.0, 1, 0, "");
366  load_builtin_param_int("fps", (void*)&presetInputs.fps, P_FLAG_READONLY, 15, MAX_INT_SIZE, 0, "");
367
368  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_NONE,
369                           0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
370  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_NONE,
371                           0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
372  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_NONE,
373                           0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
374  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_NONE,
375                           0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
376
377  load_builtin_param_float("q1", (void*)&presetOutputs.q1,  NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
378  load_builtin_param_float("q2", (void*)&presetOutputs.q2,  NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
379  load_builtin_param_float("q3", (void*)&presetOutputs.q3,  NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
380  load_builtin_param_float("q4", (void*)&presetOutputs.q4,  NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
381  load_builtin_param_float("q5", (void*)&presetOutputs.q5,  NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
382  load_builtin_param_float("q6", (void*)&presetOutputs.q6,  NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
383  load_builtin_param_float("q7", (void*)&presetOutputs.q7,  NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
384  load_builtin_param_float("q8", (void*)&presetOutputs.q8,  NULL, P_FLAG_PER_PIXEL |P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
385
386  /* variables added in 1.04 */
387  load_builtin_param_int("meshx", (void*)&presetInputs.gx, P_FLAG_READONLY, 32, 96, 8, "");
388  load_builtin_param_int("meshy", (void*)&presetInputs.gy, P_FLAG_READONLY, 24, 72, 6, "");
389
390  return PROJECTM_SUCCESS;
391
392}
393