File: oinksie.h

package info (click to toggle)
libvisual-plugins 1%3A0.4.0%2Bdfsg1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,656 kB
  • sloc: ansic: 9,358; sh: 8,809; cpp: 871; makefile: 222; sed: 16
file content (161 lines) | stat: -rw-r--r-- 3,356 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/* Libvisual-plugins - Standard plugins for libvisual
 * 
 * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit <ds@nerds-incorporated.org>
 *
 * Authors: Dennis Smit <ds@nerds-incorporated.org>
 *
 * $Id: oinksie.h,v 1.10 2006/01/22 13:25:26 synap Exp $
 *
 * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#ifndef _OINK_OINKSIE_H
#define _OINK_OINKSIE_H

#include <time.h>

#include <libvisual/libvisual.h>

/* FIXME indent all likewise eventually */
typedef struct {
	float r;
	float g;
	float b;
	float r_cur;
	float g_cur;
	float b_cur;
} OinksiePalFade;

typedef struct {
	int pal_new;

	int fade_start;
	int fade_steps;
	int fade_stepsdone;
	int fade_poststeps;
	int fade_poststop;
} OinksiePalData;

typedef struct {
	int blurmode;
	int scopemode;
	int backgroundmode;

	int audiodebug;

	int palfunky;

	int scenenew;

	int acidpalette;
} OinksieConfig;

typedef struct {
	int bass;

	int tripple;

	int highest;

	float pcm[3][4096];
	float freq[2][256];
	float freqsmall[4];

	int musicmood;
	char beat;
	int energy;

	int volume;
} OinksieAudio;

typedef struct {
	int scopestereo_enabled;
	int scopestereo_start;
	int scopestereo_space;
	float scopestereo_adder;

	/* shooting balls vars */
	int ball_enabled;
	int ball_xstart;
	int ball_ystart;
	int ball_distance;
	int ball_adder;
	int ball_spread;

	/* turning circles vars */
	int circles_enabled;
	int circles_direction;
	int circles_nr;
	int circles_turn;

	/* ball sine */
	int ballsine_enabled;
	int ballsine_scroll;
	int ballsine_rotate;
	int ballsine_infade;
	int ballsine_direction;

        /* floaters vars */
	int floaters_direction;
	int floaters_turn;

	int rotate;
} OinksieScene;

typedef struct {
	/* Major vars */
	uint8_t			*drawbuf;

	/* Palette vars */
	OinksiePalFade		 pal_fades[256];
	OinksiePalData		 pal_data;
	VisPalette		 pal_cur;
	VisPalette		 pal_old;
	int			 pal_startup;

	/* Screen vars */
	int			 screen_size;
	int			 screen_width;
	int			 screen_height;
	int			 screen_halfwidth;
	int			 screen_halfheight;
	int			 screen_xybiggest;
	int			 screen_xysmallest;

	time_t			 timing;
	time_t			 timing_prev;

	/* Config vars */
	OinksieConfig		 config;
	OinksieAudio		 audio;
	OinksieScene		 scene;

	/* Random context */
	VisRandomContext	*rcontext;
} OinksiePrivate;

void oinksie_init (OinksiePrivate *priv, int width, int height);
void oinksie_quit (OinksiePrivate *priv);

void oinksie_sample (OinksiePrivate *priv);

void oinksie_palette_change (OinksiePrivate *priv, uint8_t funky);

void oinksie_render (OinksiePrivate *priv);
int oinksie_size_set (OinksiePrivate *priv, int width, int height);

VisPalette *oinksie_palette_get (OinksiePrivate *priv);

#endif /* _OINK_OINKSIE_H */