Пример #1
0
void encoder()
{
    int vnum,i;

    init_encoder();
    for(i=0; i<QSIZE; i++) 
	thequeue[i]=0;
    for(vnum=0; 
	read_sound_buffer(IDIM, thequeue + (vnum * IDIM)%QSIZE) > 0;
	vnum++) 
    {
	vector_end = thequeue+(vnum*IDIM)%QSIZE+IDIM;
	encode_vector(0);
	adapt_frame();
    }
}
Пример #2
0
static void
fill_polygon(PLStream *pls)
{
    TekDev *dev = (TekDev *) pls->dev;
    int i;
    char fillcol[4], firstpoint[5];

    if (pls->dev_npts < 1)
	return;

    tek_graph(pls);

    encode_int(fillcol, -dev->curcolor);
    encode_vector(firstpoint, pls->dev_x[0], pls->dev_y[0]);

/* Select the fill pattern */

    pls->bytecnt += fprintf(pls->OutFile, "\033MP%s", fillcol);

/* Begin panel boundary */
/* Set pls->debug to see the boundary of each fill box -- cool! */

    if (pls->debug)
	pls->bytecnt += fprintf(pls->OutFile, "\033LP%s1", firstpoint);
    else
	pls->bytecnt += fprintf(pls->OutFile, "\033LP%s0", firstpoint);

/* Specify boundary (in vector mode) */

    pls->bytecnt += fprintf(pls->OutFile, VECTOR_MODE);
    for (i = 1; i < pls->dev_npts; i++) 
	tek_vector(pls, pls->dev_x[i], pls->dev_y[i]);

/* End panel */

    pls->bytecnt += fprintf(pls->OutFile, "\033LE");
}