all repos — mgba @ 8137a432339f6f734c4a6674d8b2c4c41fde5ff7

mGBA Game Boy Advance Emulator

Qt: Don't use non-C++14 designated initializers
Vicki Pfau vi@endrift.com
Mon, 29 Jun 2020 14:47:31 -0700
commit

8137a432339f6f734c4a6674d8b2c4c41fde5ff7

parent

8a7f8c67fce5b760320c0758662d7528cf979bd9

2 files changed, 42 insertions(+), 71 deletions(-)

jump to
M src/platform/qt/VideoView.cppsrc/platform/qt/VideoView.cpp

@@ -112,96 +112,58 @@

void VideoView::updatePresets() { m_presets.clear(); - addPreset(m_ui.preset4K, { - .container = QString(), - .vcodec = QString(), - .acodec = QString(), - .vbr = 0, - .abr = 0, - .dims = maintainAspect(QSize(3840, 2160)) - }); - - addPreset(m_ui.preset1080, { - .container = QString(), - .vcodec = QString(), - .acodec = QString(), - .vbr = 0, - .abr = 0, - .dims = maintainAspect(QSize(1920, 1080)) - }); - - addPreset(m_ui.preset720, { - .container = QString(), - .vcodec = QString(), - .acodec = QString(), - .vbr = 0, - .abr = 0, - .dims = maintainAspect(QSize(1280, 720)) - }); - - addPreset(m_ui.preset480, { - .container = QString(), - .vcodec = QString(), - .acodec = QString(), - .vbr = 0, - .abr = 0, - .dims = maintainAspect(QSize(720, 480)) - }); + addPreset(m_ui.preset4K, { maintainAspect(QSize(3840, 2160)) }); + addPreset(m_ui.preset1080, { maintainAspect(QSize(1920, 1080)) }); + addPreset(m_ui.preset720, { maintainAspect(QSize(1280, 720)) }); + addPreset(m_ui.preset480, { maintainAspect(QSize(720, 480)) }); if (m_nativeWidth && m_nativeHeight) { - addPreset(m_ui.presetNative, { - .container = QString(), - .vcodec = QString(), - .acodec = QString(), - .vbr = 0, - .abr = 0, - .dims = QSize(m_nativeWidth, m_nativeHeight) - }); + addPreset(m_ui.presetNative, { QSize(m_nativeWidth, m_nativeHeight) }); m_ui.presetNative->setEnabled(true); } addPreset(m_ui.presetHQ, { - .container = "MP4", - .vcodec = "h.264", - .acodec = "AAC", - .vbr = 8000, - .abr = 384, - .dims = maintainAspect(QSize(1920, 1080)) + "MP4", + "h.264", + "AAC", + 8000, + 384, + maintainAspect({ 1920, 1080 }) }); addPreset(m_ui.presetYoutube, { - .container = "MP4", - .vcodec = "h.264", - .acodec = "AAC", - .vbr = 5000, - .abr = 256, - .dims = maintainAspect(QSize(1280, 720)) + "MP4", + "h.264", + "AAC", + 5000, + 256, + maintainAspect({ 1280, 720 }) }); addPreset(m_ui.presetWebM, { - .container = "WebM", - .vcodec = "VP9", - .acodec = "Opus", - .vbr = 800, - .abr = 128 + "WebM", + "VP9", + "Opus", + 800, + 128 }); addPreset(m_ui.presetMP4, { - .container = "MP4", - .vcodec = "h.264", - .acodec = "AAC", - .vbr = 800, - .abr = 128 + "MP4", + "h.264", + "AAC", + 800, + 128 }); if (m_nativeWidth && m_nativeHeight) { addPreset(m_ui.presetLossless, { - .container = "MKV", - .vcodec = "h.264", - .acodec = "FLAC", - .vbr = -1, - .abr = 0, - .dims = QSize(m_nativeWidth, m_nativeHeight) + "MKV", + "h.264", + "FLAC", + -1, + 0, + { m_nativeWidth, m_nativeHeight } }); } }
M src/platform/qt/VideoView.hsrc/platform/qt/VideoView.h

@@ -70,6 +70,15 @@ int vbr;

int abr; QSize dims; + Preset() {} + Preset(QString container, QString vcodec, QString acodec, int vbr, int abr, QSize dims = QSize()) + : container(container) + , vcodec(vcodec) + , acodec(acodec) + , vbr(vbr) + , abr(abr) + , dims(dims) {} + Preset(QSize dims) : dims(dims) {} bool compatible(const Preset&) const; };