Skip to content

Commit

Permalink
libobs, UI: Add OBS_ICON_TYPE_PROCESS_AUDIO_OUTPUT
Browse files Browse the repository at this point in the history
  • Loading branch information
jpark37 authored and jp9000 committed Jul 24, 2022
1 parent 7864c86 commit 9b46795
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions UI/data/themes/Acri.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ OBSBasic {
qproperty-groupIcon: url(./Dark/sources/group.svg);
qproperty-sceneIcon: url(./Dark/sources/scene.svg);
qproperty-defaultIcon: url(./Dark/sources/default.svg);
qproperty-audioProcessOutputIcon: url(./Dark/sources/windowaudio.svg);
}

/* Scene Tree */
Expand Down
1 change: 1 addition & 0 deletions UI/data/themes/Dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ OBSBasic {
qproperty-groupIcon: url(./Dark/sources/group.svg);
qproperty-sceneIcon: url(./Dark/sources/scene.svg);
qproperty-defaultIcon: url(./Dark/sources/default.svg);
qproperty-audioProcessOutputIcon: url(./Dark/sources/windowaudio.svg);
}

/* Scene Tree */
Expand Down
1 change: 1 addition & 0 deletions UI/data/themes/Dark/sources/windowaudio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions UI/data/themes/Rachni.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,7 @@ OBSBasic {
qproperty-groupIcon: url(./Dark/sources/group.svg);
qproperty-sceneIcon: url(./Dark/sources/scene.svg);
qproperty-defaultIcon: url(./Dark/sources/default.svg);
qproperty-audioProcessOutputIcon: url(./Dark/sources/windowaudio.svg);
}

/* Scene Tree */
Expand Down
1 change: 1 addition & 0 deletions UI/data/themes/System.qss
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ OBSBasic {
qproperty-groupIcon: url(:res/images/sources/group.svg);
qproperty-sceneIcon: url(:res/images/sources/scene.svg);
qproperty-defaultIcon: url(:res/images/sources/default.svg);
qproperty-audioProcessOutputIcon: url(:res/images/sources/windowaudio.svg);
}

/* Scene Tree */
Expand Down
1 change: 1 addition & 0 deletions UI/forms/images/sources/windowaudio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions UI/forms/obs.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<file>images/sources/text.svg</file>
<file>images/sources/window.svg</file>
<file>images/sources/default.svg</file>
<file>images/sources/windowaudio.svg</file>
<file>images/recording-active.svg</file>
<file>images/recording-inactive.svg</file>
<file>images/recording-pause.svg</file>
Expand Down
12 changes: 12 additions & 0 deletions UI/window-basic-main-icons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ QIcon OBSBasic::GetSourceIcon(const char *id) const
case OBS_ICON_TYPE_CUSTOM:
//TODO: Add ability for sources to define custom icons
return GetDefaultIcon();
case OBS_ICON_TYPE_PROCESS_AUDIO_OUTPUT:
return GetAudioProcessOutputIcon();
default:
return GetDefaultIcon();
}
Expand Down Expand Up @@ -112,6 +114,11 @@ void OBSBasic::SetDefaultIcon(const QIcon &icon)
defaultIcon = icon;
}

void OBSBasic::SetAudioProcessOutputIcon(const QIcon &icon)
{
audioProcessOutputIcon = icon;
}

QIcon OBSBasic::GetImageIcon() const
{
return imageIcon;
Expand Down Expand Up @@ -186,3 +193,8 @@ QIcon OBSBasic::GetDefaultIcon() const
{
return defaultIcon;
}

QIcon OBSBasic::GetAudioProcessOutputIcon() const
{
return audioProcessOutputIcon;
}
5 changes: 5 additions & 0 deletions UI/window-basic-main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class OBSBasic : public OBSMainWindow {
DESIGNABLE true)
Q_PROPERTY(QIcon defaultIcon READ GetDefaultIcon WRITE SetDefaultIcon
DESIGNABLE true)
Q_PROPERTY(QIcon audioProcessOutputIcon READ GetAudioProcessOutputIcon
WRITE SetAudioProcessOutputIcon DESIGNABLE true)

friend class OBSAbout;
friend class OBSBasicPreview;
Expand Down Expand Up @@ -560,6 +562,7 @@ class OBSBasic : public OBSMainWindow {
QIcon groupIcon;
QIcon sceneIcon;
QIcon defaultIcon;
QIcon audioProcessOutputIcon;

QIcon GetImageIcon() const;
QIcon GetColorIcon() const;
Expand All @@ -574,6 +577,7 @@ class OBSBasic : public OBSMainWindow {
QIcon GetMediaIcon() const;
QIcon GetBrowserIcon() const;
QIcon GetDefaultIcon() const;
QIcon GetAudioProcessOutputIcon() const;

QSlider *tBar;
bool tBarActive = false;
Expand Down Expand Up @@ -773,6 +777,7 @@ private slots:
void SetGroupIcon(const QIcon &icon);
void SetSceneIcon(const QIcon &icon);
void SetDefaultIcon(const QIcon &icon);
void SetAudioProcessOutputIcon(const QIcon &icon);

void TBarChanged(int value);
void TBarReleased();
Expand Down
1 change: 1 addition & 0 deletions libobs/obs-source.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ enum obs_icon_type {
OBS_ICON_TYPE_MEDIA,
OBS_ICON_TYPE_BROWSER,
OBS_ICON_TYPE_CUSTOM,
OBS_ICON_TYPE_PROCESS_AUDIO_OUTPUT,
};

enum obs_media_state {
Expand Down

0 comments on commit 9b46795

Please sign in to comment.