window-basic-settings-stream.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. #include <QMessageBox>
  2. #include <QUrl>
  3. #include "window-basic-settings.hpp"
  4. #include "obs-frontend-api.h"
  5. #include "obs-app.hpp"
  6. #include "window-basic-main.hpp"
  7. #include "qt-wrappers.hpp"
  8. #include "url-push-button.hpp"
  9. #ifdef BROWSER_AVAILABLE
  10. #include <browser-panel.hpp>
  11. #include "auth-oauth.hpp"
  12. #endif
  13. struct QCef;
  14. struct QCefCookieManager;
  15. extern QCef *cef;
  16. extern QCefCookieManager *panel_cookies;
  17. enum class ListOpt : int {
  18. ShowAll = 1,
  19. Custom,
  20. };
  21. enum class Section : int {
  22. Connect,
  23. StreamKey,
  24. };
  25. inline bool OBSBasicSettings::IsCustomService() const
  26. {
  27. return ui->service->currentData().toInt() == (int)ListOpt::Custom;
  28. }
  29. void OBSBasicSettings::InitStreamPage()
  30. {
  31. ui->connectAccount2->setVisible(false);
  32. ui->disconnectAccount->setVisible(false);
  33. ui->bandwidthTestEnable->setVisible(false);
  34. ui->twitchAddonDropdown->setVisible(false);
  35. ui->twitchAddonLabel->setVisible(false);
  36. int vertSpacing = ui->topStreamLayout->verticalSpacing();
  37. QMargins m = ui->topStreamLayout->contentsMargins();
  38. m.setBottom(vertSpacing / 2);
  39. ui->topStreamLayout->setContentsMargins(m);
  40. m = ui->loginPageLayout->contentsMargins();
  41. m.setTop(vertSpacing / 2);
  42. ui->loginPageLayout->setContentsMargins(m);
  43. m = ui->streamkeyPageLayout->contentsMargins();
  44. m.setTop(vertSpacing / 2);
  45. ui->streamkeyPageLayout->setContentsMargins(m);
  46. LoadServices(false);
  47. ui->twitchAddonDropdown->addItem(
  48. QTStr("Basic.Settings.Stream.TTVAddon.None"));
  49. ui->twitchAddonDropdown->addItem(
  50. QTStr("Basic.Settings.Stream.TTVAddon.BTTV"));
  51. ui->twitchAddonDropdown->addItem(
  52. QTStr("Basic.Settings.Stream.TTVAddon.FFZ"));
  53. ui->twitchAddonDropdown->addItem(
  54. QTStr("Basic.Settings.Stream.TTVAddon.Both"));
  55. connect(ui->service, SIGNAL(currentIndexChanged(int)), this,
  56. SLOT(UpdateServerList()));
  57. connect(ui->service, SIGNAL(currentIndexChanged(int)), this,
  58. SLOT(UpdateKeyLink()));
  59. connect(ui->service, SIGNAL(currentIndexChanged(int)), this,
  60. SLOT(UpdateVodTrackSetting()));
  61. connect(ui->customServer, SIGNAL(textChanged(const QString &)), this,
  62. SLOT(UpdateKeyLink()));
  63. connect(ui->customServer, SIGNAL(editingFinished(const QString &)),
  64. this, SLOT(UpdateKeyLink()));
  65. connect(ui->service, SIGNAL(currentIndexChanged(int)), this,
  66. SLOT(UpdateMoreInfoLink()));
  67. }
  68. void OBSBasicSettings::LoadStream1Settings()
  69. {
  70. obs_service_t *service_obj = main->GetService();
  71. const char *type = obs_service_get_type(service_obj);
  72. loading = true;
  73. obs_data_t *settings = obs_service_get_settings(service_obj);
  74. const char *service = obs_data_get_string(settings, "service");
  75. const char *server = obs_data_get_string(settings, "server");
  76. const char *key = obs_data_get_string(settings, "key");
  77. if (strcmp(type, "rtmp_custom") == 0) {
  78. ui->service->setCurrentIndex(0);
  79. ui->customServer->setText(server);
  80. bool use_auth = obs_data_get_bool(settings, "use_auth");
  81. const char *username =
  82. obs_data_get_string(settings, "username");
  83. const char *password =
  84. obs_data_get_string(settings, "password");
  85. ui->authUsername->setText(QT_UTF8(username));
  86. ui->authPw->setText(QT_UTF8(password));
  87. ui->useAuth->setChecked(use_auth);
  88. } else {
  89. int idx = ui->service->findText(service);
  90. if (idx == -1) {
  91. if (service && *service)
  92. ui->service->insertItem(1, service);
  93. idx = 1;
  94. }
  95. ui->service->setCurrentIndex(idx);
  96. bool bw_test = obs_data_get_bool(settings, "bwtest");
  97. ui->bandwidthTestEnable->setChecked(bw_test);
  98. idx = config_get_int(main->Config(), "Twitch", "AddonChoice");
  99. ui->twitchAddonDropdown->setCurrentIndex(idx);
  100. }
  101. UpdateServerList();
  102. if (strcmp(type, "rtmp_common") == 0) {
  103. int idx = ui->server->findData(server);
  104. if (idx == -1) {
  105. if (server && *server)
  106. ui->server->insertItem(0, server, server);
  107. idx = 0;
  108. }
  109. ui->server->setCurrentIndex(idx);
  110. }
  111. ui->key->setText(key);
  112. lastService.clear();
  113. on_service_currentIndexChanged(0);
  114. obs_data_release(settings);
  115. UpdateKeyLink();
  116. UpdateMoreInfoLink();
  117. UpdateVodTrackSetting();
  118. bool streamActive = obs_frontend_streaming_active();
  119. ui->streamPage->setEnabled(!streamActive);
  120. loading = false;
  121. }
  122. void OBSBasicSettings::SaveStream1Settings()
  123. {
  124. bool customServer = IsCustomService();
  125. const char *service_id = customServer ? "rtmp_custom" : "rtmp_common";
  126. obs_service_t *oldService = main->GetService();
  127. OBSData hotkeyData = obs_hotkeys_save_service(oldService);
  128. obs_data_release(hotkeyData);
  129. OBSData settings = obs_data_create();
  130. obs_data_release(settings);
  131. if (!customServer) {
  132. obs_data_set_string(settings, "service",
  133. QT_TO_UTF8(ui->service->currentText()));
  134. obs_data_set_string(
  135. settings, "server",
  136. QT_TO_UTF8(ui->server->currentData().toString()));
  137. } else {
  138. obs_data_set_string(settings, "server",
  139. QT_TO_UTF8(ui->customServer->text()));
  140. obs_data_set_bool(settings, "use_auth",
  141. ui->useAuth->isChecked());
  142. if (ui->useAuth->isChecked()) {
  143. obs_data_set_string(
  144. settings, "username",
  145. QT_TO_UTF8(ui->authUsername->text()));
  146. obs_data_set_string(settings, "password",
  147. QT_TO_UTF8(ui->authPw->text()));
  148. }
  149. }
  150. if (!!auth && strcmp(auth->service(), "Twitch") == 0) {
  151. bool choiceExists = config_has_user_value(
  152. main->Config(), "Twitch", "AddonChoice");
  153. int currentChoice =
  154. config_get_int(main->Config(), "Twitch", "AddonChoice");
  155. int newChoice = ui->twitchAddonDropdown->currentIndex();
  156. config_set_int(main->Config(), "Twitch", "AddonChoice",
  157. newChoice);
  158. if (choiceExists && currentChoice != newChoice)
  159. forceAuthReload = true;
  160. obs_data_set_bool(settings, "bwtest",
  161. ui->bandwidthTestEnable->isChecked());
  162. } else {
  163. obs_data_set_bool(settings, "bwtest", false);
  164. }
  165. obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));
  166. OBSService newService = obs_service_create(
  167. service_id, "default_service", settings, hotkeyData);
  168. obs_service_release(newService);
  169. if (!newService)
  170. return;
  171. main->SetService(newService);
  172. main->SaveService();
  173. main->auth = auth;
  174. if (!!main->auth)
  175. main->auth->LoadUI();
  176. }
  177. void OBSBasicSettings::UpdateMoreInfoLink()
  178. {
  179. if (IsCustomService()) {
  180. ui->moreInfoButton->hide();
  181. return;
  182. }
  183. QString serviceName = ui->service->currentText();
  184. obs_properties_t *props = obs_get_service_properties("rtmp_common");
  185. obs_property_t *services = obs_properties_get(props, "service");
  186. OBSData settings = obs_data_create();
  187. obs_data_release(settings);
  188. obs_data_set_string(settings, "service", QT_TO_UTF8(serviceName));
  189. obs_property_modified(services, settings);
  190. const char *more_info_link =
  191. obs_data_get_string(settings, "more_info_link");
  192. if (!more_info_link || (*more_info_link == '\0')) {
  193. ui->moreInfoButton->hide();
  194. } else {
  195. ui->moreInfoButton->setTargetUrl(QUrl(more_info_link));
  196. ui->moreInfoButton->show();
  197. }
  198. obs_properties_destroy(props);
  199. }
  200. void OBSBasicSettings::UpdateKeyLink()
  201. {
  202. QString serviceName = ui->service->currentText();
  203. QString customServer = ui->customServer->text();
  204. QString streamKeyLink;
  205. if (serviceName == "Twitch") {
  206. streamKeyLink = "https://dashboard.twitch.tv/settings/stream";
  207. } else if (serviceName.startsWith("YouTube")) {
  208. streamKeyLink = "https://www.youtube.com/live_dashboard";
  209. } else if (serviceName.startsWith("Restream.io")) {
  210. streamKeyLink =
  211. "https://restream.io/settings/streaming-setup?from=OBS";
  212. } else if (serviceName == "Facebook Live" ||
  213. (customServer.contains("fbcdn.net") && IsCustomService())) {
  214. streamKeyLink =
  215. "https://www.facebook.com/live/producer?ref=OBS";
  216. } else if (serviceName.startsWith("Twitter")) {
  217. streamKeyLink = "https://www.pscp.tv/account/producer";
  218. } else if (serviceName.startsWith("YouStreamer")) {
  219. streamKeyLink = "https://app.youstreamer.com/stream/";
  220. } else if (serviceName == "Trovo") {
  221. streamKeyLink = "https://studio.trovo.live/mychannel/stream";
  222. }
  223. if (QString(streamKeyLink).isNull()) {
  224. ui->getStreamKeyButton->hide();
  225. } else {
  226. ui->getStreamKeyButton->setTargetUrl(QUrl(streamKeyLink));
  227. ui->getStreamKeyButton->show();
  228. }
  229. }
  230. void OBSBasicSettings::LoadServices(bool showAll)
  231. {
  232. obs_properties_t *props = obs_get_service_properties("rtmp_common");
  233. OBSData settings = obs_data_create();
  234. obs_data_release(settings);
  235. obs_data_set_bool(settings, "show_all", showAll);
  236. obs_property_t *prop = obs_properties_get(props, "show_all");
  237. obs_property_modified(prop, settings);
  238. ui->service->blockSignals(true);
  239. ui->service->clear();
  240. QStringList names;
  241. obs_property_t *services = obs_properties_get(props, "service");
  242. size_t services_count = obs_property_list_item_count(services);
  243. for (size_t i = 0; i < services_count; i++) {
  244. const char *name = obs_property_list_item_string(services, i);
  245. names.push_back(name);
  246. }
  247. if (showAll)
  248. names.sort(Qt::CaseInsensitive);
  249. for (QString &name : names)
  250. ui->service->addItem(name);
  251. if (!showAll) {
  252. ui->service->addItem(
  253. QTStr("Basic.AutoConfig.StreamPage.Service.ShowAll"),
  254. QVariant((int)ListOpt::ShowAll));
  255. }
  256. ui->service->insertItem(
  257. 0, QTStr("Basic.AutoConfig.StreamPage.Service.Custom"),
  258. QVariant((int)ListOpt::Custom));
  259. if (!lastService.isEmpty()) {
  260. int idx = ui->service->findText(lastService);
  261. if (idx != -1)
  262. ui->service->setCurrentIndex(idx);
  263. }
  264. obs_properties_destroy(props);
  265. ui->service->blockSignals(false);
  266. }
  267. static inline bool is_auth_service(const std::string &service)
  268. {
  269. return Auth::AuthType(service) != Auth::Type::None;
  270. }
  271. void OBSBasicSettings::on_service_currentIndexChanged(int)
  272. {
  273. bool showMore = ui->service->currentData().toInt() ==
  274. (int)ListOpt::ShowAll;
  275. if (showMore)
  276. return;
  277. std::string service = QT_TO_UTF8(ui->service->currentText());
  278. bool custom = IsCustomService();
  279. ui->disconnectAccount->setVisible(false);
  280. ui->bandwidthTestEnable->setVisible(false);
  281. ui->twitchAddonDropdown->setVisible(false);
  282. ui->twitchAddonLabel->setVisible(false);
  283. #ifdef BROWSER_AVAILABLE
  284. if (cef) {
  285. if (lastService != service.c_str()) {
  286. QString key = ui->key->text();
  287. bool can_auth = is_auth_service(service);
  288. int page = can_auth && (!loading || key.isEmpty())
  289. ? (int)Section::Connect
  290. : (int)Section::StreamKey;
  291. ui->streamStackWidget->setCurrentIndex(page);
  292. ui->streamKeyWidget->setVisible(true);
  293. ui->streamKeyLabel->setVisible(true);
  294. ui->connectAccount2->setVisible(can_auth);
  295. }
  296. } else {
  297. ui->connectAccount2->setVisible(false);
  298. }
  299. #else
  300. ui->connectAccount2->setVisible(false);
  301. #endif
  302. ui->useAuth->setVisible(custom);
  303. ui->authUsernameLabel->setVisible(custom);
  304. ui->authUsername->setVisible(custom);
  305. ui->authPwLabel->setVisible(custom);
  306. ui->authPwWidget->setVisible(custom);
  307. if (custom) {
  308. ui->streamkeyPageLayout->insertRow(1, ui->serverLabel,
  309. ui->serverStackedWidget);
  310. ui->serverStackedWidget->setCurrentIndex(1);
  311. ui->serverStackedWidget->setVisible(true);
  312. ui->serverLabel->setVisible(true);
  313. on_useAuth_toggled();
  314. } else {
  315. ui->serverStackedWidget->setCurrentIndex(0);
  316. }
  317. #ifdef BROWSER_AVAILABLE
  318. auth.reset();
  319. if (!!main->auth &&
  320. service.find(main->auth->service()) != std::string::npos) {
  321. auth = main->auth;
  322. OnAuthConnected();
  323. }
  324. #endif
  325. }
  326. void OBSBasicSettings::UpdateServerList()
  327. {
  328. QString serviceName = ui->service->currentText();
  329. bool showMore = ui->service->currentData().toInt() ==
  330. (int)ListOpt::ShowAll;
  331. if (showMore) {
  332. LoadServices(true);
  333. ui->service->showPopup();
  334. return;
  335. } else {
  336. lastService = serviceName;
  337. }
  338. obs_properties_t *props = obs_get_service_properties("rtmp_common");
  339. obs_property_t *services = obs_properties_get(props, "service");
  340. OBSData settings = obs_data_create();
  341. obs_data_release(settings);
  342. obs_data_set_string(settings, "service", QT_TO_UTF8(serviceName));
  343. obs_property_modified(services, settings);
  344. obs_property_t *servers = obs_properties_get(props, "server");
  345. ui->server->clear();
  346. size_t servers_count = obs_property_list_item_count(servers);
  347. for (size_t i = 0; i < servers_count; i++) {
  348. const char *name = obs_property_list_item_name(servers, i);
  349. const char *server = obs_property_list_item_string(servers, i);
  350. ui->server->addItem(name, server);
  351. }
  352. obs_properties_destroy(props);
  353. }
  354. void OBSBasicSettings::on_show_clicked()
  355. {
  356. if (ui->key->echoMode() == QLineEdit::Password) {
  357. ui->key->setEchoMode(QLineEdit::Normal);
  358. ui->show->setText(QTStr("Hide"));
  359. } else {
  360. ui->key->setEchoMode(QLineEdit::Password);
  361. ui->show->setText(QTStr("Show"));
  362. }
  363. }
  364. void OBSBasicSettings::on_authPwShow_clicked()
  365. {
  366. if (ui->authPw->echoMode() == QLineEdit::Password) {
  367. ui->authPw->setEchoMode(QLineEdit::Normal);
  368. ui->authPwShow->setText(QTStr("Hide"));
  369. } else {
  370. ui->authPw->setEchoMode(QLineEdit::Password);
  371. ui->authPwShow->setText(QTStr("Show"));
  372. }
  373. }
  374. OBSService OBSBasicSettings::SpawnTempService()
  375. {
  376. bool custom = IsCustomService();
  377. const char *service_id = custom ? "rtmp_custom" : "rtmp_common";
  378. OBSData settings = obs_data_create();
  379. obs_data_release(settings);
  380. if (!custom) {
  381. obs_data_set_string(settings, "service",
  382. QT_TO_UTF8(ui->service->currentText()));
  383. obs_data_set_string(
  384. settings, "server",
  385. QT_TO_UTF8(ui->server->currentData().toString()));
  386. } else {
  387. obs_data_set_string(settings, "server",
  388. QT_TO_UTF8(ui->customServer->text()));
  389. }
  390. obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));
  391. OBSService newService = obs_service_create(service_id, "temp_service",
  392. settings, nullptr);
  393. obs_service_release(newService);
  394. return newService;
  395. }
  396. void OBSBasicSettings::OnOAuthStreamKeyConnected()
  397. {
  398. #ifdef BROWSER_AVAILABLE
  399. OAuthStreamKey *a = reinterpret_cast<OAuthStreamKey *>(auth.get());
  400. if (a) {
  401. bool validKey = !a->key().empty();
  402. if (validKey)
  403. ui->key->setText(QT_UTF8(a->key().c_str()));
  404. ui->streamKeyWidget->setVisible(false);
  405. ui->streamKeyLabel->setVisible(false);
  406. ui->connectAccount2->setVisible(false);
  407. ui->disconnectAccount->setVisible(true);
  408. if (strcmp(a->service(), "Twitch") == 0) {
  409. ui->bandwidthTestEnable->setVisible(true);
  410. ui->twitchAddonLabel->setVisible(true);
  411. ui->twitchAddonDropdown->setVisible(true);
  412. } else {
  413. ui->bandwidthTestEnable->setChecked(false);
  414. }
  415. }
  416. ui->streamStackWidget->setCurrentIndex((int)Section::StreamKey);
  417. #endif
  418. }
  419. void OBSBasicSettings::OnAuthConnected()
  420. {
  421. std::string service = QT_TO_UTF8(ui->service->currentText());
  422. Auth::Type type = Auth::AuthType(service);
  423. if (type == Auth::Type::OAuth_StreamKey) {
  424. OnOAuthStreamKeyConnected();
  425. }
  426. if (!loading) {
  427. stream1Changed = true;
  428. EnableApplyButton(true);
  429. }
  430. }
  431. void OBSBasicSettings::on_connectAccount_clicked()
  432. {
  433. #ifdef BROWSER_AVAILABLE
  434. std::string service = QT_TO_UTF8(ui->service->currentText());
  435. OAuth::DeleteCookies(service);
  436. auth = OAuthStreamKey::Login(this, service);
  437. if (!!auth)
  438. OnAuthConnected();
  439. #endif
  440. }
  441. #define DISCONNECT_COMFIRM_TITLE \
  442. "Basic.AutoConfig.StreamPage.DisconnectAccount.Confirm.Title"
  443. #define DISCONNECT_COMFIRM_TEXT \
  444. "Basic.AutoConfig.StreamPage.DisconnectAccount.Confirm.Text"
  445. void OBSBasicSettings::on_disconnectAccount_clicked()
  446. {
  447. QMessageBox::StandardButton button;
  448. button = OBSMessageBox::question(this, QTStr(DISCONNECT_COMFIRM_TITLE),
  449. QTStr(DISCONNECT_COMFIRM_TEXT));
  450. if (button == QMessageBox::No) {
  451. return;
  452. }
  453. main->auth.reset();
  454. auth.reset();
  455. std::string service = QT_TO_UTF8(ui->service->currentText());
  456. #ifdef BROWSER_AVAILABLE
  457. OAuth::DeleteCookies(service);
  458. #endif
  459. ui->bandwidthTestEnable->setChecked(false);
  460. ui->streamKeyWidget->setVisible(true);
  461. ui->streamKeyLabel->setVisible(true);
  462. ui->connectAccount2->setVisible(true);
  463. ui->disconnectAccount->setVisible(false);
  464. ui->bandwidthTestEnable->setVisible(false);
  465. ui->twitchAddonDropdown->setVisible(false);
  466. ui->twitchAddonLabel->setVisible(false);
  467. ui->key->setText("");
  468. }
  469. void OBSBasicSettings::on_useStreamKey_clicked()
  470. {
  471. ui->streamStackWidget->setCurrentIndex((int)Section::StreamKey);
  472. }
  473. void OBSBasicSettings::on_useAuth_toggled()
  474. {
  475. if (!IsCustomService())
  476. return;
  477. bool use_auth = ui->useAuth->isChecked();
  478. ui->authUsernameLabel->setVisible(use_auth);
  479. ui->authUsername->setVisible(use_auth);
  480. ui->authPwLabel->setVisible(use_auth);
  481. ui->authPwWidget->setVisible(use_auth);
  482. }
  483. void OBSBasicSettings::UpdateVodTrackSetting()
  484. {
  485. bool enableVodTrack = ui->service->currentText() == "Twitch";
  486. bool wasEnabled = !!vodTrackCheckbox;
  487. if (enableVodTrack == wasEnabled)
  488. return;
  489. if (!enableVodTrack) {
  490. delete vodTrackCheckbox;
  491. delete vodTrackContainer;
  492. return;
  493. }
  494. vodTrackCheckbox = new QCheckBox(
  495. QTStr("Basic.Settings.Output.Adv.TwitchVodTrack"));
  496. vodTrackCheckbox->setLayoutDirection(Qt::RightToLeft);
  497. vodTrackContainer = new QWidget();
  498. QHBoxLayout *vodTrackLayout = new QHBoxLayout();
  499. for (int i = 0; i < MAX_AUDIO_MIXES; i++) {
  500. vodTrack[i] = new QRadioButton(QString::number(i + 1));
  501. vodTrackLayout->addWidget(vodTrack[i]);
  502. HookWidget(vodTrack[i], SIGNAL(clicked(bool)),
  503. SLOT(OutputsChanged()));
  504. }
  505. HookWidget(vodTrackCheckbox, SIGNAL(clicked(bool)),
  506. SLOT(OutputsChanged()));
  507. vodTrackLayout->addStretch();
  508. vodTrackLayout->setContentsMargins(0, 0, 0, 0);
  509. vodTrackContainer->setLayout(vodTrackLayout);
  510. ui->advOutTopLayout->insertRow(2, vodTrackCheckbox, vodTrackContainer);
  511. bool vodTrackEnabled =
  512. config_get_bool(main->Config(), "AdvOut", "VodTrackEnabled");
  513. vodTrackCheckbox->setChecked(vodTrackEnabled);
  514. vodTrackContainer->setEnabled(vodTrackEnabled);
  515. connect(vodTrackCheckbox, SIGNAL(clicked(bool)), vodTrackContainer,
  516. SLOT(setEnabled(bool)));
  517. int trackIndex =
  518. config_get_int(main->Config(), "AdvOut", "VodTrackIndex");
  519. for (int i = 0; i < MAX_AUDIO_MIXES; i++) {
  520. vodTrack[i]->setChecked((i + 1) == trackIndex);
  521. }
  522. }