void AutoConfig::SaveSettings() { OBSBasic *main = reinterpret_cast<OBSBasic*>(App()->GetMainWindow()); if (recordingEncoder != Encoder::Stream) config_set_string(main->Config(), "SimpleOutput", "RecEncoder", GetEncoderId(recordingEncoder)); const char *quality = recordingQuality == Quality::High ? "Small" : "Stream"; config_set_string(main->Config(), "Output", "Mode", "Simple"); config_set_string(main->Config(), "SimpleOutput", "RecQuality", quality); config_set_int(main->Config(), "Video", "BaseCX", baseResolutionCX); config_set_int(main->Config(), "Video", "BaseCY", baseResolutionCY); config_set_int(main->Config(), "Video", "OutputCX", idealResolutionCX); config_set_int(main->Config(), "Video", "OutputCY", idealResolutionCY); if (fpsType != FPSType::UseCurrent) { config_set_uint(main->Config(), "Video", "FPSType", 0); config_set_string(main->Config(), "Video", "FPSCommon", std::to_string(idealFPSNum).c_str()); } main->ResetVideo(); main->ResetOutputs(); config_save_safe(main->Config(), "tmp", nullptr); }
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"); }
ListCasts::ListCasts(unsigned feed_id,QWidget *parent,const char *name) : QDialog(parent,name,true) { list_feed_id=feed_id; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setCaption(tr("Podcast List")); // // Create Fonts // QFont font=QFont("Helvetica",12,QFont::Bold); font.setPixelSize(12); QFont list_font=QFont("Helvetica",12,QFont::Normal); list_font.setPixelSize(12); QFont small_font=QFont("Helvetica",10,QFont::Normal); small_font.setPixelSize(10); // // Create Icons // list_greenball_map=new QPixmap(greenball_xpm); list_redball_map=new QPixmap(redball_xpm); list_whiteball_map=new QPixmap(whiteball_xpm); // // The Feed // list_feed=new RDFeed(feed_id,this); // // Progress Dialog // list_progress_dialog= new QProgressDialog(tr("Uploading Audio..."),"Cancel",4,this); list_progress_dialog->setCaption(tr("Progress")); list_progress_dialog->setMinimumDuration(0); list_progress_dialog->setTotalSteps(list_feed->totalPostSteps()); connect(list_feed,SIGNAL(postProgressChanged(int)), this,SLOT(postProgressChangedData(int))); // // Filter // list_filter_edit=new QLineEdit(this,"list_filter_edit"); list_filter_label= new QLabel(list_filter_edit,tr("Filter:"),this,"list_filter_label"); list_filter_label->setFont(font); list_filter_label->setAlignment(AlignRight|AlignVCenter); connect(list_filter_edit,SIGNAL(textChanged(const QString &)), this,SLOT(filterChangedData(const QString &))); // // Unexpired Check Box // list_unexpired_check=new QCheckBox(this,"list_unexpired_check"); list_unexpired_label= new QLabel(list_unexpired_check,tr("Only Show Unexpired Casts"),this, "list_unexpired_label"); list_unexpired_label->setFont(font); list_unexpired_label->setAlignment(AlignLeft|AlignVCenter); connect(list_unexpired_check,SIGNAL(toggled(bool)), this,SLOT(notexpiredToggledData(bool))); // // Active Check Box // list_active_check=new QCheckBox(this,"list_active_check"); list_active_label= new QLabel(list_active_check,tr("Only Show Active Casts"),this, "list_active_label"); list_active_label->setFont(font); list_active_label->setAlignment(AlignLeft|AlignVCenter); connect(list_active_check,SIGNAL(toggled(bool)), this,SLOT(activeToggledData(bool))); // // Group List // list_casts_view=new RDListView(this,"list_casts_view"); list_casts_view->setAllColumnsShowFocus(true); list_casts_view->setItemMargin(5); list_casts_view->addColumn(tr(" ")); list_casts_view->setColumnAlignment(0,AlignCenter); list_casts_view->addColumn(tr("Title")); list_casts_view->setColumnAlignment(1,AlignLeft); list_casts_view->addColumn(tr("Origin")); list_casts_view->setColumnAlignment(2,AlignLeft); list_casts_view->addColumn(tr("Expires")); list_casts_view->setColumnAlignment(3,AlignCenter); list_casts_view->addColumn(tr("Length")); list_casts_view->setColumnAlignment(4,AlignRight); list_casts_view->addColumn(tr("Description")); list_casts_view->setColumnAlignment(5,AlignLeft); list_casts_view->addColumn(tr("Category")); list_casts_view->setColumnAlignment(6,AlignCenter); list_casts_view->addColumn(tr("Link")); list_casts_view->setColumnAlignment(7,AlignCenter); connect(list_casts_view, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), this, SLOT(doubleClickedData(QListViewItem *,const QPoint &,int))); // // Post Cart Button // list_cart_button=new QPushButton(this,"list_cart_button"); list_cart_button->setFont(font); list_cart_button->setText(tr("Post From\nCar&t/Cut")); connect(list_cart_button,SIGNAL(clicked()),this,SLOT(addCartData())); // // Post File Button // list_file_button=new QPushButton(this,"list_file_button"); list_file_button->setFont(font); list_file_button->setText(tr("Post From\n&File")); connect(list_file_button,SIGNAL(clicked()),this,SLOT(addFileData())); // // Edit Button // list_edit_button=new QPushButton(this,"list_edit_button"); list_edit_button->setFont(font); list_edit_button->setText(tr("&Edit")); connect(list_edit_button,SIGNAL(clicked()),this,SLOT(editData())); // // Delete Button // list_delete_button=new QPushButton(this,"list_delete_button"); list_delete_button->setFont(font); list_delete_button->setText(tr("&Delete")); connect(list_delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); // // Report Button // list_report_button=new QPushButton(this,"list_report_button"); list_report_button->setFont(font); list_report_button->setText(tr("Subscription\n&Report")); connect(list_report_button,SIGNAL(clicked()),this,SLOT(reportData())); // // Close Button // list_close_button=new QPushButton(this,"list_close_button"); list_close_button->setDefault(true); list_close_button->setFont(font); list_close_button->setText(tr("&Close")); connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData())); RefreshList(); GetEncoderId(); connect(cast_ripc,SIGNAL(userChanged()),this,SLOT(userChangedData())); userChangedData(); }