diff options
author | Alwin Esch <alwin.esch@web.de> | 2016-03-09 12:23:59 +0100 |
---|---|---|
committer | Alwin Esch <alwin.esch@web.de> | 2016-03-09 12:23:59 +0100 |
commit | cc5100913c891e9b1dba2bcac75da09c7df6d43f (patch) | |
tree | 4232d886f08603c08e7deff103343168ab754ffe | |
parent | 755c367a60d5afb8a096459c95c72ae2f1e60899 (diff) |
[addon] Move add-on library parts to independent folders (code rework)
59 files changed, 2371 insertions, 1704 deletions
diff --git a/.gitignore b/.gitignore index ffc39188ce..12384b7880 100644 --- a/.gitignore +++ b/.gitignore @@ -397,6 +397,7 @@ lib/cpluff/stamp-h1 # /xbmc/addons/ /xbmc/addons/Makefile +/xbmc/addons/binary/interfaces/Makefile # /xbmc/platform/android /xbmc/platform/android/Makefile diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj index aa28208fcd..9d97926402 100644 --- a/Kodi.xcodeproj/project.pbxproj +++ b/Kodi.xcodeproj/project.pbxproj @@ -255,6 +255,19 @@ 5EB3113C1A978B9B00551907 /* CueInfoLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EB3113A1A978B9B00551907 /* CueInfoLoader.cpp */; }; 5EE4F9181A9FF36F002E20F8 /* CueInfoLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EB3113A1A978B9B00551907 /* CueInfoLoader.cpp */; }; 5EF801001A97892A0035AA4D /* ReplayGain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF800FE1A97892A0035AA4D /* ReplayGain.cpp */; }; + 761170901C8B85F8006C6366 /* AddonGUIRenderingControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7611708C1C8B85F8006C6366 /* AddonGUIRenderingControl.cpp */; }; + 761170911C8B85F8006C6366 /* AddonGUIWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7611708E1C8B85F8006C6366 /* AddonGUIWindow.cpp */; }; + 76AEFB361C8F79BD00EF2EC0 /* AddonInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E991C878F61000F5E80 /* AddonInterfaces.cpp */; }; + 76AEFB371C8F79C100EF2EC0 /* AddonCallbacksAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E921C878EE0000F5E80 /* AddonCallbacksAddon.cpp */; }; + 76AEFB381C8F79C400EF2EC0 /* AddonCallbacksAudioDSP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E951C878EF8000F5E80 /* AddonCallbacksAudioDSP.cpp */; }; + 76AEFB391C8F79C700EF2EC0 /* AddonCallbacksAudioEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E8F1C878EB8000F5E80 /* AddonCallbacksAudioEngine.cpp */; }; + 76AEFB3A1C8F79CA00EF2EC0 /* AddonCallbacksCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E8C1C878E97000F5E80 /* AddonCallbacksCodec.cpp */; }; + 76AEFB3B1C8F79CE00EF2EC0 /* AddonGUIRenderingControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7611708C1C8B85F8006C6366 /* AddonGUIRenderingControl.cpp */; }; + 76AEFB3C1C8F79D100EF2EC0 /* AddonGUIWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7611708E1C8B85F8006C6366 /* AddonGUIWindow.cpp */; }; + 76AEFB3D1C8F79D500EF2EC0 /* AddonCallbacksGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E891C878E62000F5E80 /* AddonCallbacksGUI.cpp */; }; + 76AEFB3E1C8F79D900EF2EC0 /* AddonCallbacksInputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F4C37C1C8E92E000A1E64B /* AddonCallbacksInputStream.cpp */; }; + 76AEFB3F1C8F79DC00EF2EC0 /* AddonCallbacksPVR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E861C878DE8000F5E80 /* AddonCallbacksPVR.cpp */; }; + 76F4C37E1C8E92E000A1E64B /* AddonCallbacksInputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F4C37C1C8E92E000A1E64B /* AddonCallbacksInputStream.cpp */; }; 7C0B98A4154B79C30065A238 /* AEDeviceInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C0B98A1154B79C30065A238 /* AEDeviceInfo.cpp */; }; 7C140989183224B8009F9411 /* ISetting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C14096F183224B8009F9411 /* ISetting.cpp */; }; 7C14098A183224B8009F9411 /* ISetting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C14096F183224B8009F9411 /* ISetting.cpp */; }; @@ -284,8 +297,6 @@ 7C1A85661520522500C63311 /* TextureCacheJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1A85631520522500C63311 /* TextureCacheJob.cpp */; }; 7C1D682915A7D2FD00658B65 /* DatabaseManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1D682715A7D2FD00658B65 /* DatabaseManager.cpp */; }; 7C1F6EBB13ECCFA7001726AB /* LibraryDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1F6EB913ECCFA7001726AB /* LibraryDirectory.cpp */; }; - 7C226E3E1BA5F61C00185CE0 /* AddonCallbacksAudioEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C226E3C1BA5F61C00185CE0 /* AddonCallbacksAudioEngine.cpp */; }; - 7C226E3F1BA5F61D00185CE0 /* AddonCallbacksAudioEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C226E3C1BA5F61C00185CE0 /* AddonCallbacksAudioEngine.cpp */; }; 7C26126C182068660086E04D /* SettingsOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C26126A182068660086E04D /* SettingsOperations.cpp */; }; 7C26126D182068660086E04D /* SettingsOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C26126A182068660086E04D /* SettingsOperations.cpp */; }; 7C2612711825B6340086E04D /* DatabaseQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C26126F1825B6340086E04D /* DatabaseQuery.cpp */; }; @@ -296,8 +307,6 @@ 7C4458BD161E203800A905F6 /* Screenshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4458BB161E203800A905F6 /* Screenshot.cpp */; }; 7C45DBE910F325C400D4BBF3 /* DAVDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C45DBE710F325C400D4BBF3 /* DAVDirectory.cpp */; }; 7C4705AE12EF584C00369E51 /* AddonInstaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4705AC12EF584C00369E51 /* AddonInstaller.cpp */; }; - 7C4B649F1C86F6BD000E1F74 /* AddonCallbacksInputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4B649D1C86F6BC000E1F74 /* AddonCallbacksInputStream.cpp */; }; - 7C4B64A01C86F6BD000E1F74 /* AddonCallbacksInputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4B649D1C86F6BC000E1F74 /* AddonCallbacksInputStream.cpp */; }; 7C4B64A31C86F6D8000E1F74 /* InputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4B64A11C86F6D8000E1F74 /* InputStream.cpp */; }; 7C4B64A41C86F6D8000E1F74 /* InputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4B64A11C86F6D8000E1F74 /* InputStream.cpp */; }; 7C4B64A71C86F712000E1F74 /* InputStreamAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4B64A51C86F712000E1F74 /* InputStreamAddon.cpp */; }; @@ -375,7 +384,6 @@ 7C908895196358A8003D0619 /* auto_buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C908892196358A8003D0619 /* auto_buffer.cpp */; }; 7C920CF9181669FF00DA1477 /* TextureOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C920CF7181669FF00DA1477 /* TextureOperations.cpp */; }; 7C920CFA181669FF00DA1477 /* TextureOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C920CF7181669FF00DA1477 /* TextureOperations.cpp */; }; - 7C973CE51B50378E0002A874 /* AddonCallbacksAudioDSP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C973CE31B50378E0002A874 /* AddonCallbacksAudioDSP.cpp */; }; 7C973CF11B5037EF0002A874 /* ActiveAEDSP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C973CE71B5037EF0002A874 /* ActiveAEDSP.cpp */; }; 7C973CF21B5037EF0002A874 /* ActiveAEDSPAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C973CE91B5037EF0002A874 /* ActiveAEDSPAddon.cpp */; }; 7C973CF31B5037EF0002A874 /* ActiveAEDSPDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C973CEB1B5037EF0002A874 /* ActiveAEDSPDatabase.cpp */; }; @@ -700,10 +708,6 @@ C8482909156CFF24005A996F /* PVRDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482905156CFF24005A996F /* PVRDirectory.cpp */; }; C848290A156CFF24005A996F /* PVRFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482907156CFF24005A996F /* PVRFile.cpp */; }; C8482910156CFFA0005A996F /* DVDInputStreamPVRManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C848290E156CFFA0005A996F /* DVDInputStreamPVRManager.cpp */; }; - C8482919156CFFE7005A996F /* AddonCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482911156CFFE7005A996F /* AddonCallbacks.cpp */; }; - C848291A156CFFE7005A996F /* AddonCallbacksAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482913156CFFE7005A996F /* AddonCallbacksAddon.cpp */; }; - C848291B156CFFE7005A996F /* AddonCallbacksGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482915156CFFE7005A996F /* AddonCallbacksGUI.cpp */; }; - C848291C156CFFE7005A996F /* AddonCallbacksPVR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482917156CFFE7005A996F /* AddonCallbacksPVR.cpp */; }; C848291F156D003E005A996F /* TextSearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C848291D156D003E005A996F /* TextSearch.cpp */; }; C84BF7341349BB74006D6FC9 /* JSONServiceDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C84BF7321349BB74006D6FC9 /* JSONServiceDescription.cpp */; }; C85EB75C1174614E0008E5A5 /* Repository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C85EB75A1174614E0008E5A5 /* Repository.cpp */; }; @@ -906,8 +910,6 @@ DFB65FD215373AE7006B8FF1 /* AEStreamInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB65FAF15373AE7006B8FF1 /* AEStreamInfo.cpp */; }; DFB65FD315373AE7006B8FF1 /* AEUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB65FB115373AE7006B8FF1 /* AEUtil.cpp */; }; DFB6610915374E80006B8FF1 /* DVDAudioCodecPassthrough.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB6610615374E80006B8FF1 /* DVDAudioCodecPassthrough.cpp */; }; - DFBB4308178B574E006CC20A /* AddonCallbacksCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFBB4306178B574E006CC20A /* AddonCallbacksCodec.cpp */; }; - DFBB430A178B574E006CC20A /* AddonCallbacksCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFBB4306178B574E006CC20A /* AddonCallbacksCodec.cpp */; }; DFBB4319178B5E6F006CC20A /* CompileInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFBB4317178B5E6F006CC20A /* CompileInfo.cpp */; }; DFBB431B178B5E6F006CC20A /* CompileInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFBB4317178B5E6F006CC20A /* CompileInfo.cpp */; }; DFBE805115F7D75700D7D102 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DFBE803D15F7D72100D7D102 /* SystemConfiguration.framework */; }; @@ -958,7 +960,6 @@ DFDE5D521AE5658200EE53AD /* PictureScalingAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFDE5D4F1AE5658200EE53AD /* PictureScalingAlgorithm.cpp */; }; DFE4095B17417FDF00473BD9 /* LegacyPathTranslation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4095917417FDF00473BD9 /* LegacyPathTranslation.cpp */; }; DFE4BE061C661C5F0048EB03 /* AnnounceReceiver.mm in Sources */ = {isa = PBXBuildFile; fileRef = DFE4BE051C661C5F0048EB03 /* AnnounceReceiver.mm */; }; - DFEA4B4E1B5271A900562321 /* AddonCallbacksAudioDSP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C973CE31B50378E0002A874 /* AddonCallbacksAudioDSP.cpp */; }; DFEA4B501B5271EB00562321 /* ActiveAEDSP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C973CE71B5037EF0002A874 /* ActiveAEDSP.cpp */; }; DFEA4B521B5271EE00562321 /* ActiveAEDSPAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C973CE91B5037EF0002A874 /* ActiveAEDSPAddon.cpp */; }; DFEA4B541B5271F200562321 /* ActiveAEDSPDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C973CEB1B5037EF0002A874 /* ActiveAEDSPDatabase.cpp */; }; @@ -1363,10 +1364,6 @@ E4991177174E5CC300741B6D /* unpack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25770D263BF600618676 /* unpack.cpp */; settings = {COMPILER_FLAGS = "-DSILENT"; }; }; E4991178174E5CC300741B6D /* volume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E1D5E0D25F9FC00618676 /* volume.cpp */; settings = {COMPILER_FLAGS = "-DSILENT"; }; }; E4991179174E5CE000741B6D /* Addon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B49FF11152BFA5001AF8A6 /* Addon.cpp */; }; - E499117A174E5CE000741B6D /* AddonCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482911156CFFE7005A996F /* AddonCallbacks.cpp */; }; - E499117B174E5CE000741B6D /* AddonCallbacksAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482913156CFFE7005A996F /* AddonCallbacksAddon.cpp */; }; - E499117C174E5CE000741B6D /* AddonCallbacksGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482915156CFFE7005A996F /* AddonCallbacksGUI.cpp */; }; - E499117D174E5CE000741B6D /* AddonCallbacksPVR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482917156CFFE7005A996F /* AddonCallbacksPVR.cpp */; }; E499117E174E5CE000741B6D /* AddonDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C3821294203F009E7A26 /* AddonDatabase.cpp */; }; E499117F174E5CE000741B6D /* AddonInstaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4705AC12EF584C00369E51 /* AddonInstaller.cpp */; }; E4991180174E5CE000741B6D /* AddonManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B49FF41152BFA5001AF8A6 /* AddonManager.cpp */; }; @@ -2095,6 +2092,13 @@ E4A249F71095C880003D74C6 /* AutorunMediaJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A249F51095C880003D74C6 /* AutorunMediaJob.cpp */; }; E4E91BB80E7F7338001F0546 /* NptXbmcFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4E91BB70E7F7338001F0546 /* NptXbmcFile.cpp */; settings = {COMPILER_FLAGS = "-I$SRCROOT/lib/libUPnP -I$SRCROOT/lib/libUPnP/Neptune/Source/Core -I$SRCROOT/lib/libUPnP/Platinum/Source/Core -I$SRCROOT/lib/libUPnP/Platinum/Source/Platinum -I$SRCROOT/lib/libUPnP/Platinum/Source/Extras -I$SRCROOT/lib/libUPnP/Platinum/Source/Devices/MediaServer -I$SRCROOT/lib/libUPnP/Platinum/Source/Devices/MediaConnect -I$SRCROOT/lib/libUPnP/Platinum/Source/Devices/MediaRenderer"; }; }; EC720A8F155091BB00FFD782 /* ilog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC720A8D155091BB00FFD782 /* ilog.cpp */; }; + EDED2E881C878DE8000F5E80 /* AddonCallbacksPVR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E861C878DE8000F5E80 /* AddonCallbacksPVR.cpp */; }; + EDED2E8B1C878E62000F5E80 /* AddonCallbacksGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E891C878E62000F5E80 /* AddonCallbacksGUI.cpp */; }; + EDED2E8E1C878E97000F5E80 /* AddonCallbacksCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E8C1C878E97000F5E80 /* AddonCallbacksCodec.cpp */; }; + EDED2E911C878EB8000F5E80 /* AddonCallbacksAudioEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E8F1C878EB8000F5E80 /* AddonCallbacksAudioEngine.cpp */; }; + EDED2E941C878EE0000F5E80 /* AddonCallbacksAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E921C878EE0000F5E80 /* AddonCallbacksAddon.cpp */; }; + EDED2E971C878EF8000F5E80 /* AddonCallbacksAudioDSP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E951C878EF8000F5E80 /* AddonCallbacksAudioDSP.cpp */; }; + EDED2E9B1C878F61000F5E80 /* AddonInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDED2E991C878F61000F5E80 /* AddonInterfaces.cpp */; }; F500E35617F3412C004FC217 /* WinEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F500E35517F3412C004FC217 /* WinEvents.cpp */; }; F500E35717F3412C004FC217 /* WinEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F500E35517F3412C004FC217 /* WinEvents.cpp */; }; F506297A0E57B9680066625A /* MultiPathFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F50629780E57B9680066625A /* MultiPathFile.cpp */; }; @@ -2673,6 +2677,12 @@ 6E97BDC10DA2B620003A2A89 /* EventServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventServer.h; sourceTree = "<group>"; }; 6E97BDC30DA2B620003A2A89 /* Fanart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Fanart.h; sourceTree = "<group>"; }; 6E97BDC40DA2B620003A2A89 /* Socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Socket.h; sourceTree = "<group>"; }; + 7611708C1C8B85F8006C6366 /* AddonGUIRenderingControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonGUIRenderingControl.cpp; path = addons/binary/interfaces/api1/GUI/AddonGUIRenderingControl.cpp; sourceTree = "<group>"; }; + 7611708D1C8B85F8006C6366 /* AddonGUIRenderingControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonGUIRenderingControl.h; path = addons/binary/interfaces/api1/GUI/AddonGUIRenderingControl.h; sourceTree = "<group>"; }; + 7611708E1C8B85F8006C6366 /* AddonGUIWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonGUIWindow.cpp; path = addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp; sourceTree = "<group>"; }; + 7611708F1C8B85F8006C6366 /* AddonGUIWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonGUIWindow.h; path = addons/binary/interfaces/api1/GUI/AddonGUIWindow.h; sourceTree = "<group>"; }; + 76F4C37C1C8E92E000A1E64B /* AddonCallbacksInputStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonCallbacksInputStream.cpp; path = addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.cpp; sourceTree = "<group>"; }; + 76F4C37D1C8E92E000A1E64B /* AddonCallbacksInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonCallbacksInputStream.h; path = addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.h; sourceTree = "<group>"; }; 7C0B98A1154B79C30065A238 /* AEDeviceInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AEDeviceInfo.cpp; sourceTree = "<group>"; }; 7C0B98A2154B79C30065A238 /* AEDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEDeviceInfo.h; sourceTree = "<group>"; }; 7C14096F183224B8009F9411 /* ISetting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ISetting.cpp; path = lib/ISetting.cpp; sourceTree = "<group>"; }; @@ -2713,8 +2723,6 @@ 7C1D682815A7D2FD00658B65 /* DatabaseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseManager.h; sourceTree = "<group>"; }; 7C1F6EB913ECCFA7001726AB /* LibraryDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LibraryDirectory.cpp; sourceTree = "<group>"; }; 7C1F6EBA13ECCFA7001726AB /* LibraryDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibraryDirectory.h; sourceTree = "<group>"; }; - 7C226E3C1BA5F61C00185CE0 /* AddonCallbacksAudioEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallbacksAudioEngine.cpp; sourceTree = "<group>"; }; - 7C226E3D1BA5F61C00185CE0 /* AddonCallbacksAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallbacksAudioEngine.h; sourceTree = "<group>"; }; 7C26126A182068660086E04D /* SettingsOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SettingsOperations.cpp; sourceTree = "<group>"; }; 7C26126B182068660086E04D /* SettingsOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsOperations.h; sourceTree = "<group>"; }; 7C26126F1825B6340086E04D /* DatabaseQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseQuery.cpp; sourceTree = "<group>"; }; @@ -2730,8 +2738,6 @@ 7C45DBE810F325C400D4BBF3 /* DAVDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DAVDirectory.h; sourceTree = "<group>"; }; 7C4705AC12EF584C00369E51 /* AddonInstaller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonInstaller.cpp; sourceTree = "<group>"; }; 7C4705AD12EF584C00369E51 /* AddonInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonInstaller.h; sourceTree = "<group>"; }; - 7C4B649D1C86F6BC000E1F74 /* AddonCallbacksInputStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallbacksInputStream.cpp; sourceTree = "<group>"; }; - 7C4B649E1C86F6BC000E1F74 /* AddonCallbacksInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallbacksInputStream.h; sourceTree = "<group>"; }; 7C4B64A11C86F6D8000E1F74 /* InputStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputStream.cpp; sourceTree = "<group>"; }; 7C4B64A21C86F6D8000E1F74 /* InputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputStream.h; sourceTree = "<group>"; }; 7C4B64A51C86F712000E1F74 /* InputStreamAddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputStreamAddon.cpp; sourceTree = "<group>"; }; @@ -2839,8 +2845,6 @@ 7C908893196358A8003D0619 /* auto_buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = auto_buffer.h; sourceTree = "<group>"; }; 7C920CF7181669FF00DA1477 /* TextureOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextureOperations.cpp; sourceTree = "<group>"; }; 7C920CF8181669FF00DA1477 /* TextureOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextureOperations.h; sourceTree = "<group>"; }; - 7C973CE31B50378E0002A874 /* AddonCallbacksAudioDSP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallbacksAudioDSP.cpp; sourceTree = "<group>"; }; - 7C973CE41B50378E0002A874 /* AddonCallbacksAudioDSP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallbacksAudioDSP.h; sourceTree = "<group>"; }; 7C973CE71B5037EF0002A874 /* ActiveAEDSP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ActiveAEDSP.cpp; path = xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.cpp; sourceTree = SOURCE_ROOT; }; 7C973CE81B5037EF0002A874 /* ActiveAEDSP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ActiveAEDSP.h; path = xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.h; sourceTree = SOURCE_ROOT; }; 7C973CE91B5037EF0002A874 /* ActiveAEDSPAddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ActiveAEDSPAddon.cpp; path = xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp; sourceTree = SOURCE_ROOT; }; @@ -3397,14 +3401,6 @@ C8482908156CFF24005A996F /* PVRFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PVRFile.h; sourceTree = "<group>"; }; C848290E156CFFA0005A996F /* DVDInputStreamPVRManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDInputStreamPVRManager.cpp; sourceTree = "<group>"; }; C848290F156CFFA0005A996F /* DVDInputStreamPVRManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDInputStreamPVRManager.h; sourceTree = "<group>"; }; - C8482911156CFFE7005A996F /* AddonCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallbacks.cpp; sourceTree = "<group>"; }; - C8482912156CFFE7005A996F /* AddonCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallbacks.h; sourceTree = "<group>"; }; - C8482913156CFFE7005A996F /* AddonCallbacksAddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallbacksAddon.cpp; sourceTree = "<group>"; }; - C8482914156CFFE7005A996F /* AddonCallbacksAddon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallbacksAddon.h; sourceTree = "<group>"; }; - C8482915156CFFE7005A996F /* AddonCallbacksGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallbacksGUI.cpp; sourceTree = "<group>"; }; - C8482916156CFFE7005A996F /* AddonCallbacksGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallbacksGUI.h; sourceTree = "<group>"; }; - C8482917156CFFE7005A996F /* AddonCallbacksPVR.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallbacksPVR.cpp; sourceTree = "<group>"; }; - C8482918156CFFE7005A996F /* AddonCallbacksPVR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallbacksPVR.h; sourceTree = "<group>"; }; C848291D156D003E005A996F /* TextSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextSearch.cpp; sourceTree = "<group>"; }; C848291E156D003E005A996F /* TextSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextSearch.h; sourceTree = "<group>"; }; C84BF7321349BB74006D6FC9 /* JSONServiceDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONServiceDescription.cpp; sourceTree = "<group>"; }; @@ -3749,8 +3745,6 @@ DFB65FB215373AE7006B8FF1 /* AEUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEUtil.h; sourceTree = "<group>"; }; DFB6610615374E80006B8FF1 /* DVDAudioCodecPassthrough.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDAudioCodecPassthrough.cpp; sourceTree = "<group>"; }; DFB6610715374E80006B8FF1 /* DVDAudioCodecPassthrough.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDAudioCodecPassthrough.h; sourceTree = "<group>"; }; - DFBB4306178B574E006CC20A /* AddonCallbacksCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallbacksCodec.cpp; sourceTree = "<group>"; }; - DFBB4307178B574E006CC20A /* AddonCallbacksCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallbacksCodec.h; sourceTree = "<group>"; }; DFBB4317178B5E6F006CC20A /* CompileInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompileInfo.cpp; sourceTree = "<group>"; }; DFBB4318178B5E6F006CC20A /* CompileInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompileInfo.h; sourceTree = "<group>"; }; DFBD336A1BD531CB001A8FEE /* DllVideoToolBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllVideoToolBox.h; sourceTree = "<group>"; }; @@ -4636,6 +4630,21 @@ EDE8C7231C7F618500A86ECC /* xbmc_scr_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xbmc_scr_types.h; path = "kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h"; sourceTree = "<group>"; }; EDE8C7251C7F618500A86ECC /* xbmc_vis_dll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xbmc_vis_dll.h; path = "kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h"; sourceTree = "<group>"; }; EDE8C7261C7F618500A86ECC /* xbmc_vis_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xbmc_vis_types.h; path = "kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h"; sourceTree = "<group>"; }; + EDED2E861C878DE8000F5E80 /* AddonCallbacksPVR.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonCallbacksPVR.cpp; path = addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.cpp; sourceTree = "<group>"; }; + EDED2E871C878DE8000F5E80 /* AddonCallbacksPVR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonCallbacksPVR.h; path = addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.h; sourceTree = "<group>"; }; + EDED2E891C878E62000F5E80 /* AddonCallbacksGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonCallbacksGUI.cpp; path = addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.cpp; sourceTree = "<group>"; }; + EDED2E8A1C878E62000F5E80 /* AddonCallbacksGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonCallbacksGUI.h; path = addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.h; sourceTree = "<group>"; }; + EDED2E8C1C878E97000F5E80 /* AddonCallbacksCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonCallbacksCodec.cpp; path = addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.cpp; sourceTree = "<group>"; }; + EDED2E8D1C878E97000F5E80 /* AddonCallbacksCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonCallbacksCodec.h; path = addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h; sourceTree = "<group>"; }; + EDED2E8F1C878EB8000F5E80 /* AddonCallbacksAudioEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonCallbacksAudioEngine.cpp; path = addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.cpp; sourceTree = "<group>"; }; + EDED2E901C878EB8000F5E80 /* AddonCallbacksAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonCallbacksAudioEngine.h; path = addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.h; sourceTree = "<group>"; }; + EDED2E921C878EE0000F5E80 /* AddonCallbacksAddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonCallbacksAddon.cpp; path = addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.cpp; sourceTree = "<group>"; }; + EDED2E931C878EE0000F5E80 /* AddonCallbacksAddon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonCallbacksAddon.h; path = addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.h; sourceTree = "<group>"; }; + EDED2E951C878EF8000F5E80 /* AddonCallbacksAudioDSP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonCallbacksAudioDSP.cpp; path = addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp; sourceTree = "<group>"; }; + EDED2E961C878EF8000F5E80 /* AddonCallbacksAudioDSP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonCallbacksAudioDSP.h; path = addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.h; sourceTree = "<group>"; }; + EDED2E991C878F61000F5E80 /* AddonInterfaces.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonInterfaces.cpp; path = addons/binary/interfaces/AddonInterfaces.cpp; sourceTree = "<group>"; }; + EDED2E9A1C878F61000F5E80 /* AddonInterfaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonInterfaces.h; path = addons/binary/interfaces/AddonInterfaces.h; sourceTree = "<group>"; }; + EDED2E9C1C878F70000F5E80 /* IAddonInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IAddonInterface.h; path = addons/binary/interfaces/IAddonInterface.h; sourceTree = "<group>"; }; F500E35517F3412C004FC217 /* WinEvents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WinEvents.cpp; sourceTree = "<group>"; }; F500E35917F34132004FC217 /* WinEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WinEvents.h; sourceTree = "<group>"; }; F502BFDA160F34B900C96C76 /* CallbackHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CallbackHandler.cpp; path = python/CallbackHandler.cpp; sourceTree = "<group>"; }; @@ -4934,27 +4943,12 @@ 18B49FF01152BEEB001AF8A6 /* addons */ = { isa = PBXGroup; children = ( + EDED2E7D1C878BDF000F5E80 /* binary */, EDE8C7091C7F60C200A86ECC /* kodi-addon-dev-kit */, - 7C4B649D1C86F6BC000E1F74 /* AddonCallbacksInputStream.cpp */, - 7C4B649E1C86F6BC000E1F74 /* AddonCallbacksInputStream.h */, 9A999F1B1C67B77600E4E0D5 /* AddonBuilder.cpp */, 9A999F1C1C67B77600E4E0D5 /* AddonBuilder.h */, - 7C226E3C1BA5F61C00185CE0 /* AddonCallbacksAudioEngine.cpp */, - 7C226E3D1BA5F61C00185CE0 /* AddonCallbacksAudioEngine.h */, - 7C973CE31B50378E0002A874 /* AddonCallbacksAudioDSP.cpp */, - 7C973CE41B50378E0002A874 /* AddonCallbacksAudioDSP.h */, 18B49FF11152BFA5001AF8A6 /* Addon.cpp */, 18B49FF21152BFA5001AF8A6 /* Addon.h */, - C8482911156CFFE7005A996F /* AddonCallbacks.cpp */, - C8482912156CFFE7005A996F /* AddonCallbacks.h */, - C8482913156CFFE7005A996F /* AddonCallbacksAddon.cpp */, - C8482914156CFFE7005A996F /* AddonCallbacksAddon.h */, - DFBB4306178B574E006CC20A /* AddonCallbacksCodec.cpp */, - DFBB4307178B574E006CC20A /* AddonCallbacksCodec.h */, - C8482915156CFFE7005A996F /* AddonCallbacksGUI.cpp */, - C8482916156CFFE7005A996F /* AddonCallbacksGUI.h */, - C8482917156CFFE7005A996F /* AddonCallbacksPVR.cpp */, - C8482918156CFFE7005A996F /* AddonCallbacksPVR.h */, 18B7C3821294203F009E7A26 /* AddonDatabase.cpp */, 18B7C3831294203F009E7A26 /* AddonDatabase.h */, 18B49FF31152BFA5001AF8A6 /* AddonDll.h */, @@ -5923,6 +5917,15 @@ path = osx; sourceTree = "<group>"; }; + 76F4C37B1C8E927A00A1E64B /* InputStream */ = { + isa = PBXGroup; + children = ( + 76F4C37C1C8E92E000A1E64B /* AddonCallbacksInputStream.cpp */, + 76F4C37D1C8E92E000A1E64B /* AddonCallbacksInputStream.h */, + ); + name = InputStream; + sourceTree = "<group>"; + }; 7C14096E18322476009F9411 /* lib */ = { isa = PBXGroup; children = ( @@ -7368,8 +7371,8 @@ E38E14610D25F9F900618676 /* xbmc */ = { isa = PBXGroup; children = ( - DFC6F4AB1AFF7CB10039A7FA /* contrib */, 18B49FF01152BEEB001AF8A6 /* addons */, + DFC6F4AB1AFF7CB10039A7FA /* contrib */, E38E147F0D25F9F900618676 /* cdrip */, EC720A91155091CA00FFD782 /* commons */, E38E149A0D25F9F900618676 /* cores */, @@ -8712,6 +8715,98 @@ name = kodi; sourceTree = "<group>"; }; + EDED2E7D1C878BDF000F5E80 /* binary */ = { + isa = PBXGroup; + children = ( + EDED2E7E1C878C5F000F5E80 /* interfaces */, + ); + name = binary; + path = ..; + sourceTree = "<group>"; + }; + EDED2E7E1C878C5F000F5E80 /* interfaces */ = { + isa = PBXGroup; + children = ( + EDED2E9C1C878F70000F5E80 /* IAddonInterface.h */, + EDED2E991C878F61000F5E80 /* AddonInterfaces.cpp */, + EDED2E9A1C878F61000F5E80 /* AddonInterfaces.h */, + EDED2E7F1C878C87000F5E80 /* api1 */, + ); + name = interfaces; + sourceTree = "<group>"; + }; + EDED2E7F1C878C87000F5E80 /* api1 */ = { + isa = PBXGroup; + children = ( + EDED2E841C878D1D000F5E80 /* Addon */, + EDED2E851C878D3F000F5E80 /* AudioDSP */, + EDED2E831C878D04000F5E80 /* AudioEngine */, + EDED2E821C878CF6000F5E80 /* Codec */, + EDED2E801C878CB4000F5E80 /* GUI */, + 76F4C37B1C8E927A00A1E64B /* InputStream */, + EDED2E811C878CC1000F5E80 /* PVR */, + ); + name = api1; + sourceTree = "<group>"; + }; + EDED2E801C878CB4000F5E80 /* GUI */ = { + isa = PBXGroup; + children = ( + 7611708C1C8B85F8006C6366 /* AddonGUIRenderingControl.cpp */, + 7611708D1C8B85F8006C6366 /* AddonGUIRenderingControl.h */, + 7611708E1C8B85F8006C6366 /* AddonGUIWindow.cpp */, + 7611708F1C8B85F8006C6366 /* AddonGUIWindow.h */, + EDED2E891C878E62000F5E80 /* AddonCallbacksGUI.cpp */, + EDED2E8A1C878E62000F5E80 /* AddonCallbacksGUI.h */, + ); + name = GUI; + sourceTree = "<group>"; + }; + EDED2E811C878CC1000F5E80 /* PVR */ = { + isa = PBXGroup; + children = ( + EDED2E861C878DE8000F5E80 /* AddonCallbacksPVR.cpp */, + EDED2E871C878DE8000F5E80 /* AddonCallbacksPVR.h */, + ); + name = PVR; + sourceTree = "<group>"; + }; + EDED2E821C878CF6000F5E80 /* Codec */ = { + isa = PBXGroup; + children = ( + EDED2E8C1C878E97000F5E80 /* AddonCallbacksCodec.cpp */, + EDED2E8D1C878E97000F5E80 /* AddonCallbacksCodec.h */, + ); + name = Codec; + sourceTree = "<group>"; + }; + EDED2E831C878D04000F5E80 /* AudioEngine */ = { + isa = PBXGroup; + children = ( + EDED2E8F1C878EB8000F5E80 /* AddonCallbacksAudioEngine.cpp */, + EDED2E901C878EB8000F5E80 /* AddonCallbacksAudioEngine.h */, + ); + name = AudioEngine; + sourceTree = "<group>"; + }; + EDED2E841C878D1D000F5E80 /* Addon */ = { + isa = PBXGroup; + children = ( + EDED2E921C878EE0000F5E80 /* AddonCallbacksAddon.cpp */, + EDED2E931C878EE0000F5E80 /* AddonCallbacksAddon.h */, + ); + name = Addon; + sourceTree = "<group>"; + }; + EDED2E851C878D3F000F5E80 /* AudioDSP */ = { + isa = PBXGroup; + children = ( + EDED2E951C878EF8000F5E80 /* AddonCallbacksAudioDSP.cpp */, + EDED2E961C878EF8000F5E80 /* AddonCallbacksAudioDSP.h */, + ); + name = AudioDSP; + sourceTree = "<group>"; + }; F563529F16E53FE900D21BAD /* dialogs */ = { isa = PBXGroup; children = ( @@ -9268,7 +9363,6 @@ E38E1FA90D25F9FD00618676 /* VideoPlayerSubtitle.cpp in Sources */, 395C2A141A9F072400EBC7AD /* ResourceFile.cpp in Sources */, E38E1FAA0D25F9FD00618676 /* VideoPlayerVideo.cpp in Sources */, - 7C4B649F1C86F6BD000E1F74 /* AddonCallbacksInputStream.cpp in Sources */, DF91E93E1C0A26350011084D /* SDLMain.mm in Sources */, E38E1FAB0D25F9FD00618676 /* DVDStreamInfo.cpp in Sources */, E38E1FAC0D25F9FD00618676 /* DVDFactorySubtitle.cpp in Sources */, @@ -9285,6 +9379,8 @@ E38E1FF80D25F9FD00618676 /* Database.cpp in Sources */, E38E1FFA0D25F9FD00618676 /* DetectDVDType.cpp in Sources */, E38E1FFB0D25F9FD00618676 /* DNSNameCache.cpp in Sources */, + EDED2E941C878EE0000F5E80 /* AddonCallbacksAddon.cpp in Sources */, + EDED2E971C878EF8000F5E80 /* AddonCallbacksAudioDSP.cpp in Sources */, E38E1FFC0D25F9FD00618676 /* DynamicDll.cpp in Sources */, E38E1FFF0D25F9FD00618676 /* FileItem.cpp in Sources */, E38E20010D25F9FD00618676 /* MemBufferCache.cpp in Sources */, @@ -9293,6 +9389,7 @@ E38E20040D25F9FD00618676 /* cddb.cpp in Sources */, E38E20050D25F9FD00618676 /* cdioSupport.cpp in Sources */, E38E20070D25F9FD00618676 /* Directory.cpp in Sources */, + EDED2E881C878DE8000F5E80 /* AddonCallbacksPVR.cpp in Sources */, E38E20090D25F9FD00618676 /* DirectoryHistory.cpp in Sources */, 395C29D81A98A11C00EBC7AD /* WsgiInputStream.cpp in Sources */, E38E200B0D25F9FD00618676 /* DllLibCurl.cpp in Sources */, @@ -9470,6 +9567,7 @@ E38E225D0D25F9FE00618676 /* strfn.cpp in Sources */, E38E225E0D25F9FE00618676 /* strlist.cpp in Sources */, E38E22600D25F9FE00618676 /* system.cpp in Sources */, + EDED2E8E1C878E97000F5E80 /* AddonCallbacksCodec.cpp in Sources */, E38E22610D25F9FE00618676 /* timefn.cpp in Sources */, E38E22620D25F9FE00618676 /* ulinks.cpp in Sources */, E38E22630D25F9FE00618676 /* unicode.cpp in Sources */, @@ -9741,7 +9839,6 @@ 18B7C7DF1294222E009E7A26 /* GUISpinControl.cpp in Sources */, 399442711A8DD920006C39E9 /* VideoLibraryJob.cpp in Sources */, 18B7C7E01294222E009E7A26 /* GUISpinControlEx.cpp in Sources */, - 7C973CE51B50378E0002A874 /* AddonCallbacksAudioDSP.cpp in Sources */, 18B7C7E21294222E009E7A26 /* GUIStaticItem.cpp in Sources */, 18B7C7E31294222E009E7A26 /* GUITextBox.cpp in Sources */, 18B7C7E41294222E009E7A26 /* GUITextLayout.cpp in Sources */, @@ -9796,6 +9893,7 @@ 18B7C937129428CA009E7A26 /* PlayListXML.cpp in Sources */, 18B7C938129428CA009E7A26 /* SmartPlayList.cpp in Sources */, 18B7C97C1294380A009E7A26 /* GUIWindowAddonBrowser.cpp in Sources */, + EDED2E911C878EB8000F5E80 /* AddonCallbacksAudioEngine.cpp in Sources */, 18B7C9831294385F009E7A26 /* XMLUtils.cpp in Sources */, 432D7CE412D86DA500CE4C49 /* NetworkLinux.cpp in Sources */, 432D7CF712D870E800CE4C49 /* TCPServer.cpp in Sources */, @@ -9889,6 +9987,7 @@ DF93D6A51444A8B1007C6459 /* MusicDatabaseFile.cpp in Sources */, DF93D6A61444A8B1007C6459 /* NFSFile.cpp in Sources */, DF93D6A71444A8B1007C6459 /* PipeFile.cpp in Sources */, + EDED2E8B1C878E62000F5E80 /* AddonCallbacksGUI.cpp in Sources */, DF93D6A81444A8B1007C6459 /* RarFile.cpp in Sources */, DF93D6AA1444A8B1007C6459 /* SFTPFile.cpp in Sources */, DF93D6AB1444A8B1007C6459 /* ShoutcastFile.cpp in Sources */, @@ -9918,6 +10017,7 @@ DFB65FD315373AE7006B8FF1 /* AEUtil.cpp in Sources */, DFB6610915374E80006B8FF1 /* DVDAudioCodecPassthrough.cpp in Sources */, 7C0B98A4154B79C30065A238 /* AEDeviceInfo.cpp in Sources */, + 76F4C37E1C8E92E000A1E64B /* AddonCallbacksInputStream.cpp in Sources */, 7C6EB330155BD1D40080368A /* ImageFile.cpp in Sources */, 7C6EB6FA155F32C30080368A /* HTTPImageHandler.cpp in Sources */, C84828C0156CFCD8005A996F /* PVRClient.cpp in Sources */, @@ -9963,10 +10063,6 @@ C8482909156CFF24005A996F /* PVRDirectory.cpp in Sources */, C848290A156CFF24005A996F /* PVRFile.cpp in Sources */, C8482910156CFFA0005A996F /* DVDInputStreamPVRManager.cpp in Sources */, - C8482919156CFFE7005A996F /* AddonCallbacks.cpp in Sources */, - C848291A156CFFE7005A996F /* AddonCallbacksAddon.cpp in Sources */, - C848291B156CFFE7005A996F /* AddonCallbacksGUI.cpp in Sources */, - C848291C156CFFE7005A996F /* AddonCallbacksPVR.cpp in Sources */, C848291F156D003E005A996F /* TextSearch.cpp in Sources */, 18E7CACB1578C26D001D4554 /* CDDARipJob.cpp in Sources */, 36A9443D15821E2800727135 /* DatabaseUtils.cpp in Sources */, @@ -10060,7 +10156,6 @@ F56352AA16E5402100D21BAD /* GUIDialogContentSettings.cpp in Sources */, F56352BB16E5403400D21BAD /* GUIWindowSettings.cpp in Sources */, F56352BC16E5403400D21BAD /* GUIWindowSettingsCategory.cpp in Sources */, - 7C226E3E1BA5F61C00185CE0 /* AddonCallbacksAudioEngine.cpp in Sources */, F56352BE16E5403400D21BAD /* GUIWindowSettingsScreenCalibration.cpp in Sources */, F56352BF16E5403400D21BAD /* GUIWindowTestPattern.cpp in Sources */, F56352C816E5436900D21BAD /* AppParamParser.cpp in Sources */, @@ -10103,7 +10198,6 @@ DF40BC20178B4BEC009DB567 /* PythonInvoker.cpp in Sources */, DF40BC2F178B4C07009DB567 /* LanguageInvokerThread.cpp in Sources */, DF40BC31178B4C07009DB567 /* ScriptInvocationManager.cpp in Sources */, - DFBB430A178B574E006CC20A /* AddonCallbacksCodec.cpp in Sources */, 55611BA31766672F00754072 /* RenderFlags.cpp in Sources */, 5558ED10176396CD00118C35 /* StereoscopicsManager.cpp in Sources */, F59EED7E17AD5174005BB7C6 /* ApplicationPlayer.cpp in Sources */, @@ -10205,6 +10299,7 @@ 7CCDA1F3192753E30074CF51 /* ConnectionManagerSCPD.cpp in Sources */, 7CCDA1FE192753E30074CF51 /* ContentDirectorySCPD.cpp in Sources */, 7CCDA209192753E30074CF51 /* ContentDirectorywSearchSCPD.cpp in Sources */, + EDED2E9B1C878F61000F5E80 /* AddonInterfaces.cpp in Sources */, 7CCDA214192753E30074CF51 /* PltDidl.cpp in Sources */, 7CCDA21D192753E30074CF51 /* PltFileMediaServer.cpp in Sources */, 7CCDA226192753E30074CF51 /* PltMediaBrowser.cpp in Sources */, @@ -10230,8 +10325,10 @@ 7CCDA7BB192756250074CF51 /* NptDynamicLibraries.cpp in Sources */, 7CCDA7BE192756250074CF51 /* NptFile.cpp in Sources */, 7CCDA7C7192756250074CF51 /* NptHash.cpp in Sources */, + 761170911C8B85F8006C6366 /* AddonGUIWindow.cpp in Sources */, DF1D2DED1B6E85EE002BB9DB /* XbtDirectory.cpp in Sources */, 7CCDA7D0192756250074CF51 /* NptHttp.cpp in Sources */, + 761170901C8B85F8006C6366 /* AddonGUIRenderingControl.cpp in Sources */, 7CCDA7D9192756250074CF51 /* NptJson.cpp in Sources */, 7CCDA7DC192756250074CF51 /* NptList.cpp in Sources */, 7CCDA7E5192756250074CF51 /* NptLogging.cpp in Sources */, @@ -10340,11 +10437,7 @@ E4991178174E5CC300741B6D /* volume.cpp in Sources */, DFEA4B5C1B52721700562321 /* GUIDialogAudioDSPSettings.cpp in Sources */, E4991179174E5CE000741B6D /* Addon.cpp in Sources */, - E499117A174E5CE000741B6D /* AddonCallbacks.cpp in Sources */, DFD717621C0A031B0025D964 /* XBMCController.mm in Sources */, - E499117B174E5CE000741B6D /* AddonCallbacksAddon.cpp in Sources */, - E499117C174E5CE000741B6D /* AddonCallbacksGUI.cpp in Sources */, - E499117D174E5CE000741B6D /* AddonCallbacksPVR.cpp in Sources */, E499117E174E5CE000741B6D /* AddonDatabase.cpp in Sources */, E499117F174E5CE000741B6D /* AddonInstaller.cpp in Sources */, E4991180174E5CE000741B6D /* AddonManager.cpp in Sources */, @@ -10503,6 +10596,7 @@ E499123D174E5D7E00741B6D /* GUIDialogKeyboardGeneric.cpp in Sources */, E499123E174E5D7E00741B6D /* GUIDialogMediaFilter.cpp in Sources */, E499123F174E5D7E00741B6D /* GUIDialogMediaSource.cpp in Sources */, + 76AEFB3C1C8F79D100EF2EC0 /* AddonGUIWindow.cpp in Sources */, 395C29E41A98A15700EBC7AD /* HTTPPythonHandler.cpp in Sources */, E4991241174E5D7E00741B6D /* GUIDialogNumeric.cpp in Sources */, E4991242174E5D7E00741B6D /* GUIDialogOK.cpp in Sources */, @@ -10555,6 +10649,7 @@ E4991278174E5D8F00741B6D /* LibraryDirectory.cpp in Sources */, E4991279174E5D8F00741B6D /* MemBufferCache.cpp in Sources */, E499127A174E5D8F00741B6D /* MultiPathDirectory.cpp in Sources */, + 76AEFB3D1C8F79D500EF2EC0 /* AddonCallbacksGUI.cpp in Sources */, E499127B174E5D8F00741B6D /* MultiPathFile.cpp in Sources */, E499127C174E5D9900741B6D /* DirectoryNode.cpp in Sources */, E499127D174E5D9900741B6D /* DirectoryNodeAlbum.cpp in Sources */, @@ -10626,6 +10721,7 @@ E49912C0174E5D9900741B6D /* UPnPFile.cpp in Sources */, E49912C1174E5DA000741B6D /* DirectoryNode.cpp in Sources */, DF1D2DF11B6E85EE002BB9DB /* XbtFile.cpp in Sources */, + 76AEFB3B1C8F79CE00EF2EC0 /* AddonGUIRenderingControl.cpp in Sources */, E49912C2174E5DA000741B6D /* DirectoryNodeEpisodes.cpp in Sources */, E49912C3174E5DA000741B6D /* DirectoryNodeGrouped.cpp in Sources */, E49912C4174E5DA000741B6D /* DirectoryNodeMoviesOverview.cpp in Sources */, @@ -10665,6 +10761,7 @@ E49912E7174E5DAD00741B6D /* GUIButtonControl.cpp in Sources */, E49912E8174E5DAD00741B6D /* GUICheckMarkControl.cpp in Sources */, E49912E9174E5DAD00741B6D /* GUIColorManager.cpp in Sources */, + 76AEFB3F1C8F79DC00EF2EC0 /* AddonCallbacksPVR.cpp in Sources */, E49912EA174E5DAD00741B6D /* GUIControl.cpp in Sources */, E49912EB174E5DAD00741B6D /* GUIControlFactory.cpp in Sources */, E49912EC174E5DAD00741B6D /* GUIControlGroup.cpp in Sources */, @@ -10877,6 +10974,7 @@ E49913CB174E5F8100741B6D /* PeripheralBluetooth.cpp in Sources */, E49913CC174E5F8100741B6D /* PeripheralCecAdapter.cpp in Sources */, E49913CD174E5F8100741B6D /* PeripheralDisk.cpp in Sources */, + 76AEFB371C8F79C100EF2EC0 /* AddonCallbacksAddon.cpp in Sources */, E49913CE174E5F8100741B6D /* PeripheralHID.cpp in Sources */, E49913CF174E5F8100741B6D /* PeripheralImon.cpp in Sources */, E49913D0174E5F8100741B6D /* PeripheralNIC.cpp in Sources */, @@ -10886,6 +10984,7 @@ 395C2A1A1A9F074C00EBC7AD /* Locale.cpp in Sources */, E49913D5174E5F8600741B6D /* Peripherals.cpp in Sources */, E49913D6174E5F8D00741B6D /* GUIDialogPictureInfo.cpp in Sources */, + 76AEFB391C8F79C700EF2EC0 /* AddonCallbacksAudioEngine.cpp in Sources */, E49913D7174E5F8D00741B6D /* GUIViewStatePictures.cpp in Sources */, E49913D8174E5F8D00741B6D /* GUIWindowPictures.cpp in Sources */, E49913D9174E5F8D00741B6D /* GUIWindowSlideShow.cpp in Sources */, @@ -10922,7 +11021,6 @@ E49913F5174E5FB000741B6D /* PVRChannelGroup.cpp in Sources */, E49913F6174E5FB000741B6D /* PVRChannelGroupInternal.cpp in Sources */, E49913F7174E5FB000741B6D /* PVRChannelGroups.cpp in Sources */, - 7C4B64A01C86F6BD000E1F74 /* AddonCallbacksInputStream.cpp in Sources */, E49913F8174E5FB000741B6D /* PVRChannelGroupsContainer.cpp in Sources */, E49913F9174E5FB000741B6D /* GUIDialogPVRChannelManager.cpp in Sources */, E49913FA174E5FB000741B6D /* GUIDialogPVRChannelsOSD.cpp in Sources */, @@ -11014,6 +11112,7 @@ E499145D174E605900741B6D /* JSONVariantParser.cpp in Sources */, E499145E174E605900741B6D /* JSONVariantWriter.cpp in Sources */, E499145F174E605900741B6D /* LabelFormatter.cpp in Sources */, + 76AEFB361C8F79BD00EF2EC0 /* AddonInterfaces.cpp in Sources */, E4991460174E605900741B6D /* LangCodeExpander.cpp in Sources */, E4991461174E605900741B6D /* LegacyPathTranslation.cpp in Sources */, 395C2A151A9F072400EBC7AD /* ResourceFile.cpp in Sources */, @@ -11039,7 +11138,6 @@ E4991474174E605900741B6D /* Stopwatch.cpp in Sources */, E4991475174E605900741B6D /* StreamDetails.cpp in Sources */, E4991476174E605900741B6D /* StreamUtils.cpp in Sources */, - DFEA4B4E1B5271A900562321 /* AddonCallbacksAudioDSP.cpp in Sources */, E4991477174E605900741B6D /* StringUtils.cpp in Sources */, E4991478174E605900741B6D /* SystemInfo.cpp in Sources */, E4991479174E605900741B6D /* TextSearch.cpp in Sources */, @@ -11079,6 +11177,7 @@ E499149A174E606600741B6D /* VideoReferenceClock.cpp in Sources */, E499149B174E606600741B6D /* VideoThumbLoader.cpp in Sources */, E499149C174E606E00741B6D /* GUIViewControl.cpp in Sources */, + 76AEFB3E1C8F79D900EF2EC0 /* AddonCallbacksInputStream.cpp in Sources */, E499149D174E606E00741B6D /* GUIViewState.cpp in Sources */, E499149E174E606E00741B6D /* ViewDatabase.cpp in Sources */, E499149F174E606E00741B6D /* ViewStateSettings.cpp in Sources */, @@ -11188,7 +11287,6 @@ DF40BC29178B4C07009DB567 /* LanguageInvokerThread.cpp in Sources */, DF40BC2B178B4C07009DB567 /* ScriptInvocationManager.cpp in Sources */, DF02BA621A910623006DCA16 /* VideoSyncIos.cpp in Sources */, - DFBB4308178B574E006CC20A /* AddonCallbacksCodec.cpp in Sources */, F55BA70B17AB2264002A36D1 /* StereoscopicsManager.cpp in Sources */, F55BA71017AB2293002A36D1 /* RenderFlags.cpp in Sources */, F59EED7F17AD5174005BB7C6 /* ApplicationPlayer.cpp in Sources */, @@ -11220,6 +11318,7 @@ 7C14099F183224B8009F9411 /* SettingSection.cpp in Sources */, 7C1409A2183224B8009F9411 /* SettingsManager.cpp in Sources */, 7C1409A5183224B8009F9411 /* SettingUpdate.cpp in Sources */, + 76AEFB381C8F79C400EF2EC0 /* AddonCallbacksAudioDSP.cpp in Sources */, DF0ABB74183A94A30018445D /* Utf8Utils.cpp in Sources */, 7C1409AA184015C9009F9411 /* InfoExpression.cpp in Sources */, AE4E87A717354C4A00D15206 /* XSLTUtils.cpp in Sources */, @@ -11240,6 +11339,7 @@ 7CC7B6B71918699000DDB120 /* GUIDialogSettingsManagerBase.cpp in Sources */, 7CC7B6BA1918699000DDB120 /* GUIDialogSettingsManualBase.cpp in Sources */, DF0E4ACB1AD5982500A75430 /* InfoTagRadioRDS.cpp in Sources */, + 76AEFB3A1C8F79CA00EF2EC0 /* AddonCallbacksCodec.cpp in Sources */, 7CC7B6C1191869EA00DDB120 /* SettingCreator.cpp in Sources */, 7CC7B6C4191869EA00DDB120 /* SettingUtils.cpp in Sources */, 7CC7B6C919186A8800DDB120 /* SettingConditions.cpp in Sources */, @@ -11324,7 +11424,6 @@ 7CCDA819192756250074CF51 /* NptSockets.cpp in Sources */, 7CCDA822192756250074CF51 /* NptStreams.cpp in Sources */, 7CCDA82B192756250074CF51 /* NptStrings.cpp in Sources */, - 7C226E3F1BA5F61D00185CE0 /* AddonCallbacksAudioEngine.cpp in Sources */, DFD717291C09EDD70025D964 /* MessagePrinter.cpp in Sources */, 7CCDA834192756250074CF51 /* NptSystem.cpp in Sources */, 7CCDA83D192756250074CF51 /* NptThreads.cpp in Sources */, diff --git a/Makefile.in b/Makefile.in index 3416ba170a..1c559cdb18 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,6 +25,14 @@ VideoPlayer_ARCHIVES=xbmc/cores/VideoPlayer/VideoPlayer.a \ DIRECTORY_ARCHIVES=$(VideoPlayer_ARCHIVES) \ xbmc/addons/addons.a \ + xbmc/addons/binary/interfaces/addon-interfaces.a \ + xbmc/addons/binary/interfaces/api1/Addon/addon-callbacks-addon.a \ + xbmc/addons/binary/interfaces/api1/AudioDSP/addon-callbacks-audiodsp.a \ + xbmc/addons/binary/interfaces/api1/AudioEngine/addon-callbacks-audioengine.a \ + xbmc/addons/binary/interfaces/api1/Codec/addon-callbacks-codec.a \ + xbmc/addons/binary/interfaces/api1/GUI/addon-callbacks-gui.a \ + xbmc/addons/binary/interfaces/api1/InputStream/addon-callbacks-inputstream.a \ + xbmc/addons/binary/interfaces/api1/PVR/addon-callbacks-pvr.a \ xbmc/cdrip/cdrip.a \ xbmc/contrib/kissfft/kissfft.a \ xbmc/cores/AudioEngine/audioengine.a \ diff --git a/configure.ac b/configure.ac index 70a7ac2eaa..e30ff3cb8b 100644 --- a/configure.ac +++ b/configure.ac @@ -2199,6 +2199,7 @@ OUTPUT_FILES="Makefile \ addons/skin.estuary/media/Makefile \ addons/skin.estouchy/media/Makefile \ xbmc/Makefile \ + xbmc/addons/binary/interfaces/Makefile \ xbmc/cdrip/Makefile \ xbmc/cores/Makefile \ xbmc/cores/VideoPlayer/VideoRenderers/Makefile \ diff --git a/lib/addons/library.kodi.adsp/libKODI_adsp.cpp b/lib/addons/library.kodi.adsp/libKODI_adsp.cpp index ac78c73099..5101163b13 100644 --- a/lib/addons/library.kodi.adsp/libKODI_adsp.cpp +++ b/lib/addons/library.kodi.adsp/libKODI_adsp.cpp @@ -23,7 +23,7 @@ #include <stdarg.h> #include <string> #include "addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h" -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.h" #ifdef _WIN32 #include <windows.h> @@ -33,6 +33,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::AudioDSP; extern "C" { @@ -44,7 +45,7 @@ DLLEXPORT void* ADSP_register_me(void *hdl) fprintf(stderr, "libKODI_adsp-ERROR: ADSPLib_register_me is called with NULL handle !!!\n"); else { - cb = ((AddonCB*)hdl)->ADSPLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_ADSPLib*)((AddonCB*)hdl)->ADSPLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libKODI_adsp-ERROR: ADSPLib_register_me can't get callback table from KODI !!!\n"); } diff --git a/lib/addons/library.kodi.audioengine/libKODI_audioengine.cpp b/lib/addons/library.kodi.audioengine/libKODI_audioengine.cpp index fad7760f7a..0886bd6de3 100644 --- a/lib/addons/library.kodi.audioengine/libKODI_audioengine.cpp +++ b/lib/addons/library.kodi.audioengine/libKODI_audioengine.cpp @@ -23,7 +23,7 @@ #include <stdlib.h> #include <string> #include "addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h" -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.h" #ifdef _WIN32 #include <windows.h> @@ -33,6 +33,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::AudioEngine; #define LIBRARY_NAME "libKODI_audioengine" @@ -46,7 +47,7 @@ DLLEXPORT void* AudioEngine_register_me(void *hdl) fprintf(stderr, "%s-ERROR: AudioEngine_register_me is called with NULL handle !!!\n", LIBRARY_NAME); else { - cb = ((AddonCB*)hdl)->AudioEngineLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_AudioEngineLib*)((AddonCB*)hdl)->AudioEngineLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "%s-ERROR: AudioEngine_register_me can't get callback table from KODI !!!\n", LIBRARY_NAME); } @@ -224,8 +225,4 @@ void CAddonAEStream::SetResampleRatio(double Ratio) ((CB_AudioEngineLib*)m_Callbacks)->AEStream_SetResampleRatio(((AddonCB*)m_AddonHandle)->addonData, m_StreamHandle, Ratio); } -void CAddonAEStream::Discontinuity() -{ - return ((CB_AudioEngineLib*)m_Callbacks)->AEStream_Discontinuity(((AddonCB*)m_AddonHandle)->addonData, m_StreamHandle); -} }; diff --git a/lib/addons/library.kodi.guilib/libKODI_guilib.cpp b/lib/addons/library.kodi.guilib/libKODI_guilib.cpp index 3a3233fe4e..188562a8d0 100644 --- a/lib/addons/library.kodi.guilib/libKODI_guilib.cpp +++ b/lib/addons/library.kodi.guilib/libKODI_guilib.cpp @@ -23,7 +23,7 @@ #include <stdio.h> #include <stdlib.h> #include <string> -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.h" #ifdef _WIN32 #include <windows.h> @@ -33,6 +33,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::GUI; extern "C" { @@ -44,7 +45,7 @@ DLLEXPORT void* GUI_register_me(void *hdl) fprintf(stderr, "libXBMC_gui-ERROR: GUILib_register_me is called with NULL handle !!!\n"); else { - cb = ((AddonCB*)hdl)->GUILib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_GUILib*)((AddonCB*)hdl)->GUILib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libXBMC_gui-ERROR: GUILib_register_me can't get callback table from XBMC !!!\n"); } diff --git a/lib/addons/library.kodi.inputstream/libKODI_inputstream.cpp b/lib/addons/library.kodi.inputstream/libKODI_inputstream.cpp index 3ec5bcbbae..be8f987869 100644 --- a/lib/addons/library.kodi.inputstream/libKODI_inputstream.cpp +++ b/lib/addons/library.kodi.inputstream/libKODI_inputstream.cpp @@ -24,7 +24,7 @@ #include <stdarg.h> #include <string> #include "addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h" -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.h" #ifdef _WIN32 #include <windows.h> @@ -34,6 +34,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::InputStream; extern "C" { @@ -45,7 +46,7 @@ DLLEXPORT void* INPUTSTREAM_register_me(void *hdl) fprintf(stderr, "libKODI_inputstream-ERROR: %s is called with NULL handle\n", __FUNCTION__); else { - cb = ((AddonCB*)hdl)->INPUTSTREAMLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_INPUTSTREAMLib*)((AddonCB*)hdl)->INPUTSTREAMLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libKODI_inputstream--ERROR: %s can't get callback table from KODI\n", __FUNCTION__); } diff --git a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp index 757cbc87b0..50738d9e09 100644 --- a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp +++ b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp @@ -22,9 +22,10 @@ #include <stdlib.h> #include <stdarg.h> #include <string> -#include "addons/AddonCallbacks.h" +#include <sys/stat.h> #include "addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h" #include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h" +#include "addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.h" #ifdef _WIN32 #include <windows.h> @@ -36,6 +37,7 @@ using namespace std; using namespace ADDON; +using namespace V1::KodiAPI::AddOn; extern "C" { @@ -47,7 +49,7 @@ DLLEXPORT void* XBMC_register_me(void *hdl) fprintf(stderr, "libXBMC_addon-ERROR: XBMC_register_me is called with NULL handle !!!\n"); else { - cb = ((AddonCB*)hdl)->AddOnLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_AddOnLib*)((AddonCB*)hdl)->AddOnLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libXBMC_addon-ERROR: XBMC_register_me can't get callback table from XBMC !!!\n"); } @@ -236,7 +238,7 @@ DLLEXPORT bool XBMC_file_exists(void *hdl, void* cb, const char *strFileName, bo return ((CB_AddOnLib*)cb)->FileExists(((AddonCB*)hdl)->addonData, strFileName, bUseCache); } -DLLEXPORT int XBMC_stat_file(void *hdl, void* cb, const char *strFileName, struct ::__stat64* buffer) +DLLEXPORT int XBMC_stat_file(void *hdl, void* cb, const char *strFileName, struct __stat64* buffer) { if (cb == NULL) return -1; diff --git a/lib/addons/library.xbmc.codec/libXBMC_codec.cpp b/lib/addons/library.xbmc.codec/libXBMC_codec.cpp index 8d1afac1b5..8f13c6805f 100644 --- a/lib/addons/library.xbmc.codec/libXBMC_codec.cpp +++ b/lib/addons/library.xbmc.codec/libXBMC_codec.cpp @@ -22,7 +22,7 @@ #include <stdlib.h> #include <stdarg.h> #include <string> -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h" #include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h" #ifdef _WIN32 @@ -33,18 +33,19 @@ #endif using namespace std; +using namespace V1::KodiAPI::Codec; extern "C" { DLLEXPORT void* CODEC_register_me(void *hdl) { - CB_CODECLib *cb = NULL; + CB_CodecLib *cb = NULL; if (!hdl) fprintf(stderr, "libXBMC_codec-ERROR: %s is called with NULL handle\n", __FUNCTION__); else { - cb = ((AddonCB*)hdl)->CODECLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_CodecLib*)((AddonCB*)hdl)->CodecLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libXBMC_codec-ERROR: %s can't get callback table from XBMC\n", __FUNCTION__); } @@ -54,7 +55,7 @@ DLLEXPORT void* CODEC_register_me(void *hdl) DLLEXPORT void CODEC_unregister_me(void *hdl, void* cb) { if (hdl && cb) - ((AddonCB*)hdl)->CODECLib_UnRegisterMe(((AddonCB*)hdl)->addonData, (CB_CODECLib*)cb); + ((AddonCB*)hdl)->CodecLib_UnRegisterMe(((AddonCB*)hdl)->addonData, (CB_CodecLib*)cb); } DLLEXPORT xbmc_codec_t CODEC_get_codec_by_name(void *hdl, void* cb, const char* strCodecName) @@ -64,7 +65,7 @@ DLLEXPORT xbmc_codec_t CODEC_get_codec_by_name(void *hdl, void* cb, const char* retVal.codec_type = XBMC_CODEC_TYPE_UNKNOWN; if (cb != NULL) - retVal = ((CB_CODECLib*)cb)->GetCodecByName(((AddonCB*)hdl)->addonData, strCodecName); + retVal = ((CB_CodecLib*)cb)->GetCodecByName(((AddonCB*)hdl)->addonData, strCodecName); return retVal; } diff --git a/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp b/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp index cc9f3c8635..c993c43d73 100644 --- a/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp +++ b/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp @@ -24,7 +24,7 @@ #include <stdlib.h> #include <stdarg.h> #include <string> -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.h" #include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h" #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" @@ -36,6 +36,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::PVR; extern "C" { @@ -47,7 +48,7 @@ DLLEXPORT void* PVR_register_me(void *hdl) fprintf(stderr, "libXBMC_pvr-ERROR: PVRLib_register_me is called with NULL handle !!!\n"); else { - cb = ((AddonCB*)hdl)->PVRLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_PVRLib*)((AddonCB*)hdl)->PVRLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libXBMC_pvr-ERROR: PVRLib_register_me can't get callback table from XBMC !!!\n"); } diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index 91feaa4be7..e3f11caae1 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -182,18 +182,20 @@ </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\xbmc\addons\AddonBuilder.cpp" /> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacks.cpp" /> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksAddon.cpp" /> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksAudioDSP.cpp" /> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksAudioEngine.cpp" /> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksCodec.cpp" /> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksGUI.cpp" /> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksInputStream.cpp" /> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksPVR.cpp" /> <ClCompile Include="..\..\xbmc\addons\AddonDatabase.cpp" /> <ClCompile Include="..\..\xbmc\addons\AddonInstaller.cpp" /> <ClCompile Include="..\..\xbmc\addons\AddonSystemSettings.cpp" /> <ClCompile Include="..\..\xbmc\addons\AddonVersion.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\AddonInterfaces.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\Addon\AddonCallbacksAddon.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\AudioDSP\AddonCallbacksAudioDSP.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\AudioEngine\AddonCallbacksAudioEngine.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\Codec\AddonCallbacksCodec.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonCallbacksGUI.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonGUIRenderingControl.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonGUIWindow.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\InputStream\AddonCallbacksInputStream.cpp" /> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\PVR\AddonCallbacksPVR.cpp" /> <ClCompile Include="..\..\xbmc\addons\ContextMenuAddon.cpp" /> <ClCompile Include="..\..\xbmc\addons\AudioDecoder.cpp" /> <ClCompile Include="..\..\xbmc\addons\GUIDialogAddonInfo.cpp" /> @@ -923,11 +925,18 @@ <ClCompile Include="..\..\xbmc\TextureDatabase.cpp" /> <ClCompile Include="..\..\xbmc\DatabaseManager.cpp" /> <ClInclude Include="..\..\xbmc\addons\AddonBuilder.h" /> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksAudioDSP.h" /> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksAudioEngine.h" /> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksCodec.h" /> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksInputStream.h" /> <ClInclude Include="..\..\xbmc\addons\AudioDecoder.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\AddonInterfaces.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\Addon\AddonCallbacksAddon.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\AudioDSP\AddonCallbacksAudioDSP.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\AudioEngine\AddonCallbacksAudioEngine.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\Codec\AddonCallbacksCodec.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonCallbacksGUI.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonGUIRenderingControl.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonGUIWindow.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\InputStream\AddonCallbacksInputStream.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\PVR\AddonCallbacksPVR.h" /> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\IAddonInterface.h" /> <ClInclude Include="..\..\xbmc\addons\ContextMenuAddon.h" /> <ClInclude Include="..\..\xbmc\addons\ImageResource.h" /> <ClInclude Include="..\..\xbmc\addons\kodi-addon-dev-kit\include\kodi\kodi_adsp_dll.h" /> @@ -1863,10 +1872,6 @@ <ClCompile Include="..\..\xbmc\platform\XbmcContext.cpp" /> </ItemGroup> <ItemGroup> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacks.h" /> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksAddon.h" /> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksGUI.h" /> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksPVR.h" /> <ClInclude Include="..\..\xbmc\addons\AddonDatabase.h" /> <ClInclude Include="..\..\xbmc\addons\AddonInstaller.h" /> <ClInclude Include="..\..\xbmc\addons\AddonSystemSettings.h" /> diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index e861fa9fb4..389f00b3b7 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -388,8 +388,32 @@ <Filter Include="cores\Process"> <UniqueIdentifier>{45ab3e06-b8d3-44f5-994e-d6130258c99c}</UniqueIdentifier> </Filter> - <Filter Include="addons\include"> - <UniqueIdentifier>{353ba04b-a59a-4fb3-90d0-630277d5305b}</UniqueIdentifier> + <Filter Include="addons\binary"> + <UniqueIdentifier>{0840727e-72bd-4092-a230-5a1b0a582346}</UniqueIdentifier> + </Filter> + <Filter Include="addons\binary\interfaces"> + <UniqueIdentifier>{c3d7bd79-2535-4e6e-a518-04fe52d63af7}</UniqueIdentifier> + </Filter> + <Filter Include="addons\binary\interfaces\api1"> + <UniqueIdentifier>{e8906622-ec29-4c0a-9c78-3707434c249f}</UniqueIdentifier> + </Filter> + <Filter Include="addons\binary\interfaces\api1\Addon"> + <UniqueIdentifier>{713565a3-6312-41cc-b933-8bb825e7b92b}</UniqueIdentifier> + </Filter> + <Filter Include="addons\binary\interfaces\api1\AudioDSP"> + <UniqueIdentifier>{9d29c165-ad4c-4aa5-8b5a-cea7bd1a4518}</UniqueIdentifier> + </Filter> + <Filter Include="addons\binary\interfaces\api1\AudioEngine"> + <UniqueIdentifier>{0427f795-7a94-42cc-a428-24f793ec1e9e}</UniqueIdentifier> + </Filter> + <Filter Include="addons\binary\interfaces\api1\GUI"> + <UniqueIdentifier>{81553ed3-d668-4b18-b634-1b0d5895eaff}</UniqueIdentifier> + </Filter> + <Filter Include="addons\binary\interfaces\api1\PVR"> + <UniqueIdentifier>{86920521-ee04-41f2-b7fc-4b00051c1357}</UniqueIdentifier> + </Filter> + <Filter Include="addons\binary\interfaces\api1\Codec"> + <UniqueIdentifier>{c9f0b2a1-0169-4c0f-9f9f-15e08a659a5d}</UniqueIdentifier> </Filter> </ItemGroup> <ItemGroup> @@ -1698,18 +1722,6 @@ <ClCompile Include="..\..\xbmc\pvr\addons\PVRClients.cpp"> <Filter>pvr\addons</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacks.cpp"> - <Filter>addons</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksAddon.cpp"> - <Filter>addons</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksGUI.cpp"> - <Filter>addons</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksPVR.cpp"> - <Filter>addons</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\dialogs\GUIDialogPlayEject.cpp"> <Filter>dialogs</Filter> </ClCompile> @@ -2711,9 +2723,6 @@ <ClCompile Include="..\..\xbmc\interfaces\python\PythonInvoker.cpp"> <Filter>interfaces\python</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksCodec.cpp"> - <Filter>addons</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\interfaces\json-rpc\ProfilesOperations.cpp"> <Filter>interfaces\json-rpc</Filter> </ClCompile> @@ -2897,9 +2906,6 @@ <ClCompile Include="..\..\xbmc\cores\AudioEngine\DSPAddons\ActiveAEDSPProcess.cpp"> <Filter>cores\AudioEngine\DSPAddons</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksAudioDSP.cpp"> - <Filter>addons</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\utils\HttpRangeUtils.cpp"> <Filter>utils</Filter> </ClCompile> @@ -3165,9 +3171,6 @@ <ClCompile Include="..\..\xbmc\interfaces\builtins\WeatherBuiltins.cpp"> <Filter>interfaces\builtins</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\addons\AddonCallbacksAudioEngine.cpp"> - <Filter>addons</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\input\InputCodingTableKorean.cpp"> <Filter>input</Filter> </ClCompile> @@ -3289,6 +3292,7 @@ <ClCompile Include="..\..\xbmc\cores\VideoPlayer\Process\ProcessInfo.cpp"> <Filter>cores\Process</Filter> </ClCompile> +<<<<<<< c6b201a8ade5ab0e3eea677cae5b6ea55139839f <ClCompile Include="..\..\xbmc\addons\InputStream.cpp"> <Filter>addons</Filter> </ClCompile> @@ -3298,6 +3302,33 @@ <ClCompile Include="..\..\xbmc\cores\VideoPlayer\DVDInputStreams\InputStreamAddon.cpp"> <Filter>cores\VideoPlayer\DVDInputStreams</Filter> </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\PVR\AddonCallbacksPVR.cpp"> + <Filter>addons\binary\interfaces\api1\PVR</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonCallbacksGUI.cpp"> + <Filter>addons\binary\interfaces\api1\GUI</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\Codec\AddonCallbacksCodec.cpp"> + <Filter>addons\binary\interfaces\api1\Codec</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\AudioEngine\AddonCallbacksAudioEngine.cpp"> + <Filter>addons\binary\interfaces\api1\AudioEngine</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\AudioDSP\AddonCallbacksAudioDSP.cpp"> + <Filter>addons\binary\interfaces\api1\AudioDSP</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\Addon\AddonCallbacksAddon.cpp"> + <Filter>addons\binary\interfaces\api1\Addon</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\AddonInterfaces.cpp"> + <Filter>addons\binary\interfaces</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonGUIRenderingControl.cpp"> + <Filter>addons\binary\interfaces\api1\GUI</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonGUIWindow.cpp"> + <Filter>addons\binary\interfaces\api1\GUI</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\xbmc\win32\pch.h"> @@ -4787,18 +4818,6 @@ <ClInclude Include="..\..\xbmc\pvr\addons\PVRClients.h"> <Filter>pvr\addons</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacks.h"> - <Filter>addons</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksAddon.h"> - <Filter>addons</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksGUI.h"> - <Filter>addons</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksPVR.h"> - <Filter>addons</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\dialogs\GUIDialogPlayEject.h"> <Filter>dialogs</Filter> </ClInclude> @@ -5732,9 +5751,6 @@ <ClInclude Include="..\..\xbmc\interfaces\generic\ILanguageInvocationHandler.h"> <Filter>interfaces\generic</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksCodec.h"> - <Filter>addons</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\interfaces\json-rpc\ProfilesOperations.h"> <Filter>interfaces\json-rpc</Filter> </ClInclude> @@ -5953,9 +5969,6 @@ <ClInclude Include="..\..\xbmc\cores\AudioEngine\DSPAddons\ActiveAEDSPProcess.h"> <Filter>cores\AudioEngine\DSPAddons</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksAudioDSP.h"> - <Filter>addons</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\addons\DllAudioDSP.h"> <Filter>addons</Filter> </ClInclude> @@ -6235,9 +6248,6 @@ <ClInclude Include="..\..\xbmc\interfaces\builtins\WeatherBuiltins.h"> <Filter>interfaces\builtins</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\addons\AddonCallbacksAudioEngine.h"> - <Filter>addons</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\cores\AudioEngine\Utils\AEStreamData.h"> <Filter>cores\AudioEngine\Utils</Filter> </ClInclude> @@ -6404,6 +6414,36 @@ <ClInclude Include="..\..\xbmc\addons\AddonCallbacksInputStream.h"> <Filter>addons</Filter> </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\AddonInterfaces.h"> + <Filter>addons\binary\interfaces</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\IAddonInterface.h"> + <Filter>addons\binary\interfaces</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\PVR\AddonCallbacksPVR.h"> + <Filter>addons\binary\interfaces\api1\PVR</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonCallbacksGUI.h"> + <Filter>addons\binary\interfaces\api1\GUI</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\Codec\AddonCallbacksCodec.h"> + <Filter>addons\binary\interfaces\api1\Codec</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\AudioEngine\AddonCallbacksAudioEngine.h"> + <Filter>addons\binary\interfaces\api1\AudioEngine</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\AudioDSP\AddonCallbacksAudioDSP.h"> + <Filter>addons\binary\interfaces\api1\AudioDSP</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\Addon\AddonCallbacksAddon.h"> + <Filter>addons\binary\interfaces\api1\Addon</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonGUIRenderingControl.h"> + <Filter>addons\binary\interfaces\api1\GUI</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\addons\binary\interfaces\api1\GUI\AddonGUIWindow.h"> + <Filter>addons\binary\interfaces\api1\GUI</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc"> diff --git a/project/cmake/treedata/common/subdirs.txt b/project/cmake/treedata/common/subdirs.txt index 762547e938..591d6fde72 100644 --- a/project/cmake/treedata/common/subdirs.txt +++ b/project/cmake/treedata/common/subdirs.txt @@ -1,25 +1,33 @@ -xbmc xbmc -xbmc/addons addons -xbmc/commons commons -xbmc/cdrip cdrip -xbmc/dbwrappers dbwrappers -xbmc/dialogs dialogs -xbmc/epg epg -xbmc/guilib guilib -xbmc/input input -xbmc/listproviders listproviders -xbmc/media media -xbmc/messaging messaging -xbmc/messaging/helpers messagingHelpers -xbmc/pictures pictures -xbmc/platform platform -xbmc/playlists playlists -xbmc/powermanagement powermanagement -xbmc/programs programs -xbmc/rendering rendering -xbmc/storage storage -xbmc/threads threads -xbmc/utils utils -xbmc/view view -xbmc/windowing windowing -xbmc/windows windows +xbmc xbmc +xbmc/addons addons +xbmc/addons/binary/interfaces addonsBinaryInterfaces +xbmc/addons/binary/interfaces/api1/Addon api1AddonCallbacks_Addon +xbmc/addons/binary/interfaces/api1/AudioDSP api1AddonCallbacks_AudioDSP +xbmc/addons/binary/interfaces/api1/AudioEngine api1AddonCallbacks_AudioEngine +xbmc/addons/binary/interfaces/api1/Codec api1AddonCallbacks_Codec +xbmc/addons/binary/interfaces/api1/GUI api1AddonCallbacks_GUI +xbmc/addons/binary/interfaces/api1/InputStream api1AddonCallbacks_InputStream +xbmc/addons/binary/interfaces/api1/PVR api1AddonCallbacks_PVR +xbmc/commons commons +xbmc/cdrip cdrip +xbmc/dbwrappers dbwrappers +xbmc/dialogs dialogs +xbmc/epg epg +xbmc/guilib guilib +xbmc/input input +xbmc/listproviders listproviders +xbmc/media media +xbmc/messaging messaging +xbmc/messaging/helpers messagingHelpers +xbmc/pictures pictures +xbmc/platform platform +xbmc/playlists playlists +xbmc/powermanagement powermanagement +xbmc/programs programs +xbmc/rendering rendering +xbmc/storage storage +xbmc/threads threads +xbmc/utils utils +xbmc/view view +xbmc/windowing windowing +xbmc/windows windows diff --git a/xbmc/addons/AddonDll.h b/xbmc/addons/AddonDll.h index a18d650b4d..34cecfd29f 100644 --- a/xbmc/addons/AddonDll.h +++ b/xbmc/addons/AddonDll.h @@ -25,7 +25,7 @@ #include "DllAddon.h" #include "AddonManager.h" #include "AddonStatusHandler.h" -#include "AddonCallbacks.h" +#include "addons/binary/interfaces/AddonInterfaces.h" #include "utils/URIUtils.h" #include "filesystem/File.h" #include "filesystem/SpecialProtocol.h" @@ -69,7 +69,7 @@ namespace ADDON virtual bool LoadSettings(); TheStruct* m_pStruct; TheProps* m_pInfo; - CAddonCallbacks* m_pHelpers; + CAddonInterfaces* m_pHelpers; bool m_bIsChild; private: @@ -206,7 +206,7 @@ ADDON_STATUS CAddonDll<TheDll, TheStruct, TheProps>::Create() /* Allocate the helper function class to allow crosstalk over helper libraries */ - m_pHelpers = new CAddonCallbacks(this); + m_pHelpers = new CAddonInterfaces(this); /* Call Create to make connections, initializing data or whatever is needed to become the AddOn running */ diff --git a/xbmc/addons/CMakeLists.txt b/xbmc/addons/CMakeLists.txt index c1bcb04f01..e0c6fc0726 100644 --- a/xbmc/addons/CMakeLists.txt +++ b/xbmc/addons/CMakeLists.txt @@ -1,13 +1,5 @@ set(SOURCES Addon.cpp AddonBuilder.cpp - AddonCallbacksAddon.cpp - AddonCallbacksAudioDSP.cpp - AddonCallbacksAudioEngine.cpp - AddonCallbacksCodec.cpp - AddonCallbacks.cpp - AddonCallbacksGUI.cpp - AddonCallbacksInputStream.cpp - AddonCallbacksPVR.cpp AddonDatabase.cpp AddonInstaller.cpp AddonManager.cpp @@ -37,14 +29,6 @@ set(SOURCES Addon.cpp set(HEADERS Addon.h AddonBuilder.h - AddonCallbacks.h - AddonCallbacksAddon.h - AddonCallbacksAudioDSP.h - AddonCallbacksAudioEngine.h - AddonCallbacksCodec.h - AddonCallbacksGUI.h - AddonCallbacksInputStream.h - AddonCallbacksPVR.h AddonDatabase.h AddonDll.h AddonInstaller.h diff --git a/xbmc/addons/Makefile b/xbmc/addons/Makefile index 7fc60a086c..88ea7874bb 100644 --- a/xbmc/addons/Makefile +++ b/xbmc/addons/Makefile @@ -1,13 +1,5 @@ SRCS=Addon.cpp \ AddonBuilder.cpp \ - AddonCallbacks.cpp \ - AddonCallbacksAddon.cpp \ - AddonCallbacksAudioDSP.cpp \ - AddonCallbacksAudioEngine.cpp \ - AddonCallbacksCodec.cpp \ - AddonCallbacksGUI.cpp \ - AddonCallbacksPVR.cpp \ - AddonCallbacksInputStream.cpp \ AddonDatabase.cpp \ AddonInstaller.cpp \ AddonManager.cpp \ diff --git a/xbmc/addons/binary/interfaces/AddonInterfaces.cpp b/xbmc/addons/binary/interfaces/AddonInterfaces.cpp index 2174b88c90..56a3d65002 100644 --- a/xbmc/addons/binary/interfaces/AddonInterfaces.cpp +++ b/xbmc/addons/binary/interfaces/AddonInterfaces.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -13,257 +14,287 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ -#include "Addon.h" -#include "AddonCallbacks.h" -#include "AddonCallbacksAddon.h" -#include "AddonCallbacksAudioDSP.h" -#include "AddonCallbacksAudioEngine.h" -#include "AddonCallbacksCodec.h" -#include "AddonCallbacksGUI.h" -#include "AddonCallbacksPVR.h" +#include "AddonInterfaces.h" + +#include "addons/Addon.h" + +#include "addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.h" +#include "addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.h" +#include "addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.h" +#include "addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h" +#include "addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.h" +#include "addons/binary/interfaces/api1/GUI/AddonGUIWindow.h" +#include "addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.h" +#include "addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.h" #include "filesystem/SpecialProtocol.h" +#include "messaging/ApplicationMessenger.h" #include "utils/log.h" +using namespace KODI::MESSAGING; + namespace ADDON { -CAddonCallbacks::CAddonCallbacks(CAddon* addon) +CAddonInterfaces::CAddonInterfaces(CAddon* addon) + : m_callbacks(new AddonCB), + m_addon(addon), + m_helperAddOn(nullptr), + m_helperAudioEngine(nullptr), + m_helperGUI(nullptr), + m_helperPVR(nullptr), + m_helperADSP(nullptr), + m_helperCODEC(nullptr), + m_helperInputStream(nullptr) { - m_addon = addon; - m_callbacks = new AddonCB; - m_helperAddon = NULL; - m_helperADSP = NULL; - m_helperAudioEngine = NULL; - m_helperGUI = NULL; - m_helperPVR = NULL; - m_helperCODEC = NULL; - m_helperInputStream = nullptr; - - m_callbacks->libBasePath = strdup(CSpecialProtocol::TranslatePath("special://xbmcbin/addons").c_str()); - m_callbacks->addonData = this; - m_callbacks->AddOnLib_RegisterMe = CAddonCallbacks::AddOnLib_RegisterMe; - m_callbacks->AddOnLib_UnRegisterMe = CAddonCallbacks::AddOnLib_UnRegisterMe; - m_callbacks->ADSPLib_RegisterMe = CAddonCallbacks::ADSPLib_RegisterMe; - m_callbacks->ADSPLib_UnRegisterMe = CAddonCallbacks::ADSPLib_UnRegisterMe; - m_callbacks->AudioEngineLib_RegisterMe = CAddonCallbacks::AudioEngineLib_RegisterMe; - m_callbacks->AudioEngineLib_UnRegisterMe = CAddonCallbacks::AudioEngineLib_UnRegisterMe; - m_callbacks->CODECLib_RegisterMe = CAddonCallbacks::CODECLib_RegisterMe; - m_callbacks->CODECLib_UnRegisterMe = CAddonCallbacks::CODECLib_UnRegisterMe; - m_callbacks->GUILib_RegisterMe = CAddonCallbacks::GUILib_RegisterMe; - m_callbacks->GUILib_UnRegisterMe = CAddonCallbacks::GUILib_UnRegisterMe; - m_callbacks->PVRLib_RegisterMe = CAddonCallbacks::PVRLib_RegisterMe; - m_callbacks->PVRLib_UnRegisterMe = CAddonCallbacks::PVRLib_UnRegisterMe; - m_callbacks->INPUTSTREAMLib_RegisterMe = CAddonCallbacks::INPUTSTREAMLib_RegisterMe; - m_callbacks->INPUTSTREAMLib_UnRegisterMe = CAddonCallbacks::INPUTSTREAMLib_UnRegisterMe; + m_callbacks->libBasePath = strdup(CSpecialProtocol::TranslatePath("special://xbmcbin/addons").c_str()); + m_callbacks->addonData = this; + + m_callbacks->AddOnLib_RegisterMe = CAddonInterfaces::AddOnLib_RegisterMe; + m_callbacks->AddOnLib_UnRegisterMe = CAddonInterfaces::AddOnLib_UnRegisterMe; + m_callbacks->AudioEngineLib_RegisterMe = CAddonInterfaces::AudioEngineLib_RegisterMe; + m_callbacks->AudioEngineLib_UnRegisterMe = CAddonInterfaces::AudioEngineLib_UnRegisterMe; + m_callbacks->GUILib_RegisterMe = CAddonInterfaces::GUILib_RegisterMe; + m_callbacks->GUILib_UnRegisterMe = CAddonInterfaces::GUILib_UnRegisterMe; + m_callbacks->PVRLib_RegisterMe = CAddonInterfaces::PVRLib_RegisterMe; + m_callbacks->PVRLib_UnRegisterMe = CAddonInterfaces::PVRLib_UnRegisterMe; + m_callbacks->ADSPLib_RegisterMe = CAddonInterfaces::ADSPLib_RegisterMe; + m_callbacks->ADSPLib_UnRegisterMe = CAddonInterfaces::ADSPLib_UnRegisterMe; + m_callbacks->CodecLib_RegisterMe = CAddonInterfaces::CodecLib_RegisterMe; + m_callbacks->CodecLib_UnRegisterMe = CAddonInterfaces::CodecLib_UnRegisterMe; + m_callbacks->INPUTSTREAMLib_RegisterMe = CAddonInterfaces::INPUTSTREAMLib_RegisterMe; + m_callbacks->INPUTSTREAMLib_UnRegisterMe = CAddonInterfaces::INPUTSTREAMLib_UnRegisterMe; } -CAddonCallbacks::~CAddonCallbacks() +CAddonInterfaces::~CAddonInterfaces() { - delete m_helperAddon; - m_helperAddon = NULL; - delete m_helperADSP; - m_helperADSP = NULL; - delete m_helperAudioEngine; - m_helperAudioEngine = NULL; - delete m_helperCODEC; - m_helperCODEC = NULL; - delete m_helperGUI; - m_helperGUI = NULL; - delete m_helperPVR; - m_helperPVR = NULL; - delete m_helperInputStream; - m_helperInputStream = nullptr; + delete static_cast<V1::KodiAPI::AddOn::CAddonCallbacksAddon*>(m_helperAddOn); + delete static_cast<V1::KodiAPI::AudioEngine::CAddonCallbacksAudioEngine*>(m_helperAudioEngine); + delete static_cast<V1::KodiAPI::PVR::CAddonCallbacksPVR*>(m_helperPVR); + delete static_cast<V1::KodiAPI::GUI::CAddonCallbacksGUI*>(m_helperGUI); + delete static_cast<V1::KodiAPI::AudioDSP::CAddonCallbacksADSP*>(m_helperADSP); + delete static_cast<V1::KodiAPI::Codec::CAddonCallbacksCodec*>(m_helperCODEC); + delete static_cast<V1::KodiAPI::InputStream::CAddonCallbacksInputStream*>(m_helperInputStream); + free((char*)m_callbacks->libBasePath); delete m_callbacks; - m_callbacks = NULL; } -CB_AddOnLib* CAddonCallbacks::AddOnLib_RegisterMe(void *addonData) +/*\_____________________________________________________________________________ +\*/ + +void* CAddonInterfaces::AddOnLib_RegisterMe(void *addonData) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); - return NULL; + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); + return nullptr; } - addon->m_helperAddon = new CAddonCallbacksAddon(addon->m_addon); - return addon->m_helperAddon->GetCallbacks(); + addon->m_helperAddOn = new V1::KodiAPI::AddOn::CAddonCallbacksAddon(addon->m_addon); + return static_cast<V1::KodiAPI::AddOn::CAddonCallbacksAddon*>(addon->m_helperAddOn)->GetCallbacks(); } -void CAddonCallbacks::AddOnLib_UnRegisterMe(void *addonData, CB_AddOnLib *cbTable) +void CAddonInterfaces::AddOnLib_UnRegisterMe(void *addonData, void *cbTable) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); return; } - delete addon->m_helperAddon; - addon->m_helperAddon = NULL; + delete static_cast<V1::KodiAPI::AddOn::CAddonCallbacksAddon*>(addon->m_helperAddOn); + addon->m_helperAddOn = nullptr; } -CB_ADSPLib* CAddonCallbacks::ADSPLib_RegisterMe(void *addonData) +/*\_____________________________________________________________________________ +\*/ +void* CAddonInterfaces::AudioEngineLib_RegisterMe(void *addonData) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); - return NULL; + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); + return nullptr; } - addon->m_helperADSP = new CAddonCallbacksADSP(addon->m_addon); - return addon->m_helperADSP->GetCallbacks(); + addon->m_helperAudioEngine = new V1::KodiAPI::AudioEngine::CAddonCallbacksAudioEngine(addon->m_addon); + return static_cast<V1::KodiAPI::AudioEngine::CAddonCallbacksAudioEngine*>(addon->m_helperAudioEngine)->GetCallbacks(); } -void CAddonCallbacks::ADSPLib_UnRegisterMe(void *addonData, CB_ADSPLib *cbTable) +void CAddonInterfaces::AudioEngineLib_UnRegisterMe(void *addonData, void *cbTable) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); return; } - delete addon->m_helperADSP; - addon->m_helperADSP = NULL; + delete static_cast<V1::KodiAPI::AudioEngine::CAddonCallbacksAudioEngine*>(addon->m_helperAudioEngine); + addon->m_helperAudioEngine = nullptr; } - -CB_AudioEngineLib* CAddonCallbacks::AudioEngineLib_RegisterMe(void *addonData) +/*\_____________________________________________________________________________ +\*/ +void* CAddonInterfaces::GUILib_RegisterMe(void *addonData) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); - return NULL; + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); + return nullptr; } - addon->m_helperAudioEngine = new CAddonCallbacksAudioEngine(addon->m_addon); - return addon->m_helperAudioEngine->GetCallbacks(); + addon->m_helperGUI = new V1::KodiAPI::GUI::CAddonCallbacksGUI(addon->m_addon); + return static_cast<V1::KodiAPI::GUI::CAddonCallbacksGUI*>(addon->m_helperGUI)->GetCallbacks(); } -void CAddonCallbacks::AudioEngineLib_UnRegisterMe(void *addonData, CB_AudioEngineLib *cbTable) +void CAddonInterfaces::GUILib_UnRegisterMe(void *addonData, void *cbTable) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); return; } - delete addon->m_helperAudioEngine; - addon->m_helperAudioEngine = NULL; + delete static_cast<V1::KodiAPI::GUI::CAddonCallbacksGUI*>(addon->m_helperGUI); + addon->m_helperGUI = nullptr; } - - -CB_CODECLib* CAddonCallbacks::CODECLib_RegisterMe(void *addonData) +/*\_____________________________________________________________________________ +\*/ +void* CAddonInterfaces::PVRLib_RegisterMe(void *addonData) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); - return NULL; + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); + return nullptr; } - addon->m_helperCODEC = new CAddonCallbacksCodec(addon->m_addon); - return addon->m_helperCODEC->GetCallbacks(); + addon->m_helperPVR = new V1::KodiAPI::PVR::CAddonCallbacksPVR(addon->m_addon); + return static_cast<V1::KodiAPI::PVR::CAddonCallbacksPVR*>(addon->m_helperPVR)->GetCallbacks(); } -void CAddonCallbacks::CODECLib_UnRegisterMe(void *addonData, CB_CODECLib *cbTable) +void CAddonInterfaces::PVRLib_UnRegisterMe(void *addonData, void *cbTable) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); return; } - delete addon->m_helperCODEC; - addon->m_helperCODEC = NULL; + delete static_cast<V1::KodiAPI::PVR::CAddonCallbacksPVR*>(addon->m_helperPVR); + addon->m_helperPVR = nullptr; } - -CB_GUILib* CAddonCallbacks::GUILib_RegisterMe(void *addonData) +/*\_____________________________________________________________________________ +\*/ +void* CAddonInterfaces::ADSPLib_RegisterMe(void *addonData) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); - return NULL; + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); + return nullptr; } - addon->m_helperGUI = new CAddonCallbacksGUI(addon->m_addon); - return addon->m_helperGUI->GetCallbacks(); + addon->m_helperADSP = new V1::KodiAPI::AudioDSP::CAddonCallbacksADSP(addon->m_addon); + return static_cast<V1::KodiAPI::AudioDSP::CAddonCallbacksADSP*>(addon->m_helperADSP)->GetCallbacks(); } -void CAddonCallbacks::GUILib_UnRegisterMe(void *addonData, CB_GUILib *cbTable) +void CAddonInterfaces::ADSPLib_UnRegisterMe(void *addonData, void *cbTable) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); return; } - delete addon->m_helperGUI; - addon->m_helperGUI = NULL; + delete static_cast<V1::KodiAPI::AudioDSP::CAddonCallbacksADSP*>(addon->m_helperADSP); + addon->m_helperADSP = nullptr; } - -CB_PVRLib* CAddonCallbacks::PVRLib_RegisterMe(void *addonData) +/*\_____________________________________________________________________________ +\*/ +void* CAddonInterfaces::CodecLib_RegisterMe(void *addonData) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); - return NULL; + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); + return nullptr; } - addon->m_helperPVR = new CAddonCallbacksPVR(addon->m_addon); - return addon->m_helperPVR->GetCallbacks(); + addon->m_helperCODEC = new V1::KodiAPI::Codec::CAddonCallbacksCodec(addon->m_addon); + return static_cast<V1::KodiAPI::Codec::CAddonCallbacksCodec*>(addon->m_helperCODEC)->GetCallbacks(); } -void CAddonCallbacks::PVRLib_UnRegisterMe(void *addonData, CB_PVRLib *cbTable) +void CAddonInterfaces::CodecLib_UnRegisterMe(void *addonData, void *cbTable) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); return; } - delete addon->m_helperPVR; - addon->m_helperPVR = NULL; + delete static_cast<V1::KodiAPI::Codec::CAddonCallbacksCodec*>(addon->m_helperCODEC); + addon->m_helperCODEC = nullptr; } - -CB_INPUTSTREAMLib* CAddonCallbacks::INPUTSTREAMLib_RegisterMe(void *addonData) +/*\_____________________________________________________________________________ +\*/ +void* CAddonInterfaces::INPUTSTREAMLib_RegisterMe(void *addonData) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); - return NULL; + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); + return nullptr; } - addon->m_helperInputStream = new CAddonCallbacksInputStream(addon->m_addon); - return addon->m_helperInputStream->GetCallbacks(); + addon->m_helperInputStream = new V1::KodiAPI::InputStream::CAddonCallbacksInputStream(addon->m_addon); + return static_cast<V1::KodiAPI::InputStream::CAddonCallbacksInputStream*>(addon->m_helperInputStream)->GetCallbacks(); } -void CAddonCallbacks::INPUTSTREAMLib_UnRegisterMe(void *addonData, CB_INPUTSTREAMLib *cbTable) +void CAddonInterfaces::INPUTSTREAMLib_UnRegisterMe(void *addonData, void* cbTable) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; - if (addon == NULL) + CAddonInterfaces* addon = static_cast<CAddonInterfaces*>(addonData); + if (addon == nullptr) { - CLog::Log(LOGERROR, "CAddonCallbacks - %s - called with a null pointer", __FUNCTION__); + CLog::Log(LOGERROR, "CAddonInterfaces - %s - called with a null pointer", __FUNCTION__); return; } - delete addon->m_helperInputStream; + delete static_cast<V1::KodiAPI::InputStream::CAddonCallbacksInputStream*>(addon->m_helperInputStream); addon->m_helperInputStream = nullptr; } +/*\_____________________________________________________________________________ +\*/ +void CAddonInterfaces::OnApplicationMessage(ThreadMessage* pMsg) +{ + switch (pMsg->dwMessage) + { + case TMSG_GUI_ADDON_DIALOG: + { + if (pMsg->lpVoid) + { // TODO: This is ugly - really these binary add-on dialogs should just be normal Kodi dialogs + switch (pMsg->param1) + { + case 1: + static_cast<V1::KodiAPI::GUI::CGUIAddonWindowDialog*>(pMsg->lpVoid)->Show_Internal(pMsg->param2 > 0); + break; + }; + } + } + break; + } +} }; /* namespace ADDON */ diff --git a/xbmc/addons/binary/interfaces/AddonInterfaces.h b/xbmc/addons/binary/interfaces/AddonInterfaces.h index ec383c8212..2a44dc41da 100644 --- a/xbmc/addons/binary/interfaces/AddonInterfaces.h +++ b/xbmc/addons/binary/interfaces/AddonInterfaces.h @@ -1,7 +1,8 @@ #pragma once /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -14,602 +15,124 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ -#include <stdint.h> - -#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h" -#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h" -#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h" -#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h" -#include "addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h" -#include "addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h" -#include "addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h" -#include "addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h" -#include "cores/VideoPlayer/DVDDemuxers/DVDDemuxUtils.h" -#include "AddonCallbacksInputStream.h" - -#ifdef TARGET_WINDOWS -#ifndef _SSIZE_T_DEFINED -typedef intptr_t ssize_t; -#define _SSIZE_T_DEFINED -#endif // !_SSIZE_T_DEFINED -#endif // TARGET_WINDOWS - -struct VFSDirEntry; - -typedef void (*AddOnLogCallback)(void *addonData, const ADDON::addon_log_t loglevel, const char *msg); -typedef void (*AddOnQueueNotification)(void *addonData, const ADDON::queue_msg_t type, const char *msg); -typedef bool (*AddOnWakeOnLan)(const char* mac); -typedef bool (*AddOnGetSetting)(void *addonData, const char *settingName, void *settingValue); -typedef char* (*AddOnUnknownToUTF8)(const char *sourceDest); -typedef char* (*AddOnGetLocalizedString)(const void* addonData, long dwCode); -typedef char* (*AddOnGetDVDMenuLanguage)(const void* addonData); -typedef void (*AddOnFreeString)(const void* addonData, char* str); - -typedef void* (*AddOnOpenFile)(const void* addonData, const char* strFileName, unsigned int flags); -typedef void* (*AddOnOpenFileForWrite)(const void* addonData, const char* strFileName, bool bOverWrite); -typedef ssize_t (*AddOnReadFile)(const void* addonData, void* file, void* lpBuf, size_t uiBufSize); -typedef bool (*AddOnReadFileString)(const void* addonData, void* file, char *szLine, int iLineLength); -typedef ssize_t (*AddOnWriteFile)(const void* addonData, void* file, const void* lpBuf, size_t uiBufSize); -typedef void (*AddOnFlushFile)(const void* addonData, void* file); -typedef int64_t (*AddOnSeekFile)(const void* addonData, void* file, int64_t iFilePosition, int iWhence); -typedef int (*AddOnTruncateFile)(const void* addonData, void* file, int64_t iSize); -typedef int64_t (*AddOnGetFilePosition)(const void* addonData, void* file); -typedef int64_t (*AddOnGetFileLength)(const void* addonData, void* file); -typedef double(*AddOnGetFileDownloadSpeed)(const void* addonData, void* file); -typedef void (*AddOnCloseFile)(const void* addonData, void* file); -typedef int (*AddOnGetFileChunkSize)(const void* addonData, void* file); -typedef bool (*AddOnFileExists)(const void* addonData, const char *strFileName, bool bUseCache); -typedef int (*AddOnStatFile)(const void* addonData, const char *strFileName, struct __stat64* buffer); -typedef bool (*AddOnDeleteFile)(const void* addonData, const char *strFileName); -typedef bool (*AddOnCanOpenDirectory)(const void* addonData, const char* strURL); -typedef bool (*AddOnCreateDirectory)(const void* addonData, const char *strPath); -typedef bool (*AddOnDirectoryExists)(const void* addonData, const char *strPath); -typedef bool (*AddOnRemoveDirectory)(const void* addonData, const char *strPath); -typedef bool (*AddOnGetDirectory)(const void* addonData, const char *strPath, const char* mask, VFSDirEntry** items, unsigned int* num_items); -typedef void (*AddOnFreeDirectory)(const void* addonData, VFSDirEntry* items, unsigned int num_items); -typedef void* (*AddOnCURLCreate)(const void* addonData, const char* strURL); -typedef bool(*AddOnCURLAddOption)(const void* addonData, void* file, XFILE::CURLOPTIONTYPE type, const char* name, const char * value); -typedef bool(*AddOnCURLOpen)(const void* addonData, void* file, unsigned int flags); - -typedef struct CB_AddOn -{ - AddOnLogCallback Log; - AddOnQueueNotification QueueNotification; - AddOnWakeOnLan WakeOnLan; - AddOnGetSetting GetSetting; - AddOnUnknownToUTF8 UnknownToUTF8; - AddOnGetLocalizedString GetLocalizedString; - AddOnGetDVDMenuLanguage GetDVDMenuLanguage; - AddOnFreeString FreeString; - - AddOnOpenFile OpenFile; - AddOnOpenFileForWrite OpenFileForWrite; - AddOnReadFile ReadFile; - AddOnReadFileString ReadFileString; - AddOnWriteFile WriteFile; - AddOnFlushFile FlushFile; - AddOnSeekFile SeekFile; - AddOnTruncateFile TruncateFile; - AddOnGetFilePosition GetFilePosition; - AddOnGetFileLength GetFileLength; - AddOnGetFileDownloadSpeed GetFileDownloadSpeed; - AddOnCloseFile CloseFile; - AddOnGetFileChunkSize GetFileChunkSize; - AddOnFileExists FileExists; - AddOnStatFile StatFile; - AddOnDeleteFile DeleteFile; - AddOnCanOpenDirectory CanOpenDirectory; - AddOnCreateDirectory CreateDirectory; - AddOnDirectoryExists DirectoryExists; - AddOnRemoveDirectory RemoveDirectory; - AddOnGetDirectory GetDirectory; - AddOnFreeDirectory FreeDirectory; - AddOnCURLCreate CURLCreate; - AddOnCURLAddOption CURLAddOption; - AddOnCURLOpen CURLOpen; -} CB_AddOnLib; - -typedef xbmc_codec_t (*CODECGetCodecByName)(const void* addonData, const char* strCodecName); - -typedef struct CB_CODEC -{ - CODECGetCodecByName GetCodecByName; -} CB_CODECLib; - -typedef void (*GUILock)(); -typedef void (*GUIUnlock)(); -typedef int (*GUIGetScreenHeight)(); -typedef int (*GUIGetScreenWidth)(); -typedef int (*GUIGetVideoResolution)(); -typedef GUIHANDLE (*GUIWindow_New)(void *addonData, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog); -typedef void (*GUIWindow_Delete)(void *addonData, GUIHANDLE handle); -typedef void (*GUIWindow_SetCallbacks)(void *addonData, GUIHANDLE handle, GUIHANDLE clienthandle, bool (*)(GUIHANDLE handle), bool (*)(GUIHANDLE handle, int), bool (*)(GUIHANDLE handle, int), bool (*)(GUIHANDLE handle, int)); -typedef bool (*GUIWindow_Show)(void *addonData, GUIHANDLE handle); -typedef bool (*GUIWindow_Close)(void *addonData, GUIHANDLE handle); -typedef bool (*GUIWindow_DoModal)(void *addonData, GUIHANDLE handle); -typedef bool (*GUIWindow_SetFocusId)(void *addonData, GUIHANDLE handle, int iControlId); -typedef int (*GUIWindow_GetFocusId)(void *addonData, GUIHANDLE handle); -typedef bool (*GUIWindow_SetCoordinateResolution)(void *addonData, GUIHANDLE handle, int res); -typedef void (*GUIWindow_SetProperty)(void *addonData, GUIHANDLE handle, const char *key, const char *value); -typedef void (*GUIWindow_SetPropertyInt)(void *addonData, GUIHANDLE handle, const char *key, int value); -typedef void (*GUIWindow_SetPropertyBool)(void *addonData, GUIHANDLE handle, const char *key, bool value); -typedef void (*GUIWindow_SetPropertyDouble)(void *addonData, GUIHANDLE handle, const char *key, double value); -typedef const char* (*GUIWindow_GetProperty)(void *addonData, GUIHANDLE handle, const char *key); -typedef int (*GUIWindow_GetPropertyInt)(void *addonData, GUIHANDLE handle, const char *key); -typedef bool (*GUIWindow_GetPropertyBool)(void *addonData, GUIHANDLE handle, const char *key); -typedef double (*GUIWindow_GetPropertyDouble)(void *addonData, GUIHANDLE handle, const char *key); -typedef void (*GUIWindow_ClearProperties)(void *addonData, GUIHANDLE handle); -typedef int (*GUIWindow_GetListSize)(void *addonData, GUIHANDLE handle); -typedef void (*GUIWindow_ClearList)(void *addonData, GUIHANDLE handle); -typedef GUIHANDLE (*GUIWindow_AddItem)(void *addonData, GUIHANDLE handle, GUIHANDLE item, int itemPosition); -typedef GUIHANDLE (*GUIWindow_AddStringItem)(void *addonData, GUIHANDLE handle, const char *itemName, int itemPosition); -typedef void (*GUIWindow_RemoveItem)(void *addonData, GUIHANDLE handle, int itemPosition); -typedef GUIHANDLE (*GUIWindow_GetListItem)(void *addonData, GUIHANDLE handle, int listPos); -typedef void (*GUIWindow_SetCurrentListPosition)(void *addonData, GUIHANDLE handle, int listPos); -typedef int (*GUIWindow_GetCurrentListPosition)(void *addonData, GUIHANDLE handle); -typedef GUIHANDLE (*GUIWindow_GetControl_Spin)(void *addonData, GUIHANDLE handle, int controlId); -typedef GUIHANDLE (*GUIWindow_GetControl_Button)(void *addonData, GUIHANDLE handle, int controlId); -typedef GUIHANDLE (*GUIWindow_GetControl_RadioButton)(void *addonData, GUIHANDLE handle, int controlId); -typedef GUIHANDLE (*GUIWindow_GetControl_Edit)(void *addonData, GUIHANDLE handle, int controlId); -typedef GUIHANDLE (*GUIWindow_GetControl_Progress)(void *addonData, GUIHANDLE handle, int controlId); -typedef GUIHANDLE (*GUIWindow_GetControl_RenderAddon)(void *addonData, GUIHANDLE handle, int controlId); -typedef void (*GUIWindow_SetControlLabel)(void *addonData, GUIHANDLE handle, int controlId, const char *label); -typedef void (*GUIWindow_MarkDirtyRegion)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_Spin_SetVisible)(void *addonData, GUIHANDLE spinhandle, bool yesNo); -typedef void (*GUIControl_Spin_SetText)(void *addonData, GUIHANDLE spinhandle, const char *label); -typedef void (*GUIControl_Spin_Clear)(void *addonData, GUIHANDLE spinhandle); -typedef void (*GUIControl_Spin_AddLabel)(void *addonData, GUIHANDLE spinhandle, const char *label, int iValue); -typedef int (*GUIControl_Spin_GetValue)(void *addonData, GUIHANDLE spinhandle); -typedef void (*GUIControl_Spin_SetValue)(void *addonData, GUIHANDLE spinhandle, int iValue); -typedef void (*GUIControl_RadioButton_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo); -typedef void (*GUIControl_RadioButton_SetText)(void *addonData, GUIHANDLE handle, const char *label); -typedef void (*GUIControl_RadioButton_SetSelected)(void *addonData, GUIHANDLE handle, bool yesNo); -typedef bool (*GUIControl_RadioButton_IsSelected)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_Progress_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent); -typedef float (*GUIControl_Progress_GetPercentage)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_Progress_SetInfo)(void *addonData, GUIHANDLE handle, int iInfo); -typedef int (*GUIControl_Progress_GetInfo)(void *addonData, GUIHANDLE handle); -typedef const char* (*GUIControl_Progress_GetDescription)(void *addonData, GUIHANDLE handle); -typedef GUIHANDLE (*GUIWindow_GetControl_Slider)(void *addonData, GUIHANDLE handle, int controlId); -typedef void (*GUIControl_Slider_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo); -typedef const char *(*GUIControl_Slider_GetDescription)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_Slider_SetIntRange)(void *addonData, GUIHANDLE handle, int iStart, int iEnd); -typedef void (*GUIControl_Slider_SetIntValue)(void *addonData, GUIHANDLE handle, int iValue); -typedef int (*GUIControl_Slider_GetIntValue)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_Slider_SetIntInterval)(void *addonData, GUIHANDLE handle, int iInterval); -typedef void (*GUIControl_Slider_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent); -typedef float (*GUIControl_Slider_GetPercentage)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_Slider_SetFloatRange)(void *addonData, GUIHANDLE handle, float fStart, float fEnd); -typedef void (*GUIControl_Slider_SetFloatValue)(void *addonData, GUIHANDLE handle, float fValue); -typedef float (*GUIControl_Slider_GetFloatValue)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_Slider_SetFloatInterval)(void *addonData, GUIHANDLE handle, float fInterval); -typedef GUIHANDLE (*GUIWindow_GetControl_SettingsSlider)(void *addonData, GUIHANDLE handle, int controlId); -typedef void (*GUIControl_SettingsSlider_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo); -typedef void (*GUIControl_SettingsSlider_SetText)(void *addonData, GUIHANDLE handle, const char *label); -typedef const char *(*GUIControl_SettingsSlider_GetDescription)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_SettingsSlider_SetIntRange)(void *addonData, GUIHANDLE handle, int iStart, int iEnd); -typedef void (*GUIControl_SettingsSlider_SetIntValue)(void *addonData, GUIHANDLE handle, int iValue); -typedef int (*GUIControl_SettingsSlider_GetIntValue)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_SettingsSlider_SetIntInterval)(void *addonData, GUIHANDLE handle, int iInterval); -typedef void (*GUIControl_SettingsSlider_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent); -typedef float (*GUIControl_SettingsSlider_GetPercentage)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_SettingsSlider_SetFloatRange)(void *addonData, GUIHANDLE handle, float fStart, float fEnd); -typedef void (*GUIControl_SettingsSlider_SetFloatValue)(void *addonData, GUIHANDLE handle, float fValue); -typedef float (*GUIControl_SettingsSlider_GetFloatValue)(void *addonData, GUIHANDLE handle); -typedef void (*GUIControl_SettingsSlider_SetFloatInterval)(void *addonData, GUIHANDLE handle, float fInterval); -typedef GUIHANDLE (*GUIListItem_Create)(void *addonData, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path); -typedef const char* (*GUIListItem_GetLabel)(void *addonData, GUIHANDLE handle); -typedef void (*GUIListItem_SetLabel)(void *addonData, GUIHANDLE handle, const char *label); -typedef const char* (*GUIListItem_GetLabel2)(void *addonData, GUIHANDLE handle); -typedef void (*GUIListItem_SetLabel2)(void *addonData, GUIHANDLE handle, const char *label); -typedef void (*GUIListItem_SetIconImage)(void *addonData, GUIHANDLE handle, const char *image); -typedef void (*GUIListItem_SetThumbnailImage)(void *addonData, GUIHANDLE handle, const char *image); -typedef void (*GUIListItem_SetInfo)(void *addonData, GUIHANDLE handle, const char *info); -typedef void (*GUIListItem_SetProperty)(void *addonData, GUIHANDLE handle, const char *key, const char *value); -typedef const char* (*GUIListItem_GetProperty)(void *addonData, GUIHANDLE handle, const char *key); -typedef void (*GUIListItem_SetPath)(void *addonData, GUIHANDLE handle, const char *path); -typedef void (*GUIRenderAddon_SetCallbacks)(void *addonData, GUIHANDLE handle, GUIHANDLE clienthandle, bool (*createCB)(GUIHANDLE,int,int,int,int,void*), void (*renderCB)(GUIHANDLE), void (*stopCB)(GUIHANDLE), bool (*dirtyCB)(GUIHANDLE)); -typedef void (*GUIRenderAddon_Delete)(void *addonData, GUIHANDLE handle); -typedef void (*GUIRenderAddon_MarkDirty)(void *addonData, GUIHANDLE handle); - -typedef bool (*GUIDialog_Keyboard_ShowAndGetInputWithHead)(char &strTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs); -typedef bool (*GUIDialog_Keyboard_ShowAndGetInput)(char &strTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs); -typedef bool (*GUIDialog_Keyboard_ShowAndGetNewPasswordWithHead)(char &newPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs); -typedef bool (*GUIDialog_Keyboard_ShowAndGetNewPassword)(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); -typedef bool (*GUIDialog_Keyboard_ShowAndVerifyNewPasswordWithHead)(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmpty, unsigned int autoCloseMs); -typedef bool (*GUIDialog_Keyboard_ShowAndVerifyNewPassword)(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); -typedef int (*GUIDialog_Keyboard_ShowAndVerifyPassword)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs); -typedef bool (*GUIDialog_Keyboard_ShowAndGetFilter)(char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs); -typedef bool (*GUIDialog_Keyboard_SendTextToActiveKeyboard)(const char *aTextString, bool closeKeyboard); -typedef bool (*GUIDialog_Keyboard_isKeyboardActivated)(); - -typedef bool (*GUIDialog_Numeric_ShowAndVerifyNewPassword)(char &strNewPassword, unsigned int iMaxStringSize); -typedef int (*GUIDialog_Numeric_ShowAndVerifyPassword)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries); -typedef bool (*GUIDialog_Numeric_ShowAndVerifyInput)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput); -typedef bool (*GUIDialog_Numeric_ShowAndGetTime)(tm &time, const char *strHeading); -typedef bool (*GUIDialog_Numeric_ShowAndGetDate)(tm &date, const char *strHeading); -typedef bool (*GUIDialog_Numeric_ShowAndGetIPAddress)(char &strIPAddress, unsigned int iMaxStringSize, const char *strHeading); -typedef bool (*GUIDialog_Numeric_ShowAndGetNumber)(char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs); -typedef bool (*GUIDialog_Numeric_ShowAndGetSeconds)(char &timeString, unsigned int iMaxStringSize, const char *strHeading); - -typedef bool (*GUIDialog_FileBrowser_ShowAndGetFile)(const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList); - -typedef void (*GUIDialog_OK_ShowAndGetInputSingleText)(const char *heading, const char *text); -typedef void (*GUIDialog_OK_ShowAndGetInputLineText)(const char *heading, const char *line0, const char *line1, const char *line2); - -typedef bool (*GUIDialog_YesNo_ShowAndGetInputSingleText)(const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel); -typedef bool (*GUIDialog_YesNo_ShowAndGetInputLineText)(const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel); -typedef bool (*GUIDialog_YesNo_ShowAndGetInputLineButtonText)(const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel); - -typedef void (*GUIDialog_TextViewer)(const char *heading, const char *text); - -typedef int (*GUIDialog_Select)(const char *heading, const char *entries[], unsigned int size, int selected); - -typedef struct CB_GUILib -{ - GUILock Lock; - GUIUnlock Unlock; - GUIGetScreenHeight GetScreenHeight; - GUIGetScreenWidth GetScreenWidth; - GUIGetVideoResolution GetVideoResolution; - GUIWindow_New Window_New; - GUIWindow_Delete Window_Delete; - GUIWindow_SetCallbacks Window_SetCallbacks; - GUIWindow_Show Window_Show; - GUIWindow_Close Window_Close; - GUIWindow_DoModal Window_DoModal; - GUIWindow_SetFocusId Window_SetFocusId; - GUIWindow_GetFocusId Window_GetFocusId; - GUIWindow_SetCoordinateResolution Window_SetCoordinateResolution; - GUIWindow_SetProperty Window_SetProperty; - GUIWindow_SetPropertyInt Window_SetPropertyInt; - GUIWindow_SetPropertyBool Window_SetPropertyBool; - GUIWindow_SetPropertyDouble Window_SetPropertyDouble; - GUIWindow_GetProperty Window_GetProperty; - GUIWindow_GetPropertyInt Window_GetPropertyInt; - GUIWindow_GetPropertyBool Window_GetPropertyBool; - GUIWindow_GetPropertyDouble Window_GetPropertyDouble; - GUIWindow_ClearProperties Window_ClearProperties; - GUIWindow_GetListSize Window_GetListSize; - GUIWindow_ClearList Window_ClearList; - GUIWindow_AddItem Window_AddItem; - GUIWindow_AddStringItem Window_AddStringItem; - GUIWindow_RemoveItem Window_RemoveItem; - GUIWindow_GetListItem Window_GetListItem; - GUIWindow_SetCurrentListPosition Window_SetCurrentListPosition; - GUIWindow_GetCurrentListPosition Window_GetCurrentListPosition; - GUIWindow_GetControl_Spin Window_GetControl_Spin; - GUIWindow_GetControl_Button Window_GetControl_Button; - GUIWindow_GetControl_RadioButton Window_GetControl_RadioButton; - GUIWindow_GetControl_Edit Window_GetControl_Edit; - GUIWindow_GetControl_Progress Window_GetControl_Progress; - GUIWindow_GetControl_RenderAddon Window_GetControl_RenderAddon; - GUIWindow_SetControlLabel Window_SetControlLabel; - GUIWindow_MarkDirtyRegion Window_MarkDirtyRegion; - GUIControl_Spin_SetVisible Control_Spin_SetVisible; - GUIControl_Spin_SetText Control_Spin_SetText; - GUIControl_Spin_Clear Control_Spin_Clear; - GUIControl_Spin_AddLabel Control_Spin_AddLabel; - GUIControl_Spin_GetValue Control_Spin_GetValue; - GUIControl_Spin_SetValue Control_Spin_SetValue; - GUIControl_RadioButton_SetVisible Control_RadioButton_SetVisible; - GUIControl_RadioButton_SetText Control_RadioButton_SetText; - GUIControl_RadioButton_SetSelected Control_RadioButton_SetSelected; - GUIControl_RadioButton_IsSelected Control_RadioButton_IsSelected; - GUIControl_Progress_SetPercentage Control_Progress_SetPercentage; - GUIControl_Progress_GetPercentage Control_Progress_GetPercentage; - GUIControl_Progress_SetInfo Control_Progress_SetInfo; - GUIControl_Progress_GetInfo Control_Progress_GetInfo; - GUIControl_Progress_GetDescription Control_Progress_GetDescription; - GUIListItem_Create ListItem_Create; - GUIListItem_GetLabel ListItem_GetLabel; - GUIListItem_SetLabel ListItem_SetLabel; - GUIListItem_GetLabel2 ListItem_GetLabel2; - GUIListItem_SetLabel2 ListItem_SetLabel2; - GUIListItem_SetIconImage ListItem_SetIconImage; - GUIListItem_SetThumbnailImage ListItem_SetThumbnailImage; - GUIListItem_SetInfo ListItem_SetInfo; - GUIListItem_SetProperty ListItem_SetProperty; - GUIListItem_GetProperty ListItem_GetProperty; - GUIListItem_SetPath ListItem_SetPath; - GUIRenderAddon_SetCallbacks RenderAddon_SetCallbacks; - GUIRenderAddon_Delete RenderAddon_Delete; - - GUIWindow_GetControl_Slider Window_GetControl_Slider; - GUIControl_Slider_SetVisible Control_Slider_SetVisible; - GUIControl_Slider_GetDescription Control_Slider_GetDescription; - GUIControl_Slider_SetIntRange Control_Slider_SetIntRange; - GUIControl_Slider_SetIntValue Control_Slider_SetIntValue; - GUIControl_Slider_GetIntValue Control_Slider_GetIntValue; - GUIControl_Slider_SetIntInterval Control_Slider_SetIntInterval; - GUIControl_Slider_SetPercentage Control_Slider_SetPercentage; - GUIControl_Slider_GetPercentage Control_Slider_GetPercentage; - GUIControl_Slider_SetFloatRange Control_Slider_SetFloatRange; - GUIControl_Slider_SetFloatValue Control_Slider_SetFloatValue; - GUIControl_Slider_GetFloatValue Control_Slider_GetFloatValue; - GUIControl_Slider_SetFloatInterval Control_Slider_SetFloatInterval; - - GUIWindow_GetControl_SettingsSlider Window_GetControl_SettingsSlider; - GUIControl_SettingsSlider_SetVisible Control_SettingsSlider_SetVisible; - GUIControl_SettingsSlider_SetText Control_SettingsSlider_SetText; - GUIControl_SettingsSlider_GetDescription Control_SettingsSlider_GetDescription; - GUIControl_SettingsSlider_SetIntRange Control_SettingsSlider_SetIntRange; - GUIControl_SettingsSlider_SetIntValue Control_SettingsSlider_SetIntValue; - GUIControl_SettingsSlider_GetIntValue Control_SettingsSlider_GetIntValue; - GUIControl_SettingsSlider_SetIntInterval Control_SettingsSlider_SetIntInterval; - GUIControl_SettingsSlider_SetPercentage Control_SettingsSlider_SetPercentage; - GUIControl_SettingsSlider_GetPercentage Control_SettingsSlider_GetPercentage; - GUIControl_SettingsSlider_SetFloatRange Control_SettingsSlider_SetFloatRange; - GUIControl_SettingsSlider_SetFloatValue Control_SettingsSlider_SetFloatValue; - GUIControl_SettingsSlider_GetFloatValue Control_SettingsSlider_GetFloatValue; - GUIControl_SettingsSlider_SetFloatInterval Control_SettingsSlider_SetFloatInterval; - - GUIDialog_Keyboard_ShowAndGetInputWithHead Dialog_Keyboard_ShowAndGetInputWithHead; - GUIDialog_Keyboard_ShowAndGetInput Dialog_Keyboard_ShowAndGetInput; - GUIDialog_Keyboard_ShowAndGetNewPasswordWithHead Dialog_Keyboard_ShowAndGetNewPasswordWithHead; - GUIDialog_Keyboard_ShowAndGetNewPassword Dialog_Keyboard_ShowAndGetNewPassword; - GUIDialog_Keyboard_ShowAndVerifyNewPasswordWithHead Dialog_Keyboard_ShowAndVerifyNewPasswordWithHead; - GUIDialog_Keyboard_ShowAndVerifyNewPassword Dialog_Keyboard_ShowAndVerifyNewPassword; - GUIDialog_Keyboard_ShowAndVerifyPassword Dialog_Keyboard_ShowAndVerifyPassword; - GUIDialog_Keyboard_ShowAndGetFilter Dialog_Keyboard_ShowAndGetFilter; - GUIDialog_Keyboard_SendTextToActiveKeyboard Dialog_Keyboard_SendTextToActiveKeyboard; - GUIDialog_Keyboard_isKeyboardActivated Dialog_Keyboard_isKeyboardActivated; - - GUIDialog_Numeric_ShowAndVerifyNewPassword Dialog_Numeric_ShowAndVerifyNewPassword; - GUIDialog_Numeric_ShowAndVerifyPassword Dialog_Numeric_ShowAndVerifyPassword; - GUIDialog_Numeric_ShowAndVerifyInput Dialog_Numeric_ShowAndVerifyInput; - GUIDialog_Numeric_ShowAndGetTime Dialog_Numeric_ShowAndGetTime; - GUIDialog_Numeric_ShowAndGetDate Dialog_Numeric_ShowAndGetDate; - GUIDialog_Numeric_ShowAndGetIPAddress Dialog_Numeric_ShowAndGetIPAddress; - GUIDialog_Numeric_ShowAndGetNumber Dialog_Numeric_ShowAndGetNumber; - GUIDialog_Numeric_ShowAndGetSeconds Dialog_Numeric_ShowAndGetSeconds; +#include "IAddonInterface.h" - GUIDialog_FileBrowser_ShowAndGetFile Dialog_FileBrowser_ShowAndGetFile; - - GUIDialog_OK_ShowAndGetInputSingleText Dialog_OK_ShowAndGetInputSingleText; - GUIDialog_OK_ShowAndGetInputLineText Dialog_OK_ShowAndGetInputLineText; - - GUIDialog_YesNo_ShowAndGetInputSingleText Dialog_YesNo_ShowAndGetInputSingleText; - GUIDialog_YesNo_ShowAndGetInputLineText Dialog_YesNo_ShowAndGetInputLineText; - GUIDialog_YesNo_ShowAndGetInputLineButtonText Dialog_YesNo_ShowAndGetInputLineButtonText; - - GUIDialog_TextViewer Dialog_TextViewer; - GUIDialog_Select Dialog_Select; -} CB_GUILib; - -typedef void (*ADSPAddMenuHook)(void *addonData, AE_DSP_MENUHOOK *hook); -typedef void (*ADSPRemoveMenuHook)(void *addonData, AE_DSP_MENUHOOK *hook); -typedef void (*ADSPRegisterMode)(void *addonData, AE_DSP_MODES::AE_DSP_MODE *mode); -typedef void (*ADSPUnregisterMode)(void *addonData, AE_DSP_MODES::AE_DSP_MODE *mode); - -typedef ADSPHANDLE (*ADSPSoundPlay_GetHandle)(void *addonData, const char *filename); -typedef void (*ADSPSoundPlay_ReleaseHandle)(void *addonData, ADSPHANDLE handle); -typedef void (*ADSPSoundPlay_Play)(void *addonData, ADSPHANDLE handle); -typedef void (*ADSPSoundPlay_Stop)(void *addonData, ADSPHANDLE handle); -typedef bool (*ADSPSoundPlay_IsPlaying)(void *addonData, ADSPHANDLE handle); -typedef void (*ADSPSoundPlay_SetChannel)(void *addonData, ADSPHANDLE handle, AE_DSP_CHANNEL channel); -typedef AE_DSP_CHANNEL (*ADSPSoundPlay_GetChannel)(void *addonData, ADSPHANDLE handle); -typedef void (*ADSPSoundPlay_SetVolume)(void *addonData, ADSPHANDLE handle, float volume); -typedef float (*ADSPSoundPlay_GetVolume)(void *addonData, ADSPHANDLE handle); +#include <stdint.h> -typedef struct CB_ADSPLib +namespace KODI { - ADSPAddMenuHook AddMenuHook; - ADSPRemoveMenuHook RemoveMenuHook; - ADSPRegisterMode RegisterMode; - ADSPUnregisterMode UnregisterMode; - - ADSPSoundPlay_GetHandle SoundPlay_GetHandle; - ADSPSoundPlay_ReleaseHandle SoundPlay_ReleaseHandle; - ADSPSoundPlay_Play SoundPlay_Play; - ADSPSoundPlay_Stop SoundPlay_Stop; - ADSPSoundPlay_IsPlaying SoundPlay_IsPlaying; - ADSPSoundPlay_SetChannel SoundPlay_SetChannel; - ADSPSoundPlay_GetChannel SoundPlay_GetChannel; - ADSPSoundPlay_SetVolume SoundPlay_SetVolume; - ADSPSoundPlay_GetVolume SoundPlay_GetVolume; -} CB_ADSPLib; - -// --------------------------------------- -// libKODI_audioengine definitions -// --------------------------------------- -typedef AEStreamHandle* (*AudioEngine_MakeStream)(AudioEngineFormat Format, unsigned int Options); -typedef void (*AudioEngine_FreeStream)(AEStreamHandle *stream); -typedef bool (*AudioEngine_GetCurrentSinkFormat)(void *addonData, AudioEngineFormat *SinkFormat); - -// Audio Engine Stream definitions -typedef unsigned int (*AudioEngine_Stream_GetSpace)(void *addonData, AEStreamHandle *handle); -typedef unsigned int (*AudioEngine_Stream_AddData)(void *addonData, AEStreamHandle *handle, uint8_t* const *Data, unsigned int Offset, unsigned int Frames); -typedef double (*AudioEngine_Stream_GetDelay)(void *addonData, AEStreamHandle *handle); -typedef bool (*AudioEngine_Stream_IsBuffering)(void *addonData, AEStreamHandle *handle); -typedef double (*AudioEngine_Stream_GetCacheTime)(void *addonData, AEStreamHandle *handle); -typedef double (*AudioEngine_Stream_GetCacheTotal)(void *addonData, AEStreamHandle *handle); -typedef void (*AudioEngine_Stream_Pause)(void *addonData, AEStreamHandle *handle); -typedef void (*AudioEngine_Stream_Resume)(void *addonData, AEStreamHandle *handle); -typedef void (*AudioEngine_Stream_Drain)(void *addonData, AEStreamHandle *handle, bool Wait); -typedef bool (*AudioEngine_Stream_IsDraining)(void *addonData, AEStreamHandle *handle); -typedef bool (*AudioEngine_Stream_IsDrained)(void *addonData, AEStreamHandle *handle); -typedef void (*AudioEngine_Stream_Flush)(void *addonData, AEStreamHandle *handle); -typedef float (*AudioEngine_Stream_GetVolume)(void *addonData, AEStreamHandle *handle); -typedef void (*AudioEngine_Stream_SetVolume)(void *addonData, AEStreamHandle *handle, float Volume); -typedef float (*AudioEngine_Stream_GetAmplification)(void *addonData, AEStreamHandle *handle); -typedef void (*AudioEngine_Stream_SetAmplification)(void *addonData, AEStreamHandle *handle, float Amplify); -typedef const unsigned int (*AudioEngine_Stream_GetFrameSize)(void *addonData, AEStreamHandle *handle); -typedef const unsigned int (*AudioEngine_Stream_GetChannelCount)(void *addonData, AEStreamHandle *handle); -typedef const unsigned int (*AudioEngine_Stream_GetSampleRate)(void *addonData, AEStreamHandle *handle); -typedef const AEDataFormat (*AudioEngine_Stream_GetDataFormat)(void *addonData, AEStreamHandle *handle); -typedef double (*AudioEngine_Stream_GetResampleRatio)(void *addonData, AEStreamHandle *handle); -typedef void (*AudioEngine_Stream_SetResampleRatio)(void *addonData, AEStreamHandle *handle, double Ratio); -typedef void (*AudioEngine_Stream_Discontinuity)(void *addonData, AEStreamHandle *handle); - -typedef struct CB_AudioEngineLib +namespace MESSAGING { - AudioEngine_MakeStream MakeStream; - AudioEngine_FreeStream FreeStream; - AudioEngine_GetCurrentSinkFormat GetCurrentSinkFormat; - - // AudioEngine stream callbacks - AudioEngine_Stream_GetSpace AEStream_GetSpace; - AudioEngine_Stream_AddData AEStream_AddData; - AudioEngine_Stream_GetDelay AEStream_GetDelay; - AudioEngine_Stream_IsBuffering AEStream_IsBuffering; - AudioEngine_Stream_GetCacheTime AEStream_GetCacheTime; - AudioEngine_Stream_GetCacheTotal AEStream_GetCacheTotal; - AudioEngine_Stream_Pause AEStream_Pause; - AudioEngine_Stream_Resume AEStream_Resume; - AudioEngine_Stream_Drain AEStream_Drain; - AudioEngine_Stream_IsDraining AEStream_IsDraining; - AudioEngine_Stream_IsDrained AEStream_IsDrained; - AudioEngine_Stream_Flush AEStream_Flush; - AudioEngine_Stream_GetVolume AEStream_GetVolume; - AudioEngine_Stream_SetVolume AEStream_SetVolume; - AudioEngine_Stream_GetAmplification AEStream_GetAmplification; - AudioEngine_Stream_SetAmplification AEStream_SetAmplification; - AudioEngine_Stream_GetFrameSize AEStream_GetFrameSize; - AudioEngine_Stream_GetChannelCount AEStream_GetChannelCount; - AudioEngine_Stream_GetSampleRate AEStream_GetSampleRate; - AudioEngine_Stream_GetDataFormat AEStream_GetDataFormat; - AudioEngine_Stream_GetResampleRatio AEStream_GetResampleRatio; - AudioEngine_Stream_SetResampleRatio AEStream_SetResampleRatio; - AudioEngine_Stream_Discontinuity AEStream_Discontinuity; -} CB_AudioEngineLib; - -typedef void (*PVRTransferEpgEntry)(void *userData, const ADDON_HANDLE handle, const EPG_TAG *epgentry); -typedef void (*PVRTransferChannelEntry)(void *userData, const ADDON_HANDLE handle, const PVR_CHANNEL *chan); -typedef void (*PVRTransferTimerEntry)(void *userData, const ADDON_HANDLE handle, const PVR_TIMER *timer); -typedef void (*PVRTransferRecordingEntry)(void *userData, const ADDON_HANDLE handle, const PVR_RECORDING *recording); -typedef void (*PVRAddMenuHook)(void *addonData, PVR_MENUHOOK *hook); -typedef void (*PVRRecording)(void *addonData, const char *Name, const char *FileName, bool On); -typedef void (*PVRTriggerChannelUpdate)(void *addonData); -typedef void (*PVRTriggerTimerUpdate)(void *addonData); -typedef void (*PVRTriggerRecordingUpdate)(void *addonData); -typedef void (*PVRTriggerChannelGroupsUpdate)(void *addonData); -typedef void (*PVRTriggerEpgUpdate)(void *addonData, unsigned int iChannelUid); - -typedef void (*PVRTransferChannelGroup)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group); -typedef void (*PVRTransferChannelGroupMember)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member); - -typedef void (*PVRFreeDemuxPacket)(void *addonData, DemuxPacket* pPacket); -typedef DemuxPacket* (*PVRAllocateDemuxPacket)(void *addonData, int iDataSize); - -typedef void (*PVRConnectionStateChange)(void* addonData, const char* strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage); -typedef void (*PVREpgEventStateChange)(void* addonData, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState); - -typedef struct CB_PVRLib -{ - PVRTransferEpgEntry TransferEpgEntry; - PVRTransferChannelEntry TransferChannelEntry; - PVRTransferTimerEntry TransferTimerEntry; - PVRTransferRecordingEntry TransferRecordingEntry; - PVRAddMenuHook AddMenuHook; - PVRRecording Recording; - PVRTriggerChannelUpdate TriggerChannelUpdate; - PVRTriggerTimerUpdate TriggerTimerUpdate; - PVRTriggerRecordingUpdate TriggerRecordingUpdate; - PVRTriggerChannelGroupsUpdate TriggerChannelGroupsUpdate; - PVRTriggerEpgUpdate TriggerEpgUpdate; - PVRFreeDemuxPacket FreeDemuxPacket; - PVRAllocateDemuxPacket AllocateDemuxPacket; - PVRTransferChannelGroup TransferChannelGroup; - PVRTransferChannelGroupMember TransferChannelGroupMember; - PVRConnectionStateChange ConnectionStateChange; - PVREpgEventStateChange EpgEventStateChange; - -} CB_PVRLib; - - -typedef CB_AddOnLib* (*XBMCAddOnLib_RegisterMe)(void *addonData); -typedef void (*XBMCAddOnLib_UnRegisterMe)(void *addonData, CB_AddOnLib *cbTable); -typedef CB_ADSPLib* (*KODIADSPLib_RegisterMe)(void *addonData); -typedef void (*KODIADSPLib_UnRegisterMe)(void *addonData, CB_ADSPLib *cbTable); -typedef CB_AudioEngineLib* (*KODIAudioEngineLib_RegisterMe)(void *addonData); -typedef void (*KODIAudioEngineLib_UnRegisterMe)(void *addonData, CB_AudioEngineLib *cbTable); -typedef CB_CODECLib* (*XBMCCODECLib_RegisterMe)(void *addonData); -typedef void (*XBMCCODECLib_UnRegisterMe)(void *addonData, CB_CODECLib *cbTable); -typedef CB_GUILib* (*XBMCGUILib_RegisterMe)(void *addonData); -typedef void (*XBMCGUILib_UnRegisterMe)(void *addonData, CB_GUILib *cbTable); -typedef CB_PVRLib* (*XBMCPVRLib_RegisterMe)(void *addonData); -typedef void (*XBMCPVRLib_UnRegisterMe)(void *addonData, CB_PVRLib *cbTable); -typedef CB_INPUTSTREAMLib* (*KODIINPUTSTREAMLib_RegisterMe)(void *addonData); -typedef void (*KODIINPUTSTREAMLib_UnRegisterMe)(void *addonData, CB_INPUTSTREAMLib *cbTable); + class ThreadMessage; +} +} + +typedef void* (*KODIAddOnLib_RegisterMe)(void *addonData); +typedef void (*KODIAddOnLib_UnRegisterMe)(void *addonData, void *cbTable); +typedef void* (*KODIAudioEngineLib_RegisterMe)(void *addonData); +typedef void (*KODIAudioEngineLib_UnRegisterMe)(void *addonData, void *cbTable); +typedef void* (*KODIGUILib_RegisterMe)(void *addonData); +typedef void (*KODIGUILib_UnRegisterMe)(void *addonData, void *cbTable); +typedef void* (*KODIPVRLib_RegisterMe)(void *addonData); +typedef void (*KODIPVRLib_UnRegisterMe)(void *addonData, void *cbTable); +typedef void* (*KODIADSPLib_RegisterMe)(void *addonData); +typedef void (*KODIADSPLib_UnRegisterMe)(void *addonData, void *cbTable); +typedef void* (*KODICodecLib_RegisterMe)(void *addonData); +typedef void (*KODICodecLib_UnRegisterMe)(void *addonData, void *cbTable); +typedef void* (*KODIINPUTSTREAMLib_RegisterMe)(void *addonData); +typedef void (*KODIINPUTSTREAMLib_UnRegisterMe)(void *addonData, void *cbTable); typedef struct AddonCB { - const char *libBasePath; ///> Never, never change this!!! - void *addonData; - XBMCAddOnLib_RegisterMe AddOnLib_RegisterMe; - XBMCAddOnLib_UnRegisterMe AddOnLib_UnRegisterMe; - KODIAudioEngineLib_RegisterMe AudioEngineLib_RegisterMe; - KODIAudioEngineLib_UnRegisterMe AudioEngineLib_UnRegisterMe; - XBMCCODECLib_RegisterMe CODECLib_RegisterMe; - XBMCCODECLib_UnRegisterMe CODECLib_UnRegisterMe; - XBMCGUILib_RegisterMe GUILib_RegisterMe; - XBMCGUILib_UnRegisterMe GUILib_UnRegisterMe; - XBMCPVRLib_RegisterMe PVRLib_RegisterMe; - XBMCPVRLib_UnRegisterMe PVRLib_UnRegisterMe; - KODIADSPLib_RegisterMe ADSPLib_RegisterMe; - KODIADSPLib_UnRegisterMe ADSPLib_UnRegisterMe; - KODIINPUTSTREAMLib_RegisterMe INPUTSTREAMLib_RegisterMe; - KODIINPUTSTREAMLib_UnRegisterMe INPUTSTREAMLib_UnRegisterMe; + const char* libBasePath; ///< Never, never change this!!! + void* addonData; + KODIAddOnLib_RegisterMe AddOnLib_RegisterMe; + KODIAddOnLib_UnRegisterMe AddOnLib_UnRegisterMe; + KODIAudioEngineLib_RegisterMe AudioEngineLib_RegisterMe; + KODIAudioEngineLib_UnRegisterMe AudioEngineLib_UnRegisterMe; + KODICodecLib_RegisterMe CodecLib_RegisterMe; + KODICodecLib_UnRegisterMe CodecLib_UnRegisterMe; + KODIGUILib_RegisterMe GUILib_RegisterMe; + KODIGUILib_UnRegisterMe GUILib_UnRegisterMe; + KODIPVRLib_RegisterMe PVRLib_RegisterMe; + KODIPVRLib_UnRegisterMe PVRLib_UnRegisterMe; + KODIADSPLib_RegisterMe ADSPLib_RegisterMe; + KODIADSPLib_UnRegisterMe ADSPLib_UnRegisterMe; + KODIINPUTSTREAMLib_RegisterMe INPUTSTREAMLib_RegisterMe; + KODIINPUTSTREAMLib_UnRegisterMe INPUTSTREAMLib_UnRegisterMe; } AddonCB; namespace ADDON { -class CAddon; -class CAddonCallbacksAddon; -class CAddonCallbacksADSP; -class CAddonCallbacksAudioEngine; -class CAddonCallbacksCodec; -class CAddonCallbacksGUI; -class CAddonCallbacksPVR; - -class CAddonCallbacks -{ -public: - CAddonCallbacks(CAddon* addon); - ~CAddonCallbacks(); - AddonCB *GetCallbacks() { return m_callbacks; } - - static CB_AddOnLib* AddOnLib_RegisterMe(void *addonData); - static void AddOnLib_UnRegisterMe(void *addonData, CB_AddOnLib *cbTable); - static CB_ADSPLib* ADSPLib_RegisterMe(void *addonData); - static void ADSPLib_UnRegisterMe(void *addonData, CB_ADSPLib *cbTable); - static CB_AudioEngineLib* AudioEngineLib_RegisterMe(void *addonData); - static void AudioEngineLib_UnRegisterMe(void *addonData, CB_AudioEngineLib *cbTable); - static CB_CODECLib* CODECLib_RegisterMe(void *addonData); - static void CODECLib_UnRegisterMe(void *addonData, CB_CODECLib *cbTable); - static CB_GUILib* GUILib_RegisterMe(void *addonData); - static void GUILib_UnRegisterMe(void *addonData, CB_GUILib *cbTable); - static CB_PVRLib* PVRLib_RegisterMe(void *addonData); - static void PVRLib_UnRegisterMe(void *addonData, CB_PVRLib *cbTable); - static CB_INPUTSTREAMLib* INPUTSTREAMLib_RegisterMe(void *addonData); - static void INPUTSTREAMLib_UnRegisterMe(void *addonData, CB_INPUTSTREAMLib *cbTable); - - CAddonCallbacksAddon *GetHelperAddon() { return m_helperAddon; } - CAddonCallbacksADSP *GetHelperADSP() { return m_helperADSP; } - CAddonCallbacksAudioEngine *GetHelperAudioEngine() { return m_helperAudioEngine; } - CAddonCallbacksCodec *GetHelperCodec() { return m_helperCODEC; } - CAddonCallbacksGUI *GetHelperGUI() { return m_helperGUI; } - CAddonCallbacksPVR *GetHelperPVR() { return m_helperPVR; } - CAddonCallbacksInputStream *GetHelperInputStream() { return m_helperInputStream; } - -private: - AddonCB *m_callbacks; - CAddon *m_addon; - CAddonCallbacksAddon *m_helperAddon; - CAddonCallbacksADSP *m_helperADSP; - CAddonCallbacksAudioEngine *m_helperAudioEngine; - CAddonCallbacksCodec *m_helperCODEC; - CAddonCallbacksGUI *m_helperGUI; - CAddonCallbacksPVR *m_helperPVR; - CAddonCallbacksInputStream *m_helperInputStream; -}; + class CAddon; + + class CAddonInterfaces + { + public: + CAddonInterfaces(CAddon* addon); + ~CAddonInterfaces(); + + AddonCB* GetCallbacks() { return m_callbacks; } + CAddon *GetAddon() { return m_addon; } + const CAddon *GetAddon() const { return m_addon; } + /*\_________________________________________________________________________ + \*/ + static void* AddOnLib_RegisterMe (void* addonData); + static void AddOnLib_UnRegisterMe (void* addonData, void* cbTable); + void* AddOnLib_GetHelper() { return m_helperAddOn; } + /*\_________________________________________________________________________ + \*/ + static void* AudioEngineLib_RegisterMe (void* addonData); + static void AudioEngineLib_UnRegisterMe (void* addonData, void* cbTable); + void* AudioEngineLib_GetHelper() { return m_helperAudioEngine; } + /*\__________________________________________________________________________________________ + \*/ + static void* GUILib_RegisterMe (void* addonData); + static void GUILib_UnRegisterMe (void* addonData, void* cbTable); + void* GUILib_GetHelper() { return m_helperGUI; } + /*\_________________________________________________________________________ + \*/ + static void* PVRLib_RegisterMe (void* addonData); + static void PVRLib_UnRegisterMe (void* addonData, void* cbTable); + void* PVRLib_GetHelper() { return m_helperPVR; } + /*\_________________________________________________________________________ + \*/ + static void* CodecLib_RegisterMe (void* addonData); + static void CodecLib_UnRegisterMe (void* addonData, void* cbTable); + void* GetHelperCODEC() { return m_helperCODEC; } + /*\_________________________________________________________________________ + \*/ + static void* ADSPLib_RegisterMe (void* addonData); + static void ADSPLib_UnRegisterMe (void* addonData, void* cbTable); + void* GetHelperADSP() { return m_helperADSP; } + /*\_________________________________________________________________________ + \*/ + static void* INPUTSTREAMLib_RegisterMe (void *addonData); + static void INPUTSTREAMLib_UnRegisterMe (void *addonData, void* cbTable); + void* GetHelperInputStream() { return m_helperInputStream; } + /* + * API level independent functions for Kodi + */ + static void OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg); + + private: + AddonCB* m_callbacks; + CAddon* m_addon; + + void* m_helperAddOn; + void* m_helperAudioEngine; + void* m_helperGUI; + void* m_helperPVR; + void* m_helperADSP; + void* m_helperCODEC; + void* m_helperInputStream; + }; }; /* namespace ADDON */ diff --git a/xbmc/addons/binary/interfaces/CMakeLists.txt b/xbmc/addons/binary/interfaces/CMakeLists.txt new file mode 100644 index 0000000000..d53a35f929 --- /dev/null +++ b/xbmc/addons/binary/interfaces/CMakeLists.txt @@ -0,0 +1,10 @@ +set(SOURCES AddonInterfaces.cpp) + +set(HEADERS AddonInterfaces.h + IAddonInterface.h) + +core_add_library(addonsBinaryInterfaces) + +if(ENABLE_INTERNAL_FFMPEG) + add_dependencies(addons ffmpeg) +endif() diff --git a/xbmc/addons/binary/interfaces/IAddonInterface.h b/xbmc/addons/binary/interfaces/IAddonInterface.h new file mode 100644 index 0000000000..fb1bb88b3d --- /dev/null +++ b/xbmc/addons/binary/interfaces/IAddonInterface.h @@ -0,0 +1,52 @@ +#pragma once +/* + * Copyright (C) 2015 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 KODI; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include <string> + +#ifdef _WIN32 +#include <windows.h> +#define A_DLLEXPORT extern "C" __declspec(dllexport) +#else +#define A_DLLEXPORT extern "C" __attribute__ ((visibility ("default"))) +#endif + +namespace ADDON +{ + class CAddon; + + class IAddonInterface + { + public: + IAddonInterface(CAddon *addon, int apiLevel, const std::string& version) : + m_addon(addon), m_apiLevel(apiLevel), m_version(version) {} + + CAddon* GetAddon() { return m_addon; } + const CAddon* GetAddon() const { return m_addon; } + const int APILevel() const { return m_apiLevel; } + const std::string& Version() const { return m_version; } + + protected: + CAddon* m_addon; /*!< the addon */ + const int m_apiLevel; + const std::string m_version; + }; + +}; /* namespace ADDON */ diff --git a/xbmc/addons/binary/interfaces/Makefile.in b/xbmc/addons/binary/interfaces/Makefile.in new file mode 100644 index 0000000000..4f5e9bbfed --- /dev/null +++ b/xbmc/addons/binary/interfaces/Makefile.in @@ -0,0 +1,6 @@ +SRCS=AddonInterfaces.cpp \ + +LIB=addon-interfaces.a + +include @abs_top_srcdir@/Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) diff --git a/xbmc/addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.cpp b/xbmc/addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.cpp index 37c58d8331..9a7fb88085 100644 --- a/xbmc/addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.cpp +++ b/xbmc/addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -13,13 +14,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "Application.h" -#include "Addon.h" +#include "addons/Addon.h" #include "AddonCallbacksAddon.h" #include "utils/log.h" #include "LangInfo.h" @@ -34,16 +35,21 @@ #include "URL.h" #include "addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h" +using namespace ADDON; using namespace XFILE; -namespace ADDON +namespace V1 +{ +namespace KodiAPI { -CAddonCallbacksAddon::CAddonCallbacksAddon(CAddon* addon) +namespace AddOn { - m_addon = addon; - m_callbacks = new CB_AddOnLib; +CAddonCallbacksAddon::CAddonCallbacksAddon(CAddon* addon) + : ADDON::IAddonInterface(addon, APILevel(), Version()), + m_callbacks(new CB_AddOnLib) +{ /* write XBMC addon-on specific add-on function addresses to the callback table */ m_callbacks->Log = AddOnLog; m_callbacks->QueueNotification = QueueNotification; @@ -91,14 +97,14 @@ CAddonCallbacksAddon::~CAddonCallbacksAddon() void CAddonCallbacksAddon::AddOnLog(void *addonData, const addon_log_t addonLogLevel, const char *strMessage) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; + CAddonInterfaces* addon = (CAddonInterfaces*) addonData; if (addon == NULL || strMessage == NULL) { CLog::Log(LOGERROR, "CAddonCallbacksAddon - %s - called with a null pointer", __FUNCTION__); return; } - CAddonCallbacksAddon* addonHelper = addon->GetHelperAddon(); + CAddonCallbacksAddon* addonHelper = static_cast<CAddonCallbacksAddon*>(addon->AddOnLib_GetHelper()); try { @@ -132,14 +138,14 @@ void CAddonCallbacksAddon::AddOnLog(void *addonData, const addon_log_t addonLogL void CAddonCallbacksAddon::QueueNotification(void *addonData, const queue_msg_t type, const char *strMessage) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; + CAddonInterfaces* addon = (CAddonInterfaces*) addonData; if (addon == NULL || strMessage == NULL) { CLog::Log(LOGERROR, "CAddonCallbacksAddon - %s - called with a null pointer", __FUNCTION__); return; } - CAddonCallbacksAddon* addonHelper = addon->GetHelperAddon(); + CAddonCallbacksAddon* addonHelper = static_cast<CAddonCallbacksAddon*>(addon->AddOnLib_GetHelper()); try { @@ -176,14 +182,14 @@ bool CAddonCallbacksAddon::WakeOnLan(const char *mac) bool CAddonCallbacksAddon::GetAddonSetting(void *addonData, const char *strSettingName, void *settingValue) { - CAddonCallbacks* addon = (CAddonCallbacks*) addonData; + CAddonInterfaces* addon = (CAddonInterfaces*) addonData; if (addon == NULL || strSettingName == NULL || settingValue == NULL) { CLog::Log(LOGERROR, "CAddonCallbacksAddon - %s - called with a null pointer", __FUNCTION__); return false; } - CAddonCallbacksAddon* addonHelper = addon->GetHelperAddon(); + CAddonCallbacksAddon* addonHelper = static_cast<CAddonCallbacksAddon*>(addon->AddOnLib_GetHelper()); try { @@ -282,11 +288,11 @@ char* CAddonCallbacksAddon::UnknownToUTF8(const char *strSource) char* CAddonCallbacksAddon::GetLocalizedString(const void* addonData, long dwCode) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; - if (!helper || g_application.m_bStop) + CAddonInterfaces* addon = (CAddonInterfaces*) addonData; + if (!addon || g_application.m_bStop) return NULL; - CAddonCallbacksAddon* addonHelper = helper->GetHelperAddon(); + CAddonCallbacksAddon* addonHelper = static_cast<CAddonCallbacksAddon*>(addon->AddOnLib_GetHelper()); std::string string; if ((dwCode >= 30000 && dwCode <= 30999) || (dwCode >= 32000 && dwCode <= 32999)) @@ -300,7 +306,7 @@ char* CAddonCallbacksAddon::GetLocalizedString(const void* addonData, long dwCod char* CAddonCallbacksAddon::GetDVDMenuLanguage(const void* addonData) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return NULL; @@ -317,7 +323,7 @@ void CAddonCallbacksAddon::FreeString(const void* addonData, char* str) void* CAddonCallbacksAddon::OpenFile(const void* addonData, const char* strFileName, unsigned int flags) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return NULL; @@ -331,7 +337,7 @@ void* CAddonCallbacksAddon::OpenFile(const void* addonData, const char* strFileN void* CAddonCallbacksAddon::OpenFileForWrite(const void* addonData, const char* strFileName, bool bOverwrite) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return NULL; @@ -345,7 +351,7 @@ void* CAddonCallbacksAddon::OpenFileForWrite(const void* addonData, const char* ssize_t CAddonCallbacksAddon::ReadFile(const void* addonData, void* file, void* lpBuf, size_t uiBufSize) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return 0; @@ -358,7 +364,7 @@ ssize_t CAddonCallbacksAddon::ReadFile(const void* addonData, void* file, void* bool CAddonCallbacksAddon::ReadFileString(const void* addonData, void* file, char *szLine, int iLineLength) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; @@ -371,7 +377,7 @@ bool CAddonCallbacksAddon::ReadFileString(const void* addonData, void* file, cha ssize_t CAddonCallbacksAddon::WriteFile(const void* addonData, void* file, const void* lpBuf, size_t uiBufSize) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return -1; @@ -384,7 +390,7 @@ ssize_t CAddonCallbacksAddon::WriteFile(const void* addonData, void* file, const void CAddonCallbacksAddon::FlushFile(const void* addonData, void* file) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; @@ -397,7 +403,7 @@ void CAddonCallbacksAddon::FlushFile(const void* addonData, void* file) int64_t CAddonCallbacksAddon::SeekFile(const void* addonData, void* file, int64_t iFilePosition, int iWhence) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return 0; @@ -410,7 +416,7 @@ int64_t CAddonCallbacksAddon::SeekFile(const void* addonData, void* file, int64_ int CAddonCallbacksAddon::TruncateFile(const void* addonData, void* file, int64_t iSize) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return 0; @@ -423,7 +429,7 @@ int CAddonCallbacksAddon::TruncateFile(const void* addonData, void* file, int64_ int64_t CAddonCallbacksAddon::GetFilePosition(const void* addonData, void* file) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return 0; @@ -436,7 +442,7 @@ int64_t CAddonCallbacksAddon::GetFilePosition(const void* addonData, void* file) int64_t CAddonCallbacksAddon::GetFileLength(const void* addonData, void* file) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return 0; @@ -449,7 +455,7 @@ int64_t CAddonCallbacksAddon::GetFileLength(const void* addonData, void* file) double CAddonCallbacksAddon::GetFileDownloadSpeed(const void* addonData, void* file) { - CAddonCallbacks* helper = (CAddonCallbacks*)addonData; + CAddonInterfaces* helper = (CAddonInterfaces*)addonData; if (!helper) return 0.0f; @@ -462,7 +468,7 @@ double CAddonCallbacksAddon::GetFileDownloadSpeed(const void* addonData, void* f void CAddonCallbacksAddon::CloseFile(const void* addonData, void* file) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; @@ -476,7 +482,7 @@ void CAddonCallbacksAddon::CloseFile(const void* addonData, void* file) int CAddonCallbacksAddon::GetFileChunkSize(const void* addonData, void* file) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return 0; @@ -489,16 +495,16 @@ int CAddonCallbacksAddon::GetFileChunkSize(const void* addonData, void* file) bool CAddonCallbacksAddon::FileExists(const void* addonData, const char *strFileName, bool bUseCache) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; return CFile::Exists(strFileName, bUseCache); } -int CAddonCallbacksAddon::StatFile(const void* addonData, const char *strFileName, struct __stat64* buffer) +int CAddonCallbacksAddon::StatFile(const void* addonData, const char *strFileName, struct ::__stat64* buffer) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return -1; @@ -507,7 +513,7 @@ int CAddonCallbacksAddon::StatFile(const void* addonData, const char *strFileNam bool CAddonCallbacksAddon::DeleteFile(const void* addonData, const char *strFileName) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; @@ -516,7 +522,7 @@ bool CAddonCallbacksAddon::DeleteFile(const void* addonData, const char *strFile bool CAddonCallbacksAddon::CanOpenDirectory(const void* addonData, const char* strURL) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; @@ -526,7 +532,7 @@ bool CAddonCallbacksAddon::CanOpenDirectory(const void* addonData, const char* s bool CAddonCallbacksAddon::CreateDirectory(const void* addonData, const char *strPath) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; @@ -535,7 +541,7 @@ bool CAddonCallbacksAddon::CreateDirectory(const void* addonData, const char *st bool CAddonCallbacksAddon::DirectoryExists(const void* addonData, const char *strPath) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; @@ -544,7 +550,7 @@ bool CAddonCallbacksAddon::DirectoryExists(const void* addonData, const char *st bool CAddonCallbacksAddon::RemoveDirectory(const void* addonData, const char *strPath) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; @@ -577,7 +583,7 @@ static void CFileItemListToVFSDirEntries(VFSDirEntry* entries, bool CAddonCallbacksAddon::GetDirectory(const void* addonData, const char *strPath, const char* mask, VFSDirEntry** items, unsigned int* num_items) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; @@ -602,11 +608,11 @@ bool CAddonCallbacksAddon::GetDirectory(const void* addonData, const char *strPa void CAddonCallbacksAddon::FreeDirectory(const void* addonData, VFSDirEntry* items, unsigned int num_items) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; - for (unsigned int i=0;i<num_items;++i) + for (unsigned int i = 0; i < num_items; ++i) { free(items[i].label); free(items[i].path); @@ -616,7 +622,7 @@ void CAddonCallbacksAddon::FreeDirectory(const void* addonData, VFSDirEntry* ite void* CAddonCallbacksAddon::CURLCreate(const void* addonData, const char* strURL) { - CAddonCallbacks* helper = (CAddonCallbacks*)addonData; + CAddonInterfaces* helper = (CAddonInterfaces*)addonData; if (!helper) return nullptr; @@ -631,7 +637,7 @@ void* CAddonCallbacksAddon::CURLCreate(const void* addonData, const char* strURL bool CAddonCallbacksAddon::CURLAddOption(const void* addonData, void* file, XFILE::CURLOPTIONTYPE type, const char* name, const char * value) { - CAddonCallbacks* helper = (CAddonCallbacks*)addonData; + CAddonInterfaces* helper = (CAddonInterfaces*)addonData; if (!helper) return false; @@ -644,7 +650,7 @@ bool CAddonCallbacksAddon::CURLAddOption(const void* addonData, void* file, XFIL bool CAddonCallbacksAddon::CURLOpen(const void* addonData, void* file, unsigned int flags) { - CAddonCallbacks* helper = (CAddonCallbacks*)addonData; + CAddonInterfaces* helper = (CAddonInterfaces*)addonData; if (!helper) return false; @@ -655,4 +661,7 @@ bool CAddonCallbacksAddon::CURLOpen(const void* addonData, void* file, unsigned return cfile->CURLOpen(flags); } -}; /* namespace ADDON */ +}; /* namespace AddOn */ + +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.h b/xbmc/addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.h index 2f951dca2f..8cc6eff94d 100644 --- a/xbmc/addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.h +++ b/xbmc/addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.h @@ -1,7 +1,8 @@ #pragma once /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -14,32 +15,126 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ -#include "AddonCallbacks.h" +#include "addons/binary/interfaces/AddonInterfaces.h" +#include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h" struct VFSDirEntry; +#ifdef TARGET_WINDOWS +#ifndef _SSIZE_T_DEFINED +typedef intptr_t ssize_t; +#define _SSIZE_T_DEFINED +#endif // !_SSIZE_T_DEFINED +#endif // TARGET_WINDOWS + namespace ADDON { + class CAddon; +}; + +namespace V1 +{ +namespace KodiAPI +{ + +namespace AddOn +{ -class CAddonCallbacksAddon +typedef void (*AddOnLogCallback)(void *addonData, const ADDON::addon_log_t loglevel, const char *msg); +typedef void (*AddOnQueueNotification)(void *addonData, const ADDON::queue_msg_t type, const char *msg); +typedef bool (*AddOnWakeOnLan)(const char* mac); +typedef bool (*AddOnGetSetting)(void *addonData, const char *settingName, void *settingValue); +typedef char* (*AddOnUnknownToUTF8)(const char *sourceDest); +typedef char* (*AddOnGetLocalizedString)(const void* addonData, long dwCode); +typedef char* (*AddOnGetDVDMenuLanguage)(const void* addonData); +typedef void (*AddOnFreeString)(const void* addonData, char* str); + +typedef void* (*AddOnOpenFile)(const void* addonData, const char* strFileName, unsigned int flags); +typedef void* (*AddOnOpenFileForWrite)(const void* addonData, const char* strFileName, bool bOverWrite); +typedef ssize_t (*AddOnReadFile)(const void* addonData, void* file, void* lpBuf, size_t uiBufSize); +typedef bool (*AddOnReadFileString)(const void* addonData, void* file, char *szLine, int iLineLength); +typedef ssize_t (*AddOnWriteFile)(const void* addonData, void* file, const void* lpBuf, size_t uiBufSize); +typedef void (*AddOnFlushFile)(const void* addonData, void* file); +typedef int64_t (*AddOnSeekFile)(const void* addonData, void* file, int64_t iFilePosition, int iWhence); +typedef int (*AddOnTruncateFile)(const void* addonData, void* file, int64_t iSize); +typedef int64_t (*AddOnGetFilePosition)(const void* addonData, void* file); +typedef int64_t (*AddOnGetFileLength)(const void* addonData, void* file); +typedef double (*AddOnGetFileDownloadSpeed)(const void* addonData, void* file); +typedef void (*AddOnCloseFile)(const void* addonData, void* file); +typedef int (*AddOnGetFileChunkSize)(const void* addonData, void* file); +typedef bool (*AddOnFileExists)(const void* addonData, const char *strFileName, bool bUseCache); +typedef int (*AddOnStatFile)(const void* addonData, const char *strFileName, struct __stat64* buffer); +typedef bool (*AddOnDeleteFile)(const void* addonData, const char *strFileName); +typedef bool (*AddOnCanOpenDirectory)(const void* addonData, const char* strURL); +typedef bool (*AddOnCreateDirectory)(const void* addonData, const char *strPath); +typedef bool (*AddOnDirectoryExists)(const void* addonData, const char *strPath); +typedef bool (*AddOnRemoveDirectory)(const void* addonData, const char *strPath); +typedef bool (*AddOnGetDirectory)(const void* addonData, const char *strPath, const char* mask, VFSDirEntry** items, unsigned int* num_items); +typedef void (*AddOnFreeDirectory)(const void* addonData, VFSDirEntry* items, unsigned int num_items); +typedef void* (*AddOnCURLCreate)(const void* addonData, const char* strURL); +typedef bool (*AddOnCURLAddOption)(const void* addonData, void* file, XFILE::CURLOPTIONTYPE type, const char* name, const char * value); +typedef bool (*AddOnCURLOpen)(const void* addonData, void* file, unsigned int flags); + +typedef struct CB_AddOn +{ + AddOnLogCallback Log; + AddOnQueueNotification QueueNotification; + AddOnWakeOnLan WakeOnLan; + AddOnGetSetting GetSetting; + AddOnUnknownToUTF8 UnknownToUTF8; + AddOnGetLocalizedString GetLocalizedString; + AddOnGetDVDMenuLanguage GetDVDMenuLanguage; + AddOnFreeString FreeString; + + AddOnOpenFile OpenFile; + AddOnOpenFileForWrite OpenFileForWrite; + AddOnReadFile ReadFile; + AddOnReadFileString ReadFileString; + AddOnWriteFile WriteFile; + AddOnFlushFile FlushFile; + AddOnSeekFile SeekFile; + AddOnTruncateFile TruncateFile; + AddOnGetFilePosition GetFilePosition; + AddOnGetFileLength GetFileLength; + AddOnGetFileDownloadSpeed GetFileDownloadSpeed; + AddOnCloseFile CloseFile; + AddOnGetFileChunkSize GetFileChunkSize; + AddOnFileExists FileExists; + AddOnStatFile StatFile; + AddOnDeleteFile DeleteFile; + AddOnCanOpenDirectory CanOpenDirectory; + AddOnCreateDirectory CreateDirectory; + AddOnDirectoryExists DirectoryExists; + AddOnRemoveDirectory RemoveDirectory; + AddOnGetDirectory GetDirectory; + AddOnFreeDirectory FreeDirectory; + AddOnCURLCreate CURLCreate; + AddOnCURLAddOption CURLAddOption; + AddOnCURLOpen CURLOpen; +} CB_AddOnLib; + +class CAddonCallbacksAddon : public ADDON::IAddonInterface { public: - CAddonCallbacksAddon(CAddon* addon); - ~CAddonCallbacksAddon(); + CAddonCallbacksAddon(ADDON::CAddon* addon); + virtual ~CAddonCallbacksAddon(); + + static int APILevel() { return 1; } + static std::string Version() { return "0.0.1"; } /*! * @return The callback table. */ CB_AddOnLib *GetCallbacks() { return m_callbacks; } - static void AddOnLog(void *addonData, const addon_log_t addonLogLevel, const char *strMessage); + static void AddOnLog(void *addonData, const ADDON::addon_log_t addonLogLevel, const char *strMessage); static bool GetAddonSetting(void *addonData, const char *strSettingName, void *settingValue); - static void QueueNotification(void *addonData, const queue_msg_t type, const char *strMessage); + static void QueueNotification(void *addonData, const ADDON::queue_msg_t type, const char *strMessage); static bool WakeOnLan(const char *mac); static char* UnknownToUTF8(const char *strSource); static char* GetLocalizedString(const void* addonData, long dwCode); @@ -75,7 +170,9 @@ public: private: CB_AddOnLib *m_callbacks; /*!< callback addresses */ - CAddon *m_addon; /*!< the add-on */ }; -}; /* namespace ADDON */ +}; /* namespace AddOn */ + +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/Addon/CMakeLists.txt b/xbmc/addons/binary/interfaces/api1/Addon/CMakeLists.txt new file mode 100644 index 0000000000..5135de0906 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/Addon/CMakeLists.txt @@ -0,0 +1,9 @@ +set(SOURCES AddonCallbacksAddon.cpp) + +set(HEADERS AddonCallbacksAddon.h) + +core_add_library(api1AddonCallbacks_Addon) + +if(ENABLE_INTERNAL_FFMPEG) + add_dependencies(api1AddonCallbacks_Addon ffmpeg) +endif() diff --git a/xbmc/addons/binary/interfaces/api1/Addon/Makefile b/xbmc/addons/binary/interfaces/api1/Addon/Makefile new file mode 100644 index 0000000000..09ea40efa2 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/Addon/Makefile @@ -0,0 +1,7 @@ +SRCS=AddonCallbacksAddon.cpp \ + +LIB=addon-callbacks-addon.a + +include ../../../../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) + diff --git a/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp b/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp index 2087f678fc..2bfde9763e 100644 --- a/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp +++ b/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Team KODI + * Copyright (C) 2014-2016 Team KODI * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify @@ -19,25 +19,31 @@ */ #include "Application.h" -#include "AddonCallbacksAudioDSP.h" -#include "settings/AdvancedSettings.h" -#include "utils/log.h" +#include "cores/AudioEngine/AEFactory.h" #include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" #include "cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h" #include "cores/AudioEngine/Interfaces/AESound.h" -#include "cores/AudioEngine/AEFactory.h" #include "dialogs/GUIDialogKaiToast.h" +#include "settings/AdvancedSettings.h" +#include "utils/log.h" + +#include "AddonCallbacksAudioDSP.h" +using namespace ADDON; using namespace ActiveAE; -namespace ADDON +namespace V1 +{ +namespace KodiAPI { -CAddonCallbacksADSP::CAddonCallbacksADSP(CAddon* addon) +namespace AudioDSP { - m_addon = addon; - m_callbacks = new CB_ADSPLib; +CAddonCallbacksADSP::CAddonCallbacksADSP(ADDON::CAddon* addon) + : ADDON::IAddonInterface(addon, APILevel(), Version()), + m_callbacks(new CB_ADSPLib) +{ /* write KODI audio DSP specific add-on function addresses to callback table */ m_callbacks->AddMenuHook = ADSPAddMenuHook; m_callbacks->RemoveMenuHook = ADSPRemoveMenuHook; @@ -63,14 +69,14 @@ CAddonCallbacksADSP::~CAddonCallbacksADSP() CActiveAEDSPAddon *CAddonCallbacksADSP::GetAudioDSPAddon(void *addonData) { - CAddonCallbacks *addon = static_cast<CAddonCallbacks *>(addonData); + CAddonInterfaces *addon = static_cast<CAddonInterfaces *>(addonData); if (!addon || !addon->GetHelperADSP()) { CLog::Log(LOGERROR, "Audio DSP - %s - called with a null pointer", __FUNCTION__); return NULL; } - return dynamic_cast<CActiveAEDSPAddon *>(addon->GetHelperADSP()->m_addon); + return dynamic_cast<CActiveAEDSPAddon*>(static_cast<CAddonCallbacksADSP*>(addon->GetHelperADSP())->m_addon); } void CAddonCallbacksADSP::ADSPAddMenuHook(void *addonData, AE_DSP_MENUHOOK *hook) @@ -269,4 +275,7 @@ float CAddonCallbacksADSP::ADSPSoundPlay_GetVolume(void *addonData, ADSPHANDLE h return ((IAESound*)handle)->GetVolume(); } -}; /* namespace ADDON */ +}; /* namespace AudioDSP */ + +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.h b/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.h index 3329564ab1..3864f51bc2 100644 --- a/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.h +++ b/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.h @@ -1,6 +1,6 @@ #pragma once /* - * Copyright (C) 2014 Team KODI + * Copyright (C) 2014-2016 Team KODI * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify @@ -19,8 +19,8 @@ * */ -#include "AddonCallbacks.h" -#include "addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h" +#include "addons/binary/interfaces/AddonInterfaces.h" +#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h" namespace ActiveAE { @@ -29,17 +29,63 @@ namespace ActiveAE namespace ADDON { + class CAddon; +} + +namespace V1 +{ +namespace KodiAPI +{ + +namespace AudioDSP +{ + +typedef void (*ADSPAddMenuHook)(void *addonData, AE_DSP_MENUHOOK *hook); +typedef void (*ADSPRemoveMenuHook)(void *addonData, AE_DSP_MENUHOOK *hook); +typedef void (*ADSPRegisterMode)(void *addonData, AE_DSP_MODES::AE_DSP_MODE *mode); +typedef void (*ADSPUnregisterMode)(void *addonData, AE_DSP_MODES::AE_DSP_MODE *mode); + +typedef ADSPHANDLE (*ADSPSoundPlay_GetHandle)(void *addonData, const char *filename); +typedef void (*ADSPSoundPlay_ReleaseHandle)(void *addonData, ADSPHANDLE handle); +typedef void (*ADSPSoundPlay_Play)(void *addonData, ADSPHANDLE handle); +typedef void (*ADSPSoundPlay_Stop)(void *addonData, ADSPHANDLE handle); +typedef bool (*ADSPSoundPlay_IsPlaying)(void *addonData, ADSPHANDLE handle); +typedef void (*ADSPSoundPlay_SetChannel)(void *addonData, ADSPHANDLE handle, AE_DSP_CHANNEL channel); +typedef AE_DSP_CHANNEL (*ADSPSoundPlay_GetChannel)(void *addonData, ADSPHANDLE handle); +typedef void (*ADSPSoundPlay_SetVolume)(void *addonData, ADSPHANDLE handle, float volume); +typedef float (*ADSPSoundPlay_GetVolume)(void *addonData, ADSPHANDLE handle); + +typedef struct CB_ADSPLib +{ + ADSPAddMenuHook AddMenuHook; + ADSPRemoveMenuHook RemoveMenuHook; + ADSPRegisterMode RegisterMode; + ADSPUnregisterMode UnregisterMode; + + ADSPSoundPlay_GetHandle SoundPlay_GetHandle; + ADSPSoundPlay_ReleaseHandle SoundPlay_ReleaseHandle; + ADSPSoundPlay_Play SoundPlay_Play; + ADSPSoundPlay_Stop SoundPlay_Stop; + ADSPSoundPlay_IsPlaying SoundPlay_IsPlaying; + ADSPSoundPlay_SetChannel SoundPlay_SetChannel; + ADSPSoundPlay_GetChannel SoundPlay_GetChannel; + ADSPSoundPlay_SetVolume SoundPlay_SetVolume; + ADSPSoundPlay_GetVolume SoundPlay_GetVolume; +} CB_ADSPLib; /*! * Callbacks for a audio DSP add-on to KODI. * * Also translates the addon's C structures to KODI's C++ structures. */ -class CAddonCallbacksADSP +class CAddonCallbacksADSP : public ADDON::IAddonInterface { public: - CAddonCallbacksADSP(CAddon* addon); - ~CAddonCallbacksADSP(void); + CAddonCallbacksADSP(ADDON::CAddon* addon); + virtual ~CAddonCallbacksADSP(void); + + static int APILevel() { return 1; } + static std::string Version() { return KODI_AE_DSP_API_VERSION; } /*! * @return The callback table. @@ -146,10 +192,12 @@ public: //@} private: - static ActiveAE::CActiveAEDSPAddon* GetAudioDSPAddon(void* addonData); + static ::ActiveAE::CActiveAEDSPAddon* GetAudioDSPAddon(void* addonData); CB_ADSPLib *m_callbacks; /*!< callback addresses */ - CAddon *m_addon; /*!< the addon */ }; -}; /* namespace ADDON */ +}; /* namespace AudioDSP */ + +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/AudioDSP/CMakeLists.txt b/xbmc/addons/binary/interfaces/api1/AudioDSP/CMakeLists.txt new file mode 100644 index 0000000000..7d30ca9b07 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/AudioDSP/CMakeLists.txt @@ -0,0 +1,9 @@ +set(SOURCES AddonCallbacksAudioDSP.cpp) + +set(HEADERS AddonCallbacksAudioDSP.h) + +core_add_library(api1AddonCallbacks_AudioDSP) + +if(ENABLE_INTERNAL_FFMPEG) + add_dependencies(api1AddonCallbacks_AudioDSP ffmpeg) +endif() diff --git a/xbmc/addons/binary/interfaces/api1/AudioDSP/Makefile b/xbmc/addons/binary/interfaces/api1/AudioDSP/Makefile new file mode 100644 index 0000000000..16d077b089 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/AudioDSP/Makefile @@ -0,0 +1,7 @@ +SRCS=AddonCallbacksAudioDSP.cpp \ + +LIB=addon-callbacks-audiodsp.a + +include ../../../../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) + diff --git a/xbmc/addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.cpp b/xbmc/addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.cpp index 2623e7105b..fc83706309 100644 --- a/xbmc/addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.cpp +++ b/xbmc/addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.cpp @@ -18,21 +18,28 @@ * */ +#include "system.h" #include "AddonCallbacksAudioEngine.h" +#include "addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h" #include "cores/AudioEngine/AEFactory.h" #include "cores/AudioEngine/Interfaces/AEStream.h" #include "cores/AudioEngine/Utils/AEChannelData.h" #include "utils/log.h" -#include "addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h" -namespace ADDON +using namespace ADDON; + +namespace V1 +{ +namespace KodiAPI +{ + +namespace AudioEngine { CAddonCallbacksAudioEngine::CAddonCallbacksAudioEngine(CAddon* addon) + : ADDON::IAddonInterface(addon, APILevel(), Version()), + m_callbacks(new CB_AudioEngineLib) { - m_addon = addon; - m_callbacks = new CB_AudioEngineLib; - // write KODI audio DSP specific add-on function addresses to callback table m_callbacks->MakeStream = AudioEngine_MakeStream; m_callbacks->FreeStream = AudioEngine_FreeStream; @@ -394,4 +401,7 @@ void CAddonCallbacksAudioEngine::AEStream_SetResampleRatio(void *AddonData, AESt ((IAEStream*)StreamHandle)->SetResampleRatio(Ratio); } -}; /* namespace ADDON */ +}; /* namespace AudioEngine */ + +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.h b/xbmc/addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.h index 63dd32606d..8553c106f1 100644 --- a/xbmc/addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.h +++ b/xbmc/addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.h @@ -1,6 +1,6 @@ #pragma once /* - * Copyright (C) 2014 Team KODI + * Copyright (C) 2014-2016 Team KODI * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify @@ -19,20 +19,91 @@ * */ -#include "AddonCallbacks.h" +#include "addons/binary/interfaces/AddonInterfaces.h" +#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h" #include "addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h" -namespace ADDON +namespace V1 { +namespace KodiAPI +{ + +namespace AudioEngine +{ + +// --------------------------------------- +// libKODI_audioengine definitions +// --------------------------------------- +typedef AEStreamHandle* (*AudioEngine_MakeStream)(AudioEngineFormat Format, unsigned int Options); +typedef void (*AudioEngine_FreeStream)(AEStreamHandle *stream); +typedef bool (*AudioEngine_GetCurrentSinkFormat)(void *addonData, AudioEngineFormat *SinkFormat); + +// Audio Engine Stream definitions +typedef unsigned int (*AudioEngine_Stream_GetSpace)(void *addonData, AEStreamHandle *handle); +typedef unsigned int (*AudioEngine_Stream_AddData)(void *addonData, AEStreamHandle *handle, uint8_t* const *Data, unsigned int Offset, unsigned int Frames); +typedef double (*AudioEngine_Stream_GetDelay)(void *addonData, AEStreamHandle *handle); +typedef bool (*AudioEngine_Stream_IsBuffering)(void *addonData, AEStreamHandle *handle); +typedef double (*AudioEngine_Stream_GetCacheTime)(void *addonData, AEStreamHandle *handle); +typedef double (*AudioEngine_Stream_GetCacheTotal)(void *addonData, AEStreamHandle *handle); +typedef void (*AudioEngine_Stream_Pause)(void *addonData, AEStreamHandle *handle); +typedef void (*AudioEngine_Stream_Resume)(void *addonData, AEStreamHandle *handle); +typedef void (*AudioEngine_Stream_Drain)(void *addonData, AEStreamHandle *handle, bool Wait); +typedef bool (*AudioEngine_Stream_IsDraining)(void *addonData, AEStreamHandle *handle); +typedef bool (*AudioEngine_Stream_IsDrained)(void *addonData, AEStreamHandle *handle); +typedef void (*AudioEngine_Stream_Flush)(void *addonData, AEStreamHandle *handle); +typedef float (*AudioEngine_Stream_GetVolume)(void *addonData, AEStreamHandle *handle); +typedef void (*AudioEngine_Stream_SetVolume)(void *addonData, AEStreamHandle *handle, float Volume); +typedef float (*AudioEngine_Stream_GetAmplification)(void *addonData, AEStreamHandle *handle); +typedef void (*AudioEngine_Stream_SetAmplification)(void *addonData, AEStreamHandle *handle, float Amplify); +typedef const unsigned int (*AudioEngine_Stream_GetFrameSize)(void *addonData, AEStreamHandle *handle); +typedef const unsigned int (*AudioEngine_Stream_GetChannelCount)(void *addonData, AEStreamHandle *handle); +typedef const unsigned int (*AudioEngine_Stream_GetSampleRate)(void *addonData, AEStreamHandle *handle); +typedef const AEDataFormat (*AudioEngine_Stream_GetDataFormat)(void *addonData, AEStreamHandle *handle); +typedef double (*AudioEngine_Stream_GetResampleRatio)(void *addonData, AEStreamHandle *handle); +typedef void (*AudioEngine_Stream_SetResampleRatio)(void *addonData, AEStreamHandle *handle, double Ratio); + +typedef struct CB_AudioEngineLib +{ + AudioEngine_MakeStream MakeStream; + AudioEngine_FreeStream FreeStream; + AudioEngine_GetCurrentSinkFormat GetCurrentSinkFormat; + + // AudioEngine stream callbacks + AudioEngine_Stream_GetSpace AEStream_GetSpace; + AudioEngine_Stream_AddData AEStream_AddData; + AudioEngine_Stream_GetDelay AEStream_GetDelay; + AudioEngine_Stream_IsBuffering AEStream_IsBuffering; + AudioEngine_Stream_GetCacheTime AEStream_GetCacheTime; + AudioEngine_Stream_GetCacheTotal AEStream_GetCacheTotal; + AudioEngine_Stream_Pause AEStream_Pause; + AudioEngine_Stream_Resume AEStream_Resume; + AudioEngine_Stream_Drain AEStream_Drain; + AudioEngine_Stream_IsDraining AEStream_IsDraining; + AudioEngine_Stream_IsDrained AEStream_IsDrained; + AudioEngine_Stream_Flush AEStream_Flush; + AudioEngine_Stream_GetVolume AEStream_GetVolume; + AudioEngine_Stream_SetVolume AEStream_SetVolume; + AudioEngine_Stream_GetAmplification AEStream_GetAmplification; + AudioEngine_Stream_SetAmplification AEStream_SetAmplification; + AudioEngine_Stream_GetFrameSize AEStream_GetFrameSize; + AudioEngine_Stream_GetChannelCount AEStream_GetChannelCount; + AudioEngine_Stream_GetSampleRate AEStream_GetSampleRate; + AudioEngine_Stream_GetDataFormat AEStream_GetDataFormat; + AudioEngine_Stream_GetResampleRatio AEStream_GetResampleRatio; + AudioEngine_Stream_SetResampleRatio AEStream_SetResampleRatio; +} CB_AudioEngineLib; /*! * Callbacks for Kodi's AudioEngine. */ -class CAddonCallbacksAudioEngine +class CAddonCallbacksAudioEngine : public ADDON::IAddonInterface { public: - CAddonCallbacksAudioEngine(CAddon* Addon); - ~CAddonCallbacksAudioEngine(); + CAddonCallbacksAudioEngine(ADDON::CAddon* Addon); + virtual ~CAddonCallbacksAudioEngine(); + + static int APILevel() { return 1; } + static std::string Version() { return KODI_AUDIOENGINE_API_VERSION; } /*! * @return The callback table. @@ -200,7 +271,9 @@ public: private: CB_AudioEngineLib *m_callbacks; /*!< callback addresses */ - CAddon *m_addon; /*!< the addon */ }; -}; /* namespace ADDON */ +}; /* namespace AudioEngine */ + +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/AudioEngine/CMakeLists.txt b/xbmc/addons/binary/interfaces/api1/AudioEngine/CMakeLists.txt new file mode 100644 index 0000000000..15f0a7883a --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/AudioEngine/CMakeLists.txt @@ -0,0 +1,9 @@ +set(SOURCES AddonCallbacksAudioEngine.cpp) + +set(HEADERS AddonCallbacksAudioEngine.h) + +core_add_library(api1AddonCallbacks_AudioEngine) + +if(ENABLE_INTERNAL_FFMPEG) + add_dependencies(api1AddonCallbacks_AudioEngine ffmpeg) +endif() diff --git a/xbmc/addons/binary/interfaces/api1/AudioEngine/Makefile b/xbmc/addons/binary/interfaces/api1/AudioEngine/Makefile new file mode 100644 index 0000000000..74bf8a9058 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/AudioEngine/Makefile @@ -0,0 +1,6 @@ +SRCS=AddonCallbacksAudioEngine.cpp \ + +LIB=addon-callbacks-audioengine.a + +include ../../../../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) diff --git a/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.cpp b/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.cpp index 17e5d2148b..32af7e056c 100644 --- a/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.cpp +++ b/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -13,12 +14,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ -#include "Addon.h" +#include "addons/Addon.h" #include <utility> @@ -29,9 +30,16 @@ extern "C" { #include "libavcodec/avcodec.h" } +using namespace ADDON; -namespace ADDON +namespace V1 { +namespace KodiAPI +{ + +namespace Codec +{ + class CCodecIds { public: @@ -94,10 +102,9 @@ private: }; CAddonCallbacksCodec::CAddonCallbacksCodec(CAddon* addon) + : ADDON::IAddonInterface(addon, APILevel(), Version()), + m_callbacks(new CB_CodecLib) { - m_addon = addon; - m_callbacks = new CB_CODECLib; - /* write XBMC addon-on specific add-on function addresses to the callback table */ m_callbacks->GetCodecByName = GetCodecByName; } @@ -114,5 +121,7 @@ xbmc_codec_t CAddonCallbacksCodec::GetCodecByName(const void* addonData, const c return CCodecIds::GetInstance().GetCodecByName(strCodecName); } -}; /* namespace ADDON */ +}; /* namespace Codec */ +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h b/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h index 5b816fe199..0679e3ea40 100644 --- a/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h +++ b/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h @@ -1,7 +1,8 @@ #pragma once /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -14,33 +15,50 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ -#include "AddonCallbacks.h" +#include "addons/binary/interfaces/AddonInterfaces.h" +#include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h" -namespace ADDON +namespace V1 { +namespace KodiAPI +{ + +namespace Codec +{ + +typedef xbmc_codec_t (*CODECGetCodecByName)(const void* addonData, const char* strCodecName); -class CAddonCallbacksCodec +typedef struct CB_CODEC +{ + CODECGetCodecByName GetCodecByName; +} CB_CodecLib; + +class CAddonCallbacksCodec : public ADDON::IAddonInterface { public: - CAddonCallbacksCodec(CAddon* addon); - ~CAddonCallbacksCodec(); + CAddonCallbacksCodec(ADDON::CAddon* addon); + virtual ~CAddonCallbacksCodec(); + + static int APILevel() { return 1; } + static std::string Version() { return "0.0.1"; } /*! * @return The callback table. */ - CB_CODECLib *GetCallbacks() { return m_callbacks; } + CB_CodecLib *GetCallbacks() { return m_callbacks; } static xbmc_codec_t GetCodecByName(const void* addonData, const char* strCodecName); private: - CB_CODECLib* m_callbacks; /*!< callback addresses */ - CAddon* m_addon; /*!< the add-on */ + CB_CodecLib* m_callbacks; /*!< callback addresses */ }; -}; /* namespace ADDON */ +}; /* namespace Codec */ +}; /* namespace KoidAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/Codec/CMakeLists.txt b/xbmc/addons/binary/interfaces/api1/Codec/CMakeLists.txt new file mode 100644 index 0000000000..f6c482b60b --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/Codec/CMakeLists.txt @@ -0,0 +1,9 @@ +set(SOURCES AddonCallbacksCodec.cpp) + +set(HEADERS AddonCallbacksCodec.h) + +core_add_library(api1AddonCallbacks_Codec) + +if(ENABLE_INTERNAL_FFMPEG) + add_dependencies(api1AddonCallbacks_Codec ffmpeg) +endif() diff --git a/xbmc/addons/binary/interfaces/api1/Codec/Makefile b/xbmc/addons/binary/interfaces/api1/Codec/Makefile new file mode 100644 index 0000000000..f2cba21609 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/Codec/Makefile @@ -0,0 +1,7 @@ +SRCS=AddonCallbacksCodec.cpp \ + +LIB=addon-callbacks-codec.a + +include ../../../../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) + diff --git a/xbmc/addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.cpp b/xbmc/addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.cpp index bd06d51aaf..6830296ff5 100644 --- a/xbmc/addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.cpp +++ b/xbmc/addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -13,56 +14,59 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ -#include "Application.h" -#include "messaging/ApplicationMessenger.h" -#include "messaging/helpers/DialogHelper.h" -#include "Addon.h" +//#include "system.h" #include "AddonCallbacksGUI.h" -#include "utils/log.h" -#include "Skin.h" +#include "AddonGUIRenderingControl.h" +#include "AddonGUIWindow.h" + +#include "Application.h" #include "FileItem.h" +#include "addons/Addon.h" +#include "addons/Skin.h" +#include "dialogs/GUIDialogNumeric.h" +#include "dialogs/GUIDialogOK.h" +#include "dialogs/GUIDialogFileBrowser.h" +#include "dialogs/GUIDialogTextViewer.h" +#include "dialogs/GUIDialogSelect.h" #include "filesystem/File.h" -#include "utils/URIUtils.h" -#include "utils/StringUtils.h" -#include "utils/Variant.h" #include "guilib/GUIWindowManager.h" -#include "input/Key.h" -#include "guilib/TextureManager.h" #include "guilib/GUISpinControlEx.h" #include "guilib/GUIRadioButtonControl.h" #include "guilib/GUISettingsSliderControl.h" #include "guilib/GUIProgressControl.h" #include "guilib/GUIRenderingControl.h" #include "guilib/GUIKeyboardFactory.h" -#include "dialogs/GUIDialogNumeric.h" -#include "dialogs/GUIDialogOK.h" -#include "dialogs/GUIDialogFileBrowser.h" -#include "dialogs/GUIDialogTextViewer.h" -#include "dialogs/GUIDialogSelect.h" - -#define CONTROL_BTNVIEWASICONS 2 -#define CONTROL_BTNSORTBY 3 -#define CONTROL_BTNSORTASC 4 -#define CONTROL_LABELFILES 12 +#include "input/Key.h" +#include "messaging/ApplicationMessenger.h" +#include "messaging/helpers/DialogHelper.h" +#include "utils/log.h" +#include "utils/URIUtils.h" +#include "utils/StringUtils.h" +#include "utils/Variant.h" using namespace KODI::MESSAGING; using KODI::MESSAGING::HELPERS::DialogResponse; -namespace ADDON +using namespace ADDON; + +namespace V1 +{ +namespace KodiAPI +{ +namespace GUI { static int iXBMCGUILockRef = 0; CAddonCallbacksGUI::CAddonCallbacksGUI(CAddon* addon) + : ADDON::IAddonInterface(addon, APILevel(), Version()), + m_callbacks(new CB_GUILib) { - m_addon = addon; - m_callbacks = new CB_GUILib; - /* GUI Helper functions */ m_callbacks->Lock = CAddonCallbacksGUI::Lock; m_callbacks->Unlock = CAddonCallbacksGUI::Unlock; @@ -240,11 +244,11 @@ int CAddonCallbacksGUI::GetVideoResolution() GUIHANDLE CAddonCallbacksGUI::Window_New(void *addonData, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return NULL; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); RESOLUTION_INFO res; std::string strSkinPath; @@ -321,11 +325,11 @@ GUIHANDLE CAddonCallbacksGUI::Window_New(void *addonData, const char *xmlFilenam void CAddonCallbacksGUI::Window_Delete(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle) { @@ -359,7 +363,7 @@ void CAddonCallbacksGUI::Window_Delete(void *addonData, GUIHANDLE handle) void CAddonCallbacksGUI::Window_SetCallbacks(void *addonData, GUIHANDLE handle, GUIHANDLE clienthandle, bool (*initCB)(GUIHANDLE), bool (*clickCB)(GUIHANDLE, int), bool (*focusCB)(GUIHANDLE, int), bool (*onActionCB)(GUIHANDLE handle, int)) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -376,11 +380,11 @@ void CAddonCallbacksGUI::Window_SetCallbacks(void *addonData, GUIHANDLE handle, bool CAddonCallbacksGUI::Window_Show(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle) { @@ -408,11 +412,11 @@ bool CAddonCallbacksGUI::Window_Show(void *addonData, GUIHANDLE handle) bool CAddonCallbacksGUI::Window_Close(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle) { @@ -446,11 +450,11 @@ bool CAddonCallbacksGUI::Window_Close(void *addonData, GUIHANDLE handle) bool CAddonCallbacksGUI::Window_DoModal(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle) { @@ -473,11 +477,11 @@ bool CAddonCallbacksGUI::Window_DoModal(void *addonData, GUIHANDLE handle) bool CAddonCallbacksGUI::Window_SetFocusId(void *addonData, GUIHANDLE handle, int iControlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle) { @@ -508,11 +512,11 @@ int CAddonCallbacksGUI::Window_GetFocusId(void *addonData, GUIHANDLE handle) { int iControlId = -1; - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return iControlId; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle) { @@ -540,11 +544,11 @@ int CAddonCallbacksGUI::Window_GetFocusId(void *addonData, GUIHANDLE handle) bool CAddonCallbacksGUI::Window_SetCoordinateResolution(void *addonData, GUIHANDLE handle, int res) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle) { @@ -570,11 +574,11 @@ bool CAddonCallbacksGUI::Window_SetCoordinateResolution(void *addonData, GUIHAND void CAddonCallbacksGUI::Window_SetProperty(void *addonData, GUIHANDLE handle, const char *key, const char *value) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle || !key || !value) { @@ -597,11 +601,11 @@ void CAddonCallbacksGUI::Window_SetProperty(void *addonData, GUIHANDLE handle, c void CAddonCallbacksGUI::Window_SetPropertyInt(void *addonData, GUIHANDLE handle, const char *key, int value) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle || !key) { @@ -624,11 +628,11 @@ void CAddonCallbacksGUI::Window_SetPropertyInt(void *addonData, GUIHANDLE handle void CAddonCallbacksGUI::Window_SetPropertyBool(void *addonData, GUIHANDLE handle, const char *key, bool value) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle || !key) { @@ -651,11 +655,11 @@ void CAddonCallbacksGUI::Window_SetPropertyBool(void *addonData, GUIHANDLE handl void CAddonCallbacksGUI::Window_SetPropertyDouble(void *addonData, GUIHANDLE handle, const char *key, double value) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle || !key) { @@ -678,11 +682,11 @@ void CAddonCallbacksGUI::Window_SetPropertyDouble(void *addonData, GUIHANDLE han const char* CAddonCallbacksGUI::Window_GetProperty(void *addonData, GUIHANDLE handle, const char *key) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return NULL; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle || !key) { @@ -707,11 +711,11 @@ const char* CAddonCallbacksGUI::Window_GetProperty(void *addonData, GUIHANDLE ha int CAddonCallbacksGUI::Window_GetPropertyInt(void *addonData, GUIHANDLE handle, const char *key) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return -1; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle || !key) { @@ -736,11 +740,11 @@ int CAddonCallbacksGUI::Window_GetPropertyInt(void *addonData, GUIHANDLE handle, bool CAddonCallbacksGUI::Window_GetPropertyBool(void *addonData, GUIHANDLE handle, const char *key) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return false; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle || !key) { @@ -752,7 +756,7 @@ bool CAddonCallbacksGUI::Window_GetPropertyBool(void *addonData, GUIHANDLE handl CGUIWindow *pWindow = (CGUIWindow*)g_windowManager.GetWindow(pAddonWindow->m_iWindowId); if (!pWindow) return false; - + std::string lowerKey = key; StringUtils::ToLower(lowerKey); @@ -765,11 +769,11 @@ bool CAddonCallbacksGUI::Window_GetPropertyBool(void *addonData, GUIHANDLE handl double CAddonCallbacksGUI::Window_GetPropertyDouble(void *addonData, GUIHANDLE handle, const char *key) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return 0.0; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle || !key) { @@ -781,7 +785,7 @@ double CAddonCallbacksGUI::Window_GetPropertyDouble(void *addonData, GUIHANDLE h CGUIWindow *pWindow = (CGUIWindow*)g_windowManager.GetWindow(pAddonWindow->m_iWindowId); if (!pWindow) return 0.0; - + std::string lowerKey = key; StringUtils::ToLower(lowerKey); @@ -794,11 +798,11 @@ double CAddonCallbacksGUI::Window_GetPropertyDouble(void *addonData, GUIHANDLE h void CAddonCallbacksGUI::Window_ClearProperties(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); if (!handle) { @@ -818,7 +822,7 @@ void CAddonCallbacksGUI::Window_ClearProperties(void *addonData, GUIHANDLE handl int CAddonCallbacksGUI::Window_GetListSize(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return -1; @@ -833,7 +837,7 @@ int CAddonCallbacksGUI::Window_GetListSize(void *addonData, GUIHANDLE handle) void CAddonCallbacksGUI::Window_ClearList(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -848,7 +852,7 @@ void CAddonCallbacksGUI::Window_ClearList(void *addonData, GUIHANDLE handle) GUIHANDLE CAddonCallbacksGUI::Window_AddItem(void *addonData, GUIHANDLE handle, GUIHANDLE item, int itemPosition) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle || !item) return NULL; @@ -863,7 +867,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_AddItem(void *addonData, GUIHANDLE handle, GUIHANDLE CAddonCallbacksGUI::Window_AddStringItem(void *addonData, GUIHANDLE handle, const char *itemName, int itemPosition) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle || !itemName) return NULL; @@ -878,7 +882,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_AddStringItem(void *addonData, GUIHANDLE ha void CAddonCallbacksGUI::Window_RemoveItem(void *addonData, GUIHANDLE handle, int itemPosition) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -893,11 +897,11 @@ void CAddonCallbacksGUI::Window_RemoveItem(void *addonData, GUIHANDLE handle, in GUIHANDLE CAddonCallbacksGUI::Window_GetListItem(void *addonData, GUIHANDLE handle, int listPos) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; - CAddonCallbacksGUI* guiHelper = helper->GetHelperGUI(); + CAddonCallbacksGUI* guiHelper = static_cast<CAddonCallbacksGUI*>(helper->GUILib_GetHelper()); CGUIAddonWindow *pAddonWindow = (CGUIAddonWindow*)handle; Lock(); @@ -915,7 +919,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetListItem(void *addonData, GUIHANDLE hand void CAddonCallbacksGUI::Window_SetCurrentListPosition(void *addonData, GUIHANDLE handle, int listPos) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -930,7 +934,7 @@ void CAddonCallbacksGUI::Window_SetCurrentListPosition(void *addonData, GUIHANDL int CAddonCallbacksGUI::Window_GetCurrentListPosition(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return -1; @@ -945,7 +949,7 @@ int CAddonCallbacksGUI::Window_GetCurrentListPosition(void *addonData, GUIHANDLE GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Spin(void *addonData, GUIHANDLE handle, int controlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -959,7 +963,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Spin(void *addonData, GUIHANDLE GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Button(void *addonData, GUIHANDLE handle, int controlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -973,7 +977,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Button(void *addonData, GUIHANDL GUIHANDLE CAddonCallbacksGUI::Window_GetControl_RadioButton(void *addonData, GUIHANDLE handle, int controlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -987,7 +991,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_RadioButton(void *addonData, GUI GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Edit(void *addonData, GUIHANDLE handle, int controlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1001,7 +1005,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Edit(void *addonData, GUIHANDLE GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Progress(void *addonData, GUIHANDLE handle, int controlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1015,7 +1019,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Progress(void *addonData, GUIHAN GUIHANDLE CAddonCallbacksGUI::Window_GetControl_RenderAddon(void *addonData, GUIHANDLE handle, int controlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1031,7 +1035,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_RenderAddon(void *addonData, GUI void CAddonCallbacksGUI::Window_SetControlLabel(void *addonData, GUIHANDLE handle, int controlId, const char *label) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1044,7 +1048,7 @@ void CAddonCallbacksGUI::Window_SetControlLabel(void *addonData, GUIHANDLE handl void CAddonCallbacksGUI::Window_MarkDirtyRegion(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1055,7 +1059,7 @@ void CAddonCallbacksGUI::Window_MarkDirtyRegion(void *addonData, GUIHANDLE handl void CAddonCallbacksGUI::Control_Spin_SetVisible(void *addonData, GUIHANDLE spinhandle, bool yesNo) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !spinhandle) return; @@ -1065,7 +1069,7 @@ void CAddonCallbacksGUI::Control_Spin_SetVisible(void *addonData, GUIHANDLE spin void CAddonCallbacksGUI::Control_Spin_SetText(void *addonData, GUIHANDLE spinhandle, const char *label) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !spinhandle) return; @@ -1075,7 +1079,7 @@ void CAddonCallbacksGUI::Control_Spin_SetText(void *addonData, GUIHANDLE spinhan void CAddonCallbacksGUI::Control_Spin_Clear(void *addonData, GUIHANDLE spinhandle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !spinhandle) return; @@ -1085,7 +1089,7 @@ void CAddonCallbacksGUI::Control_Spin_Clear(void *addonData, GUIHANDLE spinhandl void CAddonCallbacksGUI::Control_Spin_AddLabel(void *addonData, GUIHANDLE spinhandle, const char *label, int iValue) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !spinhandle) return; @@ -1095,7 +1099,7 @@ void CAddonCallbacksGUI::Control_Spin_AddLabel(void *addonData, GUIHANDLE spinha int CAddonCallbacksGUI::Control_Spin_GetValue(void *addonData, GUIHANDLE spinhandle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !spinhandle) return -1; @@ -1105,7 +1109,7 @@ int CAddonCallbacksGUI::Control_Spin_GetValue(void *addonData, GUIHANDLE spinhan void CAddonCallbacksGUI::Control_Spin_SetValue(void *addonData, GUIHANDLE spinhandle, int iValue) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !spinhandle) return; @@ -1115,7 +1119,7 @@ void CAddonCallbacksGUI::Control_Spin_SetValue(void *addonData, GUIHANDLE spinha void CAddonCallbacksGUI::Control_RadioButton_SetVisible(void *addonData, GUIHANDLE handle, bool yesNo) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1125,7 +1129,7 @@ void CAddonCallbacksGUI::Control_RadioButton_SetVisible(void *addonData, GUIHAND void CAddonCallbacksGUI::Control_RadioButton_SetText(void *addonData, GUIHANDLE handle, const char *label) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1135,7 +1139,7 @@ void CAddonCallbacksGUI::Control_RadioButton_SetText(void *addonData, GUIHANDLE void CAddonCallbacksGUI::Control_RadioButton_SetSelected(void *addonData, GUIHANDLE handle, bool yesNo) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1145,7 +1149,7 @@ void CAddonCallbacksGUI::Control_RadioButton_SetSelected(void *addonData, GUIHAN bool CAddonCallbacksGUI::Control_RadioButton_IsSelected(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return false; @@ -1155,7 +1159,7 @@ bool CAddonCallbacksGUI::Control_RadioButton_IsSelected(void *addonData, GUIHAND void CAddonCallbacksGUI::Control_Progress_SetPercentage(void *addonData, GUIHANDLE handle, float fPercent) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1165,7 +1169,7 @@ void CAddonCallbacksGUI::Control_Progress_SetPercentage(void *addonData, GUIHAND float CAddonCallbacksGUI::Control_Progress_GetPercentage(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return 0.0; @@ -1175,7 +1179,7 @@ float CAddonCallbacksGUI::Control_Progress_GetPercentage(void *addonData, GUIHAN void CAddonCallbacksGUI::Control_Progress_SetInfo(void *addonData, GUIHANDLE handle, int iInfo) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1185,7 +1189,7 @@ void CAddonCallbacksGUI::Control_Progress_SetInfo(void *addonData, GUIHANDLE han int CAddonCallbacksGUI::Control_Progress_GetInfo(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return -1; @@ -1195,7 +1199,7 @@ int CAddonCallbacksGUI::Control_Progress_GetInfo(void *addonData, GUIHANDLE hand const char* CAddonCallbacksGUI::Control_Progress_GetDescription(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1212,7 +1216,7 @@ const char* CAddonCallbacksGUI::Control_Progress_GetDescription(void *addonData, */ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Slider(void *addonData, GUIHANDLE handle, int controlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1226,7 +1230,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_Slider(void *addonData, GUIHANDL void CAddonCallbacksGUI::Control_Slider_SetVisible(void *addonData, GUIHANDLE handle, bool yesNo) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1236,7 +1240,7 @@ void CAddonCallbacksGUI::Control_Slider_SetVisible(void *addonData, GUIHANDLE ha const char* CAddonCallbacksGUI::Control_Slider_GetDescription(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1250,7 +1254,7 @@ const char* CAddonCallbacksGUI::Control_Slider_GetDescription(void *addonData, G void CAddonCallbacksGUI::Control_Slider_SetIntRange(void *addonData, GUIHANDLE handle, int iStart, int iEnd) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1260,7 +1264,7 @@ void CAddonCallbacksGUI::Control_Slider_SetIntRange(void *addonData, GUIHANDLE h void CAddonCallbacksGUI::Control_Slider_SetIntValue(void *addonData, GUIHANDLE handle, int iValue) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1271,7 +1275,7 @@ void CAddonCallbacksGUI::Control_Slider_SetIntValue(void *addonData, GUIHANDLE h int CAddonCallbacksGUI::Control_Slider_GetIntValue(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return 0; @@ -1281,7 +1285,7 @@ int CAddonCallbacksGUI::Control_Slider_GetIntValue(void *addonData, GUIHANDLE ha void CAddonCallbacksGUI::Control_Slider_SetIntInterval(void *addonData, GUIHANDLE handle, int iInterval) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1291,7 +1295,7 @@ void CAddonCallbacksGUI::Control_Slider_SetIntInterval(void *addonData, GUIHANDL void CAddonCallbacksGUI::Control_Slider_SetPercentage(void *addonData, GUIHANDLE handle, float fPercent) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1302,7 +1306,7 @@ void CAddonCallbacksGUI::Control_Slider_SetPercentage(void *addonData, GUIHANDLE float CAddonCallbacksGUI::Control_Slider_GetPercentage(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return 0.0f; @@ -1312,7 +1316,7 @@ float CAddonCallbacksGUI::Control_Slider_GetPercentage(void *addonData, GUIHANDL void CAddonCallbacksGUI::Control_Slider_SetFloatRange(void *addonData, GUIHANDLE handle, float fStart, float fEnd) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1322,7 +1326,7 @@ void CAddonCallbacksGUI::Control_Slider_SetFloatRange(void *addonData, GUIHANDLE void CAddonCallbacksGUI::Control_Slider_SetFloatValue(void *addonData, GUIHANDLE handle, float iValue) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1333,7 +1337,7 @@ void CAddonCallbacksGUI::Control_Slider_SetFloatValue(void *addonData, GUIHANDLE float CAddonCallbacksGUI::Control_Slider_GetFloatValue(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return 0.0f; @@ -1343,7 +1347,7 @@ float CAddonCallbacksGUI::Control_Slider_GetFloatValue(void *addonData, GUIHANDL void CAddonCallbacksGUI::Control_Slider_SetFloatInterval(void *addonData, GUIHANDLE handle, float fInterval) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1356,7 +1360,7 @@ void CAddonCallbacksGUI::Control_Slider_SetFloatInterval(void *addonData, GUIHAN */ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_SettingsSlider(void *addonData, GUIHANDLE handle, int controlId) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1370,7 +1374,7 @@ GUIHANDLE CAddonCallbacksGUI::Window_GetControl_SettingsSlider(void *addonData, void CAddonCallbacksGUI::Control_SettingsSlider_SetVisible(void *addonData, GUIHANDLE handle, bool yesNo) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1380,7 +1384,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetVisible(void *addonData, GUIH void CAddonCallbacksGUI::Control_SettingsSlider_SetText(void *addonData, GUIHANDLE handle, const char *label) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1390,7 +1394,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetText(void *addonData, GUIHAND const char* CAddonCallbacksGUI::Control_SettingsSlider_GetDescription(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1404,7 +1408,7 @@ const char* CAddonCallbacksGUI::Control_SettingsSlider_GetDescription(void *addo void CAddonCallbacksGUI::Control_SettingsSlider_SetIntRange(void *addonData, GUIHANDLE handle, int iStart, int iEnd) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1414,7 +1418,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetIntRange(void *addonData, GUI void CAddonCallbacksGUI::Control_SettingsSlider_SetIntValue(void *addonData, GUIHANDLE handle, int iValue) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1425,7 +1429,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetIntValue(void *addonData, GUI int CAddonCallbacksGUI::Control_SettingsSlider_GetIntValue(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return 0; @@ -1435,7 +1439,7 @@ int CAddonCallbacksGUI::Control_SettingsSlider_GetIntValue(void *addonData, GUIH void CAddonCallbacksGUI::Control_SettingsSlider_SetIntInterval(void *addonData, GUIHANDLE handle, int iInterval) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1445,7 +1449,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetIntInterval(void *addonData, void CAddonCallbacksGUI::Control_SettingsSlider_SetPercentage(void *addonData, GUIHANDLE handle, float fPercent) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1456,7 +1460,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetPercentage(void *addonData, G float CAddonCallbacksGUI::Control_SettingsSlider_GetPercentage(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return 0.0f; @@ -1466,7 +1470,7 @@ float CAddonCallbacksGUI::Control_SettingsSlider_GetPercentage(void *addonData, void CAddonCallbacksGUI::Control_SettingsSlider_SetFloatRange(void *addonData, GUIHANDLE handle, float fStart, float fEnd) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1476,7 +1480,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetFloatRange(void *addonData, G void CAddonCallbacksGUI::Control_SettingsSlider_SetFloatValue(void *addonData, GUIHANDLE handle, float fValue) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1487,7 +1491,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetFloatValue(void *addonData, G float CAddonCallbacksGUI::Control_SettingsSlider_GetFloatValue(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return 0.0f; @@ -1497,7 +1501,7 @@ float CAddonCallbacksGUI::Control_SettingsSlider_GetFloatValue(void *addonData, void CAddonCallbacksGUI::Control_SettingsSlider_SetFloatInterval(void *addonData, GUIHANDLE handle, float fInterval) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1510,7 +1514,7 @@ void CAddonCallbacksGUI::Control_SettingsSlider_SetFloatInterval(void *addonData */ GUIHANDLE CAddonCallbacksGUI::ListItem_Create(void *addonData, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper) return NULL; @@ -1535,7 +1539,7 @@ GUIHANDLE CAddonCallbacksGUI::ListItem_Create(void *addonData, const char *label const char* CAddonCallbacksGUI::ListItem_GetLabel(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1547,7 +1551,7 @@ const char* CAddonCallbacksGUI::ListItem_GetLabel(void *addonData, GUIHANDLE han void CAddonCallbacksGUI::ListItem_SetLabel(void *addonData, GUIHANDLE handle, const char *label) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1556,7 +1560,7 @@ void CAddonCallbacksGUI::ListItem_SetLabel(void *addonData, GUIHANDLE handle, co const char* CAddonCallbacksGUI::ListItem_GetLabel2(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1569,7 +1573,7 @@ const char* CAddonCallbacksGUI::ListItem_GetLabel2(void *addonData, GUIHANDLE ha void CAddonCallbacksGUI::ListItem_SetLabel2(void *addonData, GUIHANDLE handle, const char *label) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1578,7 +1582,7 @@ void CAddonCallbacksGUI::ListItem_SetLabel2(void *addonData, GUIHANDLE handle, c void CAddonCallbacksGUI::ListItem_SetIconImage(void *addonData, GUIHANDLE handle, const char *image) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1587,7 +1591,7 @@ void CAddonCallbacksGUI::ListItem_SetIconImage(void *addonData, GUIHANDLE handle void CAddonCallbacksGUI::ListItem_SetThumbnailImage(void *addonData, GUIHANDLE handle, const char *image) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1596,7 +1600,7 @@ void CAddonCallbacksGUI::ListItem_SetThumbnailImage(void *addonData, GUIHANDLE h void CAddonCallbacksGUI::ListItem_SetInfo(void *addonData, GUIHANDLE handle, const char *info) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1604,7 +1608,7 @@ void CAddonCallbacksGUI::ListItem_SetInfo(void *addonData, GUIHANDLE handle, con void CAddonCallbacksGUI::ListItem_SetProperty(void *addonData, GUIHANDLE handle, const char *key, const char *value) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1613,7 +1617,7 @@ void CAddonCallbacksGUI::ListItem_SetProperty(void *addonData, GUIHANDLE handle, const char* CAddonCallbacksGUI::ListItem_GetProperty(void *addonData, GUIHANDLE handle, const char *key) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return NULL; @@ -1625,7 +1629,7 @@ const char* CAddonCallbacksGUI::ListItem_GetProperty(void *addonData, GUIHANDLE void CAddonCallbacksGUI::ListItem_SetPath(void *addonData, GUIHANDLE handle, const char *path) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1634,7 +1638,7 @@ void CAddonCallbacksGUI::ListItem_SetPath(void *addonData, GUIHANDLE handle, con void CAddonCallbacksGUI::RenderAddon_SetCallbacks(void *addonData, GUIHANDLE handle, GUIHANDLE clienthandle, bool (*createCB)(GUIHANDLE,int,int,int,int,void*), void (*renderCB)(GUIHANDLE), void (*stopCB)(GUIHANDLE), bool (*dirtyCB)(GUIHANDLE)) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1653,7 +1657,7 @@ void CAddonCallbacksGUI::RenderAddon_SetCallbacks(void *addonData, GUIHANDLE han void CAddonCallbacksGUI::RenderAddon_Delete(void *addonData, GUIHANDLE handle) { - CAddonCallbacks* helper = (CAddonCallbacks*) addonData; + CAddonInterfaces* helper = (CAddonInterfaces*) addonData; if (!helper || !handle) return; @@ -1912,373 +1916,6 @@ int CAddonCallbacksGUI::Dialog_Select(const char *heading, const char *entries[] } //@} -CGUIAddonWindow::CGUIAddonWindow(int id, const std::string& strXML, CAddon* addon) - : CGUIMediaWindow(id, strXML.c_str()) - , CBOnInit{nullptr} - , CBOnFocus{nullptr} - , CBOnClick{nullptr} - , CBOnAction{nullptr} - , m_clientHandle{nullptr} - , m_iWindowId(id) - , m_iOldWindowId(0) - , m_bModal(false) - , m_bIsDialog(false) - , m_actionEvent(true) - , m_addon(addon) - -{ - m_loadType = LOAD_ON_GUI_INIT; -} - -CGUIAddonWindow::~CGUIAddonWindow(void) -{ -} - -bool CGUIAddonWindow::OnAction(const CAction &action) -{ - // Let addon decide whether it wants to hande action first - if (CBOnAction && CBOnAction(m_clientHandle, action.GetID())) - return true; - - return CGUIWindow::OnAction(action); -} - -bool CGUIAddonWindow::OnMessage(CGUIMessage& message) -{ - // TODO: We shouldn't be dropping down to CGUIWindow in any of this ideally. - // We have to make up our minds about what python should be doing and - // what this side of things should be doing - switch (message.GetMessage()) - { - case GUI_MSG_WINDOW_DEINIT: - { - return CGUIMediaWindow::OnMessage(message); - } - break; - - case GUI_MSG_WINDOW_INIT: - { - CGUIMediaWindow::OnMessage(message); - if (CBOnInit) - CBOnInit(m_clientHandle); - - return true; - } - break; - - case GUI_MSG_SETFOCUS: - { - if (m_viewControl.HasControl(message.GetControlId()) && m_viewControl.GetCurrentControl() != (int)message.GetControlId()) - { - m_viewControl.SetFocused(); - return true; - } - // check if our focused control is one of our category buttons - int iControl = message.GetControlId(); - if (CBOnFocus) - { - CBOnFocus(m_clientHandle, iControl); - } - } - break; - - case GUI_MSG_FOCUSED: - { - if (HasID(message.GetSenderId()) && CBOnFocus) - { - CBOnFocus(m_clientHandle, message.GetControlId()); - } - } - break; - - case GUI_MSG_CLICKED: - { - int iControl=message.GetSenderId(); - // Handle Sort/View internally. Scripters shouldn't use ID 2, 3 or 4. - if (iControl == CONTROL_BTNSORTASC) // sort asc - { - CLog::Log(LOGINFO, "WindowXML: Internal asc/dsc button not implemented"); - /*if (m_guiState.get()) - m_guiState->SetNextSortOrder(); - UpdateFileList();*/ - return true; - } - else if (iControl == CONTROL_BTNSORTBY) // sort by - { - CLog::Log(LOGINFO, "WindowXML: Internal sort button not implemented"); - /*if (m_guiState.get()) - m_guiState->SetNextSortMethod(); - UpdateFileList();*/ - return true; - } - - if (CBOnClick && iControl && iControl != (int)this->GetID()) - { - CGUIControl* controlClicked = (CGUIControl*)this->GetControl(iControl); - - // The old python way used to check list AND SELECITEM method or if its a button, checkmark. - // Its done this way for now to allow other controls without a python version like togglebutton to still raise a onAction event - if (controlClicked) // Will get problems if we the id is not on the window and we try to do GetControlType on it. So check to make sure it exists - { - if ((controlClicked->IsContainer() && (message.GetParam1() == ACTION_SELECT_ITEM || - message.GetParam1() == ACTION_MOUSE_LEFT_CLICK)) || - !controlClicked->IsContainer()) - { - if (CBOnClick(m_clientHandle, iControl)) - return true; - } - else if (controlClicked->IsContainer() && message.GetParam1() == ACTION_MOUSE_RIGHT_CLICK) - { -// PyXBMCAction* inf = new PyXBMCAction; -// inf->pObject = Action_FromAction(CAction(ACTION_CONTEXT_MENU)); -// inf->pCallbackWindow = pCallbackWindow; -// -// // aquire lock? -// PyXBMC_AddPendingCall(Py_XBMC_Event_OnAction, inf); -// PulseActionEvent(); - } - } - } - } - break; - } - - return CGUIMediaWindow::OnMessage(message); -} - -void CGUIAddonWindow::AllocResources(bool forceLoad /*= FALSE */) -{ - std::string tmpDir = URIUtils::GetDirectory(GetProperty("xmlfile").asString()); - std::string fallbackMediaPath; - URIUtils::GetParentPath(tmpDir, fallbackMediaPath); - URIUtils::RemoveSlashAtEnd(fallbackMediaPath); - m_mediaDir = fallbackMediaPath; - - //CLog::Log(LOGDEBUG, "CGUIPythonWindowXML::AllocResources called: %s", fallbackMediaPath.c_str()); - g_TextureManager.AddTexturePath(m_mediaDir); - CGUIMediaWindow::AllocResources(forceLoad); - g_TextureManager.RemoveTexturePath(m_mediaDir); -} - -void CGUIAddonWindow::FreeResources(bool forceUnLoad /*= FALSE */) -{ - CGUIMediaWindow::FreeResources(forceUnLoad); -} - -void CGUIAddonWindow::Render() -{ - g_TextureManager.AddTexturePath(m_mediaDir); - CGUIMediaWindow::Render(); - g_TextureManager.RemoveTexturePath(m_mediaDir); -} - -void CGUIAddonWindow::Update() -{ -} - -void CGUIAddonWindow::AddItem(CFileItemPtr fileItem, int itemPosition) -{ - if (itemPosition == -1 || itemPosition > m_vecItems->Size()) - { - m_vecItems->Add(fileItem); - } - else if (itemPosition < -1 && !(itemPosition-1 < m_vecItems->Size())) - { - m_vecItems->AddFront(fileItem,0); - } - else - { - m_vecItems->AddFront(fileItem,itemPosition); - } - m_viewControl.SetItems(*m_vecItems); - UpdateButtons(); -} - -void CGUIAddonWindow::RemoveItem(int itemPosition) -{ - m_vecItems->Remove(itemPosition); - m_viewControl.SetItems(*m_vecItems); - UpdateButtons(); -} - -int CGUIAddonWindow::GetCurrentListPosition() -{ - return m_viewControl.GetSelectedItem(); -} - -void CGUIAddonWindow::SetCurrentListPosition(int item) -{ - m_viewControl.SetSelectedItem(item); -} - -int CGUIAddonWindow::GetListSize() -{ - return m_vecItems->Size(); -} - -CFileItemPtr CGUIAddonWindow::GetListItem(int position) -{ - if (position < 0 || position >= m_vecItems->Size()) return CFileItemPtr(); - return m_vecItems->Get(position); -} - -void CGUIAddonWindow::ClearList() -{ - ClearFileItems(); - - m_viewControl.SetItems(*m_vecItems); - UpdateButtons(); -} - -void CGUIAddonWindow::GetContextButtons(int itemNumber, CContextButtons &buttons) -{ - // maybe on day we can make an easy way to do this context menu - // with out this method overriding the MediaWindow version, it will display 'Add to Favorites' -} - -void CGUIAddonWindow::WaitForActionEvent(unsigned int timeout) -{ - m_actionEvent.WaitMSec(timeout); - m_actionEvent.Reset(); -} - -void CGUIAddonWindow::PulseActionEvent() -{ - m_actionEvent.Set(); -} - -bool CGUIAddonWindow::OnClick(int iItem, const std::string &player) -{ - // Hook Over calling CGUIMediaWindow::OnClick(iItem) results in it trying to PLAY the file item - // which if its not media is BAD and 99 out of 100 times undesireable. - return false; -} - -// SetupShares(); -/* - CGUIMediaWindow::OnWindowLoaded() calls SetupShares() so override it -and just call UpdateButtons(); -*/ -void CGUIAddonWindow::SetupShares() -{ - UpdateButtons(); -} - - -CGUIAddonWindowDialog::CGUIAddonWindowDialog(int id, const std::string& strXML, CAddon* addon) -: CGUIAddonWindow(id,strXML,addon) -{ - m_bRunning = false; - m_bIsDialog = true; -} - -CGUIAddonWindowDialog::~CGUIAddonWindowDialog(void) -{ -} - -bool CGUIAddonWindowDialog::OnMessage(CGUIMessage &message) -{ - if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT) - return CGUIWindow::OnMessage(message); - - return CGUIAddonWindow::OnMessage(message); -} - -void CGUIAddonWindowDialog::Show(bool show /* = true */) -{ - unsigned int iCount = g_graphicsContext.exit(); - CApplicationMessenger::GetInstance().SendMsg(TMSG_GUI_ADDON_DIALOG, 1, show ? 1 : 0, static_cast<void*>(this)); - g_graphicsContext.restore(iCount); -} - -void CGUIAddonWindowDialog::Show_Internal(bool show /* = true */) -{ - if (show) - { - m_bModal = true; - m_bRunning = true; - g_windowManager.RegisterDialog(this); - - // active this window... - CGUIMessage msg(GUI_MSG_WINDOW_INIT, 0, 0, WINDOW_INVALID, m_iWindowId); - OnMessage(msg); - - // this dialog is derived from GUiMediaWindow - // make sure it is rendered last - m_renderOrder = RENDER_ORDER_DIALOG; - while (m_bRunning && !g_application.m_bStop) - { - g_windowManager.ProcessRenderLoop(); - } - } - else // hide - { - m_bRunning = false; - - CGUIMessage msg(GUI_MSG_WINDOW_DEINIT,0,0); - OnMessage(msg); - - g_windowManager.RemoveDialog(GetID()); - } -} - -CGUIAddonRenderingControl::CGUIAddonRenderingControl(CGUIRenderingControl *pControl) - : CBCreate{nullptr}, - CBRender{nullptr}, - CBStop{nullptr}, - CBDirty{nullptr}, - m_clientHandle{nullptr}, - m_pControl{pControl}, - m_refCount{1} -{ } - -bool CGUIAddonRenderingControl::Create(int x, int y, int w, int h, void *device) -{ - if (CBCreate) - { - if (CBCreate(m_clientHandle, x, y, w, h, device)) - { - m_refCount++; - return true; - } - } - return false; -} - -void CGUIAddonRenderingControl::Render() -{ - if (CBRender) - { - CBRender(m_clientHandle); - } -} - -void CGUIAddonRenderingControl::Stop() -{ - if (CBStop) - { - CBStop(m_clientHandle); - } - m_refCount--; - if (m_refCount <= 0) - delete this; -} - -void CGUIAddonRenderingControl::Delete() -{ - m_refCount--; - if (m_refCount <= 0) - delete this; -} - -bool CGUIAddonRenderingControl::IsDirty() -{ - bool ret = true; - if (CBDirty) - { - ret = CBDirty(m_clientHandle); - } - return ret; -} - -}; /* namespace ADDON */ +}; /* namespace GUI */ +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.h b/xbmc/addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.h index 86025e1dcd..0243674860 100644 --- a/xbmc/addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.h +++ b/xbmc/addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.h @@ -1,7 +1,8 @@ #pragma once /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -14,33 +15,295 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ - -#include "AddonCallbacks.h" -#include "windows/GUIMediaWindow.h" -#include "threads/Event.h" -#include "guilib/IRenderingCallback.h" - -class CGUISpinControlEx; -class CGUIButtonControl; -class CGUIRadioButtonControl; -class CGUISliderControl; -class CGUISettingsSliderControl; -class CGUIEditControl; -class CGUIRenderingControl; +#include "addons/binary/interfaces/AddonInterfaces.h" +#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h" namespace ADDON { + class CAddon; +}; + +namespace V1 +{ +namespace KodiAPI +{ +namespace GUI +{ -class CAddonCallbacksGUI +typedef void (*GUILock)(); +typedef void (*GUIUnlock)(); +typedef int (*GUIGetScreenHeight)(); +typedef int (*GUIGetScreenWidth)(); +typedef int (*GUIGetVideoResolution)(); +typedef GUIHANDLE (*GUIWindow_New)(void *addonData, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog); +typedef void (*GUIWindow_Delete)(void *addonData, GUIHANDLE handle); +typedef void (*GUIWindow_SetCallbacks)(void *addonData, GUIHANDLE handle, GUIHANDLE clienthandle, bool (*)(GUIHANDLE handle), bool (*)(GUIHANDLE handle, int), bool (*)(GUIHANDLE handle, int), bool (*)(GUIHANDLE handle, int)); +typedef bool (*GUIWindow_Show)(void *addonData, GUIHANDLE handle); +typedef bool (*GUIWindow_Close)(void *addonData, GUIHANDLE handle); +typedef bool (*GUIWindow_DoModal)(void *addonData, GUIHANDLE handle); +typedef bool (*GUIWindow_SetFocusId)(void *addonData, GUIHANDLE handle, int iControlId); +typedef int (*GUIWindow_GetFocusId)(void *addonData, GUIHANDLE handle); +typedef bool (*GUIWindow_SetCoordinateResolution)(void *addonData, GUIHANDLE handle, int res); +typedef void (*GUIWindow_SetProperty)(void *addonData, GUIHANDLE handle, const char *key, const char *value); +typedef void (*GUIWindow_SetPropertyInt)(void *addonData, GUIHANDLE handle, const char *key, int value); +typedef void (*GUIWindow_SetPropertyBool)(void *addonData, GUIHANDLE handle, const char *key, bool value); +typedef void (*GUIWindow_SetPropertyDouble)(void *addonData, GUIHANDLE handle, const char *key, double value); +typedef const char* (*GUIWindow_GetProperty)(void *addonData, GUIHANDLE handle, const char *key); +typedef int (*GUIWindow_GetPropertyInt)(void *addonData, GUIHANDLE handle, const char *key); +typedef bool (*GUIWindow_GetPropertyBool)(void *addonData, GUIHANDLE handle, const char *key); +typedef double (*GUIWindow_GetPropertyDouble)(void *addonData, GUIHANDLE handle, const char *key); +typedef void (*GUIWindow_ClearProperties)(void *addonData, GUIHANDLE handle); +typedef int (*GUIWindow_GetListSize)(void *addonData, GUIHANDLE handle); +typedef void (*GUIWindow_ClearList)(void *addonData, GUIHANDLE handle); +typedef GUIHANDLE (*GUIWindow_AddItem)(void *addonData, GUIHANDLE handle, GUIHANDLE item, int itemPosition); +typedef GUIHANDLE (*GUIWindow_AddStringItem)(void *addonData, GUIHANDLE handle, const char *itemName, int itemPosition); +typedef void (*GUIWindow_RemoveItem)(void *addonData, GUIHANDLE handle, int itemPosition); +typedef GUIHANDLE (*GUIWindow_GetListItem)(void *addonData, GUIHANDLE handle, int listPos); +typedef void (*GUIWindow_SetCurrentListPosition)(void *addonData, GUIHANDLE handle, int listPos); +typedef int (*GUIWindow_GetCurrentListPosition)(void *addonData, GUIHANDLE handle); +typedef GUIHANDLE (*GUIWindow_GetControl_Spin)(void *addonData, GUIHANDLE handle, int controlId); +typedef GUIHANDLE (*GUIWindow_GetControl_Button)(void *addonData, GUIHANDLE handle, int controlId); +typedef GUIHANDLE (*GUIWindow_GetControl_RadioButton)(void *addonData, GUIHANDLE handle, int controlId); +typedef GUIHANDLE (*GUIWindow_GetControl_Edit)(void *addonData, GUIHANDLE handle, int controlId); +typedef GUIHANDLE (*GUIWindow_GetControl_Progress)(void *addonData, GUIHANDLE handle, int controlId); +typedef GUIHANDLE (*GUIWindow_GetControl_RenderAddon)(void *addonData, GUIHANDLE handle, int controlId); +typedef void (*GUIWindow_SetControlLabel)(void *addonData, GUIHANDLE handle, int controlId, const char *label); +typedef void (*GUIWindow_MarkDirtyRegion)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_Spin_SetVisible)(void *addonData, GUIHANDLE spinhandle, bool yesNo); +typedef void (*GUIControl_Spin_SetText)(void *addonData, GUIHANDLE spinhandle, const char *label); +typedef void (*GUIControl_Spin_Clear)(void *addonData, GUIHANDLE spinhandle); +typedef void (*GUIControl_Spin_AddLabel)(void *addonData, GUIHANDLE spinhandle, const char *label, int iValue); +typedef int (*GUIControl_Spin_GetValue)(void *addonData, GUIHANDLE spinhandle); +typedef void (*GUIControl_Spin_SetValue)(void *addonData, GUIHANDLE spinhandle, int iValue); +typedef void (*GUIControl_RadioButton_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo); +typedef void (*GUIControl_RadioButton_SetText)(void *addonData, GUIHANDLE handle, const char *label); +typedef void (*GUIControl_RadioButton_SetSelected)(void *addonData, GUIHANDLE handle, bool yesNo); +typedef bool (*GUIControl_RadioButton_IsSelected)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_Progress_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent); +typedef float (*GUIControl_Progress_GetPercentage)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_Progress_SetInfo)(void *addonData, GUIHANDLE handle, int iInfo); +typedef int (*GUIControl_Progress_GetInfo)(void *addonData, GUIHANDLE handle); +typedef const char* (*GUIControl_Progress_GetDescription)(void *addonData, GUIHANDLE handle); +typedef GUIHANDLE (*GUIWindow_GetControl_Slider)(void *addonData, GUIHANDLE handle, int controlId); +typedef void (*GUIControl_Slider_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo); +typedef const char *(*GUIControl_Slider_GetDescription)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_Slider_SetIntRange)(void *addonData, GUIHANDLE handle, int iStart, int iEnd); +typedef void (*GUIControl_Slider_SetIntValue)(void *addonData, GUIHANDLE handle, int iValue); +typedef int (*GUIControl_Slider_GetIntValue)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_Slider_SetIntInterval)(void *addonData, GUIHANDLE handle, int iInterval); +typedef void (*GUIControl_Slider_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent); +typedef float (*GUIControl_Slider_GetPercentage)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_Slider_SetFloatRange)(void *addonData, GUIHANDLE handle, float fStart, float fEnd); +typedef void (*GUIControl_Slider_SetFloatValue)(void *addonData, GUIHANDLE handle, float fValue); +typedef float (*GUIControl_Slider_GetFloatValue)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_Slider_SetFloatInterval)(void *addonData, GUIHANDLE handle, float fInterval); +typedef GUIHANDLE (*GUIWindow_GetControl_SettingsSlider)(void *addonData, GUIHANDLE handle, int controlId); +typedef void (*GUIControl_SettingsSlider_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo); +typedef void (*GUIControl_SettingsSlider_SetText)(void *addonData, GUIHANDLE handle, const char *label); +typedef const char *(*GUIControl_SettingsSlider_GetDescription)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_SettingsSlider_SetIntRange)(void *addonData, GUIHANDLE handle, int iStart, int iEnd); +typedef void (*GUIControl_SettingsSlider_SetIntValue)(void *addonData, GUIHANDLE handle, int iValue); +typedef int (*GUIControl_SettingsSlider_GetIntValue)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_SettingsSlider_SetIntInterval)(void *addonData, GUIHANDLE handle, int iInterval); +typedef void (*GUIControl_SettingsSlider_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent); +typedef float (*GUIControl_SettingsSlider_GetPercentage)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_SettingsSlider_SetFloatRange)(void *addonData, GUIHANDLE handle, float fStart, float fEnd); +typedef void (*GUIControl_SettingsSlider_SetFloatValue)(void *addonData, GUIHANDLE handle, float fValue); +typedef float (*GUIControl_SettingsSlider_GetFloatValue)(void *addonData, GUIHANDLE handle); +typedef void (*GUIControl_SettingsSlider_SetFloatInterval)(void *addonData, GUIHANDLE handle, float fInterval); +typedef GUIHANDLE (*GUIListItem_Create)(void *addonData, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path); +typedef const char* (*GUIListItem_GetLabel)(void *addonData, GUIHANDLE handle); +typedef void (*GUIListItem_SetLabel)(void *addonData, GUIHANDLE handle, const char *label); +typedef const char* (*GUIListItem_GetLabel2)(void *addonData, GUIHANDLE handle); +typedef void (*GUIListItem_SetLabel2)(void *addonData, GUIHANDLE handle, const char *label); +typedef void (*GUIListItem_SetIconImage)(void *addonData, GUIHANDLE handle, const char *image); +typedef void (*GUIListItem_SetThumbnailImage)(void *addonData, GUIHANDLE handle, const char *image); +typedef void (*GUIListItem_SetInfo)(void *addonData, GUIHANDLE handle, const char *info); +typedef void (*GUIListItem_SetProperty)(void *addonData, GUIHANDLE handle, const char *key, const char *value); +typedef const char* (*GUIListItem_GetProperty)(void *addonData, GUIHANDLE handle, const char *key); +typedef void (*GUIListItem_SetPath)(void *addonData, GUIHANDLE handle, const char *path); +typedef void (*GUIRenderAddon_SetCallbacks)(void *addonData, GUIHANDLE handle, GUIHANDLE clienthandle, bool (*createCB)(GUIHANDLE,int,int,int,int,void*), void (*renderCB)(GUIHANDLE), void (*stopCB)(GUIHANDLE), bool (*dirtyCB)(GUIHANDLE)); +typedef void (*GUIRenderAddon_Delete)(void *addonData, GUIHANDLE handle); +typedef void (*GUIRenderAddon_MarkDirty)(void *addonData, GUIHANDLE handle); + +typedef bool (*GUIDialog_Keyboard_ShowAndGetInputWithHead)(char &strTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs); +typedef bool (*GUIDialog_Keyboard_ShowAndGetInput)(char &strTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs); +typedef bool (*GUIDialog_Keyboard_ShowAndGetNewPasswordWithHead)(char &newPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs); +typedef bool (*GUIDialog_Keyboard_ShowAndGetNewPassword)(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); +typedef bool (*GUIDialog_Keyboard_ShowAndVerifyNewPasswordWithHead)(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmpty, unsigned int autoCloseMs); +typedef bool (*GUIDialog_Keyboard_ShowAndVerifyNewPassword)(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); +typedef int (*GUIDialog_Keyboard_ShowAndVerifyPassword)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs); +typedef bool (*GUIDialog_Keyboard_ShowAndGetFilter)(char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs); +typedef bool (*GUIDialog_Keyboard_SendTextToActiveKeyboard)(const char *aTextString, bool closeKeyboard); +typedef bool (*GUIDialog_Keyboard_isKeyboardActivated)(); + +typedef bool (*GUIDialog_Numeric_ShowAndVerifyNewPassword)(char &strNewPassword, unsigned int iMaxStringSize); +typedef int (*GUIDialog_Numeric_ShowAndVerifyPassword)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries); +typedef bool (*GUIDialog_Numeric_ShowAndVerifyInput)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput); +typedef bool (*GUIDialog_Numeric_ShowAndGetTime)(tm &time, const char *strHeading); +typedef bool (*GUIDialog_Numeric_ShowAndGetDate)(tm &date, const char *strHeading); +typedef bool (*GUIDialog_Numeric_ShowAndGetIPAddress)(char &strIPAddress, unsigned int iMaxStringSize, const char *strHeading); +typedef bool (*GUIDialog_Numeric_ShowAndGetNumber)(char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs); +typedef bool (*GUIDialog_Numeric_ShowAndGetSeconds)(char &timeString, unsigned int iMaxStringSize, const char *strHeading); + +typedef bool (*GUIDialog_FileBrowser_ShowAndGetFile)(const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList); + +typedef void (*GUIDialog_OK_ShowAndGetInputSingleText)(const char *heading, const char *text); +typedef void (*GUIDialog_OK_ShowAndGetInputLineText)(const char *heading, const char *line0, const char *line1, const char *line2); + +typedef bool (*GUIDialog_YesNo_ShowAndGetInputSingleText)(const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel); +typedef bool (*GUIDialog_YesNo_ShowAndGetInputLineText)(const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel); +typedef bool (*GUIDialog_YesNo_ShowAndGetInputLineButtonText)(const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel); + +typedef void (*GUIDialog_TextViewer)(const char *heading, const char *text); + +typedef int (*GUIDialog_Select)(const char *heading, const char *entries[], unsigned int size, int selected); + +typedef struct CB_GUILib +{ + GUILock Lock; + GUIUnlock Unlock; + GUIGetScreenHeight GetScreenHeight; + GUIGetScreenWidth GetScreenWidth; + GUIGetVideoResolution GetVideoResolution; + GUIWindow_New Window_New; + GUIWindow_Delete Window_Delete; + GUIWindow_SetCallbacks Window_SetCallbacks; + GUIWindow_Show Window_Show; + GUIWindow_Close Window_Close; + GUIWindow_DoModal Window_DoModal; + GUIWindow_SetFocusId Window_SetFocusId; + GUIWindow_GetFocusId Window_GetFocusId; + GUIWindow_SetCoordinateResolution Window_SetCoordinateResolution; + GUIWindow_SetProperty Window_SetProperty; + GUIWindow_SetPropertyInt Window_SetPropertyInt; + GUIWindow_SetPropertyBool Window_SetPropertyBool; + GUIWindow_SetPropertyDouble Window_SetPropertyDouble; + GUIWindow_GetProperty Window_GetProperty; + GUIWindow_GetPropertyInt Window_GetPropertyInt; + GUIWindow_GetPropertyBool Window_GetPropertyBool; + GUIWindow_GetPropertyDouble Window_GetPropertyDouble; + GUIWindow_ClearProperties Window_ClearProperties; + GUIWindow_GetListSize Window_GetListSize; + GUIWindow_ClearList Window_ClearList; + GUIWindow_AddItem Window_AddItem; + GUIWindow_AddStringItem Window_AddStringItem; + GUIWindow_RemoveItem Window_RemoveItem; + GUIWindow_GetListItem Window_GetListItem; + GUIWindow_SetCurrentListPosition Window_SetCurrentListPosition; + GUIWindow_GetCurrentListPosition Window_GetCurrentListPosition; + GUIWindow_GetControl_Spin Window_GetControl_Spin; + GUIWindow_GetControl_Button Window_GetControl_Button; + GUIWindow_GetControl_RadioButton Window_GetControl_RadioButton; + GUIWindow_GetControl_Edit Window_GetControl_Edit; + GUIWindow_GetControl_Progress Window_GetControl_Progress; + GUIWindow_GetControl_RenderAddon Window_GetControl_RenderAddon; + GUIWindow_SetControlLabel Window_SetControlLabel; + GUIWindow_MarkDirtyRegion Window_MarkDirtyRegion; + GUIControl_Spin_SetVisible Control_Spin_SetVisible; + GUIControl_Spin_SetText Control_Spin_SetText; + GUIControl_Spin_Clear Control_Spin_Clear; + GUIControl_Spin_AddLabel Control_Spin_AddLabel; + GUIControl_Spin_GetValue Control_Spin_GetValue; + GUIControl_Spin_SetValue Control_Spin_SetValue; + GUIControl_RadioButton_SetVisible Control_RadioButton_SetVisible; + GUIControl_RadioButton_SetText Control_RadioButton_SetText; + GUIControl_RadioButton_SetSelected Control_RadioButton_SetSelected; + GUIControl_RadioButton_IsSelected Control_RadioButton_IsSelected; + GUIControl_Progress_SetPercentage Control_Progress_SetPercentage; + GUIControl_Progress_GetPercentage Control_Progress_GetPercentage; + GUIControl_Progress_SetInfo Control_Progress_SetInfo; + GUIControl_Progress_GetInfo Control_Progress_GetInfo; + GUIControl_Progress_GetDescription Control_Progress_GetDescription; + GUIListItem_Create ListItem_Create; + GUIListItem_GetLabel ListItem_GetLabel; + GUIListItem_SetLabel ListItem_SetLabel; + GUIListItem_GetLabel2 ListItem_GetLabel2; + GUIListItem_SetLabel2 ListItem_SetLabel2; + GUIListItem_SetIconImage ListItem_SetIconImage; + GUIListItem_SetThumbnailImage ListItem_SetThumbnailImage; + GUIListItem_SetInfo ListItem_SetInfo; + GUIListItem_SetProperty ListItem_SetProperty; + GUIListItem_GetProperty ListItem_GetProperty; + GUIListItem_SetPath ListItem_SetPath; + GUIRenderAddon_SetCallbacks RenderAddon_SetCallbacks; + GUIRenderAddon_Delete RenderAddon_Delete; + + GUIWindow_GetControl_Slider Window_GetControl_Slider; + GUIControl_Slider_SetVisible Control_Slider_SetVisible; + GUIControl_Slider_GetDescription Control_Slider_GetDescription; + GUIControl_Slider_SetIntRange Control_Slider_SetIntRange; + GUIControl_Slider_SetIntValue Control_Slider_SetIntValue; + GUIControl_Slider_GetIntValue Control_Slider_GetIntValue; + GUIControl_Slider_SetIntInterval Control_Slider_SetIntInterval; + GUIControl_Slider_SetPercentage Control_Slider_SetPercentage; + GUIControl_Slider_GetPercentage Control_Slider_GetPercentage; + GUIControl_Slider_SetFloatRange Control_Slider_SetFloatRange; + GUIControl_Slider_SetFloatValue Control_Slider_SetFloatValue; + GUIControl_Slider_GetFloatValue Control_Slider_GetFloatValue; + GUIControl_Slider_SetFloatInterval Control_Slider_SetFloatInterval; + + GUIWindow_GetControl_SettingsSlider Window_GetControl_SettingsSlider; + GUIControl_SettingsSlider_SetVisible Control_SettingsSlider_SetVisible; + GUIControl_SettingsSlider_SetText Control_SettingsSlider_SetText; + GUIControl_SettingsSlider_GetDescription Control_SettingsSlider_GetDescription; + GUIControl_SettingsSlider_SetIntRange Control_SettingsSlider_SetIntRange; + GUIControl_SettingsSlider_SetIntValue Control_SettingsSlider_SetIntValue; + GUIControl_SettingsSlider_GetIntValue Control_SettingsSlider_GetIntValue; + GUIControl_SettingsSlider_SetIntInterval Control_SettingsSlider_SetIntInterval; + GUIControl_SettingsSlider_SetPercentage Control_SettingsSlider_SetPercentage; + GUIControl_SettingsSlider_GetPercentage Control_SettingsSlider_GetPercentage; + GUIControl_SettingsSlider_SetFloatRange Control_SettingsSlider_SetFloatRange; + GUIControl_SettingsSlider_SetFloatValue Control_SettingsSlider_SetFloatValue; + GUIControl_SettingsSlider_GetFloatValue Control_SettingsSlider_GetFloatValue; + GUIControl_SettingsSlider_SetFloatInterval Control_SettingsSlider_SetFloatInterval; + + GUIDialog_Keyboard_ShowAndGetInputWithHead Dialog_Keyboard_ShowAndGetInputWithHead; + GUIDialog_Keyboard_ShowAndGetInput Dialog_Keyboard_ShowAndGetInput; + GUIDialog_Keyboard_ShowAndGetNewPasswordWithHead Dialog_Keyboard_ShowAndGetNewPasswordWithHead; + GUIDialog_Keyboard_ShowAndGetNewPassword Dialog_Keyboard_ShowAndGetNewPassword; + GUIDialog_Keyboard_ShowAndVerifyNewPasswordWithHead Dialog_Keyboard_ShowAndVerifyNewPasswordWithHead; + GUIDialog_Keyboard_ShowAndVerifyNewPassword Dialog_Keyboard_ShowAndVerifyNewPassword; + GUIDialog_Keyboard_ShowAndVerifyPassword Dialog_Keyboard_ShowAndVerifyPassword; + GUIDialog_Keyboard_ShowAndGetFilter Dialog_Keyboard_ShowAndGetFilter; + GUIDialog_Keyboard_SendTextToActiveKeyboard Dialog_Keyboard_SendTextToActiveKeyboard; + GUIDialog_Keyboard_isKeyboardActivated Dialog_Keyboard_isKeyboardActivated; + + GUIDialog_Numeric_ShowAndVerifyNewPassword Dialog_Numeric_ShowAndVerifyNewPassword; + GUIDialog_Numeric_ShowAndVerifyPassword Dialog_Numeric_ShowAndVerifyPassword; + GUIDialog_Numeric_ShowAndVerifyInput Dialog_Numeric_ShowAndVerifyInput; + GUIDialog_Numeric_ShowAndGetTime Dialog_Numeric_ShowAndGetTime; + GUIDialog_Numeric_ShowAndGetDate Dialog_Numeric_ShowAndGetDate; + GUIDialog_Numeric_ShowAndGetIPAddress Dialog_Numeric_ShowAndGetIPAddress; + GUIDialog_Numeric_ShowAndGetNumber Dialog_Numeric_ShowAndGetNumber; + GUIDialog_Numeric_ShowAndGetSeconds Dialog_Numeric_ShowAndGetSeconds; + + GUIDialog_FileBrowser_ShowAndGetFile Dialog_FileBrowser_ShowAndGetFile; + + GUIDialog_OK_ShowAndGetInputSingleText Dialog_OK_ShowAndGetInputSingleText; + GUIDialog_OK_ShowAndGetInputLineText Dialog_OK_ShowAndGetInputLineText; + + GUIDialog_YesNo_ShowAndGetInputSingleText Dialog_YesNo_ShowAndGetInputSingleText; + GUIDialog_YesNo_ShowAndGetInputLineText Dialog_YesNo_ShowAndGetInputLineText; + GUIDialog_YesNo_ShowAndGetInputLineButtonText Dialog_YesNo_ShowAndGetInputLineButtonText; + + GUIDialog_TextViewer Dialog_TextViewer; + GUIDialog_Select Dialog_Select; +} CB_GUILib; + +class CAddonCallbacksGUI : public ADDON::IAddonInterface { public: - CAddonCallbacksGUI(CAddon* addon); - ~CAddonCallbacksGUI(); + CAddonCallbacksGUI(ADDON::CAddon* addon); + virtual ~CAddonCallbacksGUI(); + + static int APILevel() { return 1; } + static std::string Version() { return KODI_GUILIB_API_VERSION; } /**! \name General Functions */ CB_GUILib *GetCallbacks() { return m_callbacks; } @@ -179,94 +442,8 @@ public: private: CB_GUILib *m_callbacks; - CAddon *m_addon; -}; - -class CGUIAddonWindow : public CGUIMediaWindow -{ -friend class CAddonCallbacksGUI; - -public: - CGUIAddonWindow(int id, const std::string& strXML, CAddon* addon); - virtual ~CGUIAddonWindow(void); - - bool OnMessage(CGUIMessage& message) override; - bool OnAction(const CAction &action) override; - void AllocResources(bool forceLoad = false) override; - void FreeResources(bool forceUnLoad = false) override; - void Render() override; - void WaitForActionEvent(unsigned int timeout); - void PulseActionEvent(); - void AddItem(CFileItemPtr fileItem, int itemPosition); - void RemoveItem(int itemPosition); - void ClearList(); - CFileItemPtr GetListItem(int position); - int GetListSize(); - int GetCurrentListPosition(); - void SetCurrentListPosition(int item); - bool OnClick(int iItem, const std::string &player = "") override; - -protected: - void Update(); - void GetContextButtons(int itemNumber, CContextButtons &buttons) override; - void SetupShares() override; - - bool (*CBOnInit)(GUIHANDLE cbhdl); - bool (*CBOnFocus)(GUIHANDLE cbhdl, int controlId); - bool (*CBOnClick)(GUIHANDLE cbhdl, int controlId); - bool (*CBOnAction)(GUIHANDLE cbhdl, int); - - GUIHANDLE m_clientHandle; - const int m_iWindowId; - int m_iOldWindowId; - bool m_bModal; - bool m_bIsDialog; - -private: - CEvent m_actionEvent; - CAddon *m_addon; - std::string m_mediaDir; -}; - -class CGUIAddonWindowDialog : public CGUIAddonWindow -{ -public: - CGUIAddonWindowDialog(int id, const std::string& strXML, CAddon* addon); - virtual ~CGUIAddonWindowDialog(void); - - void Show(bool show = true); - virtual bool OnMessage(CGUIMessage &message); - virtual bool IsDialogRunning() const { return m_bRunning; } - virtual bool IsDialog() const { return true;}; - virtual bool IsModalDialog() const { return true; }; - virtual bool IsMediaWindow() const { return false; }; - - void Show_Internal(bool show = true); - -private: - bool m_bRunning; -}; - -class CGUIAddonRenderingControl : public IRenderingCallback -{ -friend class CAddonCallbacksGUI; -public: - CGUIAddonRenderingControl(CGUIRenderingControl *pControl); - virtual ~CGUIAddonRenderingControl() {} - virtual bool Create(int x, int y, int w, int h, void *device); - virtual void Render(); - virtual void Stop(); - virtual bool IsDirty(); - virtual void Delete(); -protected: - bool (*CBCreate) (GUIHANDLE cbhdl, int x, int y, int w, int h, void *device); - void (*CBRender)(GUIHANDLE cbhdl); - void (*CBStop)(GUIHANDLE cbhdl); - bool (*CBDirty)(GUIHANDLE cbhdl); - - GUIHANDLE m_clientHandle; - CGUIRenderingControl *m_pControl; - int m_refCount; }; -}; /* namespace ADDON */ +}; /* namespace GUI */ +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIRenderingControl.cpp b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIRenderingControl.cpp new file mode 100644 index 0000000000..fcedd9ac93 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIRenderingControl.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2015-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 KODI; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "AddonGUIRenderingControl.h" + +#include "guilib/GUIRenderingControl.h" + +namespace V1 +{ +namespace KodiAPI +{ +namespace GUI +{ + +CGUIAddonRenderingControl::CGUIAddonRenderingControl(CGUIRenderingControl *pControl) + : CBCreate{nullptr}, + CBRender{nullptr}, + CBStop{nullptr}, + CBDirty{nullptr}, + m_clientHandle{nullptr}, + m_pControl{pControl}, + m_refCount{1} +{ } + +bool CGUIAddonRenderingControl::Create(int x, int y, int w, int h, void *device) +{ + if (CBCreate) + { + if (CBCreate(m_clientHandle, x, y, w, h, device)) + { + m_refCount++; + return true; + } + } + return false; +} + +void CGUIAddonRenderingControl::Render() +{ + if (CBRender) + { + CBRender(m_clientHandle); + } +} + +void CGUIAddonRenderingControl::Stop() +{ + if (CBStop) + { + CBStop(m_clientHandle); + } + m_refCount--; + if (m_refCount <= 0) + delete this; +} + +void CGUIAddonRenderingControl::Delete() +{ + m_refCount--; + if (m_refCount <= 0) + delete this; +} + +bool CGUIAddonRenderingControl::IsDirty() +{ + bool ret = true; + if (CBDirty) + { + ret = CBDirty(m_clientHandle); + } + return ret; +} + +}; /* namespace GUI */ +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIRenderingControl.h b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIRenderingControl.h new file mode 100644 index 0000000000..57207f2f52 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIRenderingControl.h @@ -0,0 +1,58 @@ +#pragma once +/* + * Copyright (C) 2015-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 KODI; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h" +#include "guilib/IRenderingCallback.h" + +class CGUIRenderingControl; + +namespace V1 +{ +namespace KodiAPI +{ +namespace GUI +{ + +class CGUIAddonRenderingControl : public IRenderingCallback +{ +friend class CAddonCallbacksGUI; +public: + CGUIAddonRenderingControl(CGUIRenderingControl *pControl); + virtual ~CGUIAddonRenderingControl() {} + virtual bool Create(int x, int y, int w, int h, void *device); + virtual void Render(); + virtual void Stop(); + virtual bool IsDirty(); + virtual void Delete(); +protected: + bool (*CBCreate) (GUIHANDLE cbhdl, int x, int y, int w, int h, void *device); + void (*CBRender)(GUIHANDLE cbhdl); + void (*CBStop)(GUIHANDLE cbhdl); + bool (*CBDirty)(GUIHANDLE cbhdl); + + GUIHANDLE m_clientHandle; + CGUIRenderingControl *m_pControl; + int m_refCount; +}; + +}; /* namespace GUI */ +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp new file mode 100644 index 0000000000..79b3d25865 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp @@ -0,0 +1,358 @@ +/* + * Copyright (C) 2015-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 KODI; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "AddonGUIWindow.h" + +#include "Application.h" +#include "FileItem.h" +#include "addons/Addon.h" +#include "guilib/GUIWindowManager.h" +#include "guilib/TextureManager.h" +#include "messaging/ApplicationMessenger.h" +#include "utils/log.h" +#include "utils/URIUtils.h" + +#define CONTROL_BTNVIEWASICONS 2 +#define CONTROL_BTNSORTBY 3 +#define CONTROL_BTNSORTASC 4 +#define CONTROL_LABELFILES 12 + +using namespace KODI::MESSAGING; +using namespace ADDON; + +namespace V1 +{ +namespace KodiAPI +{ +namespace GUI +{ + +CGUIAddonWindow::CGUIAddonWindow(int id, const std::string& strXML, CAddon* addon) + : CGUIMediaWindow(id, strXML.c_str()) + , CBOnInit{nullptr} + , CBOnFocus{nullptr} + , CBOnClick{nullptr} + , CBOnAction{nullptr} + , m_clientHandle{nullptr} + , m_iWindowId(id) + , m_iOldWindowId(0) + , m_bModal(false) + , m_bIsDialog(false) + , m_actionEvent(true) + , m_addon(addon) + +{ + m_loadType = LOAD_ON_GUI_INIT; +} + +CGUIAddonWindow::~CGUIAddonWindow(void) +{ +} + +bool CGUIAddonWindow::OnAction(const CAction &action) +{ + // Let addon decide whether it wants to hande action first + if (CBOnAction && CBOnAction(m_clientHandle, action.GetID())) + return true; + + return CGUIWindow::OnAction(action); +} + +bool CGUIAddonWindow::OnMessage(CGUIMessage& message) +{ + // TODO: We shouldn't be dropping down to CGUIWindow in any of this ideally. + // We have to make up our minds about what python should be doing and + // what this side of things should be doing + switch (message.GetMessage()) + { + case GUI_MSG_WINDOW_DEINIT: + { + return CGUIMediaWindow::OnMessage(message); + } + break; + + case GUI_MSG_WINDOW_INIT: + { + CGUIMediaWindow::OnMessage(message); + if (CBOnInit) + CBOnInit(m_clientHandle); + + return true; + } + break; + + case GUI_MSG_SETFOCUS: + { + if (m_viewControl.HasControl(message.GetControlId()) && m_viewControl.GetCurrentControl() != (int)message.GetControlId()) + { + m_viewControl.SetFocused(); + return true; + } + // check if our focused control is one of our category buttons + int iControl = message.GetControlId(); + if (CBOnFocus) + { + CBOnFocus(m_clientHandle, iControl); + } + } + break; + + case GUI_MSG_FOCUSED: + { + if (HasID(message.GetSenderId()) && CBOnFocus) + { + CBOnFocus(m_clientHandle, message.GetControlId()); + } + } + break; + + case GUI_MSG_CLICKED: + { + int iControl=message.GetSenderId(); + // Handle Sort/View internally. Scripters shouldn't use ID 2, 3 or 4. + if (iControl == CONTROL_BTNSORTASC) // sort asc + { + CLog::Log(LOGINFO, "WindowXML: Internal asc/dsc button not implemented"); + /*if (m_guiState.get()) + m_guiState->SetNextSortOrder(); + UpdateFileList();*/ + return true; + } + else if (iControl == CONTROL_BTNSORTBY) // sort by + { + CLog::Log(LOGINFO, "WindowXML: Internal sort button not implemented"); + /*if (m_guiState.get()) + m_guiState->SetNextSortMethod(); + UpdateFileList();*/ + return true; + } + + if (CBOnClick && iControl && iControl != (int)this->GetID()) + { + CGUIControl* controlClicked = (CGUIControl*)this->GetControl(iControl); + + // The old python way used to check list AND SELECITEM method or if its a button, checkmark. + // Its done this way for now to allow other controls without a python version like togglebutton to still raise a onAction event + if (controlClicked) // Will get problems if we the id is not on the window and we try to do GetControlType on it. So check to make sure it exists + { + if ((controlClicked->IsContainer() && (message.GetParam1() == ACTION_SELECT_ITEM || + message.GetParam1() == ACTION_MOUSE_LEFT_CLICK)) || + !controlClicked->IsContainer()) + { + if (CBOnClick(m_clientHandle, iControl)) + return true; + } + else if (controlClicked->IsContainer() && message.GetParam1() == ACTION_MOUSE_RIGHT_CLICK) + { +// PyXBMCAction* inf = new PyXBMCAction; +// inf->pObject = Action_FromAction(CAction(ACTION_CONTEXT_MENU)); +// inf->pCallbackWindow = pCallbackWindow; +// +// // aquire lock? +// PyXBMC_AddPendingCall(Py_XBMC_Event_OnAction, inf); +// PulseActionEvent(); + } + } + } + } + break; + } + + return CGUIMediaWindow::OnMessage(message); +} + +void CGUIAddonWindow::AllocResources(bool forceLoad /*= FALSE */) +{ + std::string tmpDir = URIUtils::GetDirectory(GetProperty("xmlfile").asString()); + std::string fallbackMediaPath; + URIUtils::GetParentPath(tmpDir, fallbackMediaPath); + URIUtils::RemoveSlashAtEnd(fallbackMediaPath); + m_mediaDir = fallbackMediaPath; + + //CLog::Log(LOGDEBUG, "CGUIPythonWindowXML::AllocResources called: %s", fallbackMediaPath.c_str()); + g_TextureManager.AddTexturePath(m_mediaDir); + CGUIMediaWindow::AllocResources(forceLoad); + g_TextureManager.RemoveTexturePath(m_mediaDir); +} + +void CGUIAddonWindow::FreeResources(bool forceUnLoad /*= FALSE */) +{ + CGUIMediaWindow::FreeResources(forceUnLoad); +} + +void CGUIAddonWindow::Render() +{ + g_TextureManager.AddTexturePath(m_mediaDir); + CGUIMediaWindow::Render(); + g_TextureManager.RemoveTexturePath(m_mediaDir); +} + +void CGUIAddonWindow::Update() +{ +} + +void CGUIAddonWindow::AddItem(CFileItemPtr fileItem, int itemPosition) +{ + if (itemPosition == -1 || itemPosition > m_vecItems->Size()) + { + m_vecItems->Add(fileItem); + } + else if (itemPosition < -1 && !(itemPosition-1 < m_vecItems->Size())) + { + m_vecItems->AddFront(fileItem,0); + } + else + { + m_vecItems->AddFront(fileItem,itemPosition); + } + m_viewControl.SetItems(*m_vecItems); + UpdateButtons(); +} + +void CGUIAddonWindow::RemoveItem(int itemPosition) +{ + m_vecItems->Remove(itemPosition); + m_viewControl.SetItems(*m_vecItems); + UpdateButtons(); +} + +int CGUIAddonWindow::GetCurrentListPosition() +{ + return m_viewControl.GetSelectedItem(); +} + +void CGUIAddonWindow::SetCurrentListPosition(int item) +{ + m_viewControl.SetSelectedItem(item); +} + +int CGUIAddonWindow::GetListSize() +{ + return m_vecItems->Size(); +} + +CFileItemPtr CGUIAddonWindow::GetListItem(int position) +{ + if (position < 0 || position >= m_vecItems->Size()) return CFileItemPtr(); + return m_vecItems->Get(position); +} + +void CGUIAddonWindow::ClearList() +{ + ClearFileItems(); + + m_viewControl.SetItems(*m_vecItems); + UpdateButtons(); +} + +void CGUIAddonWindow::GetContextButtons(int itemNumber, CContextButtons &buttons) +{ + // maybe on day we can make an easy way to do this context menu + // with out this method overriding the MediaWindow version, it will display 'Add to Favorites' +} + +void CGUIAddonWindow::WaitForActionEvent(unsigned int timeout) +{ + m_actionEvent.WaitMSec(timeout); + m_actionEvent.Reset(); +} + +void CGUIAddonWindow::PulseActionEvent() +{ + m_actionEvent.Set(); +} + +bool CGUIAddonWindow::OnClick(int iItem, const std::string &player) +{ + // Hook Over calling CGUIMediaWindow::OnClick(iItem) results in it trying to PLAY the file item + // which if its not media is BAD and 99 out of 100 times undesireable. + return false; +} + +// SetupShares(); +/* + CGUIMediaWindow::OnWindowLoaded() calls SetupShares() so override it +and just call UpdateButtons(); +*/ +void CGUIAddonWindow::SetupShares() +{ + UpdateButtons(); +} + +CGUIAddonWindowDialog::CGUIAddonWindowDialog(int id, const std::string& strXML, CAddon* addon) +: CGUIAddonWindow(id,strXML,addon) +{ + m_bRunning = false; + m_bIsDialog = true; +} + +CGUIAddonWindowDialog::~CGUIAddonWindowDialog(void) +{ +} + +bool CGUIAddonWindowDialog::OnMessage(CGUIMessage &message) +{ + if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT) + return CGUIWindow::OnMessage(message); + + return CGUIAddonWindow::OnMessage(message); +} + +void CGUIAddonWindowDialog::Show(bool show /* = true */) +{ + unsigned int iCount = g_graphicsContext.exit(); + CApplicationMessenger::GetInstance().SendMsg(TMSG_GUI_ADDON_DIALOG, 1, show ? 1 : 0, static_cast<void*>(this)); + g_graphicsContext.restore(iCount); +} + +void CGUIAddonWindowDialog::Show_Internal(bool show /* = true */) +{ + if (show) + { + m_bModal = true; + m_bRunning = true; + g_windowManager.RegisterDialog(this); + + // active this window... + CGUIMessage msg(GUI_MSG_WINDOW_INIT, 0, 0, WINDOW_INVALID, m_iWindowId); + OnMessage(msg); + + // this dialog is derived from GUiMediaWindow + // make sure it is rendered last + m_renderOrder = RENDER_ORDER_DIALOG; + while (m_bRunning && !g_application.m_bStop) + { + g_windowManager.ProcessRenderLoop(); + } + } + else // hide + { + m_bRunning = false; + + CGUIMessage msg(GUI_MSG_WINDOW_DEINIT,0,0); + OnMessage(msg); + + g_windowManager.RemoveDialog(GetID()); + } +} + +}; /* namespace GUI */ +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.h b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.h new file mode 100644 index 0000000000..8fb18b09f4 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.h @@ -0,0 +1,109 @@ +#pragma once +/* + * Copyright (C) 2015-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 KODI; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h" + +#include "windows/GUIMediaWindow.h" +#include "threads/Event.h" + +namespace ADDON +{ + class CAddon; +}; + +namespace V1 +{ +namespace KodiAPI +{ +namespace GUI +{ + +class CGUIAddonWindow : public CGUIMediaWindow +{ +friend class CAddonCallbacksGUI; + +public: + CGUIAddonWindow(int id, const std::string& strXML, ADDON::CAddon* addon); + virtual ~CGUIAddonWindow(void); + + bool OnMessage(CGUIMessage& message) override; + bool OnAction(const CAction &action) override; + void AllocResources(bool forceLoad = false) override; + void FreeResources(bool forceUnLoad = false) override; + void Render() override; + void WaitForActionEvent(unsigned int timeout); + void PulseActionEvent(); + void AddItem(CFileItemPtr fileItem, int itemPosition); + void RemoveItem(int itemPosition); + void ClearList(); + CFileItemPtr GetListItem(int position); + int GetListSize(); + int GetCurrentListPosition(); + void SetCurrentListPosition(int item); + bool OnClick(int iItem, const std::string &player = "") override; + +protected: + void Update(); + void GetContextButtons(int itemNumber, CContextButtons &buttons) override; + void SetupShares() override; + + bool (*CBOnInit)(GUIHANDLE cbhdl); + bool (*CBOnFocus)(GUIHANDLE cbhdl, int controlId); + bool (*CBOnClick)(GUIHANDLE cbhdl, int controlId); + bool (*CBOnAction)(GUIHANDLE cbhdl, int); + + GUIHANDLE m_clientHandle; + const int m_iWindowId; + int m_iOldWindowId; + bool m_bModal; + bool m_bIsDialog; + +private: + CEvent m_actionEvent; + ADDON::CAddon* m_addon; + std::string m_mediaDir; +}; + +/*\_____________________________________________________________________________ +\*/ + +class CGUIAddonWindowDialog : public CGUIAddonWindow +{ +public: + CGUIAddonWindowDialog(int id, const std::string& strXML, ADDON::CAddon* addon); + virtual ~CGUIAddonWindowDialog(void); + + void Show(bool show = true); + virtual bool OnMessage(CGUIMessage &message); + virtual bool IsDialogRunning() const { return m_bRunning; } + virtual bool IsDialog() const { return true;}; + virtual bool IsModalDialog() const { return true; }; + virtual bool IsMediaWindow() const { return false; }; + + void Show_Internal(bool show = true); + +private: + bool m_bRunning; +}; + +}; /* namespace GUI */ +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/GUI/CMakeLists.txt b/xbmc/addons/binary/interfaces/api1/GUI/CMakeLists.txt new file mode 100644 index 0000000000..947a320d53 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/GUI/CMakeLists.txt @@ -0,0 +1,13 @@ +set(SOURCES AddonCallbacksGUI.cpp + AddonGUIRenderingControl.cpp + AddonGUIWindow.cpp) + +set(HEADERS AddonCallbacksGUI.h + AddonGUIRenderingControl.h + AddonGUIWindow.h) + +core_add_library(api1AddonCallbacks_GUI) + +if(ENABLE_INTERNAL_FFMPEG) + add_dependencies(api1AddonCallbacks_GUI ffmpeg) +endif() diff --git a/xbmc/addons/binary/interfaces/api1/GUI/Makefile b/xbmc/addons/binary/interfaces/api1/GUI/Makefile new file mode 100644 index 0000000000..8832ee9694 --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/GUI/Makefile @@ -0,0 +1,9 @@ +SRCS=AddonCallbacksGUI.cpp \ + AddonGUIRenderingControl.cpp \ + AddonGUIWindow.cpp \ + +LIB=addon-callbacks-gui.a + +include ../../../../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) + diff --git a/xbmc/addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.cpp b/xbmc/addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.cpp index 19616aab48..a78e920540 100644 --- a/xbmc/addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.cpp +++ b/xbmc/addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.cpp @@ -18,18 +18,23 @@ * */ - +#include "addons/Addon.h" #include "AddonCallbacksInputStream.h" +using namespace ADDON; -namespace ADDON +namespace V1 +{ +namespace KodiAPI { -CAddonCallbacksInputStream::CAddonCallbacksInputStream(CAddon* addon) +namespace InputStream { - m_addon = addon; - m_callbacks = new CB_INPUTSTREAMLib; +CAddonCallbacksInputStream::CAddonCallbacksInputStream(ADDON::CAddon* addon) + : ADDON::IAddonInterface(addon, APILevel(), Version()), + m_callbacks(new CB_INPUTSTREAMLib) +{ m_callbacks->FreeDemuxPacket = InputStreamFreeDemuxPacket; m_callbacks->AllocateDemuxPacket = InputStreamAllocateDemuxPacket; } @@ -50,4 +55,7 @@ DemuxPacket* CAddonCallbacksInputStream::InputStreamAllocateDemuxPacket(void *ad return CDVDDemuxUtils::AllocateDemuxPacket(iDataSize); } -}; /* namespace ADDON */ +}; /* namespace InputStream */ + +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.h b/xbmc/addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.h index 7a4e6c9067..1da5d2497c 100644 --- a/xbmc/addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.h +++ b/xbmc/addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.h @@ -1,3 +1,4 @@ +#pragma once /* * Copyright (C) 2012-2016 Team XBMC * http://www.xbmc.org @@ -18,9 +19,17 @@ * */ -#pragma once - +#include "addons/binary/interfaces/AddonInterfaces.h" #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxUtils.h" +#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h" + +namespace V1 +{ +namespace KodiAPI +{ + +namespace InputStream +{ typedef void (*InputStreamFreeDemuxPacket)(void *addonData, DemuxPacket* pPacket); typedef DemuxPacket* (*InputStreamAllocateDemuxPacket)(void *addonData, int iDataSize); @@ -31,16 +40,13 @@ typedef struct CB_INPUTSTREAMLib InputStreamAllocateDemuxPacket AllocateDemuxPacket; } CB_INPUTSTREAMLib; -namespace ADDON -{ - class CAddon; -class CAddonCallbacksInputStream +class CAddonCallbacksInputStream : public ADDON::IAddonInterface { public: - CAddonCallbacksInputStream(CAddon* addon); - ~CAddonCallbacksInputStream(); + CAddonCallbacksInputStream(ADDON::CAddon* addon); + virtual ~CAddonCallbacksInputStream(); /*! * @return The callback table. @@ -64,7 +70,9 @@ public: private: CB_INPUTSTREAMLib* m_callbacks; /*!< callback addresses */ - CAddon* m_addon; /*!< the add-on */ }; -}; /* namespace ADDON */ +}; /* namespace InputStream */ + +}; /* namespace KoidAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/InputStream/CMakeLists.txt b/xbmc/addons/binary/interfaces/api1/InputStream/CMakeLists.txt new file mode 100644 index 0000000000..9d4139920f --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/InputStream/CMakeLists.txt @@ -0,0 +1,9 @@ +set(SOURCES AddonCallbacksInputStream.cpp) + +set(HEADERS AddonCallbacksInputStream.h) + +core_add_library(api1AddonCallbacks_InputStream) + +if(ENABLE_INTERNAL_FFMPEG) + add_dependencies(addons ffmpeg) +endif() diff --git a/xbmc/addons/binary/interfaces/api1/InputStream/Makefile b/xbmc/addons/binary/interfaces/api1/InputStream/Makefile new file mode 100644 index 0000000000..59a422a94d --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/InputStream/Makefile @@ -0,0 +1,7 @@ +SRCS=AddonCallbacksInputStream.cpp \ + +LIB=addon-callbacks-inputstream.a + +include ../../../../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) + diff --git a/xbmc/addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.cpp b/xbmc/addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.cpp index 63fb8c6f1b..903a91432b 100644 --- a/xbmc/addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.cpp +++ b/xbmc/addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -13,41 +14,46 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ -#include "Application.h" #include "AddonCallbacksPVR.h" -#include "events/EventLog.h" -#include "events/NotificationEvent.h" -#include "threads/SingleLock.h" -#include "utils/log.h" -#include "utils/StringUtils.h" -#include "dialogs/GUIDialogKaiToast.h" -#include "settings/Settings.h" +#include "Application.h" +#include "cores/VideoPlayer/DVDDemuxers/DVDDemuxUtils.h" +#include "dialogs/GUIDialogKaiToast.h" #include "epg/EpgContainer.h" +#include "events/EventLog.h" +#include "events/NotificationEvent.h" #include "pvr/PVRManager.h" +#include "pvr/addons/PVRClient.h" #include "pvr/channels/PVRChannelGroupsContainer.h" #include "pvr/channels/PVRChannelGroupInternal.h" -#include "pvr/addons/PVRClient.h" #include "pvr/recordings/PVRRecordings.h" #include "pvr/timers/PVRTimers.h" #include "pvr/timers/PVRTimerInfoTag.h" +#include "settings/Settings.h" +#include "utils/log.h" +#include "utils/StringUtils.h" +using namespace ADDON; using namespace PVR; using namespace EPG; -namespace ADDON +namespace V1 +{ +namespace KodiAPI { -CAddonCallbacksPVR::CAddonCallbacksPVR(CAddon* addon) +namespace PVR { - m_addon = addon; - m_callbacks = new CB_PVRLib; +CAddonCallbacksPVR::CAddonCallbacksPVR(CAddon* addon) + : ADDON::IAddonInterface(addon, APILevel(), Version()), + m_callbacks(new CB_PVRLib) +{ /* write XBMC PVR specific add-on function addresses to callback table */ m_callbacks->TransferEpgEntry = PVRTransferEpgEntry; m_callbacks->TransferChannelEntry = PVRTransferChannelEntry; @@ -76,14 +82,14 @@ CAddonCallbacksPVR::~CAddonCallbacksPVR() CPVRClient *CAddonCallbacksPVR::GetPVRClient(void *addonData) { - CAddonCallbacks *addon = static_cast<CAddonCallbacks *>(addonData); - if (!addon || !addon->GetHelperPVR()) + CAddonInterfaces *addon = static_cast<CAddonInterfaces *>(addonData); + if (!addon || !addon->PVRLib_GetHelper()) { CLog::Log(LOGERROR, "PVR - %s - called with a null pointer", __FUNCTION__); return NULL; } - return dynamic_cast<CPVRClient *>(addon->GetHelperPVR()->m_addon); + return dynamic_cast<CPVRClient *>(static_cast<CAddonCallbacksPVR*>(addon->PVRLib_GetHelper())->m_addon); } void CAddonCallbacksPVR::PVRTransferChannelGroup(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group) @@ -119,7 +125,7 @@ void CAddonCallbacksPVR::PVRTransferChannelGroupMember(void *addonData, const AD CLog::Log(LOGERROR, "PVR - %s - invalid handler data", __FUNCTION__); return; } - + CPVRClient *client = GetPVRClient(addonData); CPVRChannelGroup *group = static_cast<CPVRChannelGroup *>(handle->dataAddress); if (!member || !client || !group) @@ -465,4 +471,7 @@ void CAddonCallbacksPVR::PVREpgEventStateChange(void* addonData, EPG_TAG* tag, u } } -}; /* namespace ADDON */ +}; /* namespace PVR */ + +}; /* namespace KodiAPI */ +}; /* namespace V1 */ diff --git a/xbmc/addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.h b/xbmc/addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.h index 4b6a9917b9..a60cc50654 100644 --- a/xbmc/addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.h +++ b/xbmc/addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.h @@ -1,7 +1,8 @@ #pragma once /* * Copyright (C) 2012-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2015-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 @@ -14,12 +15,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see + * along with KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ -#include "AddonCallbacks.h" +#include "addons/binary/interfaces/AddonInterfaces.h" +#include "addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h" #include "addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h" namespace PVR @@ -29,6 +31,58 @@ namespace PVR namespace ADDON { + class CAddon; +}; + +namespace V1 +{ +namespace KodiAPI +{ +namespace PVR +{ + +typedef void (*PVRTransferEpgEntry)(void *userData, const ADDON_HANDLE handle, const EPG_TAG *epgentry); +typedef void (*PVRTransferChannelEntry)(void *userData, const ADDON_HANDLE handle, const PVR_CHANNEL *chan); +typedef void (*PVRTransferTimerEntry)(void *userData, const ADDON_HANDLE handle, const PVR_TIMER *timer); +typedef void (*PVRTransferRecordingEntry)(void *userData, const ADDON_HANDLE handle, const PVR_RECORDING *recording); +typedef void (*PVRAddMenuHook)(void *addonData, PVR_MENUHOOK *hook); +typedef void (*PVRRecording)(void *addonData, const char *Name, const char *FileName, bool On); +typedef void (*PVRTriggerChannelUpdate)(void *addonData); +typedef void (*PVRTriggerTimerUpdate)(void *addonData); +typedef void (*PVRTriggerRecordingUpdate)(void *addonData); +typedef void (*PVRTriggerChannelGroupsUpdate)(void *addonData); +typedef void (*PVRTriggerEpgUpdate)(void *addonData, unsigned int iChannelUid); + +typedef void (*PVRTransferChannelGroup)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group); +typedef void (*PVRTransferChannelGroupMember)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member); + +typedef void (*PVRFreeDemuxPacket)(void *addonData, DemuxPacket* pPacket); +typedef DemuxPacket* (*PVRAllocateDemuxPacket)(void *addonData, int iDataSize); + +typedef void (*PVRConnectionStateChange)(void* addonData, const char* strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage); +typedef void (*PVREpgEventStateChange)(void* addonData, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState); + +typedef struct CB_PVRLib +{ + PVRTransferEpgEntry TransferEpgEntry; + PVRTransferChannelEntry TransferChannelEntry; + PVRTransferTimerEntry TransferTimerEntry; + PVRTransferRecordingEntry TransferRecordingEntry; + PVRAddMenuHook AddMenuHook; + PVRRecording Recording; + PVRTriggerChannelUpdate TriggerChannelUpdate; + PVRTriggerTimerUpdate TriggerTimerUpdate; + PVRTriggerRecordingUpdate TriggerRecordingUpdate; + PVRTriggerChannelGroupsUpdate TriggerChannelGroupsUpdate; + PVRTriggerEpgUpdate TriggerEpgUpdate; + PVRFreeDemuxPacket FreeDemuxPacket; + PVRAllocateDemuxPacket AllocateDemuxPacket; + PVRTransferChannelGroup TransferChannelGroup; + PVRTransferChannelGroupMember TransferChannelGroupMember; + PVRConnectionStateChange ConnectionStateChange; + PVREpgEventStateChange EpgEventStateChange; +} CB_PVRLib; + struct EpgEventStateChange; /*! @@ -36,11 +90,14 @@ struct EpgEventStateChange; * * Also translates the addon's C structures to XBMC's C++ structures. */ -class CAddonCallbacksPVR +class CAddonCallbacksPVR : public ADDON::IAddonInterface { public: - CAddonCallbacksPVR(CAddon* addon); - ~CAddonCallbacksPVR(void); + CAddonCallbacksPVR(ADDON::CAddon* addon); + virtual ~CAddonCallbacksPVR(void); + + static int APILevel() { return 1; } + static std::string Version() { return XBMC_PVR_API_VERSION; } /*! * @return The callback table. @@ -179,11 +236,12 @@ public: static void PVREpgEventStateChange(void* addonData, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState); private: - static PVR::CPVRClient* GetPVRClient(void* addonData); + static ::PVR::CPVRClient* GetPVRClient(void* addonData); static void UpdateEpgEvent(const EpgEventStateChange &ch, bool bQueued); CB_PVRLib *m_callbacks; /*!< callback addresses */ - CAddon *m_addon; /*!< the addon */ }; -}; /* namespace ADDON */ +}; /* namespace PVR */ +}; /* namespace V1 */ +}; /* namespace PVRLIB */ diff --git a/xbmc/addons/binary/interfaces/api1/PVR/CMakeLists.txt b/xbmc/addons/binary/interfaces/api1/PVR/CMakeLists.txt new file mode 100644 index 0000000000..8c39b9b23f --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/PVR/CMakeLists.txt @@ -0,0 +1,9 @@ +set(SOURCES AddonCallbacksPVR.cpp) + +set(HEADERS AddonCallbacksPVR.h) + +core_add_library(api1AddonCallbacks_PVR) + +if(ENABLE_INTERNAL_FFMPEG) + add_dependencies(api1AddonCallbacks_PVR ffmpeg) +endif() diff --git a/xbmc/addons/binary/interfaces/api1/PVR/Makefile b/xbmc/addons/binary/interfaces/api1/PVR/Makefile new file mode 100644 index 0000000000..a3dedd1bff --- /dev/null +++ b/xbmc/addons/binary/interfaces/api1/PVR/Makefile @@ -0,0 +1,6 @@ +SRCS=AddonCallbacksPVR.cpp \ + +LIB=addon-callbacks-pvr.a + +include ../../../../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h index f541637f29..be3b93db85 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h @@ -311,11 +311,6 @@ public: * @param ratio the new sample rate ratio, calculated by ((double)desiredRate / (double)GetSampleRate()) */ virtual void SetResampleRatio(double Ratio); - - /** - * Sginal a clock change - */ - virtual void Discontinuity(); private: AEStreamHandle *m_StreamHandle; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h index e8d5ec76bd..c61665f2dd 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h @@ -86,6 +86,8 @@ typedef intptr_t ssize_t; #include <sys/stat.h> #endif +struct __stat64; + #ifdef LOG_DEBUG #undef LOG_DEBUG #endif diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp index d301feed8c..3f0b6c0826 100644 --- a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp +++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp @@ -22,6 +22,7 @@ #include "Application.h" #include "ActiveAEDSPAddon.h" #include "ActiveAEDSP.h" +#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h" #include "commons/Exception.h" #include "settings/AdvancedSettings.h" #include "settings/Settings.h" diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp index 9a3d7a3a7f..ad7b5059cb 100644 --- a/xbmc/guilib/GUIWindowManager.cpp +++ b/xbmc/guilib/GUIWindowManager.cpp @@ -139,7 +139,7 @@ #include "settings/dialogs/GUIDialogAudioDSPSettings.h" #include "peripherals/dialogs/GUIDialogPeripheralSettings.h" -#include "addons/AddonCallbacksGUI.h" +#include "addons/binary/interfaces/AddonInterfaces.h" using namespace PVR; using namespace PERIPHERALS; @@ -869,8 +869,8 @@ void CGUIWindowManager::OnApplicationMessage(ThreadMessage* pMsg) case TMSG_GUI_ADDON_DIALOG: { if (pMsg->lpVoid) - { // TODO: This is ugly - really these python dialogs should just be normal XBMC dialogs - static_cast<ADDON::CGUIAddonWindowDialog *>(pMsg->lpVoid)->Show_Internal(pMsg->param2 > 0); + { + ADDON::CAddonInterfaces::OnApplicationMessage(pMsg); } } break; diff --git a/xbmc/pvr/addons/PVRClient.cpp b/xbmc/pvr/addons/PVRClient.cpp index ddb32f9647..f51a67413a 100644 --- a/xbmc/pvr/addons/PVRClient.cpp +++ b/xbmc/pvr/addons/PVRClient.cpp @@ -19,6 +19,7 @@ */ #include "Application.h" +#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h" #include "epg/Epg.h" #include "messaging/ApplicationMessenger.h" #include "messaging/helpers/DialogHelper.h" |