all repos — mgba @ 6ae02d05536568c6139b201c72db41a126451235

mGBA Game Boy Advance Emulator

Qt: Fix record A/V window not updating resolution (fixes #1626)
Vicki Pfau vi@endrift.com
Mon, 20 Jan 2020 18:21:37 -0800
commit

6ae02d05536568c6139b201c72db41a126451235

parent

e53df9759e84207b8a26bb22a674f740cd605129

2 files changed, 12 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -115,6 +115,7 @@ - Qt: Fix sprite view using wrong base address (fixes mgba.io/i/1603)

- Qt: Fix inability to clear default keybindings - Qt: Release held actions if they get rebound - Qt: Fix crash double-clicking menus in shortcut settings (fixes mgba.io/i/1627) + - Qt: Fix record A/V window not updating resolution (fixes mgba.io/i/1626) - Vita: Fix analog controls (fixes mgba.io/i/1554) - Wii: Fix game fast-forwarding after slowing down - Wii: Improve audio buffering (fixes mgba.io/i/1617)
M src/platform/qt/VideoView.cppsrc/platform/qt/VideoView.cpp

@@ -197,11 +197,15 @@ free(m_containerCstr);

} void VideoView::setController(std::shared_ptr<CoreController> controller) { - connect(controller.get(), &CoreController::stopping, this, &VideoView::stopRecording); - connect(this, &VideoView::recordingStarted, controller.get(), &CoreController::setAVStream); - connect(this, &VideoView::recordingStopped, controller.get(), &CoreController::clearAVStream, Qt::DirectConnection); + CoreController* controllerPtr = controller.get(); + connect(controllerPtr, &CoreController::frameAvailable, this, [this, controllerPtr]() { + setNativeResolution(controllerPtr->screenDimensions()); + }); + connect(controllerPtr, &CoreController::stopping, this, &VideoView::stopRecording); + connect(this, &VideoView::recordingStarted, controllerPtr, &CoreController::setAVStream); + connect(this, &VideoView::recordingStopped, controllerPtr, &CoreController::clearAVStream, Qt::DirectConnection); - setNativeResolution(controller->screenDimensions()); + setNativeResolution(controllerPtr->screenDimensions()); } void VideoView::startRecording() {

@@ -225,6 +229,9 @@ validateSettings();

} void VideoView::setNativeResolution(const QSize& dims) { + if (dims.width() == m_nativeWidth && dims.height() == m_nativeHeight) { + return; + } m_nativeWidth = dims.width(); m_nativeHeight = dims.height(); m_ui.presetNative->setText(tr("Native (%0x%1)").arg(m_nativeWidth).arg(m_nativeHeight));