Closed normen closed 11 months ago
Oh this is a bug in the generation code :(
The right type for inputs
on this event is Array<Object>
:
This should translate to []map[string]interface{}
, but it's currently a []*typedef.Input
:
This is a result of some wonky logic here:
https://github.com/andreykaipov/goobs/blob/b67ee5891aa019a67d163dd675222b46f705c000/internal/generate/protocol/generate.go#L440-L499 where I take a guess at what structs match what fields based on their name.
It's a remnant of the v4 protocol where it documented common typedefs that it then referred to in requests, but in v5 a lot of the request types are documented as just Object
or Array<Object>
.
At the risk of just using map[string]interface{}
everywhere to avoid situations like this and at least expose the hidden values (mapstructure's remain
decoding might come in handy here), it might just be time to migrate this library from generated code spaghetti into more maintainable code... 😅
Already tested and incorporated your changes, seems to work nicely including meters and setting zero values. Thank you very much!
Oh snap are you talking about #81? That's crazy thank you for testing it out already! I was hesitant to ping you here until I was ready to cut a release but this gives me more confidence in it!
Yep, didn't use the new builder pattern but it works great in my bridge app: https://github.com/normen/obs-mcu
I basically just had to add a few &
's really to adapt my code, meters work great without much overhead.
Thanks once again for testing this out 🙏 I released these changes in v1.0.0
Hi,
for the
InputVolumeMeters
messages I do manage to enable them but the resulting event doesn't seem to contain any info about the actual meters, only the name and type of the channel?Am I missing something?
Thanks for any hints and especially for the library!