View Single Post
Old Sep 8, 2006, 05:42 PM   #1 (permalink)
Russ
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,060
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

Bugs with addon api...

There still (3538k) appears to be some bugs with the addon api, but some of them only show up on mutli-card systems, so it is hard (for me) to figure out exactly what is happening -vs- what is supposed to happen with an addon on multi-card systems (since I have only a single card).

Issues:

Per Device Addons (only):
----------------------
The value of "p" in init() is supposed to be the device number, but on my system the value is always -10. (-1 for System Wide addons, which is expected).

Up until save_settings() is called the first time, kx_manager->get_current_device() also results in a value of -10. Only after save_settings() is called the first time, does the function appear to return the current device. (it does appear to return the current device for System Wide addons during init() (as far as I can tell anyway)).
----------

System Wide addons (only):
----------------------
load_settings() is never called.
----------

Both:
----------------------
Registering the addon reports that 2 addons were registered, even though there is only a single addon.

The return value from init() seems to make no difference. I tried returning a value of -1 (as well as other non-zero values, for testing purposes) and the addon continued to load normally.

It is unclear as to how the addon is supposed to function when it is a System Wide addon -vs- being a Per Device addon (and it does not seem to function in such a way that those terms would suggest).

i.e.
- "System Wide" sounds like it would mean that there is a single instance of the addon, shared by all devices. However, when tested on a system with two cards, there appeared to be two instances of the addon loaded at the same time (both shown on the menu). Also, I was getting some strange results when calling kx_manager->change_device() from the addon (different from the results when doing the same thing in a per device addon).

- "Per Device" sounds like one of the following scenarios:
One instance of the addon is loaded/used for/by each device (so multiple instances would be running at once).
-or-
One instance of the addon is loaded at a time, and when you change devices, the previous instance is closed, and a new instance started.

I am not sure which of the above (per device addon) scenarios is supposed to be used, but as far as I can tell, there appears to only ever be one instance of the addon loaded, and the only thing that seems to happen when you change devices, is that save_settings() is called (I am not exactly sure what happens when you change devices with a System Wide addon, as I have not had a chance, as of yet, to see the debug output under that scenario (on a multi-card system)).
----------

Again, much of this I could not test myself, since I have only a single card, but with the help of Maddogg6, some testing was done on a mutli-card system, leading to some confusing results.

I will post more info here if/when I have more info.

BTW: It would be good if there was a function to get the number of devices (and device names), rather than having to enumerate them manually.

-Russ
Russ is offline   Reply With Quote