How to retrieve current text source text?

Destroy666

Member
I don't mean the text settings, I mean any sort of text that can be from file or set by a plugin. Is this possible?
 

Destroy666

Member
Retrieve = get as a value. As this is Development forum, I'm wondering if there's a method with I guess e.g. source-related API to get the current text, no matter if from file, regular text field or if modified by plugin in a different way.
 

AaronD

Active Member
@MMLTech I think he wants the displayed text that appears on the screen, regardless of where it comes from. For context:
 
If the text is in text_gdiplus sources, and the text was manually edited or set by a script etc, you can read it from the "text" portion of the "settings" for the source. If the text is from a file, then "settings" won't have "text', but will have "read_from_file" with a value of true, and "file" with a filespec so you could read the file to get the text.
 

Destroy666

Member
If the text is in text_gdiplus sources, and the text was manually edited or set by a script etc, you can read it from the "text" portion of the "settings" for the source. If the text is from a file, then "settings" won't have "text', but will have "read_from_file" with a value of true, and "file" with a filespec so you could read the file to get the text.

Thanks, that's more or less what I'm asking about and one way to do it programatically, except I'm not too sure it covers all plugins. Also, since that's the suggested solution (which I was expecting to see but wanted to confirm), I'm just wondering if the property can be accessed through any in-built function as it's in theory stored in `text` var: https://github.com/obsproject/obs-s...df/plugins/obs-text/gdiplus/obs-text.cpp#L230

I've seen e.g. https://docs.obsproject.com/reference-sources#c.obs_source_get_private_settings and https://docs.obsproject.com/reference-sources#c.obs_get_source_properties but the descriptions didn't tell me much. Looking at text code I don't think it would be private settings (what are these?) and properties/properties2 seem to be even more secret after a quick look.
Let's put it another way. What do you want to accomplish by doing this? Where should you get the text from, and where should you put it?
Do you want to select a specific source and get all the text from it to save it in a file or somewhere else like a logging method ? If so you may want to have a look over the docs https://docs.obsproject.com/search?q=text&check_keywords=yes&area=default#

As of now, nothing. I'm just wondering about OBS internals and asking about them. What I wrote is the only knowledge needed by me - if there's some universal way to access the text of a text source (and perhaps some other hidden/internal properties of sources). Also, sorry, but linking to documentation with "yes" search is not very helpful, IMO.
 
Top