mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-27 17:55:42 -04:00
UI: Just use json directly for service lookups
This commit accomplishes three different things: - Makes it much less difficult to communicate service settings between the UI and the plugin. - Refactors some code and makes it cleaner and easier to modify to our needs (although there is still a lot of work to do on that front because of heavy code duplication issues between auto-config and the stream settings pane). - Significantly reatly reduces the number of times the json file has to be opened and parsed. This also kind of denotes a bit of a failure on the plugin communication aspect. The properties system is too limited and jank for a lot of things we would like to do at times.
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
|
||||
#include <json11.hpp>
|
||||
|
||||
class Ui_AutoConfigStartPage;
|
||||
class Ui_AutoConfigVideoPage;
|
||||
class Ui_AutoConfigStreamPage;
|
||||
@@ -174,6 +176,10 @@ class AutoConfigStreamPage : public QWizardPage {
|
||||
QString lastService;
|
||||
bool ready = false;
|
||||
|
||||
inline void GetServicesJson();
|
||||
json11::Json servicesRoot;
|
||||
bool servicesLoaded = false;
|
||||
|
||||
void LoadServices(bool showAll);
|
||||
inline bool IsCustomService() const;
|
||||
|
||||
@@ -248,7 +254,8 @@ class AutoConfigTestPage : public QWizardPage {
|
||||
|
||||
inline ServerInfo() {}
|
||||
|
||||
inline ServerInfo(const char *name_, const char *address_)
|
||||
inline ServerInfo(const std::string &name_,
|
||||
const std::string &address_)
|
||||
: name(name_), address(address_)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user