aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/resource.language.en_gb/resources/strings.po40
-rw-r--r--addons/skin.estuary/xml/Custom_1101_SettingsList.xml4
-rw-r--r--addons/skin.estuary/xml/DialogGameControllers.xml174
-rw-r--r--addons/skin.estuary/xml/DialogSelect.xml4
-rw-r--r--addons/skin.estuary/xml/GameOSD.xml15
-rw-r--r--addons/skin.estuary/xml/Includes_DialogSelect.xml8
-rw-r--r--xbmc/Application.cpp1
-rw-r--r--xbmc/ApplicationPlayer.cpp11
-rw-r--r--xbmc/ApplicationPlayer.h1
-rw-r--r--xbmc/GUIInfoManager.cpp8
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp13
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h1
-rw-r--r--xbmc/cores/GameSettings.h2
-rw-r--r--xbmc/cores/RetroPlayer/RetroPlayerUtils.cpp12
-rw-r--r--xbmc/cores/RetroPlayer/RetroPlayerUtils.h2
-rw-r--r--xbmc/cores/RetroPlayer/guibridge/GUIGameSettings.cpp4
-rw-r--r--xbmc/cores/RetroPlayer/guibridge/IGUIRenderSettings.h4
-rw-r--r--xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp22
-rw-r--r--xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h8
-rw-r--r--xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.cpp8
-rw-r--r--xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.h4
-rw-r--r--xbmc/cores/RetroPlayer/rendering/RPRenderManager.cpp6
-rw-r--r--xbmc/cores/RetroPlayer/rendering/RenderUtils.cpp31
-rw-r--r--xbmc/cores/RetroPlayer/rendering/RenderUtils.h24
-rw-r--r--xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.cpp8
-rw-r--r--xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.h6
-rw-r--r--xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.cpp20
-rw-r--r--xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.h2
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayer.cpp1
-rw-r--r--xbmc/games/controllers/windows/CMakeLists.txt6
-rw-r--r--xbmc/games/controllers/windows/ControllerInstaller.cpp132
-rw-r--r--xbmc/games/controllers/windows/ControllerInstaller.h28
-rw-r--r--xbmc/games/controllers/windows/GUIControllerDefines.h6
-rw-r--r--xbmc/games/controllers/windows/GUIControllerList.cpp22
-rw-r--r--xbmc/games/controllers/windows/GUIControllerWindow.cpp36
-rw-r--r--xbmc/games/controllers/windows/GUIControllerWindow.h7
-rw-r--r--xbmc/games/controllers/windows/GUIFeatureList.cpp49
-rw-r--r--xbmc/games/dialogs/osd/DialogGameStretchMode.cpp50
-rw-r--r--xbmc/games/dialogs/osd/DialogGameStretchMode.h10
-rw-r--r--xbmc/guilib/GUIControlFactory.cpp6
-rw-r--r--xbmc/guilib/guiinfo/GUIInfoLabels.h2
-rw-r--r--xbmc/guilib/guiinfo/GamesGUIInfo.cpp6
-rw-r--r--xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp1
-rw-r--r--xbmc/input/WindowTranslator.cpp2
-rw-r--r--xbmc/settings/GameSettings.cpp12
-rw-r--r--xbmc/settings/GameSettings.h6
-rw-r--r--xbmc/settings/MediaSettings.cpp8
-rw-r--r--xbmc/utils/LangCodeExpander.cpp6
48 files changed, 583 insertions, 256 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 9f5d02ff99..269b7ecafa 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -817,10 +817,11 @@ msgctxt "#185"
msgid "Searching album"
msgstr ""
+#: addons/skin.estuary/xml/DialogPVRGroupManager.xml
#: xbmc/addons/GUIViewStateAddonBrowser.cpp
#: xbmc/addons/GUIDialogAddonInfo.cpp
#: xbmc/dialogs/GUIDialogSelect.cpp
-#: addons/skin.estuary/xml/DialogPVRGroupManager.xml
+#: xbmc/games/controllers/windows/GUIControllerWindow.cpp
#: xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp
msgctxt "#186"
msgid "OK"
@@ -13891,12 +13892,13 @@ msgstr ""
#: xbmc/addons/GUIViewStateAddonBrowser.cpp
#: xbmc/filesystem/AddonsDirectory.cpp
-#: addons/skin.estuary/xml/MyPrograms.xml
+#: addons/skin.estuary/xml/DialogGameControllers.xml
#: addons/skin.estuary/xml/Includes.xml
-#: addons/skin.estuary/xml/MyVideoNav.xml
-#: addons/skin.estuary/xml/MyPics.xml
-#: addons/skin.estuary/xml/MyMusicNav.xml
#: addons/skin.estuary/xml/MyGames.xml
+#: addons/skin.estuary/xml/MyMusicNav.xml
+#: addons/skin.estuary/xml/MyPics.xml
+#: addons/skin.estuary/xml/MyPrograms.xml
+#: addons/skin.estuary/xml/MyVideoNav.xml
msgctxt "#21452"
msgid "Get more..."
msgstr ""
@@ -14928,6 +14930,7 @@ msgstr ""
#. Used as a title in the progress dialog when installing an add-on
#: xbmc/addons/AddonInstaller.cpp
+#: xbmc/games/controllers/windows/ControllerInstaller.cpp
msgctxt "#24057"
msgid "Installing {0:s}..."
msgstr ""
@@ -15075,6 +15078,7 @@ msgstr ""
#. Used as a text in the progress dialog when installing an add-on
#: xbmc/addons/AddonInstaller.cpp
+#: xbmc/games/controllers/windows/ControllerInstaller.cpp
msgctxt "#24086"
msgid "Installing add-on..."
msgstr ""
@@ -16856,7 +16860,19 @@ msgctxt "#35020"
msgid "Press all analog buttons now to detect them:[CR][CR]{0:s}"
msgstr ""
-#empty strings from id 35021 to 35046
+#. Button in the controller configuration dialog to install all controller profiles
+#: addons/skin.estuary/xml/DialogGameControllers.xml
+msgctxt "#35021"
+msgid "Get all"
+msgstr ""
+
+#. Message shown in the controller dialog when there is nothing to map, for example hubs (multitaps) have no buttons
+#: xbmc/games/controllers/windows/GUIFeatureList.cpp
+msgctxt "#35022"
+msgid "Nothing to map"
+msgstr ""
+
+#empty strings from id 35023 to 35046
#. Name of setting to configure peripheral add-ons
#: system/settings/settings.xml
@@ -16880,6 +16896,7 @@ msgstr ""
#. Name of controller add-ons
#: addons/skin.estuary/xml/DialogGameControllers.xml
#: xbmc/addons/Addon.cpp
+#: xbmc/games/controllers/windows/ControllerInstaller.cpp
#: xbmc/games/controllers/windows/GUIControllerWindow.cpp
msgctxt "#35050"
msgid "Controller profiles"
@@ -16942,6 +16959,7 @@ msgid "Would you like to reset this controller profile for all attached devices?
msgstr ""
#. Notice that all controller profiles are installed
+#: xbmc/games/controllers/windows/ControllerInstaller.cpp
#: xbmc/games/controllers/windows/GUIControllerWindow.cpp
msgctxt "#35062"
msgid "All available controller profiles are installed."
@@ -17472,7 +17490,13 @@ msgctxt "#35235"
msgid "Press {0:s} to open the in-game menu."
msgstr ""
-#empty strings from id 35236 to 35249
+#. Additional help text shown when the user first plays a game. This will be removed in the future.
+#: addons/skin.estuary/xml/GameOSD.xml
+msgctxt "#35236"
+msgid "In this release, only controllers can be used to play games."
+msgstr ""
+
+#empty strings from id 35237 to 35249
#: xbmc/windows/GUIMediaWindow.cpp
msgctxt "#35250"
@@ -17503,6 +17527,7 @@ msgstr ""
#. Error message when a game client fails to install when a game is being launched
#: xbmc/games/dialogs/GUIDialogSelectGameClient.cpp
+#: xbmc/games/controllers/windows/ControllerInstaller.cpp
msgctxt "#35256"
msgid "Failed to install add-on."
msgstr ""
@@ -21393,6 +21418,7 @@ msgid "installed"
msgstr ""
#: xbmc/addons/GUIDialogAddonInfo.cpp
+#: xbmc/games/controllers/windows/ControllerInstaller.cpp
msgctxt "#39020"
msgid "The following additional add-ons will be installed"
msgstr ""
diff --git a/addons/skin.estuary/xml/Custom_1101_SettingsList.xml b/addons/skin.estuary/xml/Custom_1101_SettingsList.xml
index 8cb172476a..998d0de6d0 100644
--- a/addons/skin.estuary/xml/Custom_1101_SettingsList.xml
+++ b/addons/skin.estuary/xml/Custom_1101_SettingsList.xml
@@ -8,7 +8,7 @@
<height>460</height>
<centertop>50%</centertop>
<width>700</width>
- <visible>!Window.IsActive(DialogSettings.xml) + !Window.IsActive(DialogSlider.xml) + !Window.IsActive(GameVideoFilter) + !Window.IsActive(GameViewMode) + !Window.IsActive(GameControllers) + !Window.IsActive(GameVideoRotation)</visible>
+ <visible>!Window.IsActive(DialogSettings.xml) + !Window.IsActive(DialogSlider.xml) + !Window.IsActive(GameVideoFilter) + !Window.IsActive(GameStretchMode) + !Window.IsActive(GameControllers) + !Window.IsActive(GameVideoRotation)</visible>
<animation effect="fade" time="200">VisibleChange</animation>
<include content="DialogBackgroundCommons">
<param name="width" value="700" />
@@ -127,7 +127,7 @@
<width>700</width>
<include>DialogSettingButton</include>
<label>$LOCALIZE[35233]</label>
- <onclick>ActivateWindow(GameViewMode)</onclick>
+ <onclick>ActivateWindow(GameStretchMode)</onclick>
</control>
<control type="button" id="14106">
<description>Video rotation button</description>
diff --git a/addons/skin.estuary/xml/DialogGameControllers.xml b/addons/skin.estuary/xml/DialogGameControllers.xml
index 7b6e163c31..da83b4112c 100644
--- a/addons/skin.estuary/xml/DialogGameControllers.xml
+++ b/addons/skin.estuary/xml/DialogGameControllers.xml
@@ -7,68 +7,87 @@
<centertop>50%</centertop>
<centerleft>50%</centerleft>
<width>1820</width>
- <height>690</height>
+ <height>870</height>
<include content="DialogBackgroundCommons">
<param name="width" value="1820" />
- <param name="height" value="690" />
+ <param name="height" value="870" />
<param name="header_label" value="$LOCALIZE[35058]" />
<param name="header_id" value="2" />
</include>
- <control type="label">
- <description>Controller profiles grouplist heading</description>
+ <control type="group">
+ <description>Controller list</description>
<top>90</top>
- <left>15</left>
- <width>330</width>
- <height>25</height>
- <font>font12</font>
- <label>$LOCALIZE[35050]</label>
- <align>center</align>
- <aligny>center</aligny>
- <textcolor>button_focus</textcolor>
- </control>
- <control type="image">
- <left>-5</left>
- <top>110</top>
- <width>370</width>
- <height>582</height>
- <texture border="40">buttons/dialogbutton-nofo.png</texture>
+ <left>30</left>
+ <width>410</width>
+ <height>580</height>
+ <control type="label">
+ <description>Controller profiles grouplist heading</description>
+ <height>25</height>
+ <right>20</right>
+ <font>font12</font>
+ <label>$LOCALIZE[35050]</label>
+ <align>center</align>
+ <aligny>center</aligny>
+ <textcolor>button_focus</textcolor>
+ </control>
+ <control type="image">
+ <description>Controller profiles grouplist background</description>
+ <top>20</top>
+ <bottom>-20</bottom>
+ <left>-20</left>
+ <right>0</right>
+ <texture border="40">buttons/dialogbutton-nofo.png</texture>
+ </control>
+ <control type="grouplist" id="3">
+ <description>Controller profiles grouplist</description>
+ <top>40</top>
+ <right>20</right>
+ <onleft>9001</onleft>
+ <onright>5</onright>
+ <onup>3</onup>
+ <ondown>3</ondown>
+ <pagecontrol>62</pagecontrol>
+ </control>
+ <control type="scrollbar" id="62">
+ <top>40</top>
+ <right>0</right>
+ <width>12</width>
+ <orientation>vertical</orientation>
+ </control>
+ <control type="button" id="10">
+ <description>Default controller button</description>
+ <width>390</width>
+ <height>60</height>
+ <align>center</align>
+ <aligny>center</aligny>
+ <font>font25_title</font>
+ <texturefocus colordiffuse="button_focus">lists/focus.png</texturefocus>
+ <texturenofocus />
+ </control>
</control>
- <control type="grouplist" id="3">
- <description>Controller profiles grouplist</description>
- <left>15</left>
+ <control type="gamecontroller" id="31">
<top>130</top>
- <width>330</width>
+ <left>470</left>
+ <width>540</width>
<height>540</height>
- <onleft>9001</onleft>
- <onright>5</onright>
- <onup>3</onup>
- <ondown>3</ondown>
- </control>
- <control type="button" id="10">
- <description>Default controller button</description>
- <height>60</height>
- <width>330</width>
- <align>center</align>
- <aligny>center</aligny>
- <font>font25_title</font>
- <texturefocus colordiffuse="button_focus">lists/focus.png</texturefocus>
- <texturenofocus />
</control>
- <control type="gamecontroller" id="31">
- <left>400</left>
- <top>108</top>
- <width>547</width>
- <height>547</height>
+ <!--
+ <control type="image">
+ <top>110</top>
+ <left>440</left>
+ <width>580</width>
+ <height>580</height>
+ <texture border="40">buttons/dialogbutton-nofo.png</texture>
</control>
+ -->
<control type="group">
- <left>1000</left>
- <width>410</width>
+ <description>Feature list</description>
<top>90</top>
- <height>602</height>
+ <left>1040</left>
+ <width>410</width>
+ <height>580</height>
<control type="label">
<description>Feature list heading</description>
- <left>20</left>
- <right>20</right>
<height>25</height>
<font>font12</font>
<label>$LOCALIZE[35059]</label>
@@ -78,18 +97,17 @@
</control>
<control type="image">
<top>20</top>
- <bottom>0</bottom>
+ <bottom>-20</bottom>
+ <left>-20</left>
<right>0</right>
<texture border="40">buttons/dialogbutton-nofo.png</texture>
</control>
<control type="grouplist" id="5">
<description>Features grouplist</description>
- <left>20</left>
- <right>20</right>
<top>40</top>
- <bottom>20</bottom>
+ <right>20</right>
<onleft>3</onleft>
- <onright>61</onright>
+ <onright>9001</onright>
<onup>5</onup>
<ondown>5</ondown>
<pagecontrol>61</pagecontrol>
@@ -98,13 +116,11 @@
<right>0</right>
<top>40</top>
<width>12</width>
- <bottom>20</bottom>
- <onleft>5</onleft>
- <onright>9001</onright>
<orientation>vertical</orientation>
</control>
<control type="button" id="7">
<description>Default feature button</description>
+ <width>390</width>
<height>60</height>
<left>20</left>
<right>20</right>
@@ -116,28 +132,26 @@
</control>
<control type="label" id="8">
<description>Feature group title</description>
- <left>20</left>
- <right>20</right>
- <align>center</align>
- <top>0</top>
+ <width>390</width>
<height>40</height>
+ <align>center</align>
<aligny>center</aligny>
<font>font20_title</font>
<textcolor>grey</textcolor>
<shadowcolor>black</shadowcolor>
</control>
- </control>
- <control type="image" id="9">
- <description>Feature separator image</description>
- <height>3</height>
- <texture colordiffuse="AAAAAAAA" border="3">dialogs/separator-grey.png</texture>
+ <control type="image" id="9">
+ <description>Feature separator image</description>
+ <height>3</height>
+ <texture colordiffuse="AAAAAAAA" border="3">dialogs/separator-grey.png</texture>
+ </control>
</control>
<control type="grouplist" id="9001">
- <right>20</right>
<top>110</top>
+ <right>20</right>
+ <width>340</width>
<onleft>5</onleft>
<onright>3</onright>
- <width>350</width>
<itemgap>dialogbuttons_itemgap</itemgap>
<include content="DefaultDialogButton">
<param name="width" value="350" />
@@ -156,6 +170,11 @@
</include>
<include content="DefaultDialogButton">
<param name="width" value="350" />
+ <param name="id" value="22" />
+ <param name="label" value="$LOCALIZE[35021]" />
+ </include>
+ <include content="DefaultDialogButton">
+ <param name="width" value="350" />
<param name="id" value="17" />
<param name="label" value="$LOCALIZE[10043]" />
</include>
@@ -165,6 +184,29 @@
<param name="label" value="$LOCALIZE[35019]" />
</include>
</control>
+ <control type="group">
+ <description>Bottom controller description</description>
+ <bottom>30</bottom>
+ <left>30</left>
+ <right>30</right>
+ <height>140</height>
+ <control type="image">
+ <description>Controller description background image</description>
+ <top>-20</top>
+ <bottom>-20</bottom>
+ <left>-20</left>
+ <right>-20</right>
+ <texture border="40">buttons/dialogbutton-nofo.png</texture>
+ </control>
+ <control type="textbox" id="32">
+ <top>5</top>
+ <bottom>5</bottom>
+ <left>10</left>
+ <right>10</right>
+ <description>Controller description</description>
+ <textcolor>grey</textcolor>
+ </control>
+ </control>
</control>
</controls>
</window>
diff --git a/addons/skin.estuary/xml/DialogSelect.xml b/addons/skin.estuary/xml/DialogSelect.xml
index 0570fcd0b9..6ab3e2a5af 100644
--- a/addons/skin.estuary/xml/DialogSelect.xml
+++ b/addons/skin.estuary/xml/DialogSelect.xml
@@ -4,9 +4,9 @@
<include>Animation_DialogPopupOpenClose</include>
<depth>DepthOSD</depth>
<controls>
- <include condition="![Window.IsActive(gameviewmode) | Window.IsActive(gamevideofilter) | Window.IsActive(gamevideorotation)]">DefaultDialogSelectLayout</include>
+ <include condition="![Window.IsActive(gamestretchmode) | Window.IsActive(gamevideofilter) | Window.IsActive(gamevideorotation)]">DefaultDialogSelectLayout</include>
<include condition="Window.IsActive(gamevideofilter)">GameDialogSelectFilterLayout</include>
- <include condition="Window.IsActive(gameviewmode)">GameDialogSelectViewLayout</include>
+ <include condition="Window.IsActive(gamestretchmode)">GameDialogSelectViewLayout</include>
<include condition="Window.IsActive(gamevideorotation)">GameDialogSelectViewLayout</include>
</controls>
</window>
diff --git a/addons/skin.estuary/xml/GameOSD.xml b/addons/skin.estuary/xml/GameOSD.xml
index c44464ac46..13b68d65db 100644
--- a/addons/skin.estuary/xml/GameOSD.xml
+++ b/addons/skin.estuary/xml/GameOSD.xml
@@ -5,18 +5,18 @@
<depth>DepthOSD</depth>
<controls>
<control type="group" id="1">
- <visible>!Window.IsActive(1101) + !Window.IsActive(GameVideoFilter) + !Window.IsActive(GameViewMode) + !Window.IsActive(GameControllers) + !Window.IsActive(GameVideoRotation)</visible>
+ <visible>!Window.IsActive(1101) + !Window.IsActive(GameVideoFilter) + !Window.IsActive(GameStretchMode) + !Window.IsActive(GameControllers) + !Window.IsActive(GameVideoRotation)</visible>
<control type="group" id="10">
<visible>System.GetBool(gamesgeneral.showosdhelp)</visible>
<defaultcontrol always="true">1103</defaultcontrol>
<centerleft>50%</centerleft>
- <height>910</height>
+ <height>1040</height>
<centertop>50%</centertop>
<width>700</width>
<animation effect="fade" time="200">VisibleChange</animation>
<include content="DialogBackgroundCommons">
<param name="width" value="700" />
- <param name="height" value="910" />
+ <param name="height" value="1040" />
<param name="header_label" value="$LOCALIZE[35221]" />
<param name="header_id" value="2" />
</include>
@@ -37,6 +37,15 @@
<width>640</width>
<height>640</height>
</control>
+ <control type="textbox">
+ <description>Additional help text. This will be removed in future versions.</description>
+ <bottom>30</bottom>
+ <left>30</left>
+ <right>30</right>
+ <height>130</height>
+ <font>font13</font>
+ <label>$LOCALIZE[35236]</label>
+ </control>
<control type="button">
<description>Button to close the dialog</description>
<top>0</top>
diff --git a/addons/skin.estuary/xml/Includes_DialogSelect.xml b/addons/skin.estuary/xml/Includes_DialogSelect.xml
index b0dc5e72c5..4139b8f9a8 100644
--- a/addons/skin.estuary/xml/Includes_DialogSelect.xml
+++ b/addons/skin.estuary/xml/Includes_DialogSelect.xml
@@ -189,7 +189,7 @@
<width>444</width>
<height>250</height>
<videofilter>$INFO[ListItem.Property(game.videofilter)]</videofilter>
- <viewmode>$INFO[ListItem.Property(game.viewmode)]</viewmode>
+ <stretchmode>$INFO[ListItem.Property(game.stretchmode)]</stretchmode>
<rotation>$INFO[ListItem.Property(game.videorotation)]</rotation>
</control>
<control type="label">
@@ -220,7 +220,7 @@
<width>444</width>
<height>250</height>
<videofilter>$INFO[ListItem.Property(game.videofilter)]</videofilter>
- <viewmode>$INFO[ListItem.Property(game.viewmode)]</viewmode>
+ <stretchmode>$INFO[ListItem.Property(game.stretchmode)]</stretchmode>
<rotation>$INFO[ListItem.Property(game.videorotation)]</rotation>
</control>
<control type="label">
@@ -295,7 +295,7 @@
<width>444</width>
<height>250</height>
<videofilter>$INFO[ListItem.Property(game.videofilter)]</videofilter>
- <viewmode>$INFO[ListItem.Property(game.viewmode)]</viewmode>
+ <stretchmode>$INFO[ListItem.Property(game.stretchmode)]</stretchmode>
<rotation>$INFO[ListItem.Property(game.videorotation)]</rotation>
</control>
<control type="label">
@@ -326,7 +326,7 @@
<width>444</width>
<height>250</height>
<videofilter>$INFO[ListItem.Property(game.videofilter)]</videofilter>
- <viewmode>$INFO[ListItem.Property(game.viewmode)]</viewmode>
+ <stretchmode>$INFO[ListItem.Property(game.stretchmode)]</stretchmode>
<rotation>$INFO[ListItem.Property(game.videorotation)]</rotation>
</control>
<control type="label">
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 8bc0655830..1e6b9bca8a 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -3281,6 +3281,7 @@ void CApplication::PlaybackCleanup()
if (!m_appPlayer.IsPlaying())
{
m_stackHelper.Clear();
+ m_appPlayer.ResetPlayer();
}
if (IsEnableTestMode())
diff --git a/xbmc/ApplicationPlayer.cpp b/xbmc/ApplicationPlayer.cpp
index b243b53f15..e310c2586f 100644
--- a/xbmc/ApplicationPlayer.cpp
+++ b/xbmc/ApplicationPlayer.cpp
@@ -37,12 +37,17 @@ void CApplicationPlayer::ClosePlayer()
if (player)
{
CloseFile();
- // we need to do this directly on the member
- CSingleLock lock(m_playerLock);
- m_pPlayer.reset();
+ ResetPlayer();
}
}
+void CApplicationPlayer::ResetPlayer()
+{
+ // we need to do this directly on the member
+ CSingleLock lock(m_playerLock);
+ m_pPlayer.reset();
+}
+
void CApplicationPlayer::CloseFile(bool reopen)
{
std::shared_ptr<IPlayer> player = GetInternal();
diff --git a/xbmc/ApplicationPlayer.h b/xbmc/ApplicationPlayer.h
index df2e77d50f..8ddf5dd3e8 100644
--- a/xbmc/ApplicationPlayer.h
+++ b/xbmc/ApplicationPlayer.h
@@ -35,6 +35,7 @@ public:
// player management
void ClosePlayer();
+ void ResetPlayer();
std::string GetCurrentPlayer();
float GetPlaySpeed();
float GetPlayTempo();
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 99dde196dd..844a9d0578 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -2118,10 +2118,10 @@ const infomap videoplayer[] = {{ "title", VIDEOPLAYER_TITLE },
/// @{
/// \table_start
/// \table_h3{ Labels, Type, Description }
-/// \table_row3{ <b>`ViewMode`</b>,
-/// \anchor RetroPlayer_ViewMode
+/// \table_row3{ <b>`StretchMode`</b>,
+/// \anchor RetroPlayer_StretchMode
/// _string_,
-/// Returns the view mode of the currently-playing game.\n
+/// Returns the stretch mode of the currently-playing game.\n
/// The following values are possible:
/// - normal
/// - 4:3
@@ -2132,7 +2132,7 @@ const infomap videoplayer[] = {{ "title", VIDEOPLAYER_TITLE },
///
/// -----------------------------------------------------------------------------
/// @}
-const infomap retroplayer[] = {{ "viewmode", RETROPLAYER_VIEWMODE},
+const infomap retroplayer[] = {{ "stretchmode", RETROPLAYER_STRETCHMODE},
};
const infomap player_process[] =
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
index 9c7f156346..db3d5b47ca 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
@@ -259,6 +259,7 @@ int CAESinkAUDIOTRACK::AudioTrackWrite(char* audioData, int sizeInBytes, int64_t
CAEDeviceInfo CAESinkAUDIOTRACK::m_info;
std::set<unsigned int> CAESinkAUDIOTRACK::m_sink_sampleRates;
bool CAESinkAUDIOTRACK::m_sinkSupportsFloat = false;
+bool CAESinkAUDIOTRACK::m_sinkSupportsMultiChannelFloat = false;
////////////////////////////////////////////////////////////////////////////////////////////
CAESinkAUDIOTRACK::CAESinkAUDIOTRACK()
@@ -389,7 +390,12 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
{
m_passthrough = false;
m_format.m_sampleRate = m_sink_sampleRate;
- if (m_sinkSupportsFloat && m_format.m_channelLayout.Count() == 2)
+ if (m_sinkSupportsMultiChannelFloat)
+ {
+ m_encoding = CJNIAudioFormat::ENCODING_PCM_FLOAT;
+ m_format.m_dataFormat = AE_FMT_FLOAT;
+ }
+ else if (m_sinkSupportsFloat && m_format.m_channelLayout.Count() == 2)
{
m_encoding = CJNIAudioFormat::ENCODING_PCM_FLOAT;
m_format.m_dataFormat = AE_FMT_FLOAT;
@@ -999,6 +1005,7 @@ void CAESinkAUDIOTRACK::UpdateAvailablePCMCapabilities()
int encoding = CJNIAudioFormat::ENCODING_PCM_16BIT;
m_sinkSupportsFloat = VerifySinkConfiguration(native_sampleRate, CJNIAudioFormat::CHANNEL_OUT_STEREO, CJNIAudioFormat::ENCODING_PCM_FLOAT);
+ m_sinkSupportsMultiChannelFloat = VerifySinkConfiguration(native_sampleRate, CJNIAudioFormat::CHANNEL_OUT_7POINT1_SURROUND, CJNIAudioFormat::ENCODING_PCM_FLOAT);
if (m_sinkSupportsFloat)
{
@@ -1006,6 +1013,10 @@ void CAESinkAUDIOTRACK::UpdateAvailablePCMCapabilities()
m_info.m_dataFormats.push_back(AE_FMT_FLOAT);
CLog::Log(LOGNOTICE, "Float is supported");
}
+ if (m_sinkSupportsMultiChannelFloat)
+ {
+ CLog::Log(LOGNOTICE, "Multi channel Float is supported");
+ }
// Still AML API 21 and 22 get hardcoded samplerates - we can drop that
// when we stop supporting API < 23 - let's only add the default
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
index 187257c174..647ca62d47 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
@@ -75,6 +75,7 @@ private:
static CAEDeviceInfo m_info;
static std::set<unsigned int> m_sink_sampleRates;
static bool m_sinkSupportsFloat;
+ static bool m_sinkSupportsMultiChannelFloat;
AEAudioFormat m_format;
double m_volume;
diff --git a/xbmc/cores/GameSettings.h b/xbmc/cores/GameSettings.h
index 779ece4328..ce45508b9f 100644
--- a/xbmc/cores/GameSettings.h
+++ b/xbmc/cores/GameSettings.h
@@ -23,7 +23,7 @@ enum class SCALINGMETHOD
};
// NOTE: Only append
-enum class VIEWMODE
+enum class STRETCHMODE
{
Normal = 0,
Stretch4x3 = 1,
diff --git a/xbmc/cores/RetroPlayer/RetroPlayerUtils.cpp b/xbmc/cores/RetroPlayer/RetroPlayerUtils.cpp
index 0abe52b390..daca0b45c4 100644
--- a/xbmc/cores/RetroPlayer/RetroPlayerUtils.cpp
+++ b/xbmc/cores/RetroPlayer/RetroPlayerUtils.cpp
@@ -11,17 +11,17 @@
using namespace KODI;
using namespace RETRO;
-std::string CRetroPlayerUtils::ViewModeToDescription(VIEWMODE viewMode)
+std::string CRetroPlayerUtils::StretchModeToDescription(STRETCHMODE stretchMode)
{
- switch (viewMode)
+ switch (stretchMode)
{
- case VIEWMODE::Normal:
+ case STRETCHMODE::Normal:
return "normal";
- case VIEWMODE::Stretch4x3:
+ case STRETCHMODE::Stretch4x3:
return "4:3";
- case VIEWMODE::Fullscreen:
+ case STRETCHMODE::Fullscreen:
return "fullscreen";
- case VIEWMODE::Original:
+ case STRETCHMODE::Original:
return "original";
default:
break;
diff --git a/xbmc/cores/RetroPlayer/RetroPlayerUtils.h b/xbmc/cores/RetroPlayer/RetroPlayerUtils.h
index c5b020447c..94fde43f08 100644
--- a/xbmc/cores/RetroPlayer/RetroPlayerUtils.h
+++ b/xbmc/cores/RetroPlayer/RetroPlayerUtils.h
@@ -19,7 +19,7 @@ namespace RETRO
class CRetroPlayerUtils
{
public:
- static std::string ViewModeToDescription(VIEWMODE viewMode);
+ static std::string StretchModeToDescription(STRETCHMODE stretchMode);
};
}
}
diff --git a/xbmc/cores/RetroPlayer/guibridge/GUIGameSettings.cpp b/xbmc/cores/RetroPlayer/guibridge/GUIGameSettings.cpp
index 4d663b9f6f..e553002776 100644
--- a/xbmc/cores/RetroPlayer/guibridge/GUIGameSettings.cpp
+++ b/xbmc/cores/RetroPlayer/guibridge/GUIGameSettings.cpp
@@ -59,11 +59,11 @@ void CGUIGameSettings::UpdateSettings()
// Get settings from GUI
std::string videoFilter = m_guiSettings.VideoFilter();
- VIEWMODE viewMode = m_guiSettings.ViewMode();
+ STRETCHMODE stretchMode = m_guiSettings.StretchMode();
unsigned int rotationDegCCW = m_guiSettings.RotationDegCCW();
// Save settings for renderer
m_renderSettings.VideoSettings().SetVideoFilter(videoFilter);
- m_renderSettings.VideoSettings().SetRenderViewMode(viewMode);
+ m_renderSettings.VideoSettings().SetRenderStretchMode(stretchMode);
m_renderSettings.VideoSettings().SetRenderRotation(rotationDegCCW);
}
diff --git a/xbmc/cores/RetroPlayer/guibridge/IGUIRenderSettings.h b/xbmc/cores/RetroPlayer/guibridge/IGUIRenderSettings.h
index d04bc95779..9db6eb4dbd 100644
--- a/xbmc/cores/RetroPlayer/guibridge/IGUIRenderSettings.h
+++ b/xbmc/cores/RetroPlayer/guibridge/IGUIRenderSettings.h
@@ -29,9 +29,9 @@ namespace RETRO
virtual bool HasVideoFilter() const { return true; }
/*!
- * \brief Returns true if this render target has a view mode set
+ * \brief Returns true if this render target has a stretch mode set
*/
- virtual bool HasViewMode() const { return true; }
+ virtual bool HasStretchMode() const { return true; }
/*!
* \brief Returns true if this render target has a video rotation set
diff --git a/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp b/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp
index 9935c1d526..2126dc4600 100644
--- a/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp
+++ b/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp
@@ -43,10 +43,10 @@ CGUIGameControl::CGUIGameControl(int parentID, int controlID, float posX, float
CGUIGameControl::CGUIGameControl(const CGUIGameControl &other) :
CGUIControl(other),
m_videoFilterInfo(other.m_videoFilterInfo),
- m_viewModeInfo(other.m_viewModeInfo),
+ m_stretchModeInfo(other.m_stretchModeInfo),
m_rotationInfo(other.m_rotationInfo),
m_bHasVideoFilter(other.m_bHasVideoFilter),
- m_bHasViewMode(other.m_bHasViewMode),
+ m_bHasStretchMode(other.m_bHasStretchMode),
m_bHasRotation(other.m_bHasRotation),
m_renderSettings(new CGUIRenderSettings(*this))
{
@@ -66,9 +66,9 @@ void CGUIGameControl::SetVideoFilter(const GUILIB::GUIINFO::CGUIInfoLabel &video
m_videoFilterInfo = videoFilter;
}
-void CGUIGameControl::SetViewMode(const GUILIB::GUIINFO::CGUIInfoLabel &viewMode)
+void CGUIGameControl::SetStretchMode(const GUILIB::GUIINFO::CGUIInfoLabel &stretchMode)
{
- m_viewModeInfo = viewMode;
+ m_stretchModeInfo = stretchMode;
}
void CGUIGameControl::SetRotation(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &rotation)
@@ -141,13 +141,13 @@ void CGUIGameControl::UpdateInfo(const CGUIListItem *item /* = nullptr */)
m_bHasVideoFilter = true;
}
- std::string strViewMode = m_viewModeInfo.GetItemLabel(item);
- if (StringUtils::IsNaturalNumber(strViewMode))
+ std::string strStretchMode = m_stretchModeInfo.GetItemLabel(item);
+ if (StringUtils::IsNaturalNumber(strStretchMode))
{
- unsigned int viewMode;
- std::istringstream(std::move(strViewMode)) >> viewMode;
- m_renderSettings->SetViewMode(static_cast<VIEWMODE>(viewMode));
- m_bHasViewMode = true;
+ unsigned int stretchMode;
+ std::istringstream(std::move(strStretchMode)) >> stretchMode;
+ m_renderSettings->SetStretchMode(static_cast<STRETCHMODE>(stretchMode));
+ m_bHasStretchMode = true;
}
std::string strRotation = m_rotationInfo.GetItemLabel(item);
@@ -164,7 +164,7 @@ void CGUIGameControl::UpdateInfo(const CGUIListItem *item /* = nullptr */)
void CGUIGameControl::Reset()
{
m_bHasVideoFilter = false;
- m_bHasViewMode = false;
+ m_bHasStretchMode = false;
m_bHasRotation = false;
m_renderSettings->Reset();
}
diff --git a/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h b/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h
index d824136367..3044cafc8a 100644
--- a/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h
+++ b/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h
@@ -30,12 +30,12 @@ public:
// GUI functions
void SetVideoFilter(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &videoFilter);
- void SetViewMode(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &viewMode);
+ void SetStretchMode(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &stretchMode);
void SetRotation(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &rotation);
// Rendering functions
bool HasVideoFilter() const { return m_bHasVideoFilter; }
- bool HasViewMode() const { return m_bHasViewMode; }
+ bool HasStretchMode() const { return m_bHasStretchMode; }
bool HasRotation() const { return m_bHasRotation; }
IGUIRenderSettings *GetRenderSettings() const;
@@ -58,12 +58,12 @@ private:
// GUI properties
KODI::GUILIB::GUIINFO::CGUIInfoLabel m_videoFilterInfo;
- KODI::GUILIB::GUIINFO::CGUIInfoLabel m_viewModeInfo;
+ KODI::GUILIB::GUIINFO::CGUIInfoLabel m_stretchModeInfo;
KODI::GUILIB::GUIINFO::CGUIInfoLabel m_rotationInfo;
// Rendering properties
bool m_bHasVideoFilter = false;
- bool m_bHasViewMode = false;
+ bool m_bHasStretchMode = false;
bool m_bHasRotation = false;
std::unique_ptr<CGUIRenderSettings> m_renderSettings;
std::shared_ptr<CGUIRenderHandle> m_renderHandle;
diff --git a/xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.cpp b/xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.cpp
index f3dbb99886..fe4d23d024 100644
--- a/xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.cpp
+++ b/xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.cpp
@@ -23,9 +23,9 @@ bool CGUIRenderSettings::HasVideoFilter() const
return m_guiControl.HasVideoFilter();
}
-bool CGUIRenderSettings::HasViewMode() const
+bool CGUIRenderSettings::HasStretchMode() const
{
- return m_guiControl.HasViewMode();
+ return m_guiControl.HasStretchMode();
}
bool CGUIRenderSettings::HasRotation() const
@@ -75,11 +75,11 @@ void CGUIRenderSettings::SetVideoFilter(const std::string &videoFilter)
m_renderSettings.VideoSettings().SetVideoFilter(videoFilter);
}
-void CGUIRenderSettings::SetViewMode(VIEWMODE viewMode)
+void CGUIRenderSettings::SetStretchMode(STRETCHMODE stretchMode)
{
CSingleLock lock(m_mutex);
- m_renderSettings.VideoSettings().SetRenderViewMode(viewMode);
+ m_renderSettings.VideoSettings().SetRenderStretchMode(stretchMode);
}
void CGUIRenderSettings::SetRotationDegCCW(unsigned int rotationDegCCW)
diff --git a/xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.h b/xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.h
index b47f8fbf31..ce9eb89169 100644
--- a/xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.h
+++ b/xbmc/cores/RetroPlayer/guicontrols/GUIRenderSettings.h
@@ -28,7 +28,7 @@ namespace RETRO
// implementation of IGUIRenderSettings
bool HasVideoFilter() const override;
- bool HasViewMode() const override;
+ bool HasStretchMode() const override;
bool HasRotation() const override;
CRenderSettings GetSettings() const override;
CRect GetDimensions() const override;
@@ -38,7 +38,7 @@ namespace RETRO
void SetSettings(CRenderSettings settings);
void SetDimensions(const CRect &dimensions);
void SetVideoFilter(const std::string &videoFilter);
- void SetViewMode(VIEWMODE viewMode);
+ void SetStretchMode(STRETCHMODE stretchMode);
void SetRotationDegCCW(unsigned int rotationDegCCW);
private:
diff --git a/xbmc/cores/RetroPlayer/rendering/RPRenderManager.cpp b/xbmc/cores/RetroPlayer/rendering/RPRenderManager.cpp
index ac2887cd84..8182dc7d78 100644
--- a/xbmc/cores/RetroPlayer/rendering/RPRenderManager.cpp
+++ b/xbmc/cores/RetroPlayer/rendering/RPRenderManager.cpp
@@ -424,7 +424,7 @@ std::shared_ptr<CRPBaseRenderer> CRPRenderManager::GetRenderer(const IGUIRenderS
if (renderer)
{
renderer->SetScalingMethod(effectiveRenderSettings.VideoSettings().GetScalingMethod());
- renderer->SetViewMode(effectiveRenderSettings.VideoSettings().GetRenderViewMode());
+ renderer->SetStretchMode(effectiveRenderSettings.VideoSettings().GetRenderStretchMode());
renderer->SetRenderRotation(effectiveRenderSettings.VideoSettings().GetRenderRotation());
}
@@ -616,8 +616,8 @@ CRenderVideoSettings CRPRenderManager::GetEffectiveSettings(const IGUIRenderSett
{
if (settings->HasVideoFilter())
effectiveSettings.SetVideoFilter(settings->GetSettings().VideoSettings().GetVideoFilter());
- if (settings->HasViewMode())
- effectiveSettings.SetRenderViewMode(settings->GetSettings().VideoSettings().GetRenderViewMode());
+ if (settings->HasStretchMode())
+ effectiveSettings.SetRenderStretchMode(settings->GetSettings().VideoSettings().GetRenderStretchMode());
if (settings->HasRotation())
effectiveSettings.SetRenderRotation(settings->GetSettings().VideoSettings().GetRenderRotation());
}
diff --git a/xbmc/cores/RetroPlayer/rendering/RenderUtils.cpp b/xbmc/cores/RetroPlayer/rendering/RenderUtils.cpp
index 13a97529dc..cd00c48722 100644
--- a/xbmc/cores/RetroPlayer/rendering/RenderUtils.cpp
+++ b/xbmc/cores/RetroPlayer/rendering/RenderUtils.cpp
@@ -14,13 +14,20 @@
using namespace KODI;
using namespace RETRO;
-void CRenderUtils::CalculateViewMode(VIEWMODE viewMode, unsigned int rotationDegCCW, unsigned int sourceWidth, unsigned int sourceHeight, float screenWidth, float screenHeight, float &pixelRatio, float &zoomAmount)
+void CRenderUtils::CalculateStretchMode(STRETCHMODE stretchMode,
+ unsigned int rotationDegCCW,
+ unsigned int sourceWidth,
+ unsigned int sourceHeight,
+ float screenWidth,
+ float screenHeight,
+ float &pixelRatio,
+ float &zoomAmount)
{
const float sourceFrameRatio = static_cast<float>(sourceWidth) / static_cast<float>(sourceHeight);
- switch (viewMode)
+ switch (stretchMode)
{
- case VIEWMODE::Normal:
+ case STRETCHMODE::Normal:
{
switch (rotationDegCCW)
{
@@ -38,7 +45,7 @@ void CRenderUtils::CalculateViewMode(VIEWMODE viewMode, unsigned int rotationDeg
break;
}
- case VIEWMODE::Stretch4x3:
+ case STRETCHMODE::Stretch4x3:
{
// Stretch to 4:3 ratio
pixelRatio = (4.0f / 3.0f) / sourceFrameRatio;
@@ -46,7 +53,7 @@ void CRenderUtils::CalculateViewMode(VIEWMODE viewMode, unsigned int rotationDeg
break;
}
- case VIEWMODE::Fullscreen:
+ case STRETCHMODE::Fullscreen:
{
// Stretch to the limits of the screen
pixelRatio = (screenWidth / screenHeight) / sourceFrameRatio;
@@ -54,7 +61,7 @@ void CRenderUtils::CalculateViewMode(VIEWMODE viewMode, unsigned int rotationDeg
break;
}
- case VIEWMODE::Original:
+ case STRETCHMODE::Original:
{
switch (rotationDegCCW)
{
@@ -100,7 +107,10 @@ void CRenderUtils::CalculateViewMode(VIEWMODE viewMode, unsigned int rotationDeg
}
}
-void CRenderUtils::CalcNormalRenderRect(const CRect &viewRect, float outputFrameRatio, float zoomAmount, CRect &destRect)
+void CRenderUtils::CalcNormalRenderRect(const CRect &viewRect,
+ float outputFrameRatio,
+ float zoomAmount,
+ CRect &destRect)
{
const float offsetX = viewRect.x1;
const float offsetY = viewRect.y1;
@@ -144,7 +154,9 @@ void CRenderUtils::CalcNormalRenderRect(const CRect &viewRect, float outputFrame
destRect.y2 = destRect.y1 + MathUtils::round_int(newHeight);
}
-void CRenderUtils::ClipRect(const CRect &viewRect, CRect &sourceRect, CRect &destRect)
+void CRenderUtils::ClipRect(const CRect &viewRect,
+ CRect &sourceRect,
+ CRect &destRect)
{
const float offsetX = viewRect.x1;
const float offsetY = viewRect.y1;
@@ -164,7 +176,8 @@ void CRenderUtils::ClipRect(const CRect &viewRect, CRect &sourceRect, CRect &des
}
}
-std::array<CPoint, 4> CRenderUtils::ReorderDrawPoints(const CRect &destRect, unsigned int orientationDegCCW)
+std::array<CPoint, 4> CRenderUtils::ReorderDrawPoints(const CRect &destRect,
+ unsigned int orientationDegCCW)
{
std::array<CPoint, 4> rotatedDestCoords{};
diff --git a/xbmc/cores/RetroPlayer/rendering/RenderUtils.h b/xbmc/cores/RetroPlayer/rendering/RenderUtils.h
index 6ac3e9c4fa..49aa9c86f8 100644
--- a/xbmc/cores/RetroPlayer/rendering/RenderUtils.h
+++ b/xbmc/cores/RetroPlayer/rendering/RenderUtils.h
@@ -20,10 +20,26 @@ namespace RETRO
class CRenderUtils
{
public:
- static void CalculateViewMode(VIEWMODE viewMode, unsigned int rotationDegCCW, unsigned int sourceWidth, unsigned int sourceHeight, float screenWidth, float screenHeight, float &pixelRatio, float &zoomAmount);
- static void CalcNormalRenderRect(const CRect &viewRect, float outputFrameRatio, float zoomAmount, CRect &destRect);
- static void ClipRect(const CRect &viewRect, CRect &sourceRect, CRect &destRect);
- static std::array<CPoint, 4> ReorderDrawPoints(const CRect &destRect, unsigned int orientationDegCCW);
+ static void CalculateStretchMode(STRETCHMODE stretchMode,
+ unsigned int rotationDegCCW,
+ unsigned int sourceWidth,
+ unsigned int sourceHeight,
+ float screenWidth,
+ float screenHeight,
+ float &pixelRatio,
+ float &zoomAmount);
+
+ static void CalcNormalRenderRect(const CRect &viewRect,
+ float outputFrameRatio,
+ float zoomAmount,
+ CRect &destRect);
+
+ static void ClipRect(const CRect &viewRect,
+ CRect &sourceRect,
+ CRect &destRect);
+
+ static std::array<CPoint, 4> ReorderDrawPoints(const CRect &destRect,
+ unsigned int orientationDegCCW);
};
}
}
diff --git a/xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.cpp b/xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.cpp
index fb175ce26e..4e7587271b 100644
--- a/xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.cpp
+++ b/xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.cpp
@@ -17,14 +17,14 @@ using namespace RETRO;
void CRenderVideoSettings::Reset()
{
m_scalingMethod = SCALINGMETHOD::AUTO;
- m_viewMode = VIEWMODE::Normal;
+ m_stretchMode = STRETCHMODE::Normal;
m_rotationDegCCW = 0;
}
bool CRenderVideoSettings::operator==(const CRenderVideoSettings &rhs) const
{
return m_scalingMethod == rhs.m_scalingMethod &&
- m_viewMode == rhs.m_viewMode &&
+ m_stretchMode == rhs.m_stretchMode &&
m_rotationDegCCW == rhs.m_rotationDegCCW;
}
@@ -33,8 +33,8 @@ bool CRenderVideoSettings::operator<(const CRenderVideoSettings &rhs) const
if (m_scalingMethod < rhs.m_scalingMethod) return true;
if (m_scalingMethod > rhs.m_scalingMethod) return false;
- if (m_viewMode < rhs.m_viewMode) return true;
- if (m_viewMode > rhs.m_viewMode) return false;
+ if (m_stretchMode < rhs.m_stretchMode) return true;
+ if (m_stretchMode > rhs.m_stretchMode) return false;
if (m_rotationDegCCW < rhs.m_rotationDegCCW) return true;
if (m_rotationDegCCW > rhs.m_rotationDegCCW) return false;
diff --git a/xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.h b/xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.h
index 2cb6a0aabc..603721fcf6 100644
--- a/xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.h
+++ b/xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.h
@@ -40,15 +40,15 @@ namespace RETRO
SCALINGMETHOD GetScalingMethod() const { return m_scalingMethod; }
void SetScalingMethod(SCALINGMETHOD method) { m_scalingMethod = method; }
- VIEWMODE GetRenderViewMode() const { return m_viewMode; }
- void SetRenderViewMode(VIEWMODE mode) { m_viewMode = mode; }
+ STRETCHMODE GetRenderStretchMode() const { return m_stretchMode; }
+ void SetRenderStretchMode(STRETCHMODE mode) { m_stretchMode = mode; }
unsigned int GetRenderRotation() const { return m_rotationDegCCW; }
void SetRenderRotation(unsigned int rotationDegCCW) { m_rotationDegCCW = rotationDegCCW; }
private:
SCALINGMETHOD m_scalingMethod;
- VIEWMODE m_viewMode;
+ STRETCHMODE m_stretchMode;
unsigned int m_rotationDegCCW;
};
}
diff --git a/xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.cpp b/xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.cpp
index 562c2e12bf..48535180cb 100644
--- a/xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.cpp
+++ b/xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.cpp
@@ -116,9 +116,9 @@ void CRPBaseRenderer::SetScalingMethod(SCALINGMETHOD method)
m_renderSettings.VideoSettings().SetScalingMethod(method);
}
-void CRPBaseRenderer::SetViewMode(VIEWMODE viewMode)
+void CRPBaseRenderer::SetStretchMode(STRETCHMODE stretchMode)
{
- m_renderSettings.VideoSettings().SetRenderViewMode(viewMode);
+ m_renderSettings.VideoSettings().SetRenderStretchMode(stretchMode);
}
void CRPBaseRenderer::SetRenderRotation(unsigned int rotationDegCCW)
@@ -134,7 +134,7 @@ void CRPBaseRenderer::ManageRenderArea(const IRenderBuffer &renderBuffer)
const unsigned int sourceRotationDegCCW = renderBuffer.GetRotation();
const float sourceAspectRatio = static_cast<float>(sourceWidth) / static_cast<float>(sourceHeight);
- const VIEWMODE viewMode = m_renderSettings.VideoSettings().GetRenderViewMode();
+ const STRETCHMODE stretchMode = m_renderSettings.VideoSettings().GetRenderStretchMode();
const unsigned int rotationDegCCW = (sourceRotationDegCCW + m_renderSettings.VideoSettings().GetRenderRotation()) % 360;
// Get screen parameters
@@ -149,11 +149,21 @@ void CRPBaseRenderer::ManageRenderArea(const IRenderBuffer &renderBuffer)
// Calculate pixel ratio and zoom amount
float pixelRatio = 1.0f;
float zoomAmount = 1.0f;
- CRenderUtils::CalculateViewMode(viewMode, rotationDegCCW, sourceWidth, sourceHeight, screenWidth, screenHeight, pixelRatio, zoomAmount);
+ CRenderUtils::CalculateStretchMode(stretchMode,
+ rotationDegCCW,
+ sourceWidth,
+ sourceHeight,
+ screenWidth,
+ screenHeight,
+ pixelRatio,
+ zoomAmount);
// Calculate destination dimensions
CRect destRect;
- CRenderUtils::CalcNormalRenderRect(viewRect, sourceAspectRatio * pixelRatio, zoomAmount, destRect);
+ CRenderUtils::CalcNormalRenderRect(viewRect,
+ sourceAspectRatio * pixelRatio,
+ zoomAmount,
+ destRect);
m_sourceRect.x1 = 0.0f;
m_sourceRect.y1 = 0.0f;
diff --git a/xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.h b/xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.h
index 0a60574059..933bcc44a4 100644
--- a/xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.h
+++ b/xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPBaseRenderer.h
@@ -63,7 +63,7 @@ namespace RETRO
// Set render settings
void SetScalingMethod(SCALINGMETHOD method);
- void SetViewMode(VIEWMODE viewMode);
+ void SetStretchMode(STRETCHMODE stretchMode);
void SetRenderRotation(unsigned int rotationDegCCW);
bool IsVisible() const;
diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
index 536145523f..14deb403af 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
@@ -4876,6 +4876,7 @@ void CVideoPlayer::SetVideoSettings(CVideoSettings& settings)
m_processInfo->SetVideoSettings(settings);
m_renderManager.SetVideoSettings(settings);
m_renderManager.SetDelay(static_cast<int>(settings.m_AudioDelay * 1000.0f));
+ m_VideoPlayerVideo->EnableSubtitle(settings.m_SubtitleOn);
m_VideoPlayerVideo->SetSubtitleDelay(static_cast<int>(-settings.m_SubtitleDelay * DVD_TIME_BASE));
}
diff --git a/xbmc/games/controllers/windows/CMakeLists.txt b/xbmc/games/controllers/windows/CMakeLists.txt
index 147f8b990e..e64236282f 100644
--- a/xbmc/games/controllers/windows/CMakeLists.txt
+++ b/xbmc/games/controllers/windows/CMakeLists.txt
@@ -1,9 +1,11 @@
-set(SOURCES GUIConfigurationWizard.cpp
+set(SOURCES ControllerInstaller.cpp
+ GUIConfigurationWizard.cpp
GUIControllerList.cpp
GUIControllerWindow.cpp
GUIFeatureList.cpp)
-set(HEADERS GUIConfigurationWizard.h
+set(HEADERS ControllerInstaller.h
+ GUIConfigurationWizard.h
GUIControllerDefines.h
GUIControllerList.h
GUIControllerWindow.h
diff --git a/xbmc/games/controllers/windows/ControllerInstaller.cpp b/xbmc/games/controllers/windows/ControllerInstaller.cpp
new file mode 100644
index 0000000000..6e460a976b
--- /dev/null
+++ b/xbmc/games/controllers/windows/ControllerInstaller.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "ControllerInstaller.h"
+#include "addons/Addon.h"
+#include "addons/AddonInstaller.h"
+#include "addons/AddonManager.h"
+#include "dialogs/GUIDialogProgress.h"
+#include "dialogs/GUIDialogSelect.h"
+#include "guilib/GUIComponent.h"
+#include "guilib/GUIWindowManager.h"
+#include "guilib/LocalizeStrings.h"
+#include "guilib/WindowIDs.h"
+#include "messaging/helpers/DialogOKHelper.h"
+#include "utils/log.h"
+#include "utils/StringUtils.h"
+#include "FileItem.h"
+#include "ServiceBroker.h"
+
+using namespace KODI;
+using namespace GAME;
+
+CControllerInstaller::CControllerInstaller() :
+ CThread("ControllerInstaller")
+{
+}
+
+void CControllerInstaller::Process()
+{
+ CGUIComponent *gui = CServiceBroker::GetGUI();
+ if (gui == nullptr)
+ return;
+
+ CGUIWindowManager &windowManager = gui->GetWindowManager();
+
+ auto pSelectDialog = windowManager.GetWindow<CGUIDialogSelect>(WINDOW_DIALOG_SELECT);
+ if (pSelectDialog == nullptr)
+ return;
+
+ auto pProgressDialog = windowManager.GetWindow<CGUIDialogProgress>(WINDOW_DIALOG_PROGRESS);
+ if (pProgressDialog == nullptr)
+ return;
+
+ ADDON::VECADDONS installableAddons;
+ CServiceBroker::GetAddonMgr().GetInstallableAddons(installableAddons, ADDON::ADDON_GAME_CONTROLLER);
+ if (installableAddons.empty())
+ {
+ // "Controller profiles"
+ // "All available controller profiles are installed."
+ MESSAGING::HELPERS::ShowOKDialogText(CVariant{ 35050 }, CVariant{ 35062 });
+ return;
+ }
+
+ CLog::Log(LOGDEBUG, "Controller installer: Found %u controller add-ons", installableAddons.size());
+
+ CFileItemList items;
+ for (const auto &addon : installableAddons)
+ {
+ CFileItemPtr item(new CFileItem(addon->Name()));
+ item->SetIconImage(addon->Icon());
+ items.Add(std::move(item));
+ }
+
+ pSelectDialog->Reset();
+ pSelectDialog->SetHeading(39020); // "The following additional add-ons will be installed"
+ pSelectDialog->SetUseDetails(true);
+ pSelectDialog->EnableButton(true, 186); // "OK""
+ for (const auto &it : items)
+ pSelectDialog->Add(*it);
+ pSelectDialog->Open();
+
+ if (!pSelectDialog->IsButtonPressed())
+ {
+ CLog::Log(LOGDEBUG, "Controller installer: User cancelled installation dialog");
+ return;
+ }
+
+ CLog::Log(LOGDEBUG, "Controller installer: Installing %u controller add-ons", installableAddons.size());
+
+ pProgressDialog->SetHeading(CVariant{ 24086 }); // "Installing add-on..."
+ pProgressDialog->SetLine(0, CVariant{ "" });
+ pProgressDialog->SetLine(1, CVariant{ "" });
+ pProgressDialog->SetLine(2, CVariant{ "" });
+
+ pProgressDialog->Open();
+
+ unsigned int installedCount = 0;
+ while (installedCount < installableAddons.size())
+ {
+ const auto &addon = installableAddons[installedCount];
+
+ // Set dialog text
+ const std::string progressTemplate = g_localizeStrings.Get(24057); // "Installing {0:s}..."
+ const std::string progressText = StringUtils::Format(progressTemplate, addon->Name());
+ pProgressDialog->SetLine(0, CVariant{ progressText });
+
+ // Set dialog percentage
+ const unsigned int percentage = 100 * (installedCount + 1) / installableAddons.size();
+ pProgressDialog->SetPercentage(percentage);
+
+ if (!CAddonInstaller::GetInstance().InstallOrUpdate(addon->ID(), false, false))
+ {
+ CLog::Log(LOGERROR, "Controller installer: Failed to install %s", addon->ID().c_str());
+ // "Error"
+ // "Failed to install add-on."
+ MESSAGING::HELPERS::ShowOKDialogText(257, 35256);
+ break;
+ }
+
+ if (pProgressDialog->IsCanceled())
+ {
+ CLog::Log(LOGDEBUG, "Controller installer: User cancelled add-on installation");
+ break;
+ }
+
+ if (windowManager.GetActiveWindowOrDialog() != WINDOW_DIALOG_PROGRESS)
+ {
+ CLog::Log(LOGDEBUG, "Controller installer: Progress dialog is hidden, cancelling");
+ break;
+ }
+
+ installedCount++;
+ }
+
+ CLog::Log(LOGDEBUG, "Controller window: Installed %u controller add-ons", installedCount);
+ pProgressDialog->Close();
+}
diff --git a/xbmc/games/controllers/windows/ControllerInstaller.h b/xbmc/games/controllers/windows/ControllerInstaller.h
new file mode 100644
index 0000000000..585a45d93a
--- /dev/null
+++ b/xbmc/games/controllers/windows/ControllerInstaller.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "threads/Thread.h"
+
+namespace KODI
+{
+namespace GAME
+{
+ class CControllerInstaller : public CThread
+ {
+ public:
+ CControllerInstaller();
+ ~CControllerInstaller() override = default;
+
+ protected:
+ // implementation of CThread
+ void Process() override;
+ };
+}
+}
diff --git a/xbmc/games/controllers/windows/GUIControllerDefines.h b/xbmc/games/controllers/windows/GUIControllerDefines.h
index 0eb3cebd23..3805a28b5c 100644
--- a/xbmc/games/controllers/windows/GUIControllerDefines.h
+++ b/xbmc/games/controllers/windows/GUIControllerDefines.h
@@ -21,12 +21,16 @@
#define CONTROL_FEATURE_GROUP_TITLE 8
#define CONTROL_FEATURE_SEPARATOR 9
#define CONTROL_CONTROLLER_BUTTON_TEMPLATE 10
+#define CONTROL_GAME_CONTROLLER 31
+#define CONTROL_CONTROLLER_DESCRIPTION 32
+
+// GUI button IDs
#define CONTROL_HELP_BUTTON 17
#define CONTROL_CLOSE_BUTTON 18
#define CONTROL_RESET_BUTTON 19
#define CONTROL_GET_MORE 20
#define CONTROL_FIX_SKIPPING 21
-#define CONTROL_GAME_CONTROLLER 31
+#define CONTROL_GET_ALL 22
#define MAX_CONTROLLER_COUNT 100 // large enough
#define MAX_FEATURE_COUNT 200 // large enough
diff --git a/xbmc/games/controllers/windows/GUIControllerList.cpp b/xbmc/games/controllers/windows/GUIControllerList.cpp
index ff44fc4eaf..e3f88d526f 100644
--- a/xbmc/games/controllers/windows/GUIControllerList.cpp
+++ b/xbmc/games/controllers/windows/GUIControllerList.cpp
@@ -132,6 +132,11 @@ void CGUIControllerList::OnFocus(unsigned int controllerIndex)
CGUIGameController* pController = dynamic_cast<CGUIGameController*>(m_guiWindow->GetControl(CONTROL_GAME_CONTROLLER));
if (pController)
pController->ActivateController(controller);
+
+ // Update controller description
+ CGUIMessage msg(GUI_MSG_LABEL_SET, m_guiWindow->GetID(), CONTROL_CONTROLLER_DESCRIPTION);
+ msg.SetLabel(controller->Description());
+ m_guiWindow->OnMessage(msg);
}
}
@@ -164,7 +169,7 @@ void CGUIControllerList::OnEvent(const ADDON::AddonEvent& event)
{
using namespace MESSAGING;
CGUIMessage msg(GUI_MSG_REFRESH_LIST, m_guiWindow->GetID(), CONTROL_CONTROLLER_LIST);
- CApplicationMessenger::GetInstance().SendGUIMessage(msg);
+ CApplicationMessenger::GetInstance().SendGUIMessage(msg, m_guiWindow->GetID());
}
}
@@ -174,21 +179,6 @@ bool CGUIControllerList::RefreshControllers(void)
CGameServices& gameServices = CServiceBroker::GetGameServices();
ControllerVector newControllers = gameServices.GetControllers();
- // Don't show an empty feature list in the GUI
- auto HasButtonForFeature = [this](const CControllerFeature &feature)
- {
- return m_featureList->HasButton(feature.Type());
- };
-
- auto HasButtonForController = [&](const ControllerPtr &controller)
- {
- const auto &features = controller->Features();
- auto it = std::find_if(features.begin(), features.end(), HasButtonForFeature);
- return it == features.end();
- };
-
- newControllers.erase(std::remove_if(newControllers.begin(), newControllers.end(), HasButtonForController), newControllers.end());
-
// Filter by current game add-on
if (m_gameClient)
{
diff --git a/xbmc/games/controllers/windows/GUIControllerWindow.cpp b/xbmc/games/controllers/windows/GUIControllerWindow.cpp
index 35ccaac22f..d06bd6a80f 100644
--- a/xbmc/games/controllers/windows/GUIControllerWindow.cpp
+++ b/xbmc/games/controllers/windows/GUIControllerWindow.cpp
@@ -7,10 +7,10 @@
*/
#include "GUIControllerWindow.h"
+#include "ControllerInstaller.h"
#include "GUIControllerDefines.h"
#include "GUIControllerList.h"
#include "GUIFeatureList.h"
-#include "IConfigurationWindow.h"
#include "addons/GUIWindowAddonBrowser.h"
#include "addons/IAddon.h"
#include "addons/AddonManager.h"
@@ -22,23 +22,19 @@
#include "guilib/GUIControl.h"
#include "guilib/GUIMessage.h"
#include "guilib/WindowIDs.h"
+#include "messaging/helpers/DialogOKHelper.h"
#include "ServiceBroker.h"
-// To check for button mapping support
-#include "messaging/helpers/DialogOKHelper.h"
-#include "peripherals/bus/virtual/PeripheralBusAddon.h"
+// To enable button mapping support
#include "peripherals/Peripherals.h"
-#include "utils/log.h"
-
-// To check for installable controllers
-#include "addons/AddonDatabase.h"
using namespace KODI;
using namespace GAME;
using namespace KODI::MESSAGING;
CGUIControllerWindow::CGUIControllerWindow(void) :
- CGUIDialog(WINDOW_DIALOG_GAME_CONTROLLERS, "DialogGameControllers.xml")
+ CGUIDialog(WINDOW_DIALOG_GAME_CONTROLLERS, "DialogGameControllers.xml"),
+ m_installer(new CControllerInstaller)
{
// initialize CGUIWindow
m_loadType = KEEP_IN_MEMORY;
@@ -104,6 +100,11 @@ bool CGUIControllerWindow::OnMessage(CGUIMessage& message)
GetMoreControllers();
bHandled = true;
}
+ else if (controlId == CONTROL_GET_ALL)
+ {
+ GetAllControllers();
+ bHandled = true;
+ }
else if (controlId == CONTROL_RESET_BUTTON)
{
ResetController();
@@ -285,9 +286,16 @@ void CGUIControllerWindow::UpdateButtons(void)
VECADDONS addons;
if (m_gameClient)
+ {
SET_CONTROL_HIDDEN(CONTROL_GET_MORE);
+ SET_CONTROL_HIDDEN(CONTROL_GET_ALL);
+ }
else
- CONTROL_ENABLE_ON_CONDITION(CONTROL_GET_MORE, CServiceBroker::GetAddonMgr().GetInstallableAddons(addons, ADDON::ADDON_GAME_CONTROLLER) && !addons.empty());
+ {
+ const bool bEnable = CServiceBroker::GetAddonMgr().GetInstallableAddons(addons, ADDON::ADDON_GAME_CONTROLLER) && !addons.empty();
+ CONTROL_ENABLE_ON_CONDITION(CONTROL_GET_MORE, bEnable);
+ CONTROL_ENABLE_ON_CONDITION(CONTROL_GET_ALL, bEnable);
+ }
}
void CGUIControllerWindow::GetMoreControllers(void)
@@ -302,6 +310,14 @@ void CGUIControllerWindow::GetMoreControllers(void)
}
}
+void CGUIControllerWindow::GetAllControllers()
+{
+ if (m_installer->IsRunning())
+ return;
+
+ m_installer->Create(false);
+}
+
void CGUIControllerWindow::ResetController(void)
{
if (m_controllerList)
diff --git a/xbmc/games/controllers/windows/GUIControllerWindow.h b/xbmc/games/controllers/windows/GUIControllerWindow.h
index cbd40a919b..72fdbf1e7a 100644
--- a/xbmc/games/controllers/windows/GUIControllerWindow.h
+++ b/xbmc/games/controllers/windows/GUIControllerWindow.h
@@ -12,10 +12,13 @@
#include "games/GameTypes.h"
#include "guilib/GUIDialog.h"
+#include <memory>
+
namespace KODI
{
namespace GAME
{
+ class CControllerInstaller;
class IControllerList;
class IFeatureList;
@@ -44,6 +47,7 @@ namespace GAME
// Action for the available button
void GetMoreControllers(void);
+ void GetAllControllers();
void ResetController(void);
void ShowHelp(void);
void ShowButtonCaptureDialog(void);
@@ -53,6 +57,9 @@ namespace GAME
// Game paremeters
GameClientPtr m_gameClient;
+
+ // Controller parameters
+ std::unique_ptr<CControllerInstaller> m_installer;
};
}
}
diff --git a/xbmc/games/controllers/windows/GUIFeatureList.cpp b/xbmc/games/controllers/windows/GUIFeatureList.cpp
index fab75b1812..ffbfef2fff 100644
--- a/xbmc/games/controllers/windows/GUIFeatureList.cpp
+++ b/xbmc/games/controllers/windows/GUIFeatureList.cpp
@@ -109,32 +109,29 @@ void CGUIFeatureList::Load(const ControllerPtr& controller)
buttons = GetButtons(itGroup->features, m_buttonCount);
}
- if (!buttons.empty())
- {
- // Just in case
- if (m_buttonCount + buttons.size() >= MAX_FEATURE_COUNT)
- break;
+ // Just in case
+ if (m_buttonCount + buttons.size() >= MAX_FEATURE_COUNT)
+ break;
- // Add a separator if the group list isn't empty
- if (m_guiFeatureSeparator && m_guiList->GetTotalSize() > 0)
- {
- CGUIFeatureSeparator* pSeparator = new CGUIFeatureSeparator(*m_guiFeatureSeparator, m_buttonCount);
- m_guiList->AddControl(pSeparator);
- }
+ // Add a separator if the group list isn't empty
+ if (m_guiFeatureSeparator && m_guiList->GetTotalSize() > 0)
+ {
+ CGUIFeatureSeparator* pSeparator = new CGUIFeatureSeparator(*m_guiFeatureSeparator, m_buttonCount);
+ m_guiList->AddControl(pSeparator);
+ }
- // Add the group title
- if (m_guiGroupTitle && !groupName.empty())
- {
- CGUIFeatureGroupTitle* pGroupTitle = new CGUIFeatureGroupTitle(*m_guiGroupTitle, groupName, m_buttonCount);
- m_guiList->AddControl(pGroupTitle);
- }
+ // Add the group title
+ if (m_guiGroupTitle && !groupName.empty())
+ {
+ CGUIFeatureGroupTitle* pGroupTitle = new CGUIFeatureGroupTitle(*m_guiGroupTitle, groupName, m_buttonCount);
+ m_guiList->AddControl(pGroupTitle);
+ }
- // Add the buttons
- for (CGUIButtonControl* pButton : buttons)
- m_guiList->AddControl(pButton);
+ // Add the buttons
+ for (CGUIButtonControl* pButton : buttons)
+ m_guiList->AddControl(pButton);
- m_buttonCount += buttons.size();
- }
+ m_buttonCount += buttons.size();
}
}
@@ -230,6 +227,14 @@ std::vector<CGUIFeatureList::FeatureGroup> CGUIFeatureList::GetFeatureGroups(con
}
}
+ // If there are no features, add an empty group
+ if (groups.empty())
+ {
+ FeatureGroup group;
+ group.groupName = g_localizeStrings.Get(35022); // "Nothing to map"
+ groups.emplace_back(std::move(group));
+ }
+
return groups;
}
diff --git a/xbmc/games/dialogs/osd/DialogGameStretchMode.cpp b/xbmc/games/dialogs/osd/DialogGameStretchMode.cpp
index 9c2bdee609..a759b362a1 100644
--- a/xbmc/games/dialogs/osd/DialogGameStretchMode.cpp
+++ b/xbmc/games/dialogs/osd/DialogGameStretchMode.cpp
@@ -18,13 +18,13 @@
using namespace KODI;
using namespace GAME;
-const std::vector<CDialogGameStretchMode::ViewModeProperties> CDialogGameStretchMode::m_allViewModes =
+const std::vector<CDialogGameStretchMode::StretchModeProperties> CDialogGameStretchMode::m_allStretchModes =
{
- { 630, RETRO::VIEWMODE::Normal },
-// { 631, RETRO::VIEWMODE::Zoom }, //! @todo RetroArch allows trimming some outer pixels
- { 632, RETRO::VIEWMODE::Stretch4x3 },
- { 35232, RETRO::VIEWMODE::Fullscreen },
- { 635, RETRO::VIEWMODE::Original },
+ { 630, RETRO::STRETCHMODE::Normal },
+// { 631, RETRO::STRETCHMODE::Zoom }, //! @todo RetroArch allows trimming some outer pixels
+ { 632, RETRO::STRETCHMODE::Stretch4x3 },
+ { 35232, RETRO::STRETCHMODE::Fullscreen },
+ { 635, RETRO::STRETCHMODE::Original },
};
CDialogGameStretchMode::CDialogGameStretchMode() :
@@ -39,21 +39,21 @@ std::string CDialogGameStretchMode::GetHeading()
void CDialogGameStretchMode::PreInit()
{
- m_viewModes.clear();
+ m_stretchModes.clear();
- for (const auto &viewMode : m_allViewModes)
+ for (const auto &stretchMode : m_allStretchModes)
{
bool bSupported = false;
- switch (viewMode.viewMode)
+ switch (stretchMode.stretchMode)
{
- case RETRO::VIEWMODE::Normal:
- case RETRO::VIEWMODE::Original:
+ case RETRO::STRETCHMODE::Normal:
+ case RETRO::STRETCHMODE::Original:
bSupported = true;
break;
- case RETRO::VIEWMODE::Stretch4x3:
- case RETRO::VIEWMODE::Fullscreen:
+ case RETRO::STRETCHMODE::Stretch4x3:
+ case RETRO::STRETCHMODE::Fullscreen:
if (m_gameVideoHandle)
{
bSupported = m_gameVideoHandle->SupportsRenderFeature(RETRO::RENDERFEATURE::STRETCH) ||
@@ -66,30 +66,30 @@ void CDialogGameStretchMode::PreInit()
}
if (bSupported)
- m_viewModes.emplace_back(viewMode);
+ m_stretchModes.emplace_back(stretchMode);
}
}
void CDialogGameStretchMode::GetItems(CFileItemList &items)
{
- for (const auto &viewMode : m_viewModes)
+ for (const auto &stretchMode : m_stretchModes)
{
- CFileItemPtr item = std::make_shared<CFileItem>(g_localizeStrings.Get(viewMode.stringIndex));
- item->SetProperty("game.viewmode", CVariant{ static_cast<int>(viewMode.viewMode) });
+ CFileItemPtr item = std::make_shared<CFileItem>(g_localizeStrings.Get(stretchMode.stringIndex));
+ item->SetProperty("game.stretchmode", CVariant{ static_cast<int>(stretchMode.stretchMode) });
items.Add(std::move(item));
}
}
void CDialogGameStretchMode::OnItemFocus(unsigned int index)
{
- if (index < m_viewModes.size())
+ if (index < m_stretchModes.size())
{
- const RETRO::VIEWMODE viewMode = m_viewModes[index].viewMode;
+ const RETRO::STRETCHMODE stretchMode = m_stretchModes[index].stretchMode;
CGameSettings &gameSettings = CMediaSettings::GetInstance().GetCurrentGameSettings();
- if (gameSettings.ViewMode() != viewMode)
+ if (gameSettings.StretchMode() != stretchMode)
{
- gameSettings.SetViewMode(viewMode);
+ gameSettings.SetStretchMode(stretchMode);
gameSettings.NotifyObservers(ObservableMessageSettingsChanged);
}
}
@@ -99,10 +99,10 @@ unsigned int CDialogGameStretchMode::GetFocusedItem() const
{
CGameSettings &gameSettings = CMediaSettings::GetInstance().GetCurrentGameSettings();
- for (unsigned int i = 0; i < m_viewModes.size(); i++)
+ for (unsigned int i = 0; i < m_stretchModes.size(); i++)
{
- const RETRO::VIEWMODE viewMode = m_viewModes[i].viewMode;
- if (viewMode == gameSettings.ViewMode())
+ const RETRO::STRETCHMODE stretchMode = m_stretchModes[i].stretchMode;
+ if (stretchMode == gameSettings.StretchMode())
return i;
}
@@ -111,5 +111,5 @@ unsigned int CDialogGameStretchMode::GetFocusedItem() const
void CDialogGameStretchMode::PostExit()
{
- m_viewModes.clear();
+ m_stretchModes.clear();
}
diff --git a/xbmc/games/dialogs/osd/DialogGameStretchMode.h b/xbmc/games/dialogs/osd/DialogGameStretchMode.h
index d17bc0b72c..cd6ab81d8f 100644
--- a/xbmc/games/dialogs/osd/DialogGameStretchMode.h
+++ b/xbmc/games/dialogs/osd/DialogGameStretchMode.h
@@ -33,18 +33,18 @@ namespace GAME
void PostExit() override;
private:
- struct ViewModeProperties
+ struct StretchModeProperties
{
int stringIndex;
- RETRO::VIEWMODE viewMode;
+ RETRO::STRETCHMODE stretchMode;
};
- std::vector<ViewModeProperties> m_viewModes;
+ std::vector<StretchModeProperties> m_stretchModes;
/*!
- * \brief The list of all the view modes along with their properties
+ * \brief The list of all the stretch modes along with their properties
*/
- static const std::vector<ViewModeProperties> m_allViewModes;
+ static const std::vector<StretchModeProperties> m_allStretchModes;
};
}
}
diff --git a/xbmc/guilib/GUIControlFactory.cpp b/xbmc/guilib/GUIControlFactory.cpp
index be3effb5f1..405c0579a1 100644
--- a/xbmc/guilib/GUIControlFactory.cpp
+++ b/xbmc/guilib/GUIControlFactory.cpp
@@ -1143,9 +1143,9 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl
GetInfoLabel(pControlNode, "videofilter", videoFilter, parentID);
static_cast<RETRO::CGUIGameControl*>(control)->SetVideoFilter(videoFilter);
- GUIINFO::CGUIInfoLabel viewMode;
- GetInfoLabel(pControlNode, "viewmode", viewMode, parentID);
- static_cast<RETRO::CGUIGameControl*>(control)->SetViewMode(viewMode);
+ GUIINFO::CGUIInfoLabel stretchMode;
+ GetInfoLabel(pControlNode, "stretchmode", stretchMode, parentID);
+ static_cast<RETRO::CGUIGameControl*>(control)->SetStretchMode(stretchMode);
GUIINFO::CGUIInfoLabel rotation;
GetInfoLabel(pControlNode, "rotation", rotation, parentID);
diff --git a/xbmc/guilib/guiinfo/GUIInfoLabels.h b/xbmc/guilib/guiinfo/GUIInfoLabels.h
index 9356e2c046..a2a65c7963 100644
--- a/xbmc/guilib/guiinfo/GUIInfoLabels.h
+++ b/xbmc/guilib/guiinfo/GUIInfoLabels.h
@@ -266,7 +266,7 @@
#define VIDEOPLAYER_USER_RATING 319
#define VIDEOPLAYER_DBID 320
-#define RETROPLAYER_VIEWMODE 330
+#define RETROPLAYER_STRETCHMODE 330
#define CONTAINER_HAS_PARENT_ITEM 341
#define CONTAINER_CAN_FILTER 342
diff --git a/xbmc/guilib/guiinfo/GamesGUIInfo.cpp b/xbmc/guilib/guiinfo/GamesGUIInfo.cpp
index 982d312a47..bf42439bde 100644
--- a/xbmc/guilib/guiinfo/GamesGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/GamesGUIInfo.cpp
@@ -52,10 +52,10 @@ bool CGamesGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont
///////////////////////////////////////////////////////////////////////////////////////////////
// RETROPLAYER_*
///////////////////////////////////////////////////////////////////////////////////////////////
- case RETROPLAYER_VIEWMODE:
+ case RETROPLAYER_STRETCHMODE:
{
- VIEWMODE viewMode = CMediaSettings::GetInstance().GetCurrentGameSettings().ViewMode();
- value = CRetroPlayerUtils::ViewModeToDescription(viewMode);
+ STRETCHMODE stretchMode = CMediaSettings::GetInstance().GetCurrentGameSettings().StretchMode();
+ value = CRetroPlayerUtils::StretchModeToDescription(stretchMode);
return true;
}
diff --git a/xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp b/xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp
index bec0f6cdef..dcb5aa8770 100644
--- a/xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp
@@ -86,6 +86,7 @@ bool CVisualisationGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int
{
CGUIVisualisationControl *pVis = static_cast<CGUIVisualisationControl*>(msg.GetPointer());
value = pVis->IsLocked();
+ return true;
}
break;
}
diff --git a/xbmc/input/WindowTranslator.cpp b/xbmc/input/WindowTranslator.cpp
index a3da1b0f54..9d7a28129d 100644
--- a/xbmc/input/WindowTranslator.cpp
+++ b/xbmc/input/WindowTranslator.cpp
@@ -145,7 +145,7 @@ const CWindowTranslator::WindowMapByName CWindowTranslator::WindowMappingByName
{ "radiotimerrules" , WINDOW_RADIO_TIMER_RULES},
{ "gameosd" , WINDOW_DIALOG_GAME_OSD },
{ "gamevideofilter" , WINDOW_DIALOG_GAME_VIDEO_FILTER },
- { "gameviewmode" , WINDOW_DIALOG_GAME_STRETCH_MODE },
+ { "gamestretchmode" , WINDOW_DIALOG_GAME_STRETCH_MODE },
{ "gamevolume" , WINDOW_DIALOG_GAME_VOLUME },
{ "gameadvancedsettings" , WINDOW_DIALOG_GAME_ADVANCED_SETTINGS },
{ "gamevideorotation" , WINDOW_DIALOG_GAME_VIDEO_ROTATION },
diff --git a/xbmc/settings/GameSettings.cpp b/xbmc/settings/GameSettings.cpp
index cb31eb7164..77d58efaf1 100644
--- a/xbmc/settings/GameSettings.cpp
+++ b/xbmc/settings/GameSettings.cpp
@@ -15,7 +15,7 @@ CGameSettings &CGameSettings::operator=(const CGameSettings &rhs)
if (this != &rhs)
{
m_videoFilter = rhs.m_videoFilter;
- m_viewMode = rhs.m_viewMode;
+ m_stretchMode = rhs.m_stretchMode;
m_rotationDegCCW = rhs.m_rotationDegCCW;
}
return *this;
@@ -24,14 +24,14 @@ CGameSettings &CGameSettings::operator=(const CGameSettings &rhs)
void CGameSettings::Reset()
{
m_videoFilter.clear();
- m_viewMode = RETRO::VIEWMODE::Normal;
+ m_stretchMode = RETRO::STRETCHMODE::Normal;
m_rotationDegCCW = 0;
}
bool CGameSettings::operator==(const CGameSettings &rhs) const
{
return m_videoFilter == rhs.m_videoFilter &&
- m_viewMode == rhs.m_viewMode &&
+ m_stretchMode == rhs.m_stretchMode &&
m_rotationDegCCW == rhs.m_rotationDegCCW;
}
@@ -44,11 +44,11 @@ void CGameSettings::SetVideoFilter(const std::string &videoFilter)
}
}
-void CGameSettings::SetViewMode(RETRO::VIEWMODE viewMode)
+void CGameSettings::SetStretchMode(RETRO::STRETCHMODE stretchMode)
{
- if (viewMode != m_viewMode)
+ if (stretchMode != m_stretchMode)
{
- m_viewMode = viewMode;
+ m_stretchMode = stretchMode;
SetChanged();
}
}
diff --git a/xbmc/settings/GameSettings.h b/xbmc/settings/GameSettings.h
index 2149520cb2..f4c6424fb2 100644
--- a/xbmc/settings/GameSettings.h
+++ b/xbmc/settings/GameSettings.h
@@ -30,8 +30,8 @@ public:
const std::string &VideoFilter() const { return m_videoFilter; }
void SetVideoFilter(const std::string &videoFilter);
- KODI::RETRO::VIEWMODE ViewMode() const { return m_viewMode; }
- void SetViewMode(KODI::RETRO::VIEWMODE viewMode);
+ KODI::RETRO::STRETCHMODE StretchMode() const { return m_stretchMode; }
+ void SetStretchMode(KODI::RETRO::STRETCHMODE stretchMode);
unsigned int RotationDegCCW() const { return m_rotationDegCCW; }
void SetRotationDegCCW(unsigned int rotation);
@@ -39,6 +39,6 @@ public:
private:
// Video settings
std::string m_videoFilter;
- KODI::RETRO::VIEWMODE m_viewMode;
+ KODI::RETRO::STRETCHMODE m_stretchMode;
unsigned int m_rotationDegCCW;
};
diff --git a/xbmc/settings/MediaSettings.cpp b/xbmc/settings/MediaSettings.cpp
index f29af61182..1c6bcc71c8 100644
--- a/xbmc/settings/MediaSettings.cpp
+++ b/xbmc/settings/MediaSettings.cpp
@@ -127,9 +127,9 @@ bool CMediaSettings::Load(const TiXmlNode *settings)
if (XMLUtils::GetString(pElement, "videofilter", videoFilter))
m_defaultGameSettings.SetVideoFilter(videoFilter);
- int viewMode;
- if (XMLUtils::GetInt(pElement, "viewmode", viewMode, static_cast<int>(RETRO::VIEWMODE::Normal), static_cast<int>(RETRO::VIEWMODE::Max)))
- m_defaultGameSettings.SetViewMode(static_cast<RETRO::VIEWMODE>(viewMode));
+ int stretchMode;
+ if (XMLUtils::GetInt(pElement, "stretchmode", stretchMode, static_cast<int>(RETRO::STRETCHMODE::Normal), static_cast<int>(RETRO::STRETCHMODE::Max)))
+ m_defaultGameSettings.SetStretchMode(static_cast<RETRO::STRETCHMODE>(stretchMode));
int rotation;
if (XMLUtils::GetInt(pElement, "rotation", rotation, 0, 270) && rotation >= 0)
@@ -229,7 +229,7 @@ bool CMediaSettings::Save(TiXmlNode *settings) const
return false;
XMLUtils::SetString(pNode, "videofilter", m_defaultGameSettings.VideoFilter());
- XMLUtils::SetInt(pNode, "viewmode", static_cast<int>(m_defaultGameSettings.ViewMode()));
+ XMLUtils::SetInt(pNode, "stretchmode", static_cast<int>(m_defaultGameSettings.StretchMode()));
XMLUtils::SetInt(pNode, "rotation", m_defaultGameSettings.RotationDegCCW());
// mymusic
diff --git a/xbmc/utils/LangCodeExpander.cpp b/xbmc/utils/LangCodeExpander.cpp
index d68d0d92d7..8a5fa02e42 100644
--- a/xbmc/utils/LangCodeExpander.cpp
+++ b/xbmc/utils/LangCodeExpander.cpp
@@ -331,7 +331,13 @@ bool CLangCodeExpander::ConvertToISO6391(const std::string& lang, std::string& c
}
if (tmp.length() == 3)
+ {
+ // there's only an iso639-2 code that is identical to the language name, e.g. Yao
+ if (StringUtils::EqualsNoCase(tmp, lang))
+ return false;
+
return ConvertToISO6391(tmp, code);
+ }
}
return false;