Skip to content

Commit b18f85f

Browse files
committed
fixed build
1 parent b939d65 commit b18f85f

File tree

4 files changed

+59
-1
lines changed

4 files changed

+59
-1
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ jobs:
8080
export HOMEBREW_NO_ENV_HINTS=1
8181
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
8282
brew install --force-bottle qt opencv
83-
echo "CMAKE_PREFIX_PATH=$(brew --prefix qt)" >> "$GITHUB_ENV"
83+
QT_PREFIX=$(brew --prefix qt 2>/dev/null || brew --prefix qt@6 2>/dev/null || true)
84+
if [ -n "$QT_PREFIX" ]; then
85+
echo "CMAKE_PREFIX_PATH=$QT_PREFIX" >> "$GITHUB_ENV"
86+
echo "Qt6_DIR=$QT_PREFIX/lib/cmake/Qt6" >> "$GITHUB_ENV"
87+
fi
8488
echo "OpenCV_DIR=$(brew --prefix opencv)/lib/cmake/opencv4" >> "$GITHUB_ENV"
8589
8690
- if: matrix.platform == 'macos'

app/MainWindow.cpp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,13 @@ MainWindow::MainWindow(QWidget* parent)
15441544
m_previewFastForwardButton = new QToolButton(playbackControls);
15451545
m_previewFastForwardButton->setText("Fwd");
15461546
m_previewFastForwardButton->setToolTip("Jump forward 10 frames while playing");
1547+
m_playbackOverrideDurationCheck = new QCheckBox("Fixed", playbackControls);
1548+
m_playbackOverrideDurationCheck->setToolTip("Override frame duration during playback");
1549+
m_playbackOverrideDurationSpin = new QSpinBox(playbackControls);
1550+
m_playbackOverrideDurationSpin->setRange(1, 10000);
1551+
m_playbackOverrideDurationSpin->setValue(33);
1552+
m_playbackOverrideDurationSpin->setSuffix(" ms");
1553+
m_playbackOverrideDurationSpin->setEnabled(false);
15471554
playbackControlsLayout->addStretch(1);
15481555
playbackControlsLayout->addWidget(m_previewRewindButton);
15491556
playbackControlsLayout->addWidget(m_previewPrevButton);
@@ -1552,6 +1559,9 @@ MainWindow::MainWindow(QWidget* parent)
15521559
playbackControlsLayout->addWidget(m_previewStopButton);
15531560
playbackControlsLayout->addWidget(m_previewNextButton);
15541561
playbackControlsLayout->addWidget(m_previewFastForwardButton);
1562+
playbackControlsLayout->addSpacing(12);
1563+
playbackControlsLayout->addWidget(m_playbackOverrideDurationCheck);
1564+
playbackControlsLayout->addWidget(m_playbackOverrideDurationSpin);
15551565
playbackControlsLayout->addStretch(1);
15561566
playbackControls->setLayout(playbackControlsLayout);
15571567
playbackLayout->addWidget(playbackControls, 0, Qt::AlignHCenter);
@@ -4355,6 +4365,35 @@ MainWindow::MainWindow(QWidget* parent)
43554365
connect(m_previewFastForwardButton, &QToolButton::clicked, this, [this]() {
43564366
stepPlayback(10);
43574367
});
4368+
connect(m_playbackOverrideDurationCheck, &QCheckBox::toggled, this, [this](bool enabled) {
4369+
if (!m_playbackOverrideDurationSpin) {
4370+
return;
4371+
}
4372+
m_playbackOverrideDurationSpin->setEnabled(enabled);
4373+
if (m_playbackActive) {
4374+
if (enabled) {
4375+
m_playbackFrameDurationMs = m_playbackOverrideDurationSpin->value();
4376+
} else if (m_playbackFrameIndex >= 0 &&
4377+
m_playbackFrameIndex < static_cast<int>(m_frameDurations.size()) &&
4378+
m_frameDurations[m_playbackFrameIndex] > 0) {
4379+
m_playbackFrameDurationMs = static_cast<int>(m_frameDurations[m_playbackFrameIndex]);
4380+
} else {
4381+
m_playbackFrameDurationMs = 30;
4382+
}
4383+
m_playbackFrameClock.restart();
4384+
schedulePlaybackTick();
4385+
}
4386+
});
4387+
connect(m_playbackOverrideDurationSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int value) {
4388+
if (!m_playbackOverrideDurationCheck || !m_playbackOverrideDurationCheck->isChecked()) {
4389+
return;
4390+
}
4391+
if (m_playbackActive) {
4392+
m_playbackFrameDurationMs = value;
4393+
m_playbackFrameClock.restart();
4394+
schedulePlaybackTick();
4395+
}
4396+
});
43584397
connect(m_previewRefreshButton, &QToolButton::clicked, this, [this]() {
43594398
refreshAllPreviews();
43604399
});
@@ -5896,6 +5935,10 @@ void MainWindow::renderPlaybackFrame()
58965935
m_playbackFrameDurationMs = duration;
58975936
}
58985937
}
5938+
if (m_playbackOverrideDurationCheck && m_playbackOverrideDurationCheck->isChecked() &&
5939+
m_playbackOverrideDurationSpin) {
5940+
m_playbackFrameDurationMs = m_playbackOverrideDurationSpin->value();
5941+
}
58995942
m_playbackUseHd = m_useHdFrame && hasHdFrame(frameIndex);
59005943
m_playbackRotationData = rotationBlockForRead(frameIndex, m_playbackUseHd);
59015944
m_playbackBase565.clear();
@@ -6045,6 +6088,14 @@ void MainWindow::updatePlaybackButtons()
60456088
if (m_previewFastForwardButton) {
60466089
m_previewFastForwardButton->setEnabled(hasFrames);
60476090
}
6091+
if (m_playbackOverrideDurationCheck) {
6092+
m_playbackOverrideDurationCheck->setEnabled(hasFrames);
6093+
}
6094+
if (m_playbackOverrideDurationSpin) {
6095+
const bool enabled = hasFrames && m_playbackOverrideDurationCheck &&
6096+
m_playbackOverrideDurationCheck->isChecked();
6097+
m_playbackOverrideDurationSpin->setEnabled(enabled);
6098+
}
60486099
}
60496100

60506101
void MainWindow::updatePreviewsForMaskId(int maskId)

app/MainWindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ class MainWindow : public QMainWindow
591591
class QToolButton* m_previewNextButton = nullptr;
592592
class QToolButton* m_previewRewindButton = nullptr;
593593
class QToolButton* m_previewFastForwardButton = nullptr;
594+
class QCheckBox* m_playbackOverrideDurationCheck = nullptr;
595+
class QSpinBox* m_playbackOverrideDurationSpin = nullptr;
594596
bool m_playbackActive = false;
595597
bool m_playbackPaused = false;
596598
bool m_playbackUseHd = false;

handbook.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This handbook captures editor behaviors and workflows that differ from the legac
2323
- Use the rotate toggle to preview color rotations in the preview row.
2424
- Use the refresh button to rebuild previews after bulk edits.
2525
- Use Play/Pause/Stop/Prev/Next/Rew/Fwd in the Playback tab to test-play the selected frames (or the whole ROM if none or only one frame is selected). A single selected frame becomes the start point.
26+
- Playback can override per-frame durations using the `Fixed` control (milliseconds) in the Playback tab.
2627

2728
## Canvas Controls
2829

0 commit comments

Comments
 (0)