Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

rve.cc File Reference


Detailed Description

The main program.

This is where you'll add new commands to tie it all together. A command can safely assume that it controls the entire screen, unlike an effect. The screen will usually be cleared before and after a command is run.

#include <fcntl.h>
#include <glob.h>
#include <unistd.h>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <memory>
#include "bitmap.h"
#include "effect.h"
#include "lib.h"
#include "rve.h"

Functions

void usage ()
void do_nothing (int signum)
int text_changealpha (Effect_changealpha &effect, char *text)
int cmd_showimg (int argc, char *argv[])
 

int cmd_bluebox (int argc, char *argv[])
 

int cmd_clear (int argc, char *argv[])
 

int cmd_static_text (int argc, char *argv[])
 

int cmd_fading_text (int argc, char *argv[])
 

int cmd_hscroll_text (int argc, char *argv[])
 

int cmd_clock (int argc, char *argv[])
 

int cmd_tile_text (int argc, char *argv[])
 

int cmd_simple_anim (int argc, char *argv[])
 

int cmd_streamer (int argc, char *argv[])
 

int cmd_rollcount (int argc, char *argv[])
 

int cmd_drift (int argc, char *argv[])
 

int cmd_vote (int argc, char *argv[])
 

int main (int argc, char *argv[])

Variables

int screenw
int screenh
int screenx = 0 screeny = 0
int deadline = 0
int verbosity = 1
char * global_font = FONT *stylefile = NULL
int global_fps = 23 global_textcolor = 0xFFFFFF fontsize = 5
struct {
   char *   name
   int(*   function )(int, char **)
   bool   clear
commands []


Function Documentation

int cmd_bluebox int  argc,
char *  argv[]
[static]
 

Renders a transparent blue box. Used for testing if bmovl even works.

int cmd_clear int  argc,
char *  argv[]
[static]
 

Clears the screen

int cmd_clock int  argc,
char *  argv[]
[static]
 

Renders a clock in milliseconds on the screen, for testing timing.

int cmd_drift int  argc,
char *  argv[]
 

Interfaces with Driftnet (http://www.ex-parrot.com/~chris/driftnet/) to capture images coming across the network and display them at random positions on the screen.

To make this work you need to install Driftnet and run the TOOLS/driftd script on the machine that will be capturing from the network. You may want to edit the Driftnet Makefile to disable the GUI code. Also remember to edit the configuration at the top of driftd and to create a temporary dir on the capturing machine (default: ./drift).

Instead of connecting to a host/port, the drift command can also just read from stdin if you give the "-" argument.

int cmd_fading_text int  argc,
char *  argv[]
[static]
 

Renders a text centered on the screen and makes it fade in and out. Requires one argument: the text string.

int cmd_hscroll_text int  argc,
char *  argv[]
[static]
 

Scrolls a text across the screen from right to left one or more times. Requires one argument: the text string.

Parameters:
-r Max repeat count
-s Speed, an integer > 0, defaults to 2

int cmd_rollcount int  argc,
char *  argv[]
[static]
 

Animates a rolling counter counting from a time (hours:minuts:seconds) towards zero.

Parameters:
(d)elay The number of frames that the digits to the left will lag behind those to the right. This makes it look more mechanical when multiple digits are changing.
(D)igits Force this number of digits to be shown, even if the number is smaller or larger.
(g)roupspacing Extra space, in pixels, between pairs of digits (e.g. in a time value like 2:03:58).
(i)mage background that will be shown behind the counter always. When using this, it will only look right if Digits, groupspacing, Xmargin, Ymargin and size_of_digits are tuned to suit this image.
(s)ize_of_digits The font size for printing the digits. When it has to match a background image, this is best given as a negative value, which is interpreted as absolute.
(t)ext An optional text label to be shown next to the counter.
x,y Position of counter
X,Y Where to place the counter inside the background image, if one is given. Otherwise these parameters are ignored.

int cmd_showimg int  argc,
char *  argv[]
[static]
 

Blits an image to screen, nothing else. Requires a single argument: the file name.

Parameters:
-a An optional alpha value from 0 to 255

int cmd_simple_anim int  argc,
char *  argv[]
[static]
 

Scrolls a simple looping animation across the screen. Each argument is a bitmap file, and the bitmaps will be moved from right to left on the screen while looping in an animation.

Parameters:
-s The movement speed. Around 2-5 usually looks good.

int cmd_static_text int  argc,
char *  argv[]
[static]
 

Renders a text string in the top left corner. Requires one argument: the text string.

int cmd_streamer int  argc,
char *  argv[]
[static]
 

This works like hscroll_text, except that the text will be blended on top of an animated streamer. For now the documentation is the source.

int cmd_tile_text int  argc,
char *  argv[]
[static]
 

Renders a text centered on the screen and makes it appear/disappear with a tile transition. Requires one argument: the text string.

int cmd_vote int  argc,
char *  argv[]
 

Visualizes a voting between 2 or more choices. The names of those choices are given as arguments to the vote command, and the scores are updated by feeding in numbers on stdin, like "3 2 5\n" for a voting with 3 choices.


Generated on Sun Oct 19 17:34:47 2003 for rve by doxygen 1.3.3