Fixed coding style of codec.cpp and configure_general.cpp
This commit is contained in:
parent
30c8cd4320
commit
88bbaeae49
2 changed files with 13 additions and 8 deletions
|
@ -290,8 +290,10 @@ AVFramePtr Codec::GetCurrentFrame() {
|
||||||
|
|
||||||
if (Settings::values.use_video_framerate.GetValue()) {
|
if (Settings::values.use_video_framerate.GetValue()) {
|
||||||
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
|
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
|
||||||
std::chrono::microseconds elapsed = std::chrono::duration_cast<std::chrono::microseconds>(now - last_frame_time);
|
std::chrono::microseconds elapsed =
|
||||||
std::chrono::microseconds min_frame_interval = std::chrono::microseconds(1000 / Settings::values.video_framerate.GetValue() * 1000);
|
std::chrono::duration_cast<std::chrono::microseconds>(now - last_frame_time);
|
||||||
|
std::chrono::microseconds min_frame_interval =
|
||||||
|
std::chrono::microseconds(1000 / Settings::values.video_framerate.GetValue() * 1000);
|
||||||
|
|
||||||
if (elapsed < min_frame_interval) {
|
if (elapsed < min_frame_interval) {
|
||||||
std::this_thread::sleep_for(min_frame_interval - elapsed);
|
std::this_thread::sleep_for(min_frame_interval - elapsed);
|
||||||
|
|
|
@ -56,7 +56,9 @@ void ConfigureGeneral::SetConfiguration() {
|
||||||
ui->video_framerate->setEnabled(Settings::values.use_video_framerate.GetValue());
|
ui->video_framerate->setEnabled(Settings::values.use_video_framerate.GetValue());
|
||||||
ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue());
|
ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue());
|
||||||
} else {
|
} else {
|
||||||
ui->video_framerate->setEnabled(Settings::values.use_video_framerate.GetValue() && use_video_framerate != ConfigurationShared::CheckState::Global);
|
ui->video_framerate->setEnabled(Settings::values.use_video_framerate.GetValue() &&
|
||||||
|
use_video_framerate !=
|
||||||
|
ConfigurationShared::CheckState::Global);
|
||||||
ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue() &&
|
ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue() &&
|
||||||
use_speed_limit != ConfigurationShared::CheckState::Global);
|
use_speed_limit != ConfigurationShared::CheckState::Global);
|
||||||
}
|
}
|
||||||
|
@ -93,8 +95,7 @@ void ConfigureGeneral::ApplyConfiguration() {
|
||||||
|
|
||||||
if (Settings::values.use_video_framerate.UsingGlobal()) {
|
if (Settings::values.use_video_framerate.UsingGlobal()) {
|
||||||
Settings::values.use_video_framerate.SetValue(
|
Settings::values.use_video_framerate.SetValue(
|
||||||
ui->toggle_video_framerate->checkState() ==
|
ui->toggle_video_framerate->checkState() == Qt::Checked);
|
||||||
Qt::Checked);
|
|
||||||
Settings::values.video_framerate.SetValue(ui->video_framerate->value());
|
Settings::values.video_framerate.SetValue(ui->video_framerate->value());
|
||||||
}
|
}
|
||||||
// Guard if during game and set to game-specific value
|
// Guard if during game and set to game-specific value
|
||||||
|
@ -147,14 +148,16 @@ void ConfigureGeneral::SetupPerGameUI() {
|
||||||
|
|
||||||
ui->button_reset_defaults->setVisible(false);
|
ui->button_reset_defaults->setVisible(false);
|
||||||
|
|
||||||
ConfigurationShared::SetColoredTristate(ui->toggle_video_framerate, Settings::values.use_video_framerate, use_video_framerate);
|
ConfigurationShared::SetColoredTristate(
|
||||||
|
ui->toggle_video_framerate, Settings::values.use_video_framerate, use_video_framerate);
|
||||||
ConfigurationShared::SetColoredTristate(ui->toggle_speed_limit,
|
ConfigurationShared::SetColoredTristate(ui->toggle_speed_limit,
|
||||||
Settings::values.use_speed_limit, use_speed_limit);
|
Settings::values.use_speed_limit, use_speed_limit);
|
||||||
ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core,
|
ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core,
|
||||||
use_multi_core);
|
use_multi_core);
|
||||||
|
|
||||||
connect(ui->toggle_video_framerate, &QCheckBox::clicked, ui->video_framerate, [this]() {
|
connect(ui->toggle_video_framerate, &QCheckBox::clicked, ui->video_framerate, [this]() {
|
||||||
ui->video_framerate->setEnabled(ui->toggle_video_framerate->isChecked() &&
|
ui->video_framerate->setEnabled(
|
||||||
|
ui->toggle_video_framerate->isChecked() &&
|
||||||
(use_video_framerate != ConfigurationShared::CheckState::Global));
|
(use_video_framerate != ConfigurationShared::CheckState::Global));
|
||||||
});
|
});
|
||||||
connect(ui->toggle_speed_limit, &QCheckBox::clicked, ui->speed_limit, [this]() {
|
connect(ui->toggle_speed_limit, &QCheckBox::clicked, ui->speed_limit, [this]() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue