Пример #1
0
static void capture_open(t_capture *x)
{
    int count = x->x_count;
    char buf[MAXPDSTRING];
    hammereditor_open(x->x_filehandle, "Capture", "");  /* CHECKED */
    if (count < x->x_bufsize)
    {
        float *bp = x->x_buffer;
        int col = 0;
        while (count--)
            col = capture_appendfloat(x, *bp++, buf, col);
    }
    else
    {
        float *bp = x->x_buffer + x->x_head;
        int col = 0;
        count = x->x_bufsize - x->x_head;
        while (count--)
            col = capture_appendfloat(x, *bp++, buf, col);
        bp = x->x_buffer;
        count = x->x_head;
        while (count--)
            col = capture_appendfloat(x, *bp++, buf, col);
    }
}
Пример #2
0
/* CHECKED blank line between blocks */
static void capture_open(t_capture *x)
{
    int count = x->x_count;
    char buf[MAXPDSTRING];
    int nindices = (x->x_nindices > 0 ? x->x_nindices : x->x_nblock);
    hammereditor_open(x->x_filehandle, "Signal Capture", "");  /* CHECKED */
    if (x->x_mode == 'f' || count < x->x_bufsize)
    {
	float *bp = x->x_buffer;
	int col = 0, i;
	for (i = 1; i <= count; i++)
	    col = capture_appendfloat(x, *bp++, buf, col,
				      ((i % nindices) == 0));
    }
    else
    {
	float *bp = x->x_buffer + x->x_head;
	int col = 0, i = x->x_bufsize;
	count = x->x_bufsize - x->x_head;
	while (count--)
	    col = capture_appendfloat(x, *bp++, buf, col,
				      ((--i % nindices) == 0));
	bp = x->x_buffer;
	count = x->x_head;
	while (count--)
	    col = capture_appendfloat(x, *bp++, buf, col,
				      ((count % nindices) == 0));
    }
}