From 5f7f2c1c97846bebe19ad571464ad12af730aac0 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Mon, 15 Jul 2019 06:50:23 -0500 Subject: [PATCH 1/2] UI: Fix compiler/Acri warnings --- UI/data/themes/Acri.qss | 9 ----- .../decklink-output-ui/decklink-ui-main.cpp | 3 ++ .../decklink-output-ui/forms/output.ui | 2 +- UI/record-button.cpp | 3 +- UI/volume-control.cpp | 1 + UI/window-basic-properties.cpp | 4 +- UI/window-basic-settings.cpp | 35 +++++++++++++++++ UI/window-basic-settings.hpp | 38 +++++++++++++++---- 8 files changed, 74 insertions(+), 21 deletions(-) diff --git a/UI/data/themes/Acri.qss b/UI/data/themes/Acri.qss index 6d7c4928f..2e7aee885 100644 --- a/UI/data/themes/Acri.qss +++ b/UI/data/themes/Acri.qss @@ -42,7 +42,6 @@ QWidget { outline: none; font-family: "Open Sans", "Tahoma", "Arial", sans-serif; font-size: 12px; - overflow: auto; } #menubar { @@ -651,14 +650,6 @@ QSlider::handle:disabled { /* Volume Control */ -/* Old Meters */ -VolumeMeter { - qproperty-bkColor: rgb(8,8,11); - qproperty-magColor:; - qproperty-peakColor:; - qproperty-peakHoldColor: rgb(225,224,225); -} - VolumeMeter { qproperty-backgroundNominalColor: #42740c; diff --git a/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp b/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp index ff9b0f6ed..f9f89b5f7 100644 --- a/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp +++ b/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp @@ -207,6 +207,9 @@ void on_preview_scene_changed(enum obs_frontend_event event, void *param) void render_preview_source(void *param, uint32_t cx, uint32_t cy) { + UNUSED_PARAMETER(cx); + UNUSED_PARAMETER(cy); + auto ctx = (struct preview_output *)param; if (!ctx->current_source) diff --git a/UI/frontend-plugins/decklink-output-ui/forms/output.ui b/UI/frontend-plugins/decklink-output-ui/forms/output.ui index bfaa385af..db8de92e8 100644 --- a/UI/frontend-plugins/decklink-output-ui/forms/output.ui +++ b/UI/frontend-plugins/decklink-output-ui/forms/output.ui @@ -115,7 +115,7 @@ - + Keyer output requires RGB mode in advanced settings. diff --git a/UI/record-button.cpp b/UI/record-button.cpp index 8b82c2b0f..021f5b83e 100644 --- a/UI/record-button.cpp +++ b/UI/record-button.cpp @@ -7,7 +7,6 @@ void RecordButton::resizeEvent(QResizeEvent *event) if (!main->pause) return; - QSize newSize = event->size(); QSize pauseSize = main->pause->size(); int height = main->ui->recordButton->size().height(); @@ -15,4 +14,6 @@ void RecordButton::resizeEvent(QResizeEvent *event) main->pause->setMinimumSize(height, height); main->pause->setMaximumSize(height, height); } + + event->accept(); } diff --git a/UI/volume-control.cpp b/UI/volume-control.cpp index 20a91d483..44c8c5eea 100644 --- a/UI/volume-control.cpp +++ b/UI/volume-control.cpp @@ -514,6 +514,7 @@ void VolumeMeter::setPeakMeterType(enum obs_peak_meter_type peakMeterType) void VolumeMeter::mousePressEvent(QMouseEvent *event) { setFocus(Qt::MouseFocusReason); + event->accept(); } void VolumeMeter::wheelEvent(QWheelEvent *event) diff --git a/UI/window-basic-properties.cpp b/UI/window-basic-properties.cpp index da3ec403f..4a1ab1297 100644 --- a/UI/window-basic-properties.cpp +++ b/UI/window-basic-properties.cpp @@ -153,8 +153,8 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_) uint32_t colorA = 0xFFB26F52; uint32_t colorB = 0xFF6FB252; - CreateTransitionScene(sourceA, "A", colorA); - CreateTransitionScene(sourceB, "B", colorB); + CreateTransitionScene(sourceA, (char *)"A", colorA); + CreateTransitionScene(sourceB, (char *)"B", colorB); /** * The cloned source is made from scratch, rather than using diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index 43d0a3ad0..23153aaa3 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -4519,6 +4519,41 @@ void OBSBasicSettings::on_disableOSXVSync_clicked() #endif } +QIcon OBSBasicSettings::GetGeneralIcon() const +{ + return generalIcon; +} + +QIcon OBSBasicSettings::GetStreamIcon() const +{ + return streamIcon; +} + +QIcon OBSBasicSettings::GetOutputIcon() const +{ + return outputIcon; +} + +QIcon OBSBasicSettings::GetAudioIcon() const +{ + return audioIcon; +} + +QIcon OBSBasicSettings::GetVideoIcon() const +{ + return videoIcon; +} + +QIcon OBSBasicSettings::GetHotkeysIcon() const +{ + return hotkeysIcon; +} + +QIcon OBSBasicSettings::GetAdvancedIcon() const +{ + return advancedIcon; +} + void OBSBasicSettings::SetGeneralIcon(const QIcon &icon) { ui->listWidget->item(0)->setIcon(icon); diff --git a/UI/window-basic-settings.hpp b/UI/window-basic-settings.hpp index cd5516ec0..0889d47ef 100644 --- a/UI/window-basic-settings.hpp +++ b/UI/window-basic-settings.hpp @@ -84,14 +84,20 @@ using OBSFFFormatDesc = std::unique_ptr; class OBSBasicSettings : public QDialog { Q_OBJECT - Q_PROPERTY(QIcon generalIcon WRITE SetGeneralIcon NOTIFY SetGeneralIcon) - Q_PROPERTY(QIcon streamIcon WRITE SetStreamIcon NOTIFY SetStreamIcon) - Q_PROPERTY(QIcon outputIcon WRITE SetOutputIcon NOTIFY SetOutputIcon) - Q_PROPERTY(QIcon audioIcon WRITE SetAudioIcon NOTIFY SetAudioIcon) - Q_PROPERTY(QIcon videoIcon WRITE SetVideoIcon NOTIFY SetVideoIcon) - Q_PROPERTY(QIcon hotkeysIcon WRITE SetHotkeysIcon NOTIFY SetHotkeysIcon) - Q_PROPERTY( - QIcon advancedIcon WRITE SetAdvancedIcon NOTIFY SetAdvancedIcon) + Q_PROPERTY(QIcon generalIcon READ GetGeneralIcon WRITE SetGeneralIcon + DESIGNABLE true) + Q_PROPERTY(QIcon streamIcon READ GetStreamIcon WRITE SetStreamIcon + DESIGNABLE true) + Q_PROPERTY(QIcon outputIcon READ GetOutputIcon WRITE SetOutputIcon + DESIGNABLE true) + Q_PROPERTY(QIcon audioIcon READ GetAudioIcon WRITE SetAudioIcon + DESIGNABLE true) + Q_PROPERTY(QIcon videoIcon READ GetVideoIcon WRITE SetVideoIcon + DESIGNABLE true) + Q_PROPERTY(QIcon hotkeysIcon READ GetHotkeysIcon WRITE SetHotkeysIcon + DESIGNABLE true) + Q_PROPERTY(QIcon advancedIcon READ GetAdvancedIcon WRITE SetAdvancedIcon + DESIGNABLE true) private: OBSBasic *main; @@ -278,6 +284,22 @@ private: void RecalcOutputResPixels(const char *resText); + QIcon generalIcon; + QIcon streamIcon; + QIcon outputIcon; + QIcon audioIcon; + QIcon videoIcon; + QIcon hotkeysIcon; + QIcon advancedIcon; + + QIcon GetGeneralIcon() const; + QIcon GetStreamIcon() const; + QIcon GetOutputIcon() const; + QIcon GetAudioIcon() const; + QIcon GetVideoIcon() const; + QIcon GetHotkeysIcon() const; + QIcon GetAdvancedIcon() const; + private slots: void on_theme_activated(int idx); From e8ad89fc758c69bd08a7b540a49064db36e338b1 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Mon, 15 Jul 2019 06:51:30 -0500 Subject: [PATCH 2/2] libobs, obs-scripting, vlc-video: Fix compiler warnings --- deps/obs-scripting/obs-scripting-lua.c | 5 +++-- libobs/obs-encoder.c | 2 +- plugins/vlc-video/vlc-video-source.c | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/deps/obs-scripting/obs-scripting-lua.c b/deps/obs-scripting/obs-scripting-lua.c index 0c87257ab..a626555da 100644 --- a/deps/obs-scripting/obs-scripting-lua.c +++ b/deps/obs-scripting/obs-scripting-lua.c @@ -590,9 +590,11 @@ static int enum_sources(lua_State *script) /* -------------------------------------------- */ -static bool source_enum_filters_proc(obs_source_t *source, obs_source_t *filter, +static void source_enum_filters_proc(obs_source_t *source, obs_source_t *filter, void *param) { + UNUSED_PARAMETER(source); + lua_State *script = param; obs_source_get_ref(filter); @@ -600,7 +602,6 @@ static bool source_enum_filters_proc(obs_source_t *source, obs_source_t *filter, size_t idx = lua_rawlen(script, -2); lua_rawseti(script, -2, (int)idx + 1); - return true; } static int source_enum_filters(lua_State *script) diff --git a/libobs/obs-encoder.c b/libobs/obs-encoder.c index 4c1465a19..9d309bb7c 100644 --- a/libobs/obs-encoder.c +++ b/libobs/obs-encoder.c @@ -349,7 +349,7 @@ obs_properties_t *obs_get_encoder_properties(const char *id) const struct obs_encoder_info *ei = find_encoder(id); if (ei && (ei->get_properties || ei->get_properties2)) { obs_data_t *defaults = get_defaults(ei); - obs_properties_t *properties; + obs_properties_t *properties = NULL; if (ei->get_properties2) { properties = ei->get_properties2(NULL, ei->type_data); diff --git a/plugins/vlc-video/vlc-video-source.c b/plugins/vlc-video/vlc-video-source.c index ecdd20ddc..550b04f14 100644 --- a/plugins/vlc-video/vlc-video-source.c +++ b/plugins/vlc-video/vlc-video-source.c @@ -230,7 +230,9 @@ static inline unsigned get_format_lines(enum video_format format, case VIDEO_FORMAT_BGRX: case VIDEO_FORMAT_Y800: return height; - case VIDEO_FORMAT_NONE:; + case VIDEO_FORMAT_NONE: + default: + break; } return 0;