From 912cdcaaff2a0454e34003d3ba7a591a68ddfa85 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 9 Jul 2009 00:50:08 -0700 Subject: [PATCH] Removed FseqCheck option and instead replaced with FseqThreshold option --- src/tuio.c | 22 ++++++++++++---------- src/tuio.h | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/tuio.c b/src/tuio.c index b212749..09aa6bb 100644 --- a/src/tuio.c +++ b/src/tuio.c @@ -195,11 +195,6 @@ TuioPreInit(InputDriverPtr drv, xf86Msg(X_INFO, "%s: Object device found\n", dev->identifier); - /* Allocate device storage and add to device list */ - subdev = xcalloc(1, sizeof(SubDeviceRec)); - subdev->pInfo = pInfo; - _subdev_add(&g_pTuio->subdev_list, subdev); - } else { if (!(pTuio = xcalloc(1, sizeof(TuioDeviceRec)))) { @@ -229,13 +224,19 @@ TuioPreInit(InputDriverPtr drv, pTuio->tuio_port = tuio_port; /* Get setting for checking fseq numbers in TUIO packets */ - pTuio->check_fseq= xf86CheckBoolOption(dev->commonOptions, "CheckFseq", True); - if (!pTuio->check_fseq) { - xf86Msg(X_INFO, "%s: CheckFseq set to False\n", - dev->identifier); + pTuio->fseq_threshold= xf86CheckIntOption(dev->commonOptions, + "FseqThreshold", 100); + if (pTuio->fseq_threshold != 100) { + xf86Msg(X_INFO, "%s: FseqThreshold set to %i\n", + dev->identifier, pTuio->fseq_threshold); } } + /* Allocate device storage and add to device list */ + subdev = xcalloc(1, sizeof(SubDeviceRec)); + subdev->pInfo = pInfo; + _subdev_add(&g_pTuio->subdev_list, subdev); + /* Set up InputInfoPtr */ pInfo->name = xstrdup(dev->identifier); pInfo->flags = 0; @@ -303,7 +304,8 @@ TuioReadInput(InputInfoPtr pInfo) * Also check to make sure the processed data was newer than * the last processed data */ if (pTuio->processed && - (pTuio->fseq_new > pTuio->fseq_old || !pTuio->check_fseq)) { + (pTuio->fseq_new > pTuio->fseq_old || + pTuio->fseq_old - pTuio->fseq_new > pTuio->fseq_threshold)) { while (obj != NULL) { if (!obj->alive) { diff --git a/src/tuio.h b/src/tuio.h index f48d9e2..7a7ba8b 100644 --- a/src/tuio.h +++ b/src/tuio.h @@ -48,6 +48,7 @@ typedef struct _TuioDevice { int tuio_port; int num_subdev; Bool check_fseq; + int fseq_threshold; struct _Object *obj_list; -- 2.11.4.GIT