diff options
author | AlwinEsch <alwin.esch@web.de> | 2015-05-16 13:31:13 +0200 |
---|---|---|
committer | AchimTuran <wisler@kodi.tv> | 2015-07-19 18:56:50 +0200 |
commit | 67915fa48a757a7d54540cfa49609ba4c417fe80 (patch) | |
tree | 0044e2cbd526fc09e3292ca2c1cd240a72487bf6 | |
parent | 00fbb189e7fe5ff8887ab66cb8a95193fc27150b (diff) |
[adsp] Add dsp processing setting dialog selection to player dialog
20 files changed, 1538 insertions, 31 deletions
diff --git a/addons/skin.confluence/720p/DialogAudioDSPSettings.xml b/addons/skin.confluence/720p/DialogAudioDSPSettings.xml new file mode 100644 index 0000000000..95fa7c41fe --- /dev/null +++ b/addons/skin.confluence/720p/DialogAudioDSPSettings.xml @@ -0,0 +1,244 @@ +<?xml version="1.0" encoding="UTF-8"?> +<window> + <defaultcontrol>5</defaultcontrol> + <coordinates> + <left>240</left> + <top>60</top> + </coordinates> + <include>dialogeffect</include> + <controls> + <control type="group"> + <animation effect="fade" start="100" end="0" time="400" condition="Window.IsVisible(SliderDialog)">Conditional</animation> + <control type="image"> + <description>background image</description> + <left>0</left> + <top>0</top> + <width>800</width> + <height>600</height> + <texture border="40">DialogBack2.png</texture> + </control> + <control type="image"> + <description>Dialog Header image</description> + <left>40</left> + <top>16</top> + <width>720</width> + <height>40</height> + <texture>dialogheader.png</texture> + </control> + <control type="label" id="2"> + <description>header label</description> + <left>40</left> + <top>20</top> + <width>720</width> + <height>30</height> + <font>font13_title</font> + <label>-</label> + <align>center</align> + <aligny>center</aligny> + <textcolor>selected</textcolor> + <shadowcolor>black</shadowcolor> + </control> + <control type="button"> + <description>Close Window button</description> + <left>710</left> + <top>15</top> + <width>64</width> + <height>32</height> + <label>-</label> + <font>-</font> + <onclick>PreviousMenu</onclick> + <texturefocus>DialogCloseButton-focus.png</texturefocus> + <texturenofocus>DialogCloseButton.png</texturenofocus> + <visible>system.getbool(input.enablemouse)</visible> + </control> + <control type="grouplist" id="5"> + <description>control area</description> + <left>40</left> + <top>65</top> + <width>520</width> + <height>470</height> + <itemgap>5</itemgap> + <pagecontrol>60</pagecontrol> + <onleft>60</onleft> + <onright>60</onright> + <onup>5</onup> + <ondown>5</ondown> + </control> + <control type="scrollbar" id="60"> + <left>560</left> + <top>65</top> + <width>25</width> + <height>470</height> + <texturesliderbackground border="0,14,0,14">ScrollBarV.png</texturesliderbackground> + <texturesliderbar border="0,14,0,14">ScrollBarV_bar.png</texturesliderbar> + <texturesliderbarfocus border="0,14,0,14">ScrollBarV_bar_focus.png</texturesliderbarfocus> + <textureslidernib>ScrollBarNib.png</textureslidernib> + <textureslidernibfocus>ScrollBarNib.png</textureslidernibfocus> + <onleft>5</onleft> + <onright>5</onright> + <ondown>61</ondown> + <onup>61</onup> + <showonepage>false</showonepage> + <orientation>vertical</orientation> + </control> + <control type="label"> + <description>info label</description> + <left>40</left> + <top>540</top> + <width>720</width> + <height>30</height> + <font>font13_title</font> + <label>$INFO[ADSP.MasterInfo]</label> + <align>left</align> + <aligny>center</aligny> + <textcolor>selected</textcolor> + <shadowcolor>black</shadowcolor> + </control> + <control type="image"> + <description>Audio DSP Image</description> + <left>555</left> + <top>540</top> + <width>85</width> + <height>35</height> + <aspectratio align="center">keep</aspectratio> + <visible>!IsEmpty(ADSP.MasterOwnIcon)</visible> + <texture>$INFO[ADSP.MasterOwnIcon]</texture> + </control> + <control type="image"> + <description>Audio Codec Image</description> + <left>640</left> + <top>540</top> + <width>85</width> + <height>35</height> + <aspectratio align="center">keep</aspectratio> + <texture>$INFO[VideoPlayer.AudioCodec,flagging/audio/,.png]</texture> + <visible>IsEmpty(ADSP.MasterOverrideIcon) + Player.HasVideo</visible> + </control> + <control type="image"> + <description>Audio Codec Image</description> + <left>640</left> + <top>540</top> + <width>85</width> + <height>35</height> + <aspectratio align="center">keep</aspectratio> + <texture>$INFO[MusicPlayer.Codec,flagging/audio/,.png]</texture> + <visible>IsEmpty(ADSP.MasterOverrideIcon) + Player.HasAudio</visible> + </control> + <control type="image"> + <description>Audio Codec Override Image</description> + <left>640</left> + <top>540</top> + <width>85</width> + <height>35</height> + <aspectratio align="center">keep</aspectratio> + <visible>!IsEmpty(ADSP.MasterOverrideIcon)</visible> + <texture>$INFO[ADSP.MasterOverrideIcon]</texture> + </control> + <control type="image"> + <description>Audio Channels Image</description> + <left>730</left> + <top>540</top> + <width>50</width> + <height>35</height> + <aspectratio align="center">keep</aspectratio> + <texture>$INFO[VideoPlayer.AudioChannels,flagging/audio/,.png]</texture> + </control> + <control type="label"> + <description>type label</description> + <left>590</left> + <top>65</top> + <width>720</width> + <height>30</height> + <font>font13_title</font> + <label>15042</label> + <align>left</align> + <aligny>center</aligny> + <textcolor>grey2</textcolor> + <shadowcolor>black</shadowcolor> + </control> + <control type="label"> + <description>type label</description> + <left>590</left> + <top>100</top> + <width>230</width> + <height>30</height> + <font>font13_title</font> + <label>$INFO[ADSP.DetectedStreamType]</label> + <align>left</align> + <aligny>center</aligny> + <textcolor>selected</textcolor> + <shadowcolor>black</shadowcolor> + </control> + </control> + <control type="button" id="7"> + <description>Default Button</description> + <left>0</left> + <top>0</top> + <height>40</height> + <font>font13</font> + <textcolor>grey2</textcolor> + <focusedcolor>white</focusedcolor> + <texturefocus border="5">button-focus2.png</texturefocus> + </control> + <control type="radiobutton" id="8"> + <description>Default RadioButton</description> + <left>0</left> + <top>0</top> + <height>40</height> + <font>font13</font> + <textcolor>grey2</textcolor> + <focusedcolor>white</focusedcolor> + <texturefocus border="5">button-focus2.png</texturefocus> + </control> + <control type="spincontrolex" id="9"> + <description>Default SpinControlex</description> + <left>0</left> + <top>0</top> + <height>40</height> + <font>font13</font> + <textcolor>grey2</textcolor> + <focusedcolor>white</focusedcolor> + <texturefocus border="5">button-focus2.png</texturefocus> + <texturenofocus border="5">button-nofocus.png</texturenofocus> + <aligny>center</aligny> + <reverse>yes</reverse> + </control> + <control type="image" id="11"> + <description>separator image</description> + <height>2</height> + <texture>separator2.png</texture> + </control> + <control type="edit" id="12"> + <description>Default Edit</description> + <left>0</left> + <top>0</top> + <height>40</height> + <font>font13</font> + <textcolor>grey2</textcolor> + <focusedcolor>white</focusedcolor> + <texturenofocus border="5">button-nofocus.png</texturenofocus> + <texturefocus border="5">button-focus2.png</texturefocus> + </control> + <control type="sliderex" id="13"> + <description>Default Slider</description> + <height>40</height> + <texturenofocus border="5">button-nofocus.png</texturenofocus> + <texturefocus border="5">button-focus2.png</texturefocus> + <font>font13</font> + <textcolor>grey2</textcolor> + <focusedcolor>white</focusedcolor> + </control> + <control type="label" id="14"> + <description>Default Label</description> + <left>0</left> + <top>0</top> + <height>30</height> + <label>-</label> + <align>center</align> + <aligny>bottom</aligny> + <font>font13_title</font> + <textcolor>grey</textcolor> + <shadowcolor>black</shadowcolor> + </control> + </controls> +</window> diff --git a/addons/skin.confluence/720p/MusicOSD.xml b/addons/skin.confluence/720p/MusicOSD.xml index bdfbfcdce6..18ea9d4914 100644 --- a/addons/skin.confluence/720p/MusicOSD.xml +++ b/addons/skin.confluence/720p/MusicOSD.xml @@ -27,7 +27,7 @@ <ondown>100</ondown> <animation effect="fade" time="150">VisibleChange</animation> <animation effect="slide" start="0,0" end="-30,0" time="0" condition="Window.IsVisible(Mutebug)">conditional</animation> - <visible>![Window.IsVisible(AddonSettings) | Window.IsVisible(SelectDialog) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)]</visible> + <visible>![Window.IsVisible(AddonSettings) | Window.IsVisible(SelectDialog) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(Addon)]</visible> </control> <control type="slider" id="87"> <description>Seek Slider</description> @@ -42,7 +42,7 @@ <textureslidernib>osd_slider_nibNF.png</textureslidernib> <textureslidernibfocus>osd_slider_nib.png</textureslidernibfocus> <animation effect="fade" time="150">VisibleChange</animation> - <visible>![Window.IsVisible(AddonSettings) | Window.IsVisible(SelectDialog) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)]</visible> + <visible>![Window.IsVisible(AddonSettings) | Window.IsVisible(SelectDialog) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(Addon)]</visible> </control> <control type="grouplist" id="100"> <left>325</left> @@ -52,7 +52,7 @@ <orientation>horizontal</orientation> <itemgap>0</itemgap> <animation effect="fade" time="150">VisibleChange</animation> - <visible>![Window.IsVisible(AddonSettings) | Window.IsVisible(SelectDialog) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)]</visible> + <visible>![Window.IsVisible(AddonSettings) | Window.IsVisible(SelectDialog) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(Addon)]</visible> <control type="button" id="300"> <width>55</width> <height>55</height> @@ -247,16 +247,26 @@ <onclick>PlayerControl(Random)</onclick> </control> <control type="image" id="2300"> - <width>215</width> + <width>160</width> <height>55</height> <texture>-</texture> <visible>!MusicPlayer.Content(LiveTV)</visible> </control> <control type="image" id="2400"> - <width>270</width> + <width>215</width> <texture>-</texture> <visible>MusicPlayer.Content(LiveTV)</visible> </control> + <control type="button" id="700"> + <visible>system.getbool(audiooutput.dspaddonsenabled)</visible> + <width>55</width> + <height>55</height> + <label>15047</label> + <font>-</font> + <texturefocus>OSDDSPAudioFO.png</texturefocus> + <texturenofocus>OSDDSPAudioNF.png</texturenofocus> + <onclick>ActivateWindow(OSDAudioDSPSettings)</onclick> + </control> <control type="togglebutton" id="701"> <width>55</width> <height>55</height> diff --git a/addons/skin.confluence/720p/MusicVisualisation.xml b/addons/skin.confluence/720p/MusicVisualisation.xml index 6430cb97d8..fbe93ebc1a 100644 --- a/addons/skin.confluence/720p/MusicVisualisation.xml +++ b/addons/skin.confluence/720p/MusicVisualisation.xml @@ -25,7 +25,7 @@ <!-- media infos --> <control type="group"> <animation effect="fade" time="150">VisibleChange</animation> - <visible>[Player.ShowInfo | Window.IsActive(MusicOSD)] + ![Window.IsVisible(AddonSettings) | Window.IsVisible(SelectDialog) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)]</visible> + <visible>[Player.ShowInfo | Window.IsActive(MusicOSD)] + ![Window.IsVisible(AddonSettings) | Window.IsVisible(SelectDialog) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(Addon)]</visible> <control type="image"> <left>0</left> <top>-150</top> @@ -129,6 +129,7 @@ <height>35</height> <itemgap>5</itemgap> <orientation>horizontal</orientation> + <visible>!system.getbool(audiooutput.dspaddonsenabled)</visible> <control type="label"> <width min="10" max="700">auto</width> <height>30</height> @@ -170,6 +171,72 @@ </control> </control> </control> + <control type="grouplist"> + <left>20</left> + <top>60</top> + <width>910</width> + <height>35</height> + <itemgap>5</itemgap> + <orientation>horizontal</orientation> + <visible>system.getbool(audiooutput.dspaddonsenabled)</visible> + <control type="label"> + <width min="10" max="620">auto</width> + <height>30</height> + <font>font30</font> + <align>left</align> + <aligny>center</aligny> + <label>$INFO[Player.Title]</label> + <textcolor>orange</textcolor> + <scroll>true</scroll> + </control> + <control type="image"> + <description>ADSP Master Mode Image</description> + <width>80</width> + <height>35</height> + <aspectratio align="right">keep</aspectratio> + <visible>!IsEmpty(ADSP.MasterOwnIcon)</visible> + <texture>$INFO[ADSP.MasterOwnIcon]</texture> + </control> + <control type="image"> + <description>Audio Codec Image</description> + <width>80</width> + <height>35</height> + <aspectratio align="center">keep</aspectratio> + <visible>IsEmpty(ADSP.MasterOverrideIcon)</visible> + <texture>$INFO[MusicPlayer.Codec,flagging/audio/,.png]</texture> + </control> + <control type="image"> + <description>ADSP Audio Codec Override Image</description> + <width>80</width> + <height>35</height> + <aspectratio align="center">keep</aspectratio> + <visible>!IsEmpty(ADSP.MasterOverrideIcon)</visible> + <texture>$INFO[ADSP.MasterOverrideIcon]</texture> + </control> + <control type="group"> + <description>Rating</description> + <width>110</width> + <height>35</height> + <control type="image"> + <description>rating back</description> + <left>0</left> + <top>0</top> + <width>110</width> + <height>35</height> + <aspectratio align="left">stretch</aspectratio> + <texture border="5">flagging/blank.png</texture> + </control> + <control type="image"> + <description>Rating</description> + <left>5</left> + <top>0</top> + <width>100</width> + <height>35</height> + <aspectratio align="center">keep</aspectratio> + <texture fallback="LeftRating/rating0.png">$INFO[Player.StarRating,LeftRating/]</texture> + </control> + </control> + </control> <control type="label"> <left>0</left> <top>120</top> @@ -222,7 +289,7 @@ <control type="group" id="0"> <left>0</left> <top>50</top> - <visible>Player.ShowCodec + ![Window.IsVisible(script-cu-lrclyrics-main.xml) | Window.IsVisible(VisualisationSettings) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)]</visible> + <visible>Player.ShowCodec + ![Window.IsVisible(script-cu-lrclyrics-main.xml) | Window.IsVisible(VisualisationSettings) | Window.IsVisible(VisualisationPresetList) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(Addon)]</visible> <animation effect="fade" time="150">VisibleChange</animation> <control type="image"> <description>media info background image</description> diff --git a/addons/skin.confluence/720p/VideoFullScreen.xml b/addons/skin.confluence/720p/VideoFullScreen.xml index 8f917179f7..0d4a0e2b51 100644 --- a/addons/skin.confluence/720p/VideoFullScreen.xml +++ b/addons/skin.confluence/720p/VideoFullScreen.xml @@ -4,7 +4,7 @@ <controls> <!-- media infos --> <control type="group" id="1"> - <visible>[Player.ShowInfo | Window.IsActive(VideoOSD)] + ![Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(VideoBookmarks) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide) | Window.IsVisible(SliderDialog)]</visible> + <visible>[Player.ShowInfo | Window.IsActive(VideoOSD)] + ![Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(VideoBookmarks) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide) | Window.IsVisible(SliderDialog)]</visible> <animation effect="fade" time="150">VisibleChange</animation> <control type="image" id="1"> <left>0</left> @@ -214,13 +214,30 @@ <texture>$INFO[VideoPlayer.VideoResolution,flagging/video/,.png]</texture> </control> <control type="image" id="1"> + <description>ADSP Master Mode Image</description> + <width>85</width> + <height>35</height> + <aspectratio align="right">keep</aspectratio> + <visible>!IsEmpty(ADSP.MasterOwnIcon)</visible> + <texture>$INFO[ADSP.MasterOwnIcon]</texture> + </control> + <control type="image" id="1"> <description>Audio Codec Image</description> <width>85</width> <height>35</height> <aspectratio align="center">keep</aspectratio> + <visible>IsEmpty(ADSP.MasterOverrideIcon)</visible> <texture>$INFO[VideoPlayer.AudioCodec,flagging/audio/,.png]</texture> </control> <control type="image" id="1"> + <description>ADSP Audio Codec Override Image</description> + <width>85</width> + <height>35</height> + <aspectratio align="right">keep</aspectratio> + <visible>!IsEmpty(ADSP.MasterOverrideIcon)</visible> + <texture>$INFO[ADSP.MasterOverrideIcon]</texture> + </control> + <control type="image" id="1"> <description>Audio Channels Image</description> <width>50</width> <height>35</height> diff --git a/addons/skin.confluence/720p/VideoOSD.xml b/addons/skin.confluence/720p/VideoOSD.xml index 54dec84c83..118a3bf62d 100644 --- a/addons/skin.confluence/720p/VideoOSD.xml +++ b/addons/skin.confluence/720p/VideoOSD.xml @@ -27,7 +27,7 @@ <ondown>100</ondown> <animation effect="slide" start="0,0" end="-30,0" time="0" condition="Window.IsVisible(Mutebug)">conditional</animation> <animation effect="fade" time="150">VisibleChange</animation> - <visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(VideoBookmarks)]</visible> + <visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(VideoBookmarks)]</visible> </control> <control type="slider" id="87"> <description>Seek Slider</description> @@ -42,7 +42,7 @@ <textureslidernib>osd_slider_nibNF.png</textureslidernib> <textureslidernibfocus>osd_slider_nib.png</textureslidernibfocus> <animation effect="fade" time="150">VisibleChange</animation> - <visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(VideoBookmarks) | VideoPlayer.Content(LiveTV)]</visible> + <visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(VideoBookmarks) | VideoPlayer.Content(LiveTV)]</visible> </control> <control type="grouplist" id="100"> <left>325</left> @@ -50,7 +50,7 @@ <orientation>horizontal</orientation> <itemgap>0</itemgap> <animation effect="fade" time="150">VisibleChange</animation> - <visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(VideoBookmarks) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)]</visible> + <visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(VideoBookmarks) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)]</visible> <onup>1000</onup> <control type="button" id="300"> <width>55</width> @@ -213,13 +213,16 @@ <ondown>1000</ondown> <onclick>ActivateWindow(OSDVideoSettings)</onclick> </control> - <control type="button" id="252"> + <control type="togglebutton" id="252"> <width>55</width> <height>55</height> <label>13396</label> <font>-</font> <texturefocus>OSDAudioFO.png</texturefocus> <texturenofocus>OSDAudioNF.png</texturenofocus> + <usealttexture>system.getbool(audiooutput.dspaddonsenabled)</usealttexture> + <alttexturefocus>OSDDSPAudioFO.png</alttexturefocus> + <alttexturenofocus>OSDDSPAudioNF.png</alttexturenofocus> <onup>1000</onup> <ondown>1000</ondown> <onclick>ActivateWindow(OSDAudioSettings)</onclick> @@ -281,7 +284,7 @@ <visible>Control.HasFocus(410) | Control.HasFocus(250) | ControlGroup(400).HasFocus</visible> </control> <control type="grouplist" id="400"> - <visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(VideoBookmarks)]</visible> + <visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(VideoBookmarks)]</visible> <animation effect="fade" time="150">VisibleChange</animation> <animation effect="slide" start="0,0" end="0,80" time="0" condition="![VideoPlayer.HasSubtitles + VideoPlayer.SubtitlesEnabled]">Conditional</animation> <animation effect="slide" start="0,0" end="0,40" time="0" condition="!VideoPlayer.HasSubtitles">Conditional</animation> @@ -402,7 +405,7 @@ <visible>Control.HasFocus(520) | Control.HasFocus(255) | ControlGroup(500).HasFocus</visible> </control> <control type="grouplist" id="500"> - <visible>videoplayer.isstereoscopic + ![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(VideoBookmarks) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)] + [Control.HasFocus(255) | ControlGroup(500).HasFocus | Control.HasFocus(520)]</visible> + <visible>videoplayer.isstereoscopic + ![Window.IsVisible(SliderDialog) | Window.IsVisible(OSDVideoSettings) | Window.IsVisible(OSDAudioSettings) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(VideoBookmarks) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)] + [Control.HasFocus(255) | ControlGroup(500).HasFocus | Control.HasFocus(520)]</visible> <animation effect="fade" time="150">VisibleChange</animation> <animation effect="slide" start="0,0" end="55,0" time="0" condition="VideoPlayer.Content(LiveTV)">Conditional</animation> <right>200</right> diff --git a/addons/skin.confluence/720p/VideoOSDSettings.xml b/addons/skin.confluence/720p/VideoOSDSettings.xml index e274a8a7f8..776c7dc3b5 100644 --- a/addons/skin.confluence/720p/VideoOSDSettings.xml +++ b/addons/skin.confluence/720p/VideoOSDSettings.xml @@ -9,7 +9,7 @@ <include>dialogeffect</include> <controls> <control type="group"> - <animation effect="fade" start="100" end="0" time="300" condition="Window.IsVisible(SliderDialog) | Window.IsVisible(FileBrowser)">Conditional</animation> + <animation effect="fade" start="100" end="0" time="300" condition="Window.IsVisible(SliderDialog) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(FileBrowser)">Conditional</animation> <control type="image"> <description>background image</description> <left>0</left> diff --git a/lib/addons/library.kodi.adsp/project/VS2010Express/libKODI_adsp.vcxproj b/lib/addons/library.kodi.adsp/project/VS2010Express/libKODI_adsp.vcxproj index 005aba0e7b..87a33fa58a 100644 --- a/lib/addons/library.kodi.adsp/project/VS2010Express/libKODI_adsp.vcxproj +++ b/lib/addons/library.kodi.adsp/project/VS2010Express/libKODI_adsp.vcxproj @@ -50,7 +50,7 @@ </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> - <AdditionalIncludeDirectories>..\..\..\..\..\xbmc;..\..\..\..\..\xbmc\addons\include;..\..\..\..\..\xbmc\cores\dvdplayer\DVDDemuxers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\..\..\..\..\xbmc;..\..\..\..\..\xbmc\addons\include;..\..\..\..\..\xbmc\cores\dvdplayer\DVDDemuxers;..\..\..\..\..\addons\library.xbmc.addon;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>VDR_EXPORTS;_WIN32PC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>Sync</ExceptionHandling> <PrecompiledHeader> @@ -62,7 +62,7 @@ </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> - <AdditionalIncludeDirectories>..\..\..\..\..\xbmc;..\..\..\..\..\xbmc\addons\include;..\..\..\..\..\xbmc\cores\dvdplayer\DVDDemuxers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\..\..\..\..\xbmc;..\..\..\..\..\xbmc\addons\include;..\..\..\..\..\xbmc\cores\dvdplayer\DVDDemuxers;..\..\..\..\..\addons\library.xbmc.addon;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>HAS_SDL_OPENGL;HAS_SDL;_USRDLL;XBMC_VDR_EXPORTS;_WIN32PC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>Sync</ExceptionHandling> <PrecompiledHeader> diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index f4465991ce..a98bdd8c48 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -788,6 +788,7 @@ <ClCompile Include="..\..\xbmc\settings\AdvancedSettings.cpp" /> <ClCompile Include="..\..\xbmc\settings\AudioDSPSettings.cpp" /> <ClCompile Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPManager.cpp" /> + <ClCompile Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPSettings.cpp" /> <ClCompile Include="..\..\xbmc\settings\dialogs\GUIDialogContentSettings.cpp" /> <ClCompile Include="..\..\xbmc\settings\dialogs\GUIDialogSettingsBase.cpp" /> <ClCompile Include="..\..\xbmc\settings\dialogs\GUIDialogSettingsManagerBase.cpp" /> @@ -1036,6 +1037,7 @@ <ClInclude Include="..\..\xbmc\pvr\timers\PVRTimerType.h" /> <ClInclude Include="..\..\xbmc\settings\AudioDSPSettings.h" /> <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPManager.h" /> + <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPSettings.h" /> <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogContentSettings.h" /> <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogSettingsBase.h" /> <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogSettingsManagerBase.h" /> diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index ba51b16613..b4ca7ceffe 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -3098,11 +3098,14 @@ <Filter>music</Filter> </ClCompile> <ClCompile Include="..\..\xbmc\filesystem\NFSDirectory.cpp" /> + <ClCompile Include="..\..\xbmc\test\TestUtil.cpp"> + <Filter>test</Filter> + </ClCompile> <ClCompile Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPManager.cpp"> <Filter>settings\dialogs</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\test\TestUtil.cpp"> - <Filter>test</Filter> + <ClCompile Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPSettings.cpp"> + <Filter>settings\dialogs</Filter> </ClCompile> <ClCompile Include="..\..\xbmc\utils\rfft.cpp"> <Filter>utils</Filter> @@ -6052,6 +6055,7 @@ </ClInclude> <ClInclude Include="..\..\xbmc\network\dacp\dacp.h"> <Filter>network\dacp</Filter> + </ClInclude> <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPManager.h"> <Filter>settings\dialogs</Filter> </ClInclude> @@ -6073,6 +6077,9 @@ <ClInclude Include="..\..\xbmc\messaging\IMessageTarget.h"> <Filter>messaging</Filter> </ClInclude> + <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPSettings.h"> + <Filter>settings\dialogs</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc"> diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp index 45e8a839e8..5ae1aa8b9b 100644 --- a/xbmc/guilib/GUIWindowManager.cpp +++ b/xbmc/guilib/GUIWindowManager.cpp @@ -137,6 +137,7 @@ #include "dialogs/GUIDialogMediaFilter.h" #include "video/dialogs/GUIDialogSubtitles.h" #include "settings/dialogs/GUIDialogAudioDSPManager.h" +#include "settings/dialogs/GUIDialogAudioDSPSettings.h" #ifdef HAS_KARAOKE #include "music/karaoke/GUIDialogKaraokeSongSelector.h" @@ -278,6 +279,7 @@ void CGUIWindowManager::CreateWindows() Add(new CGUIDialogPVRGuideOSD); Add(new ActiveAE::CGUIDialogAudioDSPManager); + Add(new ActiveAE::CGUIDialogAudioDSPSettings); Add(new CGUIDialogSelect); Add(new CGUIDialogMusicInfo); @@ -376,6 +378,7 @@ bool CGUIWindowManager::DestroyWindows() Delete(WINDOW_DIALOG_OSD_TELETEXT); Delete(WINDOW_DIALOG_AUDIO_DSP_MANAGER); + Delete(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS); Delete(WINDOW_DIALOG_TEXT_VIEWER); Delete(WINDOW_DIALOG_PLAY_EJECT); diff --git a/xbmc/guilib/WindowIDs.h b/xbmc/guilib/WindowIDs.h index 5d663aaf3a..b4338d258f 100644 --- a/xbmc/guilib/WindowIDs.h +++ b/xbmc/guilib/WindowIDs.h @@ -105,6 +105,7 @@ #define WINDOW_DIALOG_MEDIA_FILTER 10152 #define WINDOW_DIALOG_SUBTITLES 10153 #define WINDOW_DIALOG_AUDIO_DSP_MANAGER 10154 +#define WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS 10155 #define WINDOW_MUSIC_PLAYLIST 10500 #define WINDOW_MUSIC_FILES 10501 diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp index 3200586303..59828d9e6b 100644 --- a/xbmc/input/ButtonTranslator.cpp +++ b/xbmc/input/ButtonTranslator.cpp @@ -354,6 +354,7 @@ static const ActionMapping windows[] = {"osdvideosettings" , WINDOW_DIALOG_VIDEO_OSD_SETTINGS}, {"osdaudiosettings" , WINDOW_DIALOG_AUDIO_OSD_SETTINGS}, {"audiodspmanager" , WINDOW_DIALOG_AUDIO_DSP_MANAGER}, + {"osdaudiodspsettings" , WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS}, {"videobookmarks" , WINDOW_DIALOG_VIDEO_BOOKMARKS}, {"filebrowser" , WINDOW_DIALOG_FILE_BROWSER}, {"networksetup" , WINDOW_DIALOG_NETWORK_SETUP}, diff --git a/xbmc/music/dialogs/GUIDialogMusicOSD.cpp b/xbmc/music/dialogs/GUIDialogMusicOSD.cpp index 88e85d8503..756255cdfe 100644 --- a/xbmc/music/dialogs/GUIDialogMusicOSD.cpp +++ b/xbmc/music/dialogs/GUIDialogMusicOSD.cpp @@ -90,7 +90,8 @@ void CGUIDialogMusicOSD::FrameMove() // check for movement of mouse or a submenu open if (CInputManager::Get().IsMouseActive() || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIS_SETTINGS) || - g_windowManager.IsWindowActive(WINDOW_DIALOG_VIS_PRESET_LIST)) + g_windowManager.IsWindowActive(WINDOW_DIALOG_VIS_PRESET_LIST) || + g_windowManager.IsWindowActive(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS)) // extend show time by original value SetAutoClose(m_showDuration); } diff --git a/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp b/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp index 5ec7da844c..bccc00ffa5 100644 --- a/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp +++ b/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp @@ -567,7 +567,7 @@ bool CGUIDialogAudioDSPManager::OnContextButton(int itemNumber, CONTEXT_BUTTON b CGUIDialogTextViewer* pDlgInfo = (CGUIDialogTextViewer*)g_windowManager.GetWindow(WINDOW_DIALOG_TEXT_VIEWER); pDlgInfo->SetHeading(g_localizeStrings.Get(15062) + " - " + pItem->GetProperty("Name").asString()); pDlgInfo->SetText(addon->GetString((uint32_t)pItem->GetProperty("Help").asInteger())); - pDlgInfo->DoModal(); + pDlgInfo->Open(); } } else if (button == CONTEXT_BUTTON_ACTIVATE) @@ -694,7 +694,7 @@ void CGUIDialogAudioDSPManager::Update() helper_LogError(__FUNCTION__); return; } - pDlgBusy->Show(); + pDlgBusy->Open(); Clear(); @@ -790,7 +790,7 @@ void CGUIDialogAudioDSPManager::SaveList(void) helper_LogError(__FUNCTION__); return; } - pDlgBusy->Show(); + pDlgBusy->Open(); /* persist all modes */ if (UpdateDatabase(pDlgBusy)) diff --git a/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.cpp b/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.cpp new file mode 100644 index 0000000000..aa652def88 --- /dev/null +++ b/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.cpp @@ -0,0 +1,1010 @@ +/* + * Copyright (C) 2005-2015 Team KODI + * http://kodi.tv + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with KODI; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "GUIDialogAudioDSPSettings.h" +#include "Application.h" +#include "addons/Skin.h" +#include "cores/IPlayer.h" +#include "cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.h" +#include "cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h" +#include "cores/AudioEngine/Utils/AEUtil.h" +#include "dialogs/GUIDialogKaiToast.h" +#include "dialogs/GUIDialogYesNo.h" +#include "guilib/GUIMessage.h" +#include "guilib/GUIWindowManager.h" +#include "guilib/LocalizeStrings.h" +#include "profiles/ProfilesManager.h" +#include "settings/AdvancedSettings.h" +#include "settings/MediaSettings.h" +#include "settings/MediaSourceSettings.h" +#include "settings/Settings.h" +#include "settings/lib/SettingSection.h" +#include "settings/lib/Setting.h" +#include "settings/lib/SettingsManager.h" +#include "settings/windows/GUIControlSettings.h" +#include "utils/log.h" +#include "utils/StringUtils.h" + +#define SETTING_AUDIO_CAT_MAIN "audiodspmainsettings" +#define SETTING_AUDIO_CAT_MASTER "audiodspmastersettings" +#define SETTING_AUDIO_CAT_POST_PROCESS "audiodsppostsettings" +#define SETTING_AUDIO_CAT_RESAMPLING "audiodspresamplesettings" +#define SETTING_AUDIO_CAT_PRE_PROCESS "audiodsppresettings" +#define SETTING_AUDIO_CAT_MISC "audiodspmiscsettings" +#define SETTING_AUDIO_CAT_PROC_INFO "audiodspprocinfo" + +#define SETTING_AUDIO_MAIN_STREAMTYPE "audiodsp.main.streamtype" +#define SETTING_AUDIO_MAIN_MODETYPE "audiodsp.main.modetype" +#define SETTING_AUDIO_MAIN_VOLUME "audiodsp.main.volume" +#define SETTING_AUDIO_MAIN_VOLUME_AMPLIFICATION "audiodsp.main.volumeamplification" +#define SETTING_AUDIO_MAIN_BUTTON_MASTER "audiodsp.main.menumaster" +#define SETTING_AUDIO_MAIN_BUTTON_OUTPUT "audiodsp.main.menupostproc" +#define SETTING_AUDIO_MAIN_BUTTON_RESAMPLE "audiodsp.main.menuresample" +#define SETTING_AUDIO_MAIN_BUTTON_PRE_PROC "audiodsp.main.menupreproc" +#define SETTING_AUDIO_MAIN_BUTTON_MISC "audiodsp.main.menumisc" +#define SETTING_AUDIO_MAIN_BUTTON_INFO "audiodsp.main.menuinfo" +#define SETTING_AUDIO_MAIN_MAKE_DEFAULT "audiodsp.main.makedefault" +#define SETTING_AUDIO_MASTER_SETTINGS_MENUS "audiodsp.master.menu_" +#define SETTING_AUDIO_POST_PROC_AUDIO_DELAY "audiodsp.postproc.delay" +#define SETTING_AUDIO_PROC_SETTINGS_MENUS "audiodsp.proc.menu_" + +#define SETTING_STREAM_INFO_INPUT_CHANNELS "audiodsp.info.inputchannels" +#define SETTING_STREAM_INFO_INPUT_CHANNEL_NAMES "audiodsp.info.inputchannelnames" +#define SETTING_STREAM_INFO_INPUT_SAMPLERATE "audiodsp.info.inputsamplerate" +#define SETTING_STREAM_INFO_OUTPUT_CHANNELS "audiodsp.info.outputchannels" +#define SETTING_STREAM_INFO_OUTPUT_CHANNEL_NAMES "audiodsp.info.outputchannelnames" +#define SETTING_STREAM_INFO_OUTPUT_SAMPLERATE "audiodsp.info.outputsamplerate" +#define SETTING_STREAM_INFO_CPU_USAGE "audiodsp.info.cpuusage" +#define SETTING_STREAM_INFO_TYPE_INPUT "audiodsp.info.typeinput" +#define SETTING_STREAM_INFO_TYPE_PREPROC "audiodsp.info.typepreproc" +#define SETTING_STREAM_INFO_TYPE_MASTER "audiodsp.info.typemaster" +#define SETTING_STREAM_INFO_TYPE_POSTPROC "audiodsp.info.typepostproc" +#define SETTING_STREAM_INFO_TYPE_OUTPUT "audiodsp.info.typeoutput" +#define SETTING_STREAM_INFO_MODE_CPU_USAGE "audiodsp.info.modecpuusage_" + +#define CONTROL_SETTINGS_LABEL 2 + +using namespace std; +using namespace ActiveAE; + +CGUIDialogAudioDSPSettings::CGUIDialogAudioDSPSettings() + : CGUIDialogSettingsManualBase(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS, "DialogAudioDSPSettings.xml") +{ + m_ActiveStreamId = 0; + m_GetCPUUsage = false; + m_MenuPositions[SETTING_AUDIO_CAT_MAIN] = CONTROL_SETTINGS_START_CONTROL; + m_MenuPositions[SETTING_AUDIO_CAT_MASTER] = CONTROL_SETTINGS_START_CONTROL; + m_MenuPositions[SETTING_AUDIO_CAT_POST_PROCESS] = CONTROL_SETTINGS_START_CONTROL; + m_MenuPositions[SETTING_AUDIO_CAT_RESAMPLING] = CONTROL_SETTINGS_START_CONTROL; + m_MenuPositions[SETTING_AUDIO_CAT_PRE_PROCESS] = CONTROL_SETTINGS_START_CONTROL; + m_MenuPositions[SETTING_AUDIO_CAT_MISC] = CONTROL_SETTINGS_START_CONTROL; + m_MenuPositions[SETTING_AUDIO_CAT_PROC_INFO] = CONTROL_SETTINGS_START_CONTROL+2; +} + +CGUIDialogAudioDSPSettings::~CGUIDialogAudioDSPSettings(void) +{ } + +int CGUIDialogAudioDSPSettings::FindCategoryIndex(const std::string &catId) +{ + for (unsigned int i = 0; i < m_categories.size(); i++) + { + if (m_categories[i]->GetId() == catId) + return i; + } + return 0; +} + +void CGUIDialogAudioDSPSettings::OpenMenu(const std::string &id) +{ + m_GetCPUUsage = false; + m_MenuPositions[m_categories[m_iCategory]->GetId()] = GetFocusedControlID(); + m_MenuHierarchy.push_back(m_iCategory); + m_iCategory = FindCategoryIndex(id); + + /* Get menu name */ + m_MenuName = -1; + if (id == SETTING_AUDIO_CAT_MAIN) + m_MenuName = 15028; + else if (id == SETTING_AUDIO_CAT_MASTER) + m_MenuName = 15029; + else if (id == SETTING_AUDIO_CAT_POST_PROCESS) + m_MenuName = 15030; + else if (id == SETTING_AUDIO_CAT_RESAMPLING) + m_MenuName = 15035; + else if (id == SETTING_AUDIO_CAT_PRE_PROCESS) + m_MenuName = 15037; + else if (id == SETTING_AUDIO_CAT_MISC) + m_MenuName = 15038; + else if (id == SETTING_AUDIO_CAT_PROC_INFO) + m_MenuName = 15031; + + SET_CONTROL_LABEL(CONTROL_SETTINGS_LABEL, g_localizeStrings.Get(m_MenuName)); + CreateSettings(); + SET_CONTROL_FOCUS(m_MenuPositions[id], 0); +} + +bool CGUIDialogAudioDSPSettings::OnMessage(CGUIMessage &message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + if (iControl >= CONTROL_SETTINGS_START_CONTROL && iControl < (int)(CONTROL_SETTINGS_START_CONTROL + m_settingControls.size())) + { + CSetting *setting = GetSettingControl(iControl)->GetSetting(); + if (setting != NULL) + { + if (setting->GetId() == SETTING_AUDIO_MAIN_BUTTON_MASTER) + OpenMenu(SETTING_AUDIO_CAT_MASTER); + else if (setting->GetId() == SETTING_AUDIO_MAIN_BUTTON_OUTPUT) + OpenMenu(SETTING_AUDIO_CAT_POST_PROCESS); + else if (setting->GetId() == SETTING_AUDIO_MAIN_BUTTON_RESAMPLE) + OpenMenu(SETTING_AUDIO_CAT_RESAMPLING); + else if (setting->GetId() == SETTING_AUDIO_MAIN_BUTTON_PRE_PROC) + OpenMenu(SETTING_AUDIO_CAT_PRE_PROCESS); + else if (setting->GetId() == SETTING_AUDIO_MAIN_BUTTON_MISC) + OpenMenu(SETTING_AUDIO_CAT_MISC); + else if (setting->GetId() == SETTING_AUDIO_MAIN_BUTTON_INFO) + { + SetupView(); + OpenMenu(SETTING_AUDIO_CAT_PROC_INFO); + m_GetCPUUsage = true; + } + else + { + if (setting->GetId().substr(0, 19) == SETTING_AUDIO_PROC_SETTINGS_MENUS) + OpenAudioDSPMenu(strtol(setting->GetId().substr(19).c_str(), NULL, 0)); + else if (setting->GetId().substr(0, 21) == SETTING_AUDIO_MASTER_SETTINGS_MENUS) + OpenAudioDSPMenu(strtol(setting->GetId().substr(21).c_str(), NULL, 0)); + else if (setting->GetId().substr(0, 27) == SETTING_STREAM_INFO_MODE_CPU_USAGE) + { + if (!OpenAudioDSPMenu(m_ActiveModesData[strtol(setting->GetId().substr(27).c_str(), NULL, 0)].MenuListPtr)) + CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(15031), g_localizeStrings.Get(416)); + } + } + } + } + break; + } + default: + break; + } + + return CGUIDialogSettingsManualBase::OnMessage(message); +} + +bool CGUIDialogAudioDSPSettings::OnBack(int actionID) +{ + // if the setting dialog is not a window but a dialog we need to close differently + int mainCategory = FindCategoryIndex(SETTING_AUDIO_CAT_MAIN); + if (m_iCategory == mainCategory) + return CGUIDialogSettingsManualBase::OnBack(actionID); + + m_MenuPositions[m_categories[m_iCategory]->GetId()] = GetFocusedControlID(); + if (!m_MenuHierarchy.empty()) + { + m_iCategory = m_MenuHierarchy.back(); + m_MenuHierarchy.pop_back(); + } + else + m_iCategory = mainCategory; + + if (m_iCategory == mainCategory) + SET_CONTROL_LABEL(CONTROL_SETTINGS_LABEL, g_localizeStrings.Get(15028)); + + CreateSettings(); + SET_CONTROL_FOCUS(m_MenuPositions[m_categories[m_iCategory]->GetId()], 0); + + return true; +} + +void CGUIDialogAudioDSPSettings::FrameMove() +{ + // update the volume setting if necessary + float newVolume = g_application.GetVolume(false); + if (newVolume != m_volume) + m_settingsManager->SetNumber(SETTING_AUDIO_MAIN_VOLUME, newVolume); + + if (g_application.m_pPlayer->HasPlayer()) + { + const CVideoSettings &videoSettings = CMediaSettings::Get().GetCurrentVideoSettings(); + + // these settings can change on the fly + if (SupportsAudioFeature(IPC_AUD_OFFSET)) + m_settingsManager->SetNumber(SETTING_AUDIO_POST_PROC_AUDIO_DELAY, videoSettings.m_AudioDelay); + + bool forceReload = false; + unsigned int streamId = CActiveAEDSP::Get().GetActiveStreamId(); + if (m_ActiveStreamId != streamId) + { + m_ActiveStreamId = streamId; + m_ActiveStreamProcess = CActiveAEDSP::Get().GetDSPProcess(m_ActiveStreamId); + if (m_ActiveStreamId == (unsigned int)-1 || !m_ActiveStreamProcess) + { + Close(true); + return; + } + forceReload = true; + } + + int modeUniqueId; + AE_DSP_BASETYPE usedBaseType; + AE_DSP_STREAMTYPE streamTypeUsed; + m_ActiveStreamProcess->GetMasterModeTypeInformation(streamTypeUsed, usedBaseType, modeUniqueId); + if (forceReload || m_baseTypeUsed != usedBaseType || m_streamTypeUsed != streamTypeUsed) + { + m_baseTypeUsed = usedBaseType; + m_streamTypeUsed = streamTypeUsed; + + /*! + * Update settings + */ + int selType = CMediaSettings::Get().GetCurrentAudioSettings().m_MasterStreamTypeSel; + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterModes[streamTypeUsed][usedBaseType] = modeUniqueId; + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterModes[selType][usedBaseType] = modeUniqueId; + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterStreamBase = usedBaseType; + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterStreamType = streamTypeUsed; + + m_settingsManager->SetInt(SETTING_AUDIO_MAIN_MODETYPE, modeUniqueId); + } + + // these settings can change on the fly + if (m_GetCPUUsage) + { + m_CPUUsage = StringUtils::Format("%.02f %%", m_ActiveStreamProcess->GetCPUUsage()); + m_settingsManager->SetString(SETTING_STREAM_INFO_CPU_USAGE, m_CPUUsage); + for (unsigned int i = 0; i < m_ActiveModes.size(); i++) + { + string settingId = StringUtils::Format("%s%i", SETTING_STREAM_INFO_MODE_CPU_USAGE, i); + m_ActiveModesData[i].CPUUsage = StringUtils::Format("%.02f %%", m_ActiveModes[i]->CPUUsage()); + m_settingsManager->SetString(settingId, m_ActiveModesData[i].CPUUsage); + } + } + } + + CGUIDialogSettingsManualBase::FrameMove(); +} + +std::string CGUIDialogAudioDSPSettings::FormatDelay(float value, float interval) +{ + if (fabs(value) < 0.5f * interval) + return StringUtils::Format(g_localizeStrings.Get(22003).c_str(), 0.0); + if (value < 0) + return StringUtils::Format(g_localizeStrings.Get(22004).c_str(), fabs(value)); + + return StringUtils::Format(g_localizeStrings.Get(22005).c_str(), value); +} + +std::string CGUIDialogAudioDSPSettings::FormatDecibel(float value) +{ + return StringUtils::Format(g_localizeStrings.Get(14054).c_str(), value); +} + +std::string CGUIDialogAudioDSPSettings::FormatPercentAsDecibel(float value) +{ + return StringUtils::Format(g_localizeStrings.Get(14054).c_str(), CAEUtil::PercentToGain(value)); +} + +void CGUIDialogAudioDSPSettings::OnSettingChanged(const CSetting *setting) +{ + if (setting == NULL) + return; + + CGUIDialogSettingsManualBase::OnSettingChanged(setting); + + CVideoSettings &videoSettings = CMediaSettings::Get().GetCurrentVideoSettings(); + const std::string &settingId = setting->GetId(); + if (settingId == SETTING_AUDIO_MAIN_STREAMTYPE) + { + int type = (AE_DSP_STREAMTYPE)static_cast<const CSettingInt*>(setting)->GetValue(); + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterStreamTypeSel = type; + if (type == AE_DSP_ASTREAM_AUTO) + type = m_ActiveStreamProcess->GetDetectedStreamType(); + + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterStreamType = type; + + /* Set the input stream type if any modes are available for this type */ + if (type >= AE_DSP_ASTREAM_BASIC && type < AE_DSP_ASTREAM_AUTO && !m_MasterModes[type].empty()) + { + /* Find the master mode id for the selected stream type if it was not known before */ + if (CMediaSettings::Get().GetCurrentAudioSettings().m_MasterModes[type][m_baseTypeUsed] < 0) + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterModes[type][m_baseTypeUsed] = m_MasterModes[type][0]->ModeID(); + + /* Switch now the master mode and stream type for audio dsp processing */ + m_ActiveStreamProcess->SetMasterMode((AE_DSP_STREAMTYPE)type, + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterModes[type][m_baseTypeUsed], + true); + } + else + { + CLog::Log(LOGERROR, "ActiveAE DSP Settings - %s - Change of audio stream type failed (type = %i)", __FUNCTION__, type); + } + } + else if (settingId == SETTING_AUDIO_MAIN_MODETYPE) + { + m_modeTypeUsed = static_cast<const CSettingInt*>(setting)->GetValue(); + if (m_ActiveStreamProcess->SetMasterMode(m_streamTypeUsed, m_modeTypeUsed)) + CMediaSettings::Get().GetCurrentAudioSettings().m_MasterModes[m_streamTypeUsed][m_baseTypeUsed] = m_modeTypeUsed; + } + else if (settingId == SETTING_AUDIO_MAIN_VOLUME) + { + m_volume = static_cast<float>(static_cast<const CSettingNumber*>(setting)->GetValue()); + g_application.SetVolume(m_volume, false); // false - value is not in percent + } + else if (settingId == SETTING_AUDIO_MAIN_VOLUME_AMPLIFICATION) + { + videoSettings.m_VolumeAmplification = static_cast<float>(static_cast<const CSettingNumber*>(setting)->GetValue()); + g_application.m_pPlayer->SetDynamicRangeCompression((long)(videoSettings.m_VolumeAmplification * 100)); + } + else if (settingId == SETTING_AUDIO_POST_PROC_AUDIO_DELAY) + { + videoSettings.m_AudioDelay = static_cast<float>(static_cast<const CSettingNumber*>(setting)->GetValue()); + g_application.m_pPlayer->SetAVDelay(videoSettings.m_AudioDelay); + } +} + +void CGUIDialogAudioDSPSettings::OnSettingAction(const CSetting *setting) +{ + if (setting == NULL) + return; + + CGUIDialogSettingsManualBase::OnSettingAction(setting); + + const std::string &settingId = setting->GetId(); + if (settingId == SETTING_AUDIO_MAIN_MAKE_DEFAULT) + Save(); +} + +void CGUIDialogAudioDSPSettings::Save() +{ + if (!g_passwordManager.CheckSettingLevelLock(SettingLevelExpert) && + CProfilesManager::Get().GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE) + return; + + // prompt user if they are sure + if (!CGUIDialogYesNo::ShowAndGetInput(12376, 750, 0, 12377)) + return; + + // reset the settings + CActiveAEDSPDatabase db; + if (!db.Open()) + return; + + db.EraseActiveDSPSettings(); + db.Close(); + + CMediaSettings::Get().GetDefaultAudioSettings() = CMediaSettings::Get().GetCurrentAudioSettings(); + CMediaSettings::Get().GetDefaultAudioSettings().m_MasterStreamType = AE_DSP_ASTREAM_AUTO; + CSettings::Get().Save(); +} + +void CGUIDialogAudioDSPSettings::SetupView() +{ + CGUIDialogSettingsManualBase::SetupView(); + SET_CONTROL_LABEL(CONTROL_SETTINGS_LABEL, g_localizeStrings.Get(15028)); +} + +void CGUIDialogAudioDSPSettings::InitializeSettings() +{ + CGUIDialogSettingsManualBase::InitializeSettings(); + + CSettingCategory *category = AddCategory(SETTING_AUDIO_CAT_MAIN, -1); + if (category == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings category 'audiodspmainsettings'"); + return; + } + + // get all necessary setting groups + CSettingGroup *groupAudioModeSel = AddGroup(category); + if (groupAudioModeSel == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupAudioModeSel'"); + return; + } + CSettingGroup *groupAudioVolumeSel = AddGroup(category); + if (groupAudioVolumeSel == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupAudioVolumeSel'"); + return; + } + CSettingGroup *groupAudioSubmenuSel = AddGroup(category); + if (groupAudioSubmenuSel == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupAudioSubmenuSel'"); + return; + } + CSettingGroup *groupSaveAsDefault = AddGroup(category); + if (groupSaveAsDefault == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupSaveAsDefault'"); + return; + } + + bool usePopup = g_SkinInfo->HasSkinFile("DialogSlider.xml"); + + CVideoSettings &videoSettings = CMediaSettings::Get().GetCurrentVideoSettings(); + + m_audioCaps.clear(); + if (g_application.m_pPlayer->HasPlayer()) + g_application.m_pPlayer->GetAudioCapabilities(m_audioCaps); + + m_ActiveStreamId = CActiveAEDSP::Get().GetActiveStreamId(); + m_ActiveStreamProcess = CActiveAEDSP::Get().GetDSPProcess(m_ActiveStreamId); + if (m_ActiveStreamId == (unsigned int)-1 || !m_ActiveStreamProcess) + { + m_iCategory = FindCategoryIndex(SETTING_AUDIO_CAT_MAIN); + Close(true); + return; + } + + int modeUniqueId; + m_ActiveStreamProcess->GetMasterModeTypeInformation(m_streamTypeUsed, m_baseTypeUsed, modeUniqueId); + + int modesAvailable = 0; + for (int i = 0; i < AE_DSP_ASTREAM_AUTO; i++) + { + m_MasterModes[i].clear(); + m_ActiveStreamProcess->GetAvailableMasterModes((AE_DSP_STREAMTYPE)i, m_MasterModes[i]); + if (!m_MasterModes[i].empty()) modesAvailable++; + } + + if (modesAvailable > 0) + { + /* about size() > 1, it is always the fallback (ignore of master processing) present. */ + StaticIntegerSettingOptions modeEntries; + if (m_MasterModes[AE_DSP_ASTREAM_BASIC].size() > 1) + modeEntries.push_back(pair<int, int>(CActiveAEDSP::Get().GetStreamTypeName(AE_DSP_ASTREAM_BASIC), AE_DSP_ASTREAM_BASIC)); + if (m_MasterModes[AE_DSP_ASTREAM_MUSIC].size() > 1) + modeEntries.push_back(pair<int, int>(CActiveAEDSP::Get().GetStreamTypeName(AE_DSP_ASTREAM_MUSIC), AE_DSP_ASTREAM_MUSIC)); + if (m_MasterModes[AE_DSP_ASTREAM_MOVIE].size() > 1) + modeEntries.push_back(pair<int, int>(CActiveAEDSP::Get().GetStreamTypeName(AE_DSP_ASTREAM_MOVIE), AE_DSP_ASTREAM_MOVIE)); + if (m_MasterModes[AE_DSP_ASTREAM_GAME].size() > 1) + modeEntries.push_back(pair<int, int>(CActiveAEDSP::Get().GetStreamTypeName(AE_DSP_ASTREAM_GAME), AE_DSP_ASTREAM_GAME)); + if (m_MasterModes[AE_DSP_ASTREAM_APP].size() > 1) + modeEntries.push_back(pair<int, int>(CActiveAEDSP::Get().GetStreamTypeName(AE_DSP_ASTREAM_APP), AE_DSP_ASTREAM_APP)); + if (m_MasterModes[AE_DSP_ASTREAM_MESSAGE].size() > 1) + modeEntries.push_back(pair<int, int>(CActiveAEDSP::Get().GetStreamTypeName(AE_DSP_ASTREAM_MESSAGE), AE_DSP_ASTREAM_MESSAGE)); + if (m_MasterModes[AE_DSP_ASTREAM_PHONE].size() > 1) + modeEntries.push_back(pair<int, int>(CActiveAEDSP::Get().GetStreamTypeName(AE_DSP_ASTREAM_PHONE), AE_DSP_ASTREAM_PHONE)); + if (modesAvailable > 1 && m_MasterModes[m_streamTypeUsed].size() > 1) + modeEntries.insert(modeEntries.begin(), pair<int, int>(CActiveAEDSP::Get().GetStreamTypeName(AE_DSP_ASTREAM_AUTO), AE_DSP_ASTREAM_AUTO)); + + AddSpinner(groupAudioModeSel, + SETTING_AUDIO_MAIN_STREAMTYPE, 15021, 0, + (AE_DSP_STREAMTYPE)CMediaSettings::Get().GetCurrentAudioSettings().m_MasterStreamTypeSel, + modeEntries); + } + + bool AddonMasterModeSetupPresent = false; + m_ModeList.clear(); + for (unsigned int i = 0; i < m_MasterModes[m_streamTypeUsed].size(); i++) + { + if (m_MasterModes[m_streamTypeUsed][i]) + { + AE_DSP_ADDON addon; + int modeId = m_MasterModes[m_streamTypeUsed][i]->ModeID(); + if (modeId == AE_DSP_MASTER_MODE_ID_PASSOVER || modeId >= AE_DSP_MASTER_MODE_ID_INTERNAL_TYPES) + { + m_ModeList.push_back(make_pair(g_localizeStrings.Get(m_MasterModes[m_streamTypeUsed][i]->ModeName()), modeId)); + } + else if (CActiveAEDSP::Get().GetAudioDSPAddon(m_MasterModes[m_streamTypeUsed][i]->AddonID(), addon)) + { + m_ModeList.push_back(make_pair(addon->GetString(m_MasterModes[m_streamTypeUsed][i]->ModeName()), modeId)); + if (!AddonMasterModeSetupPresent) + AddonMasterModeSetupPresent = m_MasterModes[m_streamTypeUsed][i]->HasSettingsDialog(); + } + } + } + + m_modeTypeUsed = CMediaSettings::Get().GetCurrentAudioSettings().m_MasterModes[m_streamTypeUsed][m_baseTypeUsed]; + CSettingInt *spinner = AddSpinner(groupAudioModeSel, SETTING_AUDIO_MAIN_MODETYPE, 15022, 0, m_modeTypeUsed, AudioModeOptionFiller); + spinner->SetOptionsFiller(AudioModeOptionFiller, this); + + ///----------------------- + + // audio settings + // audio volume setting + m_volume = g_application.GetVolume(false); + if (!g_windowManager.IsWindowActive(WINDOW_DIALOG_AUDIO_OSD_SETTINGS)) + { + CSettingNumber *settingAudioVolume = AddSlider(groupAudioVolumeSel, SETTING_AUDIO_MAIN_VOLUME, 13376, 0, m_volume, 14054, VOLUME_MINIMUM, VOLUME_MAXIMUM / 100.0f, VOLUME_MAXIMUM); + static_cast<CSettingControlSlider*>(settingAudioVolume->GetControl())->SetFormatter(SettingFormatterPercentAsDecibel); + } + + // audio volume amplification setting + if (SupportsAudioFeature(IPC_AUD_AMP)) + AddSlider(groupAudioVolumeSel, SETTING_AUDIO_MAIN_VOLUME_AMPLIFICATION, 660, 0, videoSettings.m_VolumeAmplification, 14054, VOLUME_DRC_MINIMUM * 0.01f, (VOLUME_DRC_MAXIMUM - VOLUME_DRC_MINIMUM) / 6000.0f, VOLUME_DRC_MAXIMUM * 0.01f); + + ///----------------------- + + AddButton(groupAudioSubmenuSel, SETTING_AUDIO_MAIN_BUTTON_MASTER, 15025, 0, false, AddonMasterModeSetupPresent, -1); + AddButton(groupAudioSubmenuSel, SETTING_AUDIO_MAIN_BUTTON_OUTPUT, 15026, 0, false, HaveActiveMenuHooks(AE_DSP_MENUHOOK_POST_PROCESS) || SupportsAudioFeature(IPC_AUD_OFFSET), -1); + AddButton(groupAudioSubmenuSel, SETTING_AUDIO_MAIN_BUTTON_RESAMPLE, 15033, 0, false, HaveActiveMenuHooks(AE_DSP_MENUHOOK_RESAMPLE), -1); + AddButton(groupAudioSubmenuSel, SETTING_AUDIO_MAIN_BUTTON_PRE_PROC, 15039, 0, false, HaveActiveMenuHooks(AE_DSP_MENUHOOK_PRE_PROCESS), -1); + AddButton(groupAudioSubmenuSel, SETTING_AUDIO_MAIN_BUTTON_MISC, 15034, 0, false, HaveActiveMenuHooks(AE_DSP_MENUHOOK_MISCELLANEOUS), -1); + AddButton(groupAudioSubmenuSel, SETTING_AUDIO_MAIN_BUTTON_INFO, 15027, 0, false, true, -1); + + ///----------------------- + + AddButton(groupSaveAsDefault, SETTING_AUDIO_MAIN_MAKE_DEFAULT, 12376, 0); + + m_Menus.clear(); + + /** + * Audio Master mode settings Dialog init + */ + { + CSettingCategory *categoryMaster = AddCategory(SETTING_AUDIO_CAT_MASTER, -1); + if (categoryMaster == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings category 'audiodspmastersettings'"); + return; + } + + CSettingGroup *groupMasterMode = AddGroup(categoryMaster); + if (groupMasterMode == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupMasterMode'"); + return; + } + + for (unsigned int i = 0; i < m_MasterModes[m_streamTypeUsed].size(); i++) + { + if (m_MasterModes[m_streamTypeUsed][i]->HasSettingsDialog()) + { + AE_DSP_ADDON addon; + if (CActiveAEDSP::Get().GetAudioDSPAddon(m_MasterModes[m_streamTypeUsed][i]->AddonID(), addon)) + { + AE_DSP_MENUHOOKS hooks; + if (CActiveAEDSP::Get().GetMenuHooks(m_MasterModes[m_streamTypeUsed][i]->AddonID(), AE_DSP_MENUHOOK_MASTER_PROCESS, hooks)) + { + for (unsigned int j = 0; j < hooks.size(); j++) + { + if (hooks[j].iRelevantModeId != m_MasterModes[m_streamTypeUsed][i]->AddonModeNumber()) + continue; + + MenuHookMember menu; + menu.addonId = m_MasterModes[m_streamTypeUsed][i]->AddonID(); + menu.hook.category = hooks[j].category; + menu.hook.iHookId = hooks[j].iHookId; + menu.hook.iLocalizedStringId = hooks[j].iLocalizedStringId; + menu.hook.iRelevantModeId = hooks[j].iRelevantModeId; + m_Menus.push_back(menu); + + string setting = StringUtils::Format("%s%i", SETTING_AUDIO_MASTER_SETTINGS_MENUS, (int)m_Menus.size()-1); + AddButton(groupMasterMode, setting, 15041, 0); + break; + } + } + } + } + } + } + + /** + * Audio post processing settings Dialog init + */ + { + CSettingCategory *category = AddCategory(SETTING_AUDIO_CAT_POST_PROCESS, -1); + if (category == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings category 'audiodsppostsettings'"); + return; + } + + CSettingGroup *groupInternal = AddGroup(category); + if (groupInternal == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupInternal'"); + return; + } + + CSettingGroup *groupAddon = AddGroup(category); + if (groupAddon == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupAddon'"); + return; + } + + // audio delay setting + if (SupportsAudioFeature(IPC_AUD_OFFSET)) + { + CSettingNumber *settingAudioDelay = AddSlider(groupInternal, SETTING_AUDIO_POST_PROC_AUDIO_DELAY, 297, 0, videoSettings.m_AudioDelay, 0, -g_advancedSettings.m_videoAudioDelayRange, 0.025f, g_advancedSettings.m_videoAudioDelayRange, -1, usePopup); + static_cast<CSettingControlSlider*>(settingAudioDelay->GetControl())->SetFormatter(SettingFormatterDelay); + } + GetAudioDSPMenus(groupAddon, AE_DSP_MENUHOOK_POST_PROCESS); + } + + /** + * Audio add-on resampling setting dialog's + */ + { + CSettingCategory *category = AddCategory(SETTING_AUDIO_CAT_RESAMPLING, -1); + if (category == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings category 'audiodspresamplesettings'"); + return; + } + CSettingGroup *group = AddGroup(category); + if (group == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'group'"); + return; + } + GetAudioDSPMenus(group, AE_DSP_MENUHOOK_RESAMPLE); + } + + /** + * Audio add-on's pre processing setting dialog's + */ + { + CSettingCategory *category = AddCategory(SETTING_AUDIO_CAT_PRE_PROCESS, -1); + if (category == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings category 'audiodsppresettings'"); + return; + } + CSettingGroup *group = AddGroup(category); + if (group == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'group'"); + return; + } + GetAudioDSPMenus(group, AE_DSP_MENUHOOK_PRE_PROCESS); + } + + /** + * Audio add-on's miscellaneous setting dialog's + */ + { + CSettingCategory *category = AddCategory(SETTING_AUDIO_CAT_MISC, -1); + if (category == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings category 'audiodspmiscsettings'"); + return; + } + CSettingGroup *group = AddGroup(category); + if (group == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'group'"); + return; + } + GetAudioDSPMenus(group, AE_DSP_MENUHOOK_MISCELLANEOUS); + } + + /** + * Audio Information Dialog init + */ + { + CSettingGroup *group; + CSettingCategory *category = AddCategory(SETTING_AUDIO_CAT_PROC_INFO, -1); + if (category == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings category 'audiodspprocinfo'"); + return; + } + + m_ActiveModes.clear(); + m_ActiveStreamProcess->GetActiveModes(AE_DSP_MODE_TYPE_UNDEFINED, m_ActiveModes); + m_ActiveModesData.resize(m_ActiveModes.size()); + + group = AddGroup(category, 15089); + if (group == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group for '%s'", g_localizeStrings.Get(15089).c_str()); + return; + } + m_InputChannels = StringUtils::Format("%i", m_ActiveStreamProcess->GetInputChannels()); + AddInfoLabelButton(group, SETTING_STREAM_INFO_INPUT_CHANNELS, 21444, 0, m_InputChannels); + m_InputChannelNames = m_ActiveStreamProcess->GetInputChannelNames(); + AddInfoLabelButton(group, SETTING_STREAM_INFO_INPUT_CHANNEL_NAMES, 15091, 0, m_InputChannelNames); + m_InputSamplerate = StringUtils::Format("%i Hz", (int)m_ActiveStreamProcess->GetInputSamplerate()); + AddInfoLabelButton(group, SETTING_STREAM_INFO_INPUT_SAMPLERATE, 613, 0, m_InputSamplerate); + + group = AddGroup(category, 15090); + if (group == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group for '%s'", g_localizeStrings.Get(15090).c_str()); + return; + } + m_OutputChannels = StringUtils::Format("%i", m_ActiveStreamProcess->GetOutputChannels()); + AddInfoLabelButton(group, SETTING_STREAM_INFO_OUTPUT_CHANNELS, 21444, 0, m_OutputChannels); + m_OutputChannelNames = m_ActiveStreamProcess->GetOutputChannelNames(); + AddInfoLabelButton(group, SETTING_STREAM_INFO_OUTPUT_CHANNEL_NAMES, 15091, 0, m_OutputChannelNames); + m_OutputSamplerate = StringUtils::Format("%i Hz", (int)m_ActiveStreamProcess->GetOutputSamplerate()); + AddInfoLabelButton(group, SETTING_STREAM_INFO_OUTPUT_SAMPLERATE, 613, 0, m_OutputSamplerate); + + group = AddGroup(category, 15081); + if (group == NULL) + { + CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group for '%s'", g_localizeStrings.Get(15081).c_str()); + return; + } + m_CPUUsage = StringUtils::Format("%.02f %%", m_ActiveStreamProcess->GetCPUUsage()); + AddInfoLabelButton(group, SETTING_STREAM_INFO_CPU_USAGE, 15092, 0, m_CPUUsage); + + bool foundPreProcess = false, foundPostProcess = false; + for (unsigned int i = 0; i < m_ActiveModes.size(); i++) + { + AE_DSP_ADDON addon; + if (CActiveAEDSP::Get().GetAudioDSPAddon(m_ActiveModes[i]->AddonID(), addon)) + { + std::string label; + switch (m_ActiveModes[i]->ModeType()) + { + case AE_DSP_MODE_TYPE_INPUT_RESAMPLE: + group = AddGroup(category, 15087, -1, true, true); + label = StringUtils::Format(g_localizeStrings.Get(15082).c_str(), m_ActiveStreamProcess->GetProcessSamplerate()); + break; + case AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE: + group = AddGroup(category, 15088, -1, true, true); + label = StringUtils::Format(g_localizeStrings.Get(15083).c_str(), m_ActiveStreamProcess->GetOutputSamplerate()); + break; + case AE_DSP_MODE_TYPE_MASTER_PROCESS: + group = AddGroup(category, 15084, -1, true, true); + label = addon->GetString(m_ActiveModes[i]->ModeName()); + break; + case AE_DSP_MODE_TYPE_PRE_PROCESS: + if (!foundPreProcess) + { + foundPreProcess = true; + group = AddGroup(category, 15085, -1, true, true); + } + label = addon->GetString(m_ActiveModes[i]->ModeName()); + break; + case AE_DSP_MODE_TYPE_POST_PROCESS: + if (!foundPostProcess) + { + foundPostProcess = true; + group = AddGroup(category, 15086, -1, true, true); + } + label = addon->GetString(m_ActiveModes[i]->ModeName()); + break; + default: + { + label += addon->GetString(m_ActiveModes[i]->ModeName()); + label += " - "; + label += addon->GetFriendlyName(); + } + }; + m_ActiveModesData[i].CPUUsage = StringUtils::Format("%.02f %%", m_ActiveModes[i]->CPUUsage()); + + MenuHookMember menu; + menu.addonId = -1; + + AE_DSP_MENUHOOKS hooks; + m_ActiveModesData[i].MenuListPtr = -1; + if (CActiveAEDSP::Get().GetMenuHooks(m_ActiveModes[i]->AddonID(), AE_DSP_MENUHOOK_INFORMATION, hooks)) + { + for (unsigned int j = 0; j < hooks.size(); j++) + { + if (hooks[j].iRelevantModeId != m_ActiveModes[i]->AddonModeNumber()) + continue; + + menu.addonId = m_ActiveModes[i]->AddonID(); + menu.hook.category = hooks[j].category; + menu.hook.iHookId = hooks[j].iHookId; + menu.hook.iLocalizedStringId = hooks[j].iLocalizedStringId; + menu.hook.iRelevantModeId = hooks[j].iRelevantModeId; + m_Menus.push_back(menu); + m_ActiveModesData[i].MenuListPtr = m_Menus.size()-1; + label += " ..."; + break; + } + } + m_ActiveModesData[i].MenuName = label; + + string settingId = StringUtils::Format("%s%i", SETTING_STREAM_INFO_MODE_CPU_USAGE, i); + AddInfoLabelButton(group, settingId, 15041, 0, m_ActiveModesData[i].CPUUsage); + } + } + } +} + +bool CGUIDialogAudioDSPSettings::SupportsAudioFeature(int feature) +{ + for (Features::iterator itr = m_audioCaps.begin(); itr != m_audioCaps.end(); ++itr) + { + if (*itr == feature || *itr == IPC_AUD_ALL) + return true; + } + + return false; +} + +void CGUIDialogAudioDSPSettings::AudioModeOptionFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t, void *data) +{ + CGUIDialogAudioDSPSettings *dialog = (CGUIDialogAudioDSPSettings *)data; + list = dialog->m_ModeList; + + if (list.empty()) + { + list.push_back(make_pair(g_localizeStrings.Get(231), -1)); + current = -1; + } +} + +std::string CGUIDialogAudioDSPSettings::SettingFormatterDelay(const CSettingControlSlider *control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum) +{ + if (!value.isDouble()) + return ""; + + float fValue = value.asFloat(); + float fStep = step.asFloat(); + + if (fabs(fValue) < 0.5f * fStep) + return StringUtils::Format(g_localizeStrings.Get(22003).c_str(), 0.0); + if (fValue < 0) + return StringUtils::Format(g_localizeStrings.Get(22004).c_str(), fabs(fValue)); + + return StringUtils::Format(g_localizeStrings.Get(22005).c_str(), fValue); +} + +std::string CGUIDialogAudioDSPSettings::SettingFormatterPercentAsDecibel(const CSettingControlSlider *control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum) +{ + if (control == NULL || !value.isDouble()) + return ""; + + std::string formatString = control->GetFormatString(); + if (control->GetFormatLabel() > -1) + formatString = g_localizeStrings.Get(control->GetFormatLabel()); + + return StringUtils::Format(formatString.c_str(), CAEUtil::PercentToGain(value.asFloat())); +} + +bool CGUIDialogAudioDSPSettings::HaveActiveMenuHooks(AE_DSP_MENUHOOK_CAT category) +{ + /*!> Check menus are active on current stream */ + AE_DSP_ADDONMAP addonMap; + if (CActiveAEDSP::Get().HaveMenuHooks(category) && + CActiveAEDSP::Get().GetEnabledAudioDSPAddons(addonMap) > 0) + { + for (AE_DSP_ADDONMAP_ITR itr = addonMap.begin(); itr != addonMap.end(); itr++) + { + AE_DSP_MENUHOOKS hooks; + if (CActiveAEDSP::Get().GetMenuHooks(itr->second->GetID(), category, hooks)) + { + for (unsigned int i = 0; i < hooks.size(); i++) + { + if (category != AE_DSP_MENUHOOK_MISCELLANEOUS && + !m_ActiveStreamProcess->IsMenuHookModeActive(hooks[i].category, itr->second->GetID(), hooks[i].iRelevantModeId)) + continue; + + return true; + } + } + } + } + + return false; +} + +string CGUIDialogAudioDSPSettings::GetSettingsLabel(CSetting *pSetting) +{ + if (pSetting->GetLabel() == 15041) + { + const std::string &settingId = pSetting->GetId(); + + int ptr = -1; + AE_DSP_ADDON addon; + if (settingId.substr(0, 27) == SETTING_STREAM_INFO_MODE_CPU_USAGE) + { + ptr = strtol(settingId.substr(27).c_str(), NULL, 0); + if (ptr >= 0 && CActiveAEDSP::Get().GetAudioDSPAddon(m_ActiveModes[ptr]->AddonID(), addon)) + return m_ActiveModesData[ptr].MenuName; + } + else + { + if (settingId.substr(0, 21) == SETTING_AUDIO_MASTER_SETTINGS_MENUS) + ptr = strtol(settingId.substr(21).c_str(), NULL, 0); + else if (settingId.substr(0, 19) == SETTING_AUDIO_PROC_SETTINGS_MENUS) + ptr = strtol(settingId.substr(19).c_str(), NULL, 0); + + if (ptr >= 0 && CActiveAEDSP::Get().GetAudioDSPAddon(m_Menus[ptr].addonId, addon)) + return addon->GetString(m_Menus[ptr].hook.iLocalizedStringId); + } + } + + return GetLocalizedString(pSetting->GetLabel()); +} + +void CGUIDialogAudioDSPSettings::GetAudioDSPMenus(CSettingGroup *group, AE_DSP_MENUHOOK_CAT category) +{ + AE_DSP_ADDONMAP addonMap; + if (CActiveAEDSP::Get().GetEnabledAudioDSPAddons(addonMap) > 0) + { + for (AE_DSP_ADDONMAP_ITR itr = addonMap.begin(); itr != addonMap.end(); itr++) + { + AE_DSP_MENUHOOKS hooks; + if (CActiveAEDSP::Get().GetMenuHooks(itr->second->GetID(), category, hooks)) + { + for (unsigned int i = 0; i < hooks.size(); i++) + { + if (category != hooks[i].category || (category != AE_DSP_MENUHOOK_MISCELLANEOUS && + !m_ActiveStreamProcess->IsMenuHookModeActive(hooks[i].category, itr->second->GetID(), hooks[i].iRelevantModeId))) + continue; + + MenuHookMember menu; + menu.addonId = itr->second->GetID(); + menu.hook.category = hooks[i].category; + menu.hook.iHookId = hooks[i].iHookId; + menu.hook.iLocalizedStringId = hooks[i].iLocalizedStringId; + menu.hook.iRelevantModeId = hooks[i].iRelevantModeId; + m_Menus.push_back(menu); + } + } + } + } + + for (unsigned int i = 0; i < m_Menus.size(); i++) + { + AE_DSP_ADDON addon; + if (CActiveAEDSP::Get().GetAudioDSPAddon(m_Menus[i].addonId, addon) && category == m_Menus[i].hook.category) + { + std::string modeName = addon->GetString(m_Menus[i].hook.iLocalizedStringId); + if (modeName.empty()) + modeName = g_localizeStrings.Get(15041); + + string setting = StringUtils::Format("%s%i", SETTING_AUDIO_PROC_SETTINGS_MENUS, i); + AddButton(group, setting, 15041, 0); + } + } +} + +bool CGUIDialogAudioDSPSettings::OpenAudioDSPMenu(unsigned int setupEntry) +{ + if (setupEntry >= m_Menus.size()) + return false; + + AE_DSP_ADDON addon; + if (!CActiveAEDSP::Get().GetAudioDSPAddon(m_Menus[setupEntry].addonId, addon)) + return false; + + AE_DSP_MENUHOOK hook; + AE_DSP_MENUHOOK_DATA hookData; + + hook.category = m_Menus[setupEntry].hook.category; + hook.iHookId = m_Menus[setupEntry].hook.iHookId; + hook.iLocalizedStringId = m_Menus[setupEntry].hook.iLocalizedStringId; + hook.iRelevantModeId = m_Menus[setupEntry].hook.iRelevantModeId; + hookData.category = m_Menus[setupEntry].hook.category; + switch (hookData.category) + { + case AE_DSP_MENUHOOK_PRE_PROCESS: + case AE_DSP_MENUHOOK_MASTER_PROCESS: + case AE_DSP_MENUHOOK_RESAMPLE: + case AE_DSP_MENUHOOK_POST_PROCESS: + hookData.data.iStreamId = m_ActiveStreamId; + break; + default: + break; + } + + /*! + * @note the addon dialog becomes always opened on the back of Kodi ones for this reason a + * "<animation effect="fade" start="100" end="0" time="400" condition="Window.IsVisible(Addon)">Conditional</animation>" + * on skin is needed to hide dialog. + */ + addon->CallMenuHook(hook, hookData); + + return true; +} diff --git a/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.h b/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.h new file mode 100644 index 0000000000..a488f302ec --- /dev/null +++ b/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.h @@ -0,0 +1,112 @@ +#pragma once +/* + * Copyright (C) 2005-2015 Team KODI + * http://kodi.tv + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with KODI; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h" +#include "settings/dialogs/GUIDialogSettingsManualBase.h" + +namespace ActiveAE +{ + class CGUIDialogAudioDSPSettings : public CGUIDialogSettingsManualBase + { + public: + CGUIDialogAudioDSPSettings(); + virtual ~CGUIDialogAudioDSPSettings(); + + // specializations of CGUIControl + virtual bool OnMessage(CGUIMessage &message); + virtual bool OnBack(int actionID); + + // specialization of CGUIWindow + virtual void FrameMove(); + + static std::string FormatDelay(float value, float interval); + static std::string FormatDecibel(float value); + static std::string FormatPercentAsDecibel(float value); + + protected: + // implementations of ISettingCallback + virtual void OnSettingChanged(const CSetting *setting); + virtual void OnSettingAction(const CSetting *setting); + + // specialization of CGUIDialogSettingsBase + virtual bool AllowResettingSettings() const { return false; } + virtual void Save(); + virtual void SetupView(); + + // specialization of CGUIDialogSettingsManualBase + virtual void InitializeSettings(); + + bool SupportsAudioFeature(int feature); + + static void AudioModeOptionFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t, void *data); + + static std::string SettingFormatterDelay(const CSettingControlSlider *control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum); + static std::string SettingFormatterPercentAsDecibel(const CSettingControlSlider *control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum); + + std::string GetSettingsLabel(CSetting *pSetting); + + private: + typedef struct + { + int addonId; + AE_DSP_MENUHOOK hook; + } MenuHookMember; + typedef struct + { + std::string MenuName; + int MenuListPtr; + std::string CPUUsage; + } ActiveModeData; + typedef std::vector<int> Features; + + void OpenMenu(const std::string &id); + bool HaveActiveMenuHooks(AE_DSP_MENUHOOK_CAT category); + void GetAudioDSPMenus(CSettingGroup *group, AE_DSP_MENUHOOK_CAT category); + bool OpenAudioDSPMenu(unsigned int setupEntry); + int FindCategoryIndex(const std::string &catId); + + AE_DSP_STREAM_ID m_ActiveStreamId; /*!< The on dialog selectable stream identifier */ + ActiveAE::CActiveAEDSPProcessPtr m_ActiveStreamProcess; /*!< On dialog adjustable dsp processing class */ + AE_DSP_STREAMTYPE m_streamTypeUsed; /*!< The currently available stream type */ + AE_DSP_BASETYPE m_baseTypeUsed; /*!< The currently detected and used base type */ + int m_modeTypeUsed; /*!< The currently selected mode type */ + std::vector<ActiveAE::CActiveAEDSPModePtr> m_ActiveModes; /*!< The process modes currently active on dsp processing stream */ + std::vector<ActiveModeData> m_ActiveModesData; /*!< The process modes currently active on dsp processing stream info*/ + std::vector<ActiveAE::CActiveAEDSPModePtr> m_MasterModes[AE_DSP_ASTREAM_MAX]; /*!< table about selectable and usable master processing modes */ + std::map<std::string, int> m_MenuPositions; /*!< The differnet menu selection positions */ + std::vector<int> m_MenuHierarchy; /*!< Menu selection flow hierachy */ + std::vector<MenuHookMember> m_Menus; /*!< storage about present addon menus on currently selected submenu */ + std::vector< std::pair<std::string, int> > m_ModeList; /*!< currently present modes */ + bool m_GetCPUUsage; /*!< if true cpu usage detection is active */ + Features m_audioCaps; /*!< the on current playback on KODI supported audio features */ + int m_MenuName; /*!< current menu name, needed to get after the dialog was closed for addon */ + + /*! Settings control selection and information data */ + std::string m_InputChannels; + std::string m_InputChannelNames; + std::string m_InputSamplerate; + std::string m_OutputChannels; + std::string m_OutputChannelNames; + std::string m_OutputSamplerate; + std::string m_CPUUsage; + float m_volume; + }; +} diff --git a/xbmc/settings/dialogs/Makefile b/xbmc/settings/dialogs/Makefile index 0e4c899e35..101682c678 100644 --- a/xbmc/settings/dialogs/Makefile +++ b/xbmc/settings/dialogs/Makefile @@ -1,4 +1,5 @@ SRCS=GUIDialogAudioDSPManager.cpp \ + GUIDialogAudioDSPSettings.cpp \ GUIDialogContentSettings.cpp \ GUIDialogSettingsBase.cpp \ GUIDialogSettingsManagerBase.cpp \ diff --git a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp index a4e4744a58..56c367652b 100644 --- a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp +++ b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp @@ -30,6 +30,7 @@ #include "dialogs/GUIDialogYesNo.h" #include "filesystem/File.h" #include "guilib/LocalizeStrings.h" +#include "guilib/GUIWindowManager.h" #include "profiles/ProfilesManager.h" #include "settings/AdvancedSettings.h" #include "settings/MediaSettings.h" @@ -52,6 +53,7 @@ #define SETTING_AUDIO_STREAM "audio.stream" #define SETTING_AUDIO_OUTPUT_TO_ALL_SPEAKERS "audio.outputtoallspeakers" #define SETTING_AUDIO_PASSTHROUGH "audio.digitalanalog" +#define SETTING_AUDIO_DSP "audio.dsp" #define SETTING_SUBTITLE_ENABLE "subtitles.enable" #define SETTING_SUBTITLE_DELAY "subtitles.delay" @@ -62,7 +64,8 @@ CGUIDialogAudioSubtitleSettings::CGUIDialogAudioSubtitleSettings() : CGUIDialogSettingsManualBase(WINDOW_DIALOG_AUDIO_OSD_SETTINGS, "VideoOSDSettings.xml"), - m_passthrough(false) + m_passthrough(false), + m_dspEnabled(false) { } CGUIDialogAudioSubtitleSettings::~CGUIDialogAudioSubtitleSettings() @@ -80,9 +83,12 @@ void CGUIDialogAudioSubtitleSettings::FrameMove() const CVideoSettings &videoSettings = CMediaSettings::Get().GetCurrentVideoSettings(); // these settings can change on the fly - m_settingsManager->SetNumber(SETTING_AUDIO_DELAY, videoSettings.m_AudioDelay); // TODO (needs special handling): m_settingsManager->SetInt(SETTING_AUDIO_STREAM, g_application.m_pPlayer->GetAudioStream()); - m_settingsManager->SetBool(SETTING_AUDIO_OUTPUT_TO_ALL_SPEAKERS, videoSettings.m_OutputToAllSpeakers); + if (!m_dspEnabled) //< The follow settings are on enabled DSP system separated to them and need no update here. + { + m_settingsManager->SetNumber(SETTING_AUDIO_DELAY, videoSettings.m_AudioDelay); + m_settingsManager->SetBool(SETTING_AUDIO_OUTPUT_TO_ALL_SPEAKERS, videoSettings.m_OutputToAllSpeakers); + } m_settingsManager->SetBool(SETTING_AUDIO_PASSTHROUGH, CSettings::Get().GetBool("audiooutput.passthrough")); // TODO: m_settingsManager->SetBool(SETTING_SUBTITLE_ENABLE, g_application.m_pPlayer->GetSubtitleVisible()); @@ -183,7 +189,11 @@ void CGUIDialogAudioSubtitleSettings::OnSettingAction(const CSetting *setting) CGUIDialogSettingsManualBase::OnSettingAction(setting); const std::string &settingId = setting->GetId(); - if (settingId == SETTING_SUBTITLE_BROWSER) + if (settingId == SETTING_AUDIO_DSP) + { + g_windowManager.ActivateWindow(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS); + } + else if (settingId == SETTING_SUBTITLE_BROWSER) { std::string strPath; if (URIUtils::IsInRAR(g_application.CurrentFileItem().GetPath()) || URIUtils::IsInZIP(g_application.CurrentFileItem().GetPath())) @@ -303,7 +313,9 @@ void CGUIDialogAudioSubtitleSettings::InitializeSettings() ->Add(CSettingDependencyConditionPtr(new CSettingDependencyCondition("IsPlayingPassthrough", "", "", true, m_settingsManager))); SettingDependencies depsAudioOutputPassthroughDisabled; depsAudioOutputPassthroughDisabled.push_back(dependencyAudioOutputPassthroughDisabled); - + + m_dspEnabled = CSettings::Get().GetBool("audiooutput.dspaddonsenabled"); + // audio settings // audio volume setting m_volume = g_application.GetVolume(false); @@ -311,15 +323,18 @@ void CGUIDialogAudioSubtitleSettings::InitializeSettings() settingAudioVolume->SetDependencies(depsAudioOutputPassthroughDisabled); static_cast<CSettingControlSlider*>(settingAudioVolume->GetControl())->SetFormatter(SettingFormatterPercentAsDecibel); + if (m_dspEnabled) + AddButton(groupAudio, SETTING_AUDIO_DSP, 24136, 0); + // audio volume amplification setting - if (SupportsAudioFeature(IPC_AUD_AMP)) + if (SupportsAudioFeature(IPC_AUD_AMP) && !m_dspEnabled) { CSettingNumber *settingAudioVolumeAmplification = AddSlider(groupAudio, SETTING_AUDIO_VOLUME_AMPLIFICATION, 660, 0, videoSettings.m_VolumeAmplification, 14054, VOLUME_DRC_MINIMUM * 0.01f, (VOLUME_DRC_MAXIMUM - VOLUME_DRC_MINIMUM) / 6000.0f, VOLUME_DRC_MAXIMUM * 0.01f); settingAudioVolumeAmplification->SetDependencies(depsAudioOutputPassthroughDisabled); } // audio delay setting - if (SupportsAudioFeature(IPC_AUD_OFFSET)) + if (SupportsAudioFeature(IPC_AUD_OFFSET) && !m_dspEnabled) { CSettingNumber *settingAudioDelay = AddSlider(groupAudio, SETTING_AUDIO_DELAY, 297, 0, videoSettings.m_AudioDelay, 0, -g_advancedSettings.m_videoAudioDelayRange, 0.025f, g_advancedSettings.m_videoAudioDelayRange, 297, usePopup); static_cast<CSettingControlSlider*>(settingAudioDelay->GetControl())->SetFormatter(SettingFormatterDelay); @@ -331,7 +346,7 @@ void CGUIDialogAudioSubtitleSettings::InitializeSettings() // audio output to all speakers setting // TODO: remove this setting - if (SupportsAudioFeature(IPC_AUD_OUTPUT_STEREO)) + if (SupportsAudioFeature(IPC_AUD_OUTPUT_STEREO) && !m_dspEnabled) AddToggle(groupAudio, SETTING_AUDIO_OUTPUT_TO_ALL_SPEAKERS, 252, 0, videoSettings.m_OutputToAllSpeakers); // audio digital/analog setting diff --git a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.h b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.h index 4de76b361b..2fd3a20bc4 100644 --- a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.h +++ b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.h @@ -69,6 +69,7 @@ protected: bool m_passthrough; int m_subtitleStream; bool m_subtitleVisible; + bool m_dspEnabled; typedef std::vector<int> Features; Features m_audioCaps; diff --git a/xbmc/video/dialogs/GUIDialogVideoOSD.cpp b/xbmc/video/dialogs/GUIDialogVideoOSD.cpp index 73169364b3..097a2deb48 100644 --- a/xbmc/video/dialogs/GUIDialogVideoOSD.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoOSD.cpp @@ -44,6 +44,7 @@ void CGUIDialogVideoOSD::FrameMove() // check for movement of mouse or a submenu open if (CInputManager::Get().IsMouseActive() || g_windowManager.IsWindowActive(WINDOW_DIALOG_AUDIO_OSD_SETTINGS) + || g_windowManager.IsWindowActive(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIDEO_OSD_SETTINGS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIDEO_BOOKMARKS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_PVR_OSD_CHANNELS) @@ -90,6 +91,17 @@ bool CGUIDialogVideoOSD::OnMessage(CGUIMessage& message) Close(); } break; + case GUI_MSG_WINDOW_DEINIT: // fired when OSD is hidden + { + // Remove our subdialogs if visible + CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS); + if (pDialog && pDialog->IsDialogRunning()) + pDialog->Close(true); + pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_AUDIO_OSD_SETTINGS); + if (pDialog && pDialog->IsDialogRunning()) + pDialog->Close(true); + } + break; } return CGUIDialog::OnMessage(message); } |