aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/resource.language.en_gb/resources/strings.po7
-rw-r--r--xbmc/input/ActionIDs.h1
-rw-r--r--xbmc/input/ActionTranslator.cpp1
-rw-r--r--xbmc/video/PlayerController.cpp29
4 files changed, 37 insertions, 1 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index cbcdecbf8d..eac306b40b 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -21416,4 +21416,9 @@ msgstr ""
#: xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp
msgctxt "#39108"
msgid "audio description"
-msgstr "" \ No newline at end of file
+msgstr ""
+
+#: xbmc/video/PlayerController.cpp
+msgctxt "#39109"
+msgid "Select Program"
+msgstr ""
diff --git a/xbmc/input/ActionIDs.h b/xbmc/input/ActionIDs.h
index 9613a3709f..1e8ef6bb49 100644
--- a/xbmc/input/ActionIDs.h
+++ b/xbmc/input/ActionIDs.h
@@ -104,6 +104,7 @@
#define ACTION_PLAY 68 //!< Unused at the moment
#define ACTION_PLAYER_PROCESS_INFO 69 //!< show player process info (video decoder, pixel format, pvr signal strength and the like
+#define ACTION_PLAYER_PROGRAM_SELECT 70
#define ACTION_SMALL_STEP_BACK 76 //!< jumps a few seconds back during playback of movie. Can b used in videoFullScreen.xml window id=2005
#define ACTION_PLAYER_FORWARD 77 //!< FF in current file played. global action, can be used anywhere
diff --git a/xbmc/input/ActionTranslator.cpp b/xbmc/input/ActionTranslator.cpp
index 69aab521fe..ad42a1cd68 100644
--- a/xbmc/input/ActionTranslator.cpp
+++ b/xbmc/input/ActionTranslator.cpp
@@ -67,6 +67,7 @@ static const std::map<ActionName, ActionID> ActionMappings =
{ "playerdebug" , ACTION_PLAYER_DEBUG },
{ "codecinfo" , ACTION_PLAYER_PROCESS_INFO },
{ "playerprocessinfo" , ACTION_PLAYER_PROCESS_INFO },
+ { "playerprogramselect" , ACTION_PLAYER_PROGRAM_SELECT },
{ "nextpicture" , ACTION_NEXT_PICTURE },
{ "previouspicture" , ACTION_PREV_PICTURE },
{ "zoomout" , ACTION_ZOOM_OUT },
diff --git a/xbmc/video/PlayerController.cpp b/xbmc/video/PlayerController.cpp
index 0f0ad38c6f..aee0f72fe6 100644
--- a/xbmc/video/PlayerController.cpp
+++ b/xbmc/video/PlayerController.cpp
@@ -20,6 +20,7 @@
#include "PlayerController.h"
#include "ServiceBroker.h"
+#include "dialogs/GUIDialogSelect.h"
#include "dialogs/GUIDialogSlider.h"
#include "settings/AdvancedSettings.h"
#include "settings/MediaSettings.h"
@@ -28,12 +29,14 @@
#include "input/Key.h"
#include "guilib/LocalizeStrings.h"
#include "guilib/GUISliderControl.h"
+#include "guilib/GUIWindowManager.h"
#include "dialogs/GUIDialogKaiToast.h"
#include "video/dialogs/GUIDialogAudioSubtitleSettings.h"
#include "cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.h"
#include "Application.h"
#include "utils/LangCodeExpander.h"
#include "utils/StringUtils.h"
+#include "utils/Variant.h"
CPlayerController::CPlayerController()
: m_sliderAction(0)
@@ -425,6 +428,32 @@ bool CPlayerController::OnAction(const CAction &action)
return true;
}
+ case ACTION_PLAYER_PROGRAM_SELECT:
+ {
+ std::vector<ProgramInfo> programs;
+ g_application.m_pPlayer->GetPrograms(programs);
+ CGUIDialogSelect *dialog = g_windowManager.GetWindow<CGUIDialogSelect>(WINDOW_DIALOG_SELECT);
+ if (dialog)
+ {
+ int playing = 0;
+ int idx = 0;
+ for (auto prog : programs)
+ {
+ dialog->Add(prog.name);
+ if (prog.playing)
+ playing = idx;
+ idx++;
+ }
+ dialog->SetHeading(CVariant{g_localizeStrings.Get(39109)});
+ dialog->SetSelected(playing);
+ dialog->Open();
+ idx = dialog->GetSelectedItem();
+ if (idx > 0)
+ g_application.m_pPlayer->SetProgram(programs[idx].id);
+ }
+ return true;
+ }
+
default:
break;
}