本文整理汇总了C++中OBSBasic::SetService方法的典型用法代码示例。如果您正苦于以下问题:C++ OBSBasic::SetService方法的具体用法?C++ OBSBasic::SetService怎么用?C++ OBSBasic::SetService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBSBasic
的用法示例。
在下文中一共展示了OBSBasic::SetService方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveStreamSettings
void AutoConfig::SaveStreamSettings()
{
OBSBasic *main = reinterpret_cast<OBSBasic*>(App()->GetMainWindow());
/* ---------------------------------- */
/* save service */
const char *service_id = customServer
? "rtmp_custom"
: "rtmp_common";
obs_service_t *oldService = main->GetService();
OBSData hotkeyData = obs_hotkeys_save_service(oldService);
obs_data_release(hotkeyData);
OBSData settings = obs_data_create();
obs_data_release(settings);
if (!customServer)
obs_data_set_string(settings, "service", serviceName.c_str());
obs_data_set_string(settings, "server", server.c_str());
obs_data_set_string(settings, "key", key.c_str());
OBSService newService = obs_service_create(service_id,
"default_service", settings, hotkeyData);
obs_service_release(newService);
if (!newService)
return;
main->SetService(newService);
main->SaveService();
main->auth = streamPage->auth;
if (!!main->auth)
main->auth->LoadUI();
/* ---------------------------------- */
/* save stream settings */
config_set_int(main->Config(), "SimpleOutput", "VBitrate",
idealBitrate);
config_set_string(main->Config(), "SimpleOutput", "StreamEncoder",
GetEncoderId(streamingEncoder));
config_remove_value(main->Config(), "SimpleOutput", "UseAdvanced");
}