From 464863437499850ce59bac64262a612c1f94bafa Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 29 Jun 2020 14:47:31 -0700 Subject: [PATCH] Qt: Don't use non-C++14 designated initializers --- src/platform/qt/VideoView.cpp | 104 +++++++++++----------------------- src/platform/qt/VideoView.h | 9 +++ 2 files changed, 42 insertions(+), 71 deletions(-) diff --git a/src/platform/qt/VideoView.cpp b/src/platform/qt/VideoView.cpp index 9f3767ea2..b554c670e 100644 --- a/src/platform/qt/VideoView.cpp +++ b/src/platform/qt/VideoView.cpp @@ -112,96 +112,58 @@ VideoView::VideoView(QWidget* parent) 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 } }); } } diff --git a/src/platform/qt/VideoView.h b/src/platform/qt/VideoView.h index 3535535ae..865c2aafc 100644 --- a/src/platform/qt/VideoView.h +++ b/src/platform/qt/VideoView.h @@ -70,6 +70,15 @@ private: 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; };