[C/C++] Controlling sources with a plugin?

DarkMorford

New Member
I'd like to write an OBS plugin that uses the Google Docs API (probably via libcurl) to pull data from a spreadsheet at regular intervals and automatically update text sources, but I can't seem to find the right parts of libobs to do so. (I have looked into doing this in Python or Lua, but due to double-pointers and other quirks of the script bindings it's infeasible right now.) Three things in particular have me scratching my head at the moment:

1. This sort of functionality doesn't seem to be covered by any of the four main object types (source, output, encoder, service) described in the docs - I don't need to render anything myself - so I'm not even really sure where to start. Do I need to make a source with a "dummy" render function? Or is it possible to create a plugin that doesn't register any of these objects?

2. Assuming that the latter is true, how would I add my plugin to the Tools menu in OBS? I assume I need to use the Qt tools to create a settings dialog (which I don't have any experience with, but that's another post), but I don't see anything documented in the Frontend API for adding entries to the menu or displaying the dialog (which I'd like to be non-modal so it can be a sort of "control panel" during a stream).

3. The scripting API exposes timer_add and timer_remove functions, which would be very useful for scheduling calls to the Google API, but I don't see any mention of them in the rest of the documentation. Were they simply overlooked during writing, or do they not exist at all outside of scripts? If not, how would I make my plugin "tick" so it knows when to invoke libcurl?

Any specific examples I can look at or sample code would be appreciated. Thanks in advance!
 

w23

New Member
Does this really need to be a native plugin? This is far easier done as an external utility, running in a separate shell and updating a text file, which is set to be read by existing text plugin.
 
Top