From 44d0ef6ffb25c68db2e724ced61c6183531daa1d Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 2 Aug 2024 08:34:28 +0200 Subject: [PATCH] feat: add kodi as a system --- package/recalbox-system/odroidxu4/recalbox.conf | 2 +- package/recalbox-system/rpi1/recalbox.conf | 2 +- package/recalbox-system/rpi3/recalbox.conf | 2 +- package/recalbox-system/rpi4/recalbox.conf | 2 +- package/recalbox-system/rpi4_64/recalbox.conf | 2 +- package/recalbox-system/rpi5_64/recalbox.conf | 2 +- package/recalbox-system/rpizero2/recalbox.conf | 2 +- .../recalbox-system/rpizero2legacy/recalbox.conf | 2 +- package/recalbox-system/x86_64/recalbox.conf | 2 +- .../frontend/es-app/src/guis/menus/GuiMenu.cpp | 4 ---- .../frontend/es-app/src/systems/SystemManager.cpp | 14 ++++++++++++++ .../frontend/es-app/src/systems/SystemManager.h | 4 ++++ 12 files changed, 27 insertions(+), 13 deletions(-) diff --git a/package/recalbox-system/odroidxu4/recalbox.conf b/package/recalbox-system/odroidxu4/recalbox.conf index 930fc52828..433712ee40 100644 --- a/package/recalbox-system/odroidxu4/recalbox.conf +++ b/package/recalbox-system/odroidxu4/recalbox.conf @@ -127,7 +127,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/package/recalbox-system/rpi1/recalbox.conf b/package/recalbox-system/rpi1/recalbox.conf index 155b67cc25..52b6a2e52e 100644 --- a/package/recalbox-system/rpi1/recalbox.conf +++ b/package/recalbox-system/rpi1/recalbox.conf @@ -136,7 +136,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/package/recalbox-system/rpi3/recalbox.conf b/package/recalbox-system/rpi3/recalbox.conf index 4556281877..a06277f4cb 100644 --- a/package/recalbox-system/rpi3/recalbox.conf +++ b/package/recalbox-system/rpi3/recalbox.conf @@ -136,7 +136,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/package/recalbox-system/rpi4/recalbox.conf b/package/recalbox-system/rpi4/recalbox.conf index fabe2bd1a5..10f79b1420 100644 --- a/package/recalbox-system/rpi4/recalbox.conf +++ b/package/recalbox-system/rpi4/recalbox.conf @@ -128,7 +128,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/package/recalbox-system/rpi4_64/recalbox.conf b/package/recalbox-system/rpi4_64/recalbox.conf index f57bed9201..213bf21286 100644 --- a/package/recalbox-system/rpi4_64/recalbox.conf +++ b/package/recalbox-system/rpi4_64/recalbox.conf @@ -128,7 +128,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/package/recalbox-system/rpi5_64/recalbox.conf b/package/recalbox-system/rpi5_64/recalbox.conf index c35c2c4beb..c0de4de65a 100644 --- a/package/recalbox-system/rpi5_64/recalbox.conf +++ b/package/recalbox-system/rpi5_64/recalbox.conf @@ -128,7 +128,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/package/recalbox-system/rpizero2/recalbox.conf b/package/recalbox-system/rpizero2/recalbox.conf index c0073426ef..1aecb5b7aa 100644 --- a/package/recalbox-system/rpizero2/recalbox.conf +++ b/package/recalbox-system/rpizero2/recalbox.conf @@ -136,7 +136,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/package/recalbox-system/rpizero2legacy/recalbox.conf b/package/recalbox-system/rpizero2legacy/recalbox.conf index 9fa5a81a63..1b34fee6de 100644 --- a/package/recalbox-system/rpizero2legacy/recalbox.conf +++ b/package/recalbox-system/rpizero2legacy/recalbox.conf @@ -136,7 +136,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/package/recalbox-system/x86_64/recalbox.conf b/package/recalbox-system/x86_64/recalbox.conf index 3eb5b8bb19..58c841fbf3 100644 --- a/package/recalbox-system/x86_64/recalbox.conf +++ b/package/recalbox-system/x86_64/recalbox.conf @@ -126,7 +126,7 @@ emulationstation.forcebasicgamelistview=0 system.emulators.specialkeys=default ## Show or hide kodi in emulationstation (0,1) -kodi.enabled=1 +kodi.enabled=0 ## Start kodi at launch (0,1) kodi.atstartup=0 ## set x button shortcut (0,1) diff --git a/projects/frontend/es-app/src/guis/menus/GuiMenu.cpp b/projects/frontend/es-app/src/guis/menus/GuiMenu.cpp index 21714d4134..62390deeaa 100755 --- a/projects/frontend/es-app/src/guis/menus/GuiMenu.cpp +++ b/projects/frontend/es-app/src/guis/menus/GuiMenu.cpp @@ -30,10 +30,6 @@ GuiMenu::GuiMenu(WindowManager& window, SystemManager& systemManager, const IGlo // Bartop mode? bool bartop = RecalboxConf::Instance().GetMenuType() == RecalboxConf::Menu::Bartop; - // Kodi - if (RecalboxSystem::kodiExists() && RecalboxConf::Instance().GetKodiEnabled()) - AddSubMenu(_("KODI MEDIA CENTER"), MenuThemeData::MenuIcons::Type::Kodi, (int)Components::Kodi, _(MENUMESSAGE_START_KODI_HELP_MSG)); - // System menu if (!bartop) AddSubMenu(_("SYSTEM SETTINGS"), MenuThemeData::MenuIcons::Type::System, (int)Components::System, _(MENUMESSAGE_SYSTEM_HELP_MSG)); diff --git a/projects/frontend/es-app/src/systems/SystemManager.cpp b/projects/frontend/es-app/src/systems/SystemManager.cpp index 5463dc264b..9a558ecb26 100644 --- a/projects/frontend/es-app/src/systems/SystemManager.cpp +++ b/projects/frontend/es-app/src/systems/SystemManager.cpp @@ -768,6 +768,20 @@ SystemData* SystemManager::CreateArcadeSystem() return result; } +if (RecalboxSystem::kodiExists() && RecalboxConf::Instance().GetKodiEnabled()) +{ + SystemData* SystemManager::CreateKodiSystem() + { + SystemDescriptor descriptor; + descriptor.SetSystemInformation("bf126aeb-416a-471d-a868-b417f5e04ef8", sKodiSystemShortName, sKodiSystemFullName) + .SetPropertiesInformation("other", "no", "no", "no", "2020-01-01", "None", false, false, false, "") + .SetDescriptorInformation("", "", sKodiSystemShortName, "", "", false, false, false); + SystemData* result = new SystemData(*this, descriptor, SystemData::Properties::Virtual | SystemData::Properties::Searchable, + MetadataType::None, VirtualSystemType::Ports); + return result; + } +} + SystemData* SystemManager::CreateGenreSystem(GameGenres genre) { SystemDescriptor descriptor; diff --git a/projects/frontend/es-app/src/systems/SystemManager.h b/projects/frontend/es-app/src/systems/SystemManager.h index 18b1c3d05e..65259de94c 100644 --- a/projects/frontend/es-app/src/systems/SystemManager.h +++ b/projects/frontend/es-app/src/systems/SystemManager.h @@ -55,6 +55,8 @@ class SystemManager : private INoCopy // No copy allowed static constexpr const char* sLightgunSystemShortName = "lightgun"; //! Ports system internal name static constexpr const char* sArcadeSystemShortName = "arcade"; + //! Kodi system internal name + static constexpr const char* sKodiSystemShortName = "kodi"; //! Multiplayer system user-friendly name static constexpr const char* sMultiplayerSystemFullName = "Multi Players"; @@ -70,6 +72,8 @@ class SystemManager : private INoCopy // No copy allowed static constexpr const char* sLightgunSystemFullName = "LightGun Games"; //! Ports system internal name static constexpr const char* sArcadeSystemFullName = "Arcade"; + //! Kodi system internal name + static constexpr const char* sKodiSystemFullName = "Kodi"; private: //! Rom source folder to read/write (false) / read-only (true) state -- GitLab