|
From: Johann D. <de...@if...> - 2002-02-16 20:47:19
|
Hi there ! Here is a first proposal for the API. /* Describes a force feedback device */ struct ff_device; /* Related functions */ /* Get a list of available devices on the system */ ff_device_list ff_enumerateDevices(); /* Test if an effect is supported */ bool ff_effectIsSupported(ff_device, ff_effectCapability); ff_effectCapability would be a pair <effect, feature>. Sample pairs would be: - <FF_CONSTANT, FF_ANY> to check if constant effects are supported - <FF_CONSTANT, FF_ANY_DIRECTION> to check if constant effects can have any direction (not true for wheels, for example) - <FF_RUMBLE, FF_DIRECTION> to check if rumble effects can have direction (I guess it's generally not the case) - <FF_SINE, FF_UPDATE> to check if it's possible to update a sine wave effect while it's playing - <FF_ALL, FF_PAUSE> to check if it's possible to pause any kind of effect - and so on, there are many possible combinations Note the special values FF_ANY and FF_ALL. They can be seen as kinds of quantifiers (FF_ANY = exists, FF_ALL = for all). For example, to test if a device has any ff capability at all, one could use <FF_ANY, FF_ANY> (that's useless though, because ff_enumerateDevices() should not return non-ff capable devices) We could even use these pairs to express constraints and find all the devices matching those constraints. But that's for later, I think. We need to keep it simple at first, but let's keep this possibility in our minds. /* Return the number of effects that can be played at the same time */ int ff_effectsNumber(ff_device); Note that it's possible that several processes access a device. In that case, the actual number of effects playable at the same time may be lower. You may wonder what is the use of having several processes accessing a device. That's probably not meaningful for joysticks, but it is for mice. -- Johann Deneux ______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif |