andreykaipov / goobs

Go client library for OBS Studio
Apache License 2.0
132 stars 23 forks source link

SetCurrentProgramScene compile error #178

Open ea7kir opened 1 week ago

ea7kir commented 1 week ago

I'm trying discover how to use SetCurrentProgramScene in order to switch between scenes in OBS.

EXAMPLE ERROR: client.SetCurrentProgramScene undefined (type *goobs.Client has no field or method SetCurrentProgramScene)

Is this because there's an extra comma in api/requests/scenes/xx_generated.setcurrentprogramscene.go ?

OR: Is it because I'm failing to understand how to use goobs ? If so, please can you provide more examples and/or some documentation ?

andreykaipov commented 6 days ago

Hey @ea7kir - sorry this went unnoticed. Seems like I still haven't figured out notifications correctly...

Have you seen the examples in these docs https://github.com/andreykaipov/goobs/tree/main/docs#making-requests? These examples are more hands-on than the code samples you might've seen under the _examples dir. I added them to hopefully act as a guide and provide some techniques for figuring out which requests to use, but I think they might help here too.

Since the obs-websocket library has a lot of requests, I group them under the same categories they show up in the protocol documentation (see https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#requests). In your specific case, the SetCurrentProgramScene request is under the Scenes category. So after initializing the client, instead of client.SetCurrentProgramScene(...), you should use client.Scenes.SetCurrentProgramScene(...).

The table in the following doc has the 1-1 mapping for a obs-websocket protocol request to a goobs method call: https://github.com/andreykaipov/goobs/blob/main/docs/request-mapping.md

Please lemme know if this helps.