From 580962c194a652df7242a0f12c7aa457a6018691 Mon Sep 17 00:00:00 2001 From: Ethan Halsall Date: Sun, 30 Jun 2024 13:47:22 -0500 Subject: [PATCH 1/2] fix: set lower and upper bounds for video width --- tools/ld-analyse/videoparametersdialog.cpp | 7 +++++++ tools/ld-analyse/videoparametersdialog.ui | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/ld-analyse/videoparametersdialog.cpp b/tools/ld-analyse/videoparametersdialog.cpp index 80a4818be..638a0c669 100644 --- a/tools/ld-analyse/videoparametersdialog.cpp +++ b/tools/ld-analyse/videoparametersdialog.cpp @@ -50,8 +50,13 @@ void VideoParametersDialog::setVideoParameters(const LdDecodeMetaData::VideoPara // Transfer values to the dialogue ui->blackLevelSpinBox->setValue(videoParameters.black16bIre); ui->whiteLevelSpinBox->setValue(videoParameters.white16bIre); + ui->activeVideoWidthSpinBox->setValue(videoParameters.activeVideoEnd - videoParameters.activeVideoStart); ui->activeVideoStartSpinBox->setValue(videoParameters.activeVideoStart); + ui->activeVideoWidthSpinBox->setMaximum(videoParameters.fieldWidth - videoParameters.activeVideoStart); + ui->activeVideoStartSpinBox->setMaximum(videoParameters.fieldWidth - 1); + ui->activeVideoStartSpinBox->setMinimum(videoParameters.colourBurstEnd); + if (videoParameters.isWidescreen) ui->aspectRatio169RadioButton->setChecked(true); else ui->aspectRatio43RadioButton->setChecked(true); @@ -104,6 +109,8 @@ void VideoParametersDialog::on_activeVideoStartSpinBox_valueChanged(int value) { int adjustAmount = videoParameters.activeVideoStart - value; videoParameters.activeVideoStart = value; + // prevent the width from going over the actual field width + ui->activeVideoWidthSpinBox->setMaximum(videoParameters.fieldWidth - value - 1); videoParameters.activeVideoEnd = value + ui->activeVideoWidthSpinBox->value(); updateDialog(); emit videoParametersChanged(videoParameters); diff --git a/tools/ld-analyse/videoparametersdialog.ui b/tools/ld-analyse/videoparametersdialog.ui index b6501cf87..8c3ccfe06 100644 --- a/tools/ld-analyse/videoparametersdialog.ui +++ b/tools/ld-analyse/videoparametersdialog.ui @@ -136,10 +136,10 @@ - 16 + 0 - 200 + 1134 1 @@ -173,7 +173,7 @@ 1 - 1000 + 1135 1 From 7a741dd219d28eb5f68a3f5246ccbf588a2f316e Mon Sep 17 00:00:00 2001 From: Ethan Halsall Date: Sun, 30 Jun 2024 12:29:33 -0500 Subject: [PATCH 2/2] fix video parameters tab ordering --- tools/ld-analyse/videoparametersdialog.ui | 182 +++++++++++----------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/tools/ld-analyse/videoparametersdialog.ui b/tools/ld-analyse/videoparametersdialog.ui index 8c3ccfe06..fdf738406 100644 --- a/tools/ld-analyse/videoparametersdialog.ui +++ b/tools/ld-analyse/videoparametersdialog.ui @@ -20,19 +20,6 @@ 12 - - - - - 100 - 0 - - - - Reset NTSC - - - @@ -43,8 +30,8 @@ - - + + 0 @@ -60,35 +47,58 @@ 0x - - 32768 - - 65535 + 32767 256 - 54016 + 16384 16 - - + + + + + 100 + 0 + + - Display aspect ratio: + Reset NTSC + + + + + + + + 100 + 0 + + + + Reset NTSC-J + + + + + + + White level: - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + 0 @@ -104,20 +114,46 @@ 0x + + 32768 + - 32767 + 65535 256 - 16384 + 54016 16 + + + + + 100 + 0 + + + + Reset + + + + + + + Active video start: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + @@ -152,6 +188,29 @@ + + + + + 100 + 0 + + + + Reset + + + + + + + Active video width: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + @@ -186,65 +245,6 @@ - - - - - 100 - 0 - - - - Reset - - - - - - - - 100 - 0 - - - - Reset NTSC-J - - - - - - - White level: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 100 - 0 - - - - Reset - - - - - - - Active video start: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - @@ -258,13 +258,13 @@ - - + + - Active video width: + Display aspect ratio: - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter