diff options
author | Garrett Brown <garbearucla@gmail.com> | 2015-01-11 08:23:13 +0800 |
---|---|---|
committer | Garrett Brown <themagnificentmrb@gmail.com> | 2016-03-10 21:31:31 -0800 |
commit | afec10266946bad4d83c31a5d6c1b76fdfb540d1 (patch) | |
tree | 4dd21275fe79e6b313a6b23eb576d9741aa0347f /lib | |
parent | 1fe1a1a3a30b1e61813c13d8855ed1c6f75a4fb7 (diff) |
Peripheral add-ons
Thanks to frostworx for fixing the peripheral add-ons build, notspiff for
helping with the rebrand and montellese for the windows installer fix and VS
solution fix.
Diffstat (limited to 'lib')
4 files changed, 204 insertions, 0 deletions
diff --git a/lib/addons/library.kodi.peripheral/Makefile.in b/lib/addons/library.kodi.peripheral/Makefile.in new file mode 100644 index 0000000000..520ad3a14b --- /dev/null +++ b/lib/addons/library.kodi.peripheral/Makefile.in @@ -0,0 +1,29 @@ +ARCH=@ARCH@ +INCLUDES=-I. -I../../../xbmc/addons/include -I../../../xbmc +DEFINES+= +CXXFLAGS=-fPIC +LIBNAME=libKODI_peripheral +OBJS=$(LIBNAME).o + +ifeq ($(findstring osx,$(ARCH)), osx) +LIB_SHARED=../../../addons/library.kodi.peripheral/$(LIBNAME)-$(ARCH).dylib +else +LIB_SHARED=../../../addons/library.kodi.peripheral/$(LIBNAME)-$(ARCH).so +endif + +all: $(LIB_SHARED) + +$(LIB_SHARED): $(OBJS) +ifeq ($(findstring osx,$(ARCH)), osx) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -dynamiclib -o $@ $(OBJS) +else + $(CXX) $(CFLAGS) $(LDFLAGS) -shared -g -o $(LIB_SHARED) $(OBJS) +endif + +CLEAN_FILES = \ + $(LIB_SHARED) \ + +DISTCLEAN_FILES= \ + Makefile \ + +include ../../../Makefile.include diff --git a/lib/addons/library.kodi.peripheral/libKODI_peripheral.cpp b/lib/addons/library.kodi.peripheral/libKODI_peripheral.cpp new file mode 100644 index 0000000000..7c6b0c5e92 --- /dev/null +++ b/lib/addons/library.kodi.peripheral/libKODI_peripheral.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2014-2016 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 this Program; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +//#include "addons/AddonCallbacks.h" +//#include "addons/include/kodi_peripheral_types.h" +#include "addons/binary/interfaces/AddonInterfaces.h" +#include "addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h" + +#include <stdio.h> + +#ifdef _WIN32 + #include <windows.h> + #define DLLEXPORT __declspec(dllexport) +#else + #define DLLEXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +DLLEXPORT CB_PeripheralLib* PERIPHERAL_register_me(AddonCB* frontend) +{ + CB_PeripheralLib* cb = NULL; + if (!frontend) + fprintf(stderr, "ERROR: PERIPHERAL_register_frontend is called with NULL handle!!!\n"); + else + { + cb = frontend->PeripheralLib_RegisterMe(frontend->addonData); + if (!cb) + fprintf(stderr, "ERROR: PERIPHERAL_register_frontend can't get callback table from frontend!!!\n"); + } + return cb; +} + +DLLEXPORT void PERIPHERAL_unregister_me(AddonCB* frontend, CB_PeripheralLib* cb) +{ + if (frontend == NULL || cb == NULL) + return; + return frontend->PeripheralLib_UnRegisterMe(frontend->addonData, cb); +} + +DLLEXPORT void PERIPHERAL_trigger_scan(AddonCB* frontend, CB_PeripheralLib* cb) +{ + if (frontend == NULL || cb == NULL) + return; + return cb->TriggerScan(frontend->addonData); +} + +DLLEXPORT void PERIPHERAL_refresh_button_maps(AddonCB* frontend, CB_PeripheralLib* cb, const char* deviceName, const char* controllerId) +{ + if (frontend == NULL || cb == NULL) + return; + return cb->RefreshButtonMaps(frontend->addonData, deviceName ? deviceName : "", controllerId ? controllerId : ""); +} + +#ifdef __cplusplus +} +#endif diff --git a/lib/addons/library.kodi.peripheral/project/VS2010Express/libKODI_peripheral.vcxproj b/lib/addons/library.kodi.peripheral/project/VS2010Express/libKODI_peripheral.vcxproj new file mode 100644 index 0000000000..b32a96b682 --- /dev/null +++ b/lib/addons/library.kodi.peripheral/project/VS2010Express/libKODI_peripheral.vcxproj @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{FEA71D39-CB68-486B-A978-246E661A3F89}</ProjectGuid> + <RootNamespace>XBMC_VDR</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(SolutionDir)\XBMC.core-defaults.props" /> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets"> + <Import Project="$(SolutionDir)\XBMC.defaults.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\..\addons\library.kodi.peripheral\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\..\addons\library.kodi.peripheral\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\..\addons\library.xbmc.addon\;$(IncludePath)</IncludePath> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\..\addons\library.xbmc.addon\;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <AdditionalIncludeDirectories>..\..\..\..\..\xbmc;..\..\..\..\..\xbmc\addons\include;..\..\..\..\..\xbmc\cores\dvdplayer\DVDDemuxers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>VDR_EXPORTS;_WIN32PC;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ExceptionHandling>Sync</ExceptionHandling> + <PrecompiledHeader> + </PrecompiledHeader> + </ClCompile> + <Link> + <OutputFile>..\..\..\..\..\addons\library.kodi.peripheral\$(ProjectName).dll</OutputFile> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <AdditionalIncludeDirectories>..\..\..\..\..\xbmc;..\..\..\..\..\xbmc\addons\include;..\..\..\..\..\xbmc\cores\dvdplayer\DVDDemuxers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>HAS_SDL_OPENGL;HAS_SDL;_USRDLL;XBMC_VDR_EXPORTS;_WIN32PC;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ExceptionHandling>Sync</ExceptionHandling> + <PrecompiledHeader> + </PrecompiledHeader> + </ClCompile> + <Link> + <OutputFile>..\..\..\..\..\addons\library.kodi.peripheral\$(ProjectName).dll</OutputFile> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\libKODI_peripheral.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/lib/addons/library.kodi.peripheral/project/VS2010Express/libKODI_peripheral.vcxproj.filters b/lib/addons/library.kodi.peripheral/project/VS2010Express/libKODI_peripheral.vcxproj.filters new file mode 100644 index 0000000000..1674269e11 --- /dev/null +++ b/lib/addons/library.kodi.peripheral/project/VS2010Express/libKODI_peripheral.vcxproj.filters @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\libKODI_peripheral.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file |