Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Commit

Permalink
fix ui error
Browse files Browse the repository at this point in the history
  • Loading branch information
CatxFish committed Jul 29, 2017
1 parent 8a0c9c1 commit 15a5ab4
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/virtual-output/virtual_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ VirtualProperties::VirtualProperties(QWidget *parent) :
connect(ui->horizontalSlider, SIGNAL(valueChanged(int)), ui->spinBox,
SLOT(setValue(int)));

config_t* config = obs_frontend_get_global_config();
config_set_default_int(config, "VirtualOutput", "OutDelay", 3);

}

VirtualProperties::~VirtualProperties()
Expand All @@ -34,28 +37,21 @@ void VirtualProperties::SetVisable()
void VirtualProperties::onStart()
{
config_t* config = obs_frontend_get_global_config();
output_enable = true;
int delay = ui->horizontalSlider->value();

if (config){
config_set_bool(config, "VirtualOutput", "OutEnable", output_enable);
config_set_int(config, "VirtualOutput", "OutDelay", delay+1);
}
if (config)
config_set_int(config, "VirtualOutput", "OutDelay", delay);

ui->spinBox->setEnabled(false);
ui->horizontalSlider->setEnabled(false);
virtual_output_enable(delay);
virtual_output_enable(delay+1);
ui->pushButtonStart->setEnabled(false);
ui->pushButtonStop->setEnabled(true);
}

void VirtualProperties::onStop()
{
config_t* config = obs_frontend_get_global_config();
output_enable = true;

if (config)
config_set_bool(config, "VirtualOutput", "OutEnable", output_enable);

virtual_output_disable();

Expand All @@ -68,8 +64,7 @@ void VirtualProperties::onStop()
void VirtualProperties::showEvent(QShowEvent *event)
{
config_t* config = obs_frontend_get_global_config();
output_enable = config_get_bool(config, "VirtualOutput", "OutEnable");
int delay = config_get_int(config, "VirtualOutput", "OutDelay");
int delay = config_get_default_int(config, "VirtualOutput", "OutDelay");

if (delay < 0 || delay >30)
delay = 0;
Expand Down

0 comments on commit 15a5ab4

Please # to comment.