Permalink
Browse files

add support for vfs add-ons

  • Loading branch information...
1 parent b7f0f4b commit db313a1567ffd81bf2cc95752d68152db8dc75ce @notspiff notspiff committed Aug 19, 2016
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="kodi.vfs" version="1.0.0" provider-name="Team-Kodi">
+ <backwards-compatibility abi="1.0.0"/>
+ <requires>
+ <import addon="xbmc.core" version="0.1.0"/>
+ </requires>
+</addon>
@@ -20405,3 +20405,8 @@ msgstr ""
msgctxt "#39012"
msgid "Set the maximum time to wait for the network to come up after starting or waking up. When time has passed before network is up startup will continue."
msgstr ""
+
+#: xbmc/addons/Addon.cpp
+msgctxt "#39013"
+msgid "Virtual filesystems"
+msgstr ""
@@ -0,0 +1,25 @@
+# kodi-vfs-dev debian package metadata
+#
+# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to use dpkg-shlibdeps to
+# automatically generate the package dependency list and append its output to
+# PACKAGE_DEPENDS list. Only useful for packages that contain binaries.
+#
+# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
+# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
+# based on build options.
+#
+# Remaining settings are (hopefully) self-explanatory.
+
+PACKAGE_NAME @APP_NAME_LC@-vfs-dev
+PACKAGE_ARCHITECTURE all
+PACKAGE_SECTION libdevel
+PACKAGE_PRIORITY optional
+PACKAGE_SHLIBDEPS
+PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev
+PACKAGE_RECOMMENDS
+PACKAGE_SUGGESTS
+PACKAGE_BREAKS
+PACKAGE_REPLACES
+PACKAGE_PROVIDES xbmc-vfs-dev
+PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (vfs add-ons dev package)
+PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s vfs add-ons.
@@ -40,3 +40,4 @@ addons/metadata.common.theaudiodb.com/*
addons/metadata.common.themoviedb.org/*
addons/metadata.themoviedb.org/*
addons/metadata.tvdb.com/*
+addons/kodi.vfs/*
@@ -318,6 +318,13 @@ install(FILES ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/ko
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-game-dev)
+# Install kodi-vfs-dev
+install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_dll.h
+ ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h
+ ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h
+ DESTINATION include/${APP_NAME_LC}
+ COMPONENT kodi-vfs-dev)
+
# Install XBT skin files
foreach(texture ${XBT_FILES})
string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture})
@@ -9,6 +9,7 @@
<addon>kodi.inputstream</addon>
<addon>kodi.peripheral</addon>
<addon>kodi.resource</addon>
+ <addon>kodi.vfs</addon>
<addon>metadata.album.universal</addon>
<addon>metadata.artists.universal</addon>
<addon>metadata.common.allmusic.com</addon>
View
@@ -53,6 +53,7 @@
#include "addons/BinaryAddonCache.h"
#include "addons/LanguageResource.h"
#include "addons/Skin.h"
+#include "addons/VFSEntry.h"
#include "interfaces/generic/ScriptInvocationManager.h"
#ifdef HAS_PYTHON
#include "interfaces/python/XBPython.h"
@@ -204,6 +205,7 @@
#ifdef TARGET_POSIX
#include "XHandle.h"
#include "XTimeUtils.h"
+#include "filesystem/posix/PosixDirectory.h"
#endif
#if defined(TARGET_ANDROID)
@@ -2944,6 +2946,14 @@ void CApplication::Stop(int exitCode)
#ifdef HAS_FILESYSTEM_SFTP
CSFTPSessionManager::DisconnectAllSessions();
#endif
+ VECADDONS addons;
+ CServiceBroker::GetBinaryAddonCache().GetAddons(addons, ADDON_VFS);
+ for (auto& it : addons)
+ {
+ AddonPtr addon = CServiceBroker::GetBinaryAddonCache().GetAddonInstance(it->ID(), ADDON_VFS);
+ VFSEntryPtr vfs = std::static_pointer_cast<CVFSEntry>(addon);
+ vfs->DisconnectAll();
+ }
#if defined(TARGET_POSIX) && defined(HAS_FILESYSTEM_SMB)
smb.Deinit();
@@ -4582,6 +4592,15 @@ void CApplication::ProcessSlow()
CSFTPSessionManager::ClearOutIdleSessions();
#endif
+ VECADDONS addons;
+ CServiceBroker::GetBinaryAddonCache().GetAddons(addons, ADDON_VFS);
+ for (auto& it : addons)
+ {
+ AddonPtr addon = CServiceBroker::GetBinaryAddonCache().GetAddonInstance(it->ID(), ADDON_VFS);
+ VFSEntryPtr vfs = std::static_pointer_cast<CVFSEntry>(addon);
+ vfs->ClearOutIdle();
+ }
+
g_mediaManager.ProcessEvents();
CAEFactory::GarbageCollect();
@@ -5203,6 +5222,15 @@ void CApplication::CloseNetworkShares()
#ifdef HAS_FILESYSTEM_SFTP
CSFTPSessionManager::DisconnectAllSessions();
#endif
+
+ VECADDONS addons;
+ CServiceBroker::GetBinaryAddonCache().GetAddons(addons, ADDON_VFS);
+ for (auto& it : addons)
+ {
+ AddonPtr addon = CServiceBroker::GetBinaryAddonCache().GetAddonInstance(it->ID(), ADDON_VFS);
+ VFSEntryPtr vfs = std::static_pointer_cast<CVFSEntry>(addon);
+ vfs->DisconnectAll();
+ }
}
void CApplication::RegisterActionListener(IActionListener *listener)
@@ -109,6 +109,7 @@ static const TypeMapping types[] =
{"kodi.resource.games", ADDON_RESOURCE_GAMES, 35209, "DefaultAddonGame.png" },
{"kodi.adsp", ADDON_ADSPDLL, 24135, "DefaultAddonAudioDSP.png" },
{"kodi.inputstream", ADDON_INPUTSTREAM, 24048, "DefaultAddonInputstream.png" },
+ {"kodi.vfs", ADDON_VFS, 39013, "DefaultAddonVfs.png" },
};
std::string TranslateType(ADDON::TYPE type, bool pretty/*=false*/)
@@ -33,6 +33,7 @@
#include "addons/Service.h"
#include "addons/Skin.h"
#include "addons/UISoundsResource.h"
+#include "addons/VFSEntry.h"
#include "addons/Visualisation.h"
#include "addons/Webinterface.h"
#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h"
@@ -89,6 +90,7 @@ std::shared_ptr<IAddon> CAddonBuilder::Build()
type == ADDON_ADSPDLL ||
type == ADDON_AUDIOENCODER ||
type == ADDON_AUDIODECODER ||
+ type == ADDON_VFS ||
type == ADDON_INPUTSTREAM ||
type == ADDON_PERIPHERALDLL ||
type == ADDON_GAMEDLL)
@@ -142,6 +144,8 @@ std::shared_ptr<IAddon> CAddonBuilder::Build()
return PERIPHERALS::CPeripheralAddon::FromExtension(std::move(m_props), m_extPoint);
case ADDON_GAMEDLL:
return GAME::CGameClient::FromExtension(std::move(m_props), m_extPoint);
+ case ADDON_VFS:
+ return CVFSEntry::FromExtension(std::move(m_props), m_extPoint);
case ADDON_SKIN:
return CSkinInfo::FromExtension(std::move(m_props), m_extPoint);
case ADDON_RESOURCE_IMAGES:
@@ -40,6 +40,7 @@
#include "events/AddonManagementEvent.h"
#include "events/EventLog.h"
#include "filesystem/SpecialProtocol.h"
+#include "VFSEntry.h"
#include "LangInfo.h"
#include "PluginSource.h"
#include "Repository.h"
@@ -37,6 +37,7 @@ void CBinaryAddonCache::Init()
ADDON_INPUTSTREAM,
ADDON_PVRDLL,
ADDON_GAMEDLL,
+ ADDON_VFS
};
CAddonMgr::GetInstance().Events().Subscribe(this, &CBinaryAddonCache::OnEvent);
Update();
@@ -111,4 +112,4 @@ void CBinaryAddonCache::Update()
}
}
-}
+}
@@ -30,6 +30,7 @@ set(SOURCES Addon.cpp
Service.cpp
Skin.cpp
UISoundsResource.cpp
+ VFSEntry.cpp
Visualisation.cpp
Webinterface.cpp)
@@ -70,6 +71,7 @@ set(HEADERS Addon.h
Service.h
Skin.h
UISoundsResource.h
+ VFSEntry.h
Visualisation.h
Webinterface.h)
@@ -64,6 +64,7 @@ namespace ADDON
ADDON_RESOURCE_LANGUAGE,
ADDON_RESOURCE_UISOUNDS,
ADDON_RESOURCE_GAMES,
+ ADDON_VFS,
ADDON_VIDEO, // virtual addon types
ADDON_AUDIO,
ADDON_IMAGE,
Oops, something went wrong.

1 comment on commit db313a1

@joshknnd1982

Currently kodi does not work with native windows screen readers such as NVDA. Please add accessibility support so Kodi can work with native windows screen readers such as NVDA and Linux screen readers such as Orca. Also Kodi does not work with google talkback on android and voiceOver screen reader on IOS or TVOS. Please either re-write kodi with accessibility support built in, or make a special accessible version of Kodi that works good with google talkback-android and voiceover-IOS. thanks.

Please sign in to comment.