libmapper / webmapper

An HTML5-based graphical interface to libmapper.
http://www.libmapper.org
GNU Lesser General Public License v2.1
17 stars 15 forks source link

Odd bug fixes to let devices and signals show up #27

Closed bboettcher3 closed 2 years ago

bboettcher3 commented 2 years ago

Not sure if this is just me, but I found some weird bugs that were preventing devices and signals from showing up in webmapper. Let me know if any of the assumed fixes aren't correct.

Error 1: File "C:\Users\brady\Documents\GitHub\McGill\webmapper\libmapper.py", line 559, in get_property prop = Property(prop) File "C:\Users\brady\anaconda3\lib\enum.py", line 309, in __call__ return cls.__new__(cls, value) File "C:\Users\brady\anaconda3\lib\enum.py", line 600, in __new__ raise exc File "C:\Users\brady\anaconda3\lib\enum.py", line 584, in __new__ result = cls._missing_(value) File "C:\Users\brady\anaconda3\lib\enum.py", line 613, in _missing_ raise ValueError("%r is not a valid %s" % (value, cls.__name__)) ValueError: 8192 is not a valid Property

Fix: Change 0x200 on line 557 of libmapper.py to what I assume it was meant to be: 0x2000

Error 2: File ".\webmapper.py", line 86, in sig_props props['steal'] = props['steal'].name AttributeError: 'int' object has no attribute 'name'

Fix: remove .name from line 86, let it use the int property (MPR_PROP_STEAL_MODE)

malloch commented 2 years ago

Hi @bboettcher3, line 557 should be the property 0x0200 MPR_PROP_DATA. This is documented in the updated libmapper python bindings in the libmapper repo – we should copy over the new version to the webmapper project and perhaps this will fix some of the bugs you noticed.

The bindings should be translating (line 592) the "steal" property in to a Stealing object (line 128) so calling .name() should be correct – if there is a bug it is that libmapper.py returned an int instead of a Stealing enum object. That said, make sure you are using the latest python bindings before trying to debug!

DocSunset commented 2 years ago

I was wondering about that recently; should there even be a copy of libmapper.py in the webmapper repository? I thought this script was a build product of libmapper that get installed in a global system location, like /usr/local/lib somewhere... (sorry to invade this discussion with my random comments...)

bboettcher3 commented 2 years ago

@DocSunset My understanding is that once the libmapper python wheels are distributed nicely for all platforms (to pip?) then you're right, but that installation isn't really documented or enforced yet so that's why libmapper.py is still in the repo to be used with the binaries copied into the webmapper root dir

bboettcher3 commented 2 years ago

@malloch yep, updating to the newest libmapper binary fixed them, my bad!