| 1 |
/* Libvisual-plugins - Standard plugins for libvisual |
| 2 |
* |
| 3 |
* Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit <[email protected]> |
| 4 |
* |
| 5 |
* Authors: Dennis Smit <[email protected]> |
| 6 |
* |
| 7 |
* $Id: oinksie.h,v 1.10 2006/01/22 13:25:26 synap Exp $ |
| 8 |
* |
| 9 |
* This program is free software; you can redistribute it and/or modify |
| 10 |
* it under the terms of the GNU General Public License as |
| 11 |
* published by the Free Software Foundation; either version 2 |
| 12 |
* of the License, or (at your option) any later version. |
| 13 |
* |
| 14 |
* This program is distributed in the hope that it will be useful, |
| 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
* GNU General Public License for more details. |
| 18 |
* |
| 19 |
* You should have received a copy of the GNU General Public License |
| 20 |
* along with this program; if not, write to the Free Software |
| 21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 |
*/ |
| 23 |
|
| 24 |
#ifndef _OINK_OINKSIE_H |
| 25 |
#define _OINK_OINKSIE_H |
| 26 |
|
| 27 |
#include <time.h> |
| 28 |
|
| 29 |
#include <libvisual/libvisual.h> |
| 30 |
|
| 31 |
/* FIXME indent all likewise eventually */ |
| 32 |
typedef struct { |
| 33 |
float r; |
| 34 |
float g; |
| 35 |
float b; |
| 36 |
float r_cur; |
| 37 |
float g_cur; |
| 38 |
float b_cur; |
| 39 |
} OinksiePalFade; |
| 40 |
|
| 41 |
typedef struct { |
| 42 |
int pal_new; |
| 43 |
|
| 44 |
int fade_start; |
| 45 |
int fade_steps; |
| 46 |
int fade_stepsdone; |
| 47 |
int fade_poststeps; |
| 48 |
int fade_poststop; |
| 49 |
} OinksiePalData; |
| 50 |
|
| 51 |
typedef struct { |
| 52 |
int blurmode; |
| 53 |
int scopemode; |
| 54 |
int backgroundmode; |
| 55 |
|
| 56 |
int audiodebug; |
| 57 |
|
| 58 |
int palfunky; |
| 59 |
|
| 60 |
int scenenew; |
| 61 |
|
| 62 |
int acidpalette; |
| 63 |
} OinksieConfig; |
| 64 |
|
| 65 |
typedef struct { |
| 66 |
int bass; |
| 67 |
|
| 68 |
int tripple; |
| 69 |
|
| 70 |
int highest; |
| 71 |
|
| 72 |
float pcm[3][4096]; |
| 73 |
float freq[2][256]; |
| 74 |
float freqsmall[4]; |
| 75 |
|
| 76 |
int musicmood; |
| 77 |
char beat; |
| 78 |
int energy; |
| 79 |
|
| 80 |
int volume; |
| 81 |
} OinksieAudio; |
| 82 |
|
| 83 |
typedef struct { |
| 84 |
int scopestereo_enabled; |
| 85 |
int scopestereo_start; |
| 86 |
int scopestereo_space; |
| 87 |
float scopestereo_adder; |
| 88 |
|
| 89 |
/* shooting balls vars */ |
| 90 |
int ball_enabled; |
| 91 |
int ball_xstart; |
| 92 |
int ball_ystart; |
| 93 |
int ball_distance; |
| 94 |
int ball_adder; |
| 95 |
int ball_spread; |
| 96 |
|
| 97 |
/* turning circles vars */ |
| 98 |
int circles_enabled; |
| 99 |
int circles_direction; |
| 100 |
int circles_nr; |
| 101 |
int circles_turn; |
| 102 |
|
| 103 |
/* ball sine */ |
| 104 |
int ballsine_enabled; |
| 105 |
int ballsine_scroll; |
| 106 |
int ballsine_rotate; |
| 107 |
int ballsine_infade; |
| 108 |
int ballsine_direction; |
| 109 |
|
| 110 |
/* floaters vars */ |
| 111 |
int floaters_direction; |
| 112 |
int floaters_turn; |
| 113 |
|
| 114 |
int rotate; |
| 115 |
} OinksieScene; |
| 116 |
|
| 117 |
typedef struct { |
| 118 |
/* Major vars */ |
| 119 |
uint8_t *drawbuf; |
| 120 |
|
| 121 |
/* Palette vars */ |
| 122 |
OinksiePalFade pal_fades[256]; |
| 123 |
OinksiePalData pal_data; |
| 124 |
VisPalette pal_cur; |
| 125 |
VisPalette pal_old; |
| 126 |
int pal_startup; |
| 127 |
|
| 128 |
/* Screen vars */ |
| 129 |
int screen_size; |
| 130 |
int screen_width; |
| 131 |
int screen_height; |
| 132 |
int screen_halfwidth; |
| 133 |
int screen_halfheight; |
| 134 |
int screen_xybiggest; |
| 135 |
int screen_xysmallest; |
| 136 |
|
| 137 |
time_t timing; |
| 138 |
time_t timing_prev; |
| 139 |
|
| 140 |
/* Config vars */ |
| 141 |
OinksieConfig config; |
| 142 |
OinksieAudio audio; |
| 143 |
OinksieScene scene; |
| 144 |
|
| 145 |
/* Random context */ |
| 146 |
VisRandomContext *rcontext; |
| 147 |
} OinksiePrivate; |
| 148 |
|
| 149 |
void oinksie_init (OinksiePrivate *priv, int width, int height); |
| 150 |
void oinksie_quit (OinksiePrivate *priv); |
| 151 |
|
| 152 |
void oinksie_sample (OinksiePrivate *priv); |
| 153 |
|
| 154 |
void oinksie_palette_change (OinksiePrivate *priv, uint8_t funky); |
| 155 |
|
| 156 |
void oinksie_render (OinksiePrivate *priv); |
| 157 |
int oinksie_size_set (OinksiePrivate *priv, int width, int height); |
| 158 |
|
| 159 |
VisPalette *oinksie_palette_get (OinksiePrivate *priv); |
| 160 |
|
| 161 |
#endif /* _OINK_OINKSIE_H */ |