diff -Nru kodi-visualization-waveform-2.0.1/appveyor.yml kodi-visualization-waveform-3.1.0/appveyor.yml --- kodi-visualization-waveform-2.0.1/appveyor.yml 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/appveyor.yml 2019-10-08 21:24:28.000000000 +0000 @@ -1,6 +1,6 @@ version: BuildNr.{build} -image: Visual Studio 2015 +image: Visual Studio 2017 shallow_clone: true @@ -10,18 +10,24 @@ app_id: visualization.waveform matrix: - - GENERATOR: "Visual Studio 14" + - GENERATOR: "Visual Studio 15" CONFIG: Release - - GENERATOR: "Visual Studio 14 Win64" + - GENERATOR: "Visual Studio 15 Win64" CONFIG: Release + - GENERATOR: "Visual Studio 15 Win64" + CONFIG: Release + WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.16299.0" + - GENERATOR: "Visual Studio 15 ARM" + CONFIG: Release + WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.16299.0" build_script: - cd .. - - git clone --depth=1 https://github.com/xbmc/xbmc.git + - git clone --branch Leia --depth=1 https://github.com/xbmc/xbmc.git - cd %app_id% - mkdir build - cd build - mkdir -p definition\%app_id% - echo %app_id% %APPVEYOR_BUILD_FOLDER% %APPVEYOR_REPO_COMMIT% > definition\%app_id%\%app_id%.txt - - cmake -T host=x64 -G "%GENERATOR%" -DADDONS_TO_BUILD=%app_id% -DCMAKE_BUILD_TYPE=%CONFIG% -DADDONS_DEFINITION_DIR=%APPVEYOR_BUILD_FOLDER%/build/definition -DADDON_SRC_PREFIX=../.. -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons + - cmake -T host=x64 -G "%GENERATOR%" %WINSTORE% -DADDONS_TO_BUILD=%app_id% -DCMAKE_BUILD_TYPE=%CONFIG% -DADDONS_DEFINITION_DIR=%APPVEYOR_BUILD_FOLDER%/build/definition -DADDON_SRC_PREFIX=../.. -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons - cmake --build . --config %CONFIG% --target %app_id% diff -Nru kodi-visualization-waveform-2.0.1/CMakeLists.txt kodi-visualization-waveform-3.1.0/CMakeLists.txt --- kodi-visualization-waveform-2.0.1/CMakeLists.txt 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/CMakeLists.txt 2019-10-08 21:24:28.000000000 +0000 @@ -1,10 +1,10 @@ +cmake_minimum_required(VERSION 3.5) project(visualization.waveform) -cmake_minimum_required(VERSION 2.6) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) find_package(Kodi REQUIRED) +find_package(glm REQUIRED) if(WIN32) set(SHADER_FILES src/DefaultVertexShader.hlsl @@ -32,34 +32,26 @@ endforeach(SHADER_FILE) add_custom_target(generate ALL DEPENDS ${SHADER_INCLUDES}) else() - find_package(OpenGL) - if(OPENGL_FOUND) - add_definitions(-DHAS_OPENGL) + if(APP_RENDER_SYSTEM STREQUAL "gl" OR NOT APP_RENDER_SYSTEM) + find_package(OpenGl REQUIRED) set(DEPLIBS ${OPENGL_LIBRARIES}) - set(WAVEFORM_SOURCES src/Main.cpp) - else() - find_package(OpenGLES2) - if(OPENGLES2_FOUND) - set(INCLUDES ${OPENGLES2_INCLUDE_DIR}) - add_definitions(-DHAS_GLES2) - set(WAVEFORM_SOURCES src/Main_gles.cpp - src/VisGUIShader.cpp - src/VisMatrixGLES.cpp - src/VisShader.cpp) - - set(WAVEFORM_HEADERS src/VisGUIShader.h - src/VisMatrixGLES.h - src/VisShader.h) - - set(DEPLIBS ${OPENGLES2_LIBRARIES}) - else() - message(FATAL_ERROR "No rendering API found. Bailing") - endif() + set(INCLUDES ${OPENGL_INCLUDE_DIR}) + add_definitions(${OPENGL_DEFINITIONS}) + elseif(APP_RENDER_SYSTEM STREQUAL "gles") + find_package(OpenGLES REQUIRED) + set(DEPLIBS ${OPENGLES_LIBRARIES}) + set(INCLUDES ${OPENGLES_INCLUDE_DIR}) + add_definitions(${OPENGLES_DEFINITIONS}) endif() + + set(WAVEFORM_SOURCES src/Main_gl.cpp) + + include_directories(${PROJECT_SOURCE_DIR}/lib) endif() include_directories(${INCLUDES} - ${KODI_INCLUDE_DIR}/..) # Hack way with "/..", need bigger Kodi cmake rework to match right include ways (becomes done in future) + ${GLM_INCLUDE_DIR} + ${KODI_INCLUDE_DIR}/..) # Hack way with "/..", need bigger Kodi cmake rework to match right include ways build_addon(visualization.waveform WAVEFORM DEPLIBS) diff -Nru kodi-visualization-waveform-2.0.1/debian/changelog kodi-visualization-waveform-3.1.0/debian/changelog --- kodi-visualization-waveform-2.0.1/debian/changelog 2018-03-12 17:06:34.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/debian/changelog 2013-05-31 22:59:22.000000000 +0000 @@ -1,9 +1,6 @@ -kodi-visualization-waveform (2.0.1-1~bionic) bionic; urgency=low +kodi-visualization-waveform (3.1.0-1~bionic) bionic; urgency=low - [ xbmc ] + [ kodi ] * autogenerated dummy changelog - [ wsnipex ] - * no upstream changelog available - - -- wsnipex Mon, 12 Mar 2018 18:06:34 +0100 + -- Nobody Sat, 01 Jun 2013 00:59:22 +0200 diff -Nru kodi-visualization-waveform-2.0.1/debian/changelog.in kodi-visualization-waveform-3.1.0/debian/changelog.in --- kodi-visualization-waveform-2.0.1/debian/changelog.in 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/debian/changelog.in 2013-05-31 22:59:22.000000000 +0000 @@ -1,7 +1,6 @@ kodi-visualization-waveform (#PACKAGEVERSION#-#TAGREV#~#DIST#) #DIST#; urgency=low - [ xbmc ] + [ kodi ] * autogenerated dummy changelog - -- Arne Morten Kvarving Sat, 01 Jun 2013 00:59:22 +0200 - + -- Nobody Sat, 01 Jun 2013 00:59:22 +0200 diff -Nru kodi-visualization-waveform-2.0.1/debian/changelog.tmp kodi-visualization-waveform-3.1.0/debian/changelog.tmp --- kodi-visualization-waveform-2.0.1/debian/changelog.tmp 2018-03-12 17:06:29.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/debian/changelog.tmp 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -kodi-visualization-waveform (2.0.1-1~#DIST#) #DIST#; urgency=low - - [ xbmc ] - * autogenerated dummy changelog - - -- Arne Morten Kvarving Sat, 01 Jun 2013 00:59:22 +0200 - diff -Nru kodi-visualization-waveform-2.0.1/debian/control kodi-visualization-waveform-3.1.0/debian/control --- kodi-visualization-waveform-2.0.1/debian/control 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/debian/control 2013-05-31 22:59:22.000000000 +0000 @@ -1,11 +1,12 @@ Source: kodi-visualization-waveform Priority: extra -Maintainer: Arne Morten Kvarving -Build-Depends: debhelper (>= 8.0.0), cmake, kodi-addon-dev, libkodiplatform-dev, - libgl1-mesa-dev, libglu1-mesa-dev -Standards-Version: 3.9.5 +Maintainer: Nobody +Build-Depends: debhelper (>= 9.0.0), cmake, kodi-addon-dev, + libgles2-mesa-dev [arm64 armhf], libgl1-mesa-dev [i386 amd64], + libglm-dev +Standards-Version: 4.1.2 Section: libs -Homepage: http://xbmc.org +Homepage: http://kodi.tv Package: kodi-visualization-waveform Section: libs diff -Nru kodi-visualization-waveform-2.0.1/debian/copyright kodi-visualization-waveform-3.1.0/debian/copyright --- kodi-visualization-waveform-2.0.1/debian/copyright 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/debian/copyright 2013-05-31 22:59:22.000000000 +0000 @@ -2,7 +2,7 @@ Upstream-Name: visualization.waveform Files: * -Copyright: 2005-2013 Team XBMC +Copyright: 2005-2019 Team Kodi License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ Files: debian/* Copyright: 2013 Arne Morten Kvarving 2013 wsnipex + 2005-2019 Team Kodi License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru kodi-visualization-waveform-2.0.1/debian/kodi-visualization-waveform.install kodi-visualization-waveform-3.1.0/debian/kodi-visualization-waveform.install --- kodi-visualization-waveform-2.0.1/debian/kodi-visualization-waveform.install 2018-03-12 17:06:29.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/debian/kodi-visualization-waveform.install 2013-05-31 22:59:22.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib -usr/share +usr/lib/* +usr/share/* diff -Nru kodi-visualization-waveform-2.0.1/depends/common/glm/flags.txt kodi-visualization-waveform-3.1.0/depends/common/glm/flags.txt --- kodi-visualization-waveform-2.0.1/depends/common/glm/flags.txt 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/depends/common/glm/flags.txt 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1 @@ +-DGLM_TEST_ENABLE_CXX_11=1 -DGLM_TEST_ENABLE=0 -DGLM_TEST_ENABLE_SIMD_SSE2=0 -DCMAKE_INSTALL_LIBDIR=lib diff -Nru kodi-visualization-waveform-2.0.1/depends/common/glm/glm.sha256 kodi-visualization-waveform-3.1.0/depends/common/glm/glm.sha256 --- kodi-visualization-waveform-2.0.1/depends/common/glm/glm.sha256 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/depends/common/glm/glm.sha256 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1 @@ +3a073eb8f3be07cee74481db0e1f78eda553b554941e405c863ab64de6a2e954 diff -Nru kodi-visualization-waveform-2.0.1/depends/common/glm/glm.txt kodi-visualization-waveform-3.1.0/depends/common/glm/glm.txt --- kodi-visualization-waveform-2.0.1/depends/common/glm/glm.txt 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/depends/common/glm/glm.txt 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1 @@ +glm https://github.com/g-truc/glm/archive/0.9.9.4.tar.gz diff -Nru kodi-visualization-waveform-2.0.1/depends/osx/glm/flags.txt kodi-visualization-waveform-3.1.0/depends/osx/glm/flags.txt --- kodi-visualization-waveform-2.0.1/depends/osx/glm/flags.txt 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/depends/osx/glm/flags.txt 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1 @@ +-DGLM_TEST_ENABLE_CXX_11=1 -DGLM_TEST_ENABLE=0 -DGLM_TEST_ENABLE_SIMD_SSE2=1 -DCMAKE_INSTALL_LIBDIR=lib diff -Nru kodi-visualization-waveform-2.0.1/depends/osx/glm/glm.sha256 kodi-visualization-waveform-3.1.0/depends/osx/glm/glm.sha256 --- kodi-visualization-waveform-2.0.1/depends/osx/glm/glm.sha256 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/depends/osx/glm/glm.sha256 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1 @@ +3a073eb8f3be07cee74481db0e1f78eda553b554941e405c863ab64de6a2e954 diff -Nru kodi-visualization-waveform-2.0.1/depends/osx/glm/glm.txt kodi-visualization-waveform-3.1.0/depends/osx/glm/glm.txt --- kodi-visualization-waveform-2.0.1/depends/osx/glm/glm.txt 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/depends/osx/glm/glm.txt 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1 @@ +glm https://github.com/g-truc/glm/archive/0.9.9.4.tar.gz diff -Nru kodi-visualization-waveform-2.0.1/FindDirectX.cmake kodi-visualization-waveform-3.1.0/FindDirectX.cmake --- kodi-visualization-waveform-2.0.1/FindDirectX.cmake 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/FindDirectX.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -# - Try to find DirectX SDK -# Once done this will define -# -# DIRECTX_FOUND - system has DirectX SDK -# DIRECTX_INCLUDE_DIR - the DirectX include directories -# DIRECTX_LIBRARIES - Link these to use DirectX SDK -# DIRECTX_D3D9_LIBRARY - Link this to use D3D9 -# DIRECTX_D3DX9_LIBRARY - Link this to use D3DX9 - -FIND_PATH(DIRECTX_INCLUDE_DIR d3d9.h PATHS - "$ENV{DXSDK_DIR}Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK*/Include" - "C:/apps_x86/Microsoft DirectX SDK*/Include" - "C:/apps/Microsoft DirectX SDK*/Include" - "C:/Program Files (x86)/Microsoft DirectX SDK*/Include" - "C:/Program Files/Microsoft DirectX SDK*/Include" - NO_DEFAULT_PATH -) -FIND_PATH(DIRECTX_INCLUDE_DIR d3d9.h) -GET_FILENAME_COMPONENT(DIRECTX_ROOT_DIR "${DIRECTX_INCLUDE_DIR}/.." ABSOLUTE) - -IF(CMAKE_CL_64) - SET(DIRECTX_LIBRARY_PATHS "${DIRECTX_ROOT_DIR}/Lib/x64") -ELSE() - SET(DIRECTX_LIBRARY_PATHS "${DIRECTX_ROOT_DIR}/Lib/x86" "${DIRECTX_ROOT_DIR}/Lib") -ENDIF() - -FIND_LIBRARY(DIRECTX_D3D9_LIBRARY d3d9 ${DIRECTX_LIBRARY_PATHS} NO_DEFAULT_PATH) -FIND_LIBRARY(DIRECTX_D3DX9_LIBRARY d3dx9 ${DIRECTX_LIBRARY_PATHS} NO_DEFAULT_PATH) -SET(DIRECTX_LIBRARIES ${DIRECTX_D3D9_LIBRARY} ${DIRECTX_D3DX9_LIBRARY}) - -# handle the QUIETLY and REQUIRED arguments and set DIRECTX_FOUND to TRUE if all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(DIRECTX DEFAULT_MSG DIRECTX_ROOT_DIR DIRECTX_LIBRARIES DIRECTX_INCLUDE_DIR) -MARK_AS_ADVANCED( - DIRECTX_INCLUDE_DIR - DIRECTX_D3D9_LIBRARY - DIRECTX_D3DX9_LIBRARY -) \ No newline at end of file diff -Nru kodi-visualization-waveform-2.0.1/FindOpenGl.cmake kodi-visualization-waveform-3.1.0/FindOpenGl.cmake --- kodi-visualization-waveform-2.0.1/FindOpenGl.cmake 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/FindOpenGl.cmake 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,41 @@ +#.rst: +# FindOpenGl +# ---------- +# Finds the FindOpenGl library +# +# This will define the following variables:: +# +# OPENGL_FOUND - system has OpenGl +# OPENGL_INCLUDE_DIRS - the OpenGl include directory +# OPENGL_LIBRARIES - the OpenGl libraries +# OPENGL_DEFINITIONS - the OpenGl definitions + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_OPENGL gl QUIET) +endif() + +if(NOT CORE_SYSTEM_NAME STREQUAL osx) + find_path(OPENGL_INCLUDE_DIR GL/gl.h + PATHS ${PC_OPENGL_gl_INCLUDEDIR}) + find_library(OPENGL_gl_LIBRARY NAMES GL + PATHS ${PC_OPENGL_gl_LIBDIR}) +else() + find_library(OPENGL_gl_LIBRARY NAMES OpenGL + PATHS ${CMAKE_OSX_SYSROOT}/System/Library + PATH_SUFFIXES Frameworks + NO_DEFAULT_PATH) + set(OPENGL_INCLUDE_DIR ${OPENGL_gl_LIBRARY}/Headers) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenGl + REQUIRED_VARS OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) + +if(OPENGL_FOUND) + set(OPENGL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) + set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY}) + set(OPENGL_DEFINITIONS -DHAS_GL=1) +endif() + +mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY) + diff -Nru kodi-visualization-waveform-2.0.1/FindOpenGLES2.cmake kodi-visualization-waveform-3.1.0/FindOpenGLES2.cmake --- kodi-visualization-waveform-2.0.1/FindOpenGLES2.cmake 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/FindOpenGLES2.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -# - Try to find OpenGLES2 -# Once done this will define -# -# OPENGLES2_FOUND - system has OpenGLES2 -# OPENGLES2_INCLUDE_DIR - the GLES2 include directory -# OPENGLES2_LIBRARIES - Link these to use OpenGLES2 - -find_package(PkgConfig) -if(PKG_CONFIG_FOUND) - pkg_check_modules(OpenGLES2 glesv2) -endif(PKG_CONFIG_FOUND) - -if(NOT OPENGLES2_FOUND) - if("${CORE_SYSTEM_NAME}" STREQUAL "ios") - find_library(OPENGLES2_gl_LIBRARY NAMES OpenGLES PATHS ${CMAKE_OSX_SYSROOT}/System/Library PATH_SUFFIXES Frameworks NO_DEFAULT_PATH) - set(OPENGLES2_INCLUDE_DIRS ${OPENGLES2_gl_LIBRARY}/Headers) - set(OPENGLES2_egl_LIBRARY ${OPENGLES2_gl_LIBRARY}) - else() - find_path(OPENGLES2_INCLUDE_DIRS GLES2/gl2.h) - find_library(OPENGLES2_gl_LIBRARY NAMES GLESv2) - find_library(OPENGLES2_egl_LIBRARY NAMES EGL) - endif() - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG - OPENGLES2_INCLUDE_DIRS OPENGLES2_gl_LIBRARY OPENGLES2_egl_LIBRARY) - - set(OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_egl_LIBRARY}) -endif(NOT OPENGLES2_FOUND) - -mark_as_advanced( - OPENGLES2_INCLUDE_DIRS - OPENGLES2_LIBRARIES - OPENGLES2_gl_LIBRARY - OPENGLES2_egl_LIBRARY -) diff -Nru kodi-visualization-waveform-2.0.1/FindOpenGLES.cmake kodi-visualization-waveform-3.1.0/FindOpenGLES.cmake --- kodi-visualization-waveform-2.0.1/FindOpenGLES.cmake 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/FindOpenGLES.cmake 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,54 @@ +#.rst: +# FindOpenGLES +# ------------ +# Finds the OpenGLES2 and OpenGLES3 library +# +# This will define the following variables: +# +# OPENGLES_FOUND - system has OpenGLES +# OPENGLES_INCLUDE_DIRS - the OpenGLES include directory +# OPENGLES_LIBRARIES - the OpenGLES libraries +# OPENGLES_DEFINITIONS - the OpenGLES definitions + +if(CORE_PLATFORM_NAME_LC STREQUAL rbpi) + set(_brcmprefix brcm) +endif() + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET) +endif() + +if(NOT CORE_SYSTEM_NAME STREQUAL darwin_embedded AND NOT CORE_SYSTEM_NAME STREQUAL ios) + find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h + PATHS ${PC_OPENGLES_INCLUDEDIR}) + find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2 + PATHS ${PC_OPENGLES_LIBDIR}) +else() + find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES + PATHS ${CMAKE_OSX_SYSROOT}/System/Library + PATH_SUFFIXES Frameworks + NO_DEFAULT_PATH) + set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers) +endif() + +find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenGLES + REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR) + +find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h + PATHS ${PC_OPENGLES_INCLUDEDIR}) + +if(OPENGLES_FOUND) + set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY}) + if(OPENGLES3_INCLUDE_DIR) + set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR} ${OPENGLES3_INCLUDE_DIR}) + set(OPENGLES_DEFINITIONS -DHAS_GLES=3) + mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES3_INCLUDE_DIR OPENGLES_gl_LIBRARY) + else() + set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR}) + set(OPENGLES_DEFINITIONS -DHAS_GLES=2) + mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY) + endif() +endif() diff -Nru kodi-visualization-waveform-2.0.1/.gitignore kodi-visualization-waveform-3.1.0/.gitignore --- kodi-visualization-waveform-2.0.1/.gitignore 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/.gitignore 2019-10-08 21:24:28.000000000 +0000 @@ -1,8 +1,17 @@ # build artifacts build/ -obj-x86_64-linux-gnu/ visualization.*/addon.xml +# Debian build files +debian/changelog +debian/files +debian/*.log +debian/*.substvars +debian/.debhelper/ +debian/tmp/ +debian/kodi-visualization-*/ +obj-x86_64-linux-gnu/ + # commonly used editors # vim *.swp @@ -26,5 +35,8 @@ # clion .idea/ -# KDev -*.kdev4 \ No newline at end of file +# to prevent add after a "git format-patch VALUE" and "git add ." call +/*.patch + +# to prevent add if project code opened by Visual Studio over CMake file +.vs/ diff -Nru kodi-visualization-waveform-2.0.1/Jenkinsfile kodi-visualization-waveform-3.1.0/Jenkinsfile --- kodi-visualization-waveform-2.0.1/Jenkinsfile 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/Jenkinsfile 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1 @@ +buildPlugin(version: "Leia") diff -Nru kodi-visualization-waveform-2.0.1/lib/kodi/gui/gl/GL.h kodi-visualization-waveform-3.1.0/lib/kodi/gui/gl/GL.h --- kodi-visualization-waveform-2.0.1/lib/kodi/gui/gl/GL.h 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/lib/kodi/gui/gl/GL.h 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2005-2019 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +//============================================================================== +/// +/// \defgroup cpp_kodi_gui_gl Kodi OpenGL helpers +/// \ingroup cpp_kodi_gui +/// \brief Auxiliary functions for Open GL +/// +/// This group includes help for definitions, functions, and classes for +/// OpenGL. +/// +/// To use OpenGL for your system, add the \ref GL.h "#include ". +/// +/// +///----------------------------------------------------------------------------- +/// +/// The \ref HAS_GL is declared if Open GL is required and \ref HAS_GLES if Open GL +/// Embedded Systems (ES) is required, with ES the version is additionally given +/// in the definition, this can be "2" or "3". +/// +/// +///----------------------------------------------------------------------------- +/// +/// Following \ref GL_TYPE_STRING define can be used, for example, to manage +/// different folders for GL and GLES and make the selection easier. +/// This are on OpenGL **"`GL`"** and on Open GL|ES **"`GLES`"**. +/// **Example:** +/// ~~~~~~~~~~~~~~~~~{.cpp} +/// kodi::GetAddonPath("resources/shaders/" GL_TYPE_STRING "/frag.glsl"); +/// ~~~~~~~~~~~~~~~~~ +/// +/// +///---------------------------------------------------------------------------- +/// +/// In addition, \ref BUFFER_OFFSET is declared in it which can be used to give an +/// offset on the array to GL. +/// **Example:** +/// ~~~~~~~~~~~~~~~~~{.cpp} +/// const struct PackedVertex { +/// float position[3]; // Position x, y, z +/// float color[4]; // Color r, g, b, a +/// } vertices[3] = { +/// { { -0.5f, -0.5f, 0.0f }, { 1.0f, 0.0f, 0.0f, 1.0f } }, +/// { { 0.5f, -0.5f, 0.0f }, { 0.0f, 1.0f, 0.0f, 1.0f } }, +/// { { 0.0f, 0.5f, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } } +/// }; +/// +/// glVertexAttribPointer(m_aPosition, 3, GL_FLOAT, GL_FALSE, sizeof(PackedVertex), BUFFER_OFFSET(offsetof(PackedVertex, position))); +/// glEnableVertexAttribArray(m_aPosition); +/// +/// glVertexAttribPointer(m_aColor, 4, GL_FLOAT, GL_FALSE, sizeof(PackedVertex), BUFFER_OFFSET(offsetof(PackedVertex, color))); +/// glEnableVertexAttribArray(m_aColor); +/// ~~~~~~~~~~~~~~~~~ + +#if HAS_GL + #define GL_TYPE_STRING "GL" + // always define GL_GLEXT_PROTOTYPES before include gl headers + #if !defined(GL_GLEXT_PROTOTYPES) + #define GL_GLEXT_PROTOTYPES + #endif + #if defined(TARGET_LINUX) + #include + #include + #elif defined(TARGET_FREEBSD) + #include + #elif defined(TARGET_DARWIN) + #include + #include + #elif defined(WIN32) + #error Use of GL under Windows is not possible + #endif +#elif HAS_GLES >= 2 + #define GL_TYPE_STRING "GLES" + #if defined(WIN32) + #error Use of GLES under Windows is not possible + #elif defined(TARGET_DARWIN) + #if HAS_GLES == 3 + #include + #include + #else + #include + #include + #endif + #else + #if HAS_GLES == 3 + #include + #include + #else + #include + #include + #endif + #endif +#endif + +#ifndef BUFFER_OFFSET +#define BUFFER_OFFSET(i) ((char *)nullptr + (i)) +#endif diff -Nru kodi-visualization-waveform-2.0.1/lib/kodi/gui/gl/Shader.h kodi-visualization-waveform-3.1.0/lib/kodi/gui/gl/Shader.h --- kodi-visualization-waveform-2.0.1/lib/kodi/gui/gl/Shader.h 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/lib/kodi/gui/gl/Shader.h 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,353 @@ +/* + * Copyright (C) 2005-2019 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "GL.h" + +#include +#include +#include + +#include +#include + +#define LOG_SIZE 1024 +#define GLchar char + +namespace kodi +{ + namespace gui + { + namespace gl + { + //======================================================================== + /// CShader - base class + class ATTRIBUTE_HIDDEN CShader + { + public: + CShader() = default; + virtual ~CShader() = default; + virtual bool Compile(const std::string& extraBegin = "", + const std::string& extraEnd = "") = 0; + virtual void Free() = 0; + virtual GLuint Handle() = 0; + + bool LoadSource(const std::string& file) + { + char buffer[16384]; + + kodi::vfs::CFile source; + if (!source.OpenFile(file)) + { + kodi::Log(ADDON_LOG_ERROR, "CShader::%s: Failed to open file '%s'", __FUNCTION__, file.c_str()); + return false; + } + size_t len = source.Read(buffer, sizeof(buffer)); + m_source.assign(buffer); + m_source[len] = 0; + source.Close(); + return true; + } + + bool OK() { return m_compiled; } + + protected: + std::string m_source; + std::string m_lastLog; + bool m_compiled = false; + }; + //------------------------------------------------------------------------ + + //======================================================================== + /// CVertexShader + class ATTRIBUTE_HIDDEN CVertexShader : public CShader + { + public: + CVertexShader() = default; + ~CVertexShader() override { Free(); } + + void Free() override + { + if (m_vertexShader) + glDeleteShader(m_vertexShader); + m_vertexShader = 0; + } + + bool Compile(const std::string& extraBegin = "", + const std::string& extraEnd = "") override + { + GLint params[4]; + + Free(); + + m_vertexShader = glCreateShader(GL_VERTEX_SHADER); + + GLsizei count = 0; + const char *sources[3]; + if (!extraBegin.empty()) + sources[count++] = extraBegin.c_str(); + if (!m_source.empty()) + sources[count++] = m_source.c_str(); + if (!extraEnd.empty()) + sources[count++] = extraEnd.c_str(); + + glShaderSource(m_vertexShader, count, sources, nullptr); + glCompileShader(m_vertexShader); + glGetShaderiv(m_vertexShader, GL_COMPILE_STATUS, params); + if (params[0] != GL_TRUE) + { + GLchar log[LOG_SIZE]; + glGetShaderInfoLog(m_vertexShader, LOG_SIZE, nullptr, log); + kodi::Log(ADDON_LOG_ERROR, "CVertexShader::%s: %s", __FUNCTION__, log); + fprintf(stderr, "CVertexShader::%s: %s\n", __FUNCTION__, log); + m_lastLog = log; + m_compiled = false; + } + else + { + GLchar log[LOG_SIZE]; + glGetShaderInfoLog(m_vertexShader, LOG_SIZE, nullptr, log); + m_lastLog = log; + m_compiled = true; + } + return m_compiled; + } + + GLuint Handle() override { return m_vertexShader; } + + protected: + GLuint m_vertexShader = 0; + }; + //------------------------------------------------------------------------ + + //======================================================================== + /// CPixelShader + class ATTRIBUTE_HIDDEN CPixelShader : public CShader + { + public: + CPixelShader() = default; + ~CPixelShader() { Free(); } + void Free() override + { + if (m_pixelShader) + glDeleteShader(m_pixelShader); + m_pixelShader = 0; + } + + bool Compile(const std::string& extraBegin = "", + const std::string& extraEnd = "") override + { + GLint params[4]; + + Free(); + + if (m_source.length()==0) + return true; + + m_pixelShader = glCreateShader(GL_FRAGMENT_SHADER); + + GLsizei count = 0; + const char *sources[3]; + if (!extraBegin.empty()) + sources[count++] = extraBegin.c_str(); + if (!m_source.empty()) + sources[count++] = m_source.c_str(); + if (!extraEnd.empty()) + sources[count++] = extraEnd.c_str(); + + glShaderSource(m_pixelShader, count, sources, 0); + glCompileShader(m_pixelShader); + glGetShaderiv(m_pixelShader, GL_COMPILE_STATUS, params); + if (params[0] != GL_TRUE) + { + GLchar log[LOG_SIZE]; + glGetShaderInfoLog(m_pixelShader, LOG_SIZE, nullptr, log); + kodi::Log(ADDON_LOG_ERROR, "CPixelShader::%s: %s", __FUNCTION__, log); + fprintf(stderr, "CPixelShader::%s: %s\n", __FUNCTION__, log); + m_lastLog = log; + m_compiled = false; + } + else + { + GLchar log[LOG_SIZE]; + glGetShaderInfoLog(m_pixelShader, LOG_SIZE, nullptr, log); + m_lastLog = log; + m_compiled = true; + } + return m_compiled; + } + + GLuint Handle() override { return m_pixelShader; } + + protected: + GLuint m_pixelShader = 0; + }; + //------------------------------------------------------------------------ + + //======================================================================== + /// CShaderProgram + class ATTRIBUTE_HIDDEN CShaderProgram + { + public: + CShaderProgram() = default; + CShaderProgram(const std::string &vert, const std::string &frag) + { + LoadShaderFiles(vert, frag); + } + + virtual ~CShaderProgram() + { + ShaderFree(); + } + + bool LoadShaderFiles(const std::string &vert, const std::string &frag) + { + if (!kodi::vfs::FileExists(vert) || !m_pVP.LoadSource(vert)) + { + kodi::Log(ADDON_LOG_ERROR, "%s: Failed to load '%s'", __func__, vert.c_str()); + return false; + } + + if (!kodi::vfs::FileExists(frag) || !m_pFP.LoadSource(frag)) + { + kodi::Log(ADDON_LOG_ERROR, "%s: Failed to load '%s'", __func__, frag.c_str()); + return false; + } + + return true; + } + + bool CompileAndLink(const std::string& vertexExtraBegin = "", + const std::string& vertexExtraEnd = "", + const std::string& fragmentExtraBegin = "", + const std::string& fragmentExtraEnd = "") + { + GLint params[4]; + + // free resources + ShaderFree(); + m_ok = false; + + // compiled vertex shader + if (!m_pVP.Compile(vertexExtraBegin, vertexExtraEnd)) + { + kodi::Log(ADDON_LOG_ERROR, "GL: Error compiling vertex shader"); + return false; + } + + // compile pixel shader + if (!m_pFP.Compile(fragmentExtraBegin, fragmentExtraEnd)) + { + m_pVP.Free(); + kodi::Log(ADDON_LOG_ERROR, "GL: Error compiling fragment shader"); + return false; + } + + // create program object + if (!(m_shaderProgram = glCreateProgram())) + { + kodi::Log(ADDON_LOG_ERROR, "CShaderProgram::%s: Failed to create GL program", __FUNCTION__); + ShaderFree(); + return false; + } + + // attach the vertex shader + glAttachShader(m_shaderProgram, m_pVP.Handle()); + glAttachShader(m_shaderProgram, m_pFP.Handle()); + + // link the program + glLinkProgram(m_shaderProgram); + glGetProgramiv(m_shaderProgram, GL_LINK_STATUS, params); + if (params[0] != GL_TRUE) + { + GLchar log[LOG_SIZE]; + glGetProgramInfoLog(m_shaderProgram, LOG_SIZE, nullptr, log); + kodi::Log(ADDON_LOG_ERROR, "CShaderProgram::%s: %s", __FUNCTION__, log); + fprintf(stderr, "CShaderProgram::%s: %s\n", __FUNCTION__, log); + ShaderFree(); + return false; + } + + m_validated = false; + m_ok = true; + OnCompiledAndLinked(); + return true; + } + + bool EnableShader() + { + if (ShaderOK()) + { + glUseProgram(m_shaderProgram); + if (OnEnabled()) + { + if (!m_validated) + { + // validate the program + GLint params[4]; + glValidateProgram(m_shaderProgram); + glGetProgramiv(m_shaderProgram, GL_VALIDATE_STATUS, params); + if (params[0] != GL_TRUE) + { + GLchar log[LOG_SIZE]; + glGetProgramInfoLog(m_shaderProgram, LOG_SIZE, nullptr, log); + kodi::Log(ADDON_LOG_ERROR, "CShaderProgram::%s: %s", __FUNCTION__, log); + fprintf(stderr, "CShaderProgram::%s: %s\n", __FUNCTION__, log); + } + m_validated = true; + } + return true; + } + else + { + glUseProgram(0); + return false; + } + return true; + } + return false; + } + + void DisableShader() + { + if (ShaderOK()) + { + glUseProgram(0); + OnDisabled(); + } + } + + ATTRIBUTE_FORCEINLINE bool ShaderOK() { return m_ok; } + ATTRIBUTE_FORCEINLINE CVertexShader& VertexShader() { return m_pVP; } + ATTRIBUTE_FORCEINLINE CPixelShader& PixelShader() { return m_pFP; } + ATTRIBUTE_FORCEINLINE GLuint ProgramHandle() { return m_shaderProgram; } + + virtual void OnCompiledAndLinked() {}; + virtual bool OnEnabled() { return false; }; + virtual void OnDisabled() {}; + + private: + void ShaderFree() + { + if (m_shaderProgram) + glDeleteProgram(m_shaderProgram); + m_shaderProgram = 0; + m_ok = false; + } + + CVertexShader m_pVP; + CPixelShader m_pFP; + GLuint m_shaderProgram = 0; + bool m_ok = false; + bool m_validated = false; + }; + //------------------------------------------------------------------------ + } /* namespace gl */ + } /* namespace gui */ +} /* namespace kodi */ diff -Nru kodi-visualization-waveform-2.0.1/README.md kodi-visualization-waveform-3.1.0/README.md --- kodi-visualization-waveform-2.0.1/README.md 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/README.md 2019-10-08 21:24:28.000000000 +0000 @@ -2,8 +2,8 @@ This is a [Kodi](http://kodi.tv) visualization addon. -[![Build Status](https://travis-ci.org/notspiff/visualization.waveform.svg?branch=master)](https://travis-ci.org/notspiff/visualization.waveform) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/notspiff/visualization.waveform?svg=true)](https://ci.appveyor.com/project/notspiff/visualization-waveform) +[![Build Status](https://travis-ci.org/xbmc/visualization.waveform.svg?branch=master)](https://travis-ci.org/xbmc/visualization.waveform) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/xbmc/visualization.waveform?svg=true)](https://ci.appveyor.com/project/xbmc/visualization-waveform) ## Build instructions @@ -16,8 +16,8 @@ The following instructions assume you will have built Kodi already in the `kodi-build` directory suggested by the README. -1. `git clone https://github.com/xbmc/xbmc.git` -2. `git clone https://github.com/notspiff/visualization.waveform.git` +1. `git clone --branch Leia https://github.com/xbmc/xbmc.git` +2. `git clone https://github.com/xbmc/visualization.waveform.git` 3. `cd visualization.waveform && mkdir build && cd build` 4. `cmake -DADDONS_TO_BUILD=visualization.waveform -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/kodi-build/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons` 5. `make` diff -Nru kodi-visualization-waveform-2.0.1/src/DefaultPixelShader.hlsl kodi-visualization-waveform-3.1.0/src/DefaultPixelShader.hlsl --- kodi-visualization-waveform-2.0.1/src/DefaultPixelShader.hlsl 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/DefaultPixelShader.hlsl 2019-10-08 21:24:28.000000000 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (C) 2005-2015 Team Kodi +* Copyright (C) 2005-2019 Team Kodi * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify @@ -13,7 +13,7 @@ * 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 * . * */ diff -Nru kodi-visualization-waveform-2.0.1/src/DefaultVertexShader.hlsl kodi-visualization-waveform-3.1.0/src/DefaultVertexShader.hlsl --- kodi-visualization-waveform-2.0.1/src/DefaultVertexShader.hlsl 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/DefaultVertexShader.hlsl 2019-10-08 21:24:28.000000000 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (C) 2005-2015 Team Kodi +* Copyright (C) 2005-2019 Team Kodi * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify @@ -13,7 +13,7 @@ * 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 * . * */ diff -Nru kodi-visualization-waveform-2.0.1/src/Main.cpp kodi-visualization-waveform-3.1.0/src/Main.cpp --- kodi-visualization-waveform-2.0.1/src/Main.cpp 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/Main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -/* - * Copyright (C) 2008-2013 Team XBMC - * http://xbmc.org - * - * 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 XBMC; see the file COPYING. If not, see - * . - * - */ - -// Waveform.vis -// A simple visualisation example by MrC - -#include -#include -#ifdef __APPLE__ -#include -#include -#else -#include -#include -#endif - -typedef struct { - int TopLeftX; - int TopLeftY; - int Width; - int Height; - int MinDepth; - int MaxDepth; -} D3D11_VIEWPORT; -typedef unsigned long D3DCOLOR; - -struct Vertex_t -{ - float x, y, z; - D3DCOLOR col; -}; - -class CVisualizationWaveForm - : public kodi::addon::CAddonBase, - public kodi::addon::CInstanceVisualization -{ -public: - CVisualizationWaveForm(); - virtual ~CVisualizationWaveForm(); - - virtual ADDON_STATUS Create() override; - virtual void Render() override; - virtual void AudioData(const float* audioData, int audioDataLength, float *freqData, int freqDataLength) override; - -private: - void* m_device; - float m_fWaveform[2][512]; - D3D11_VIEWPORT m_viewport; -}; - -CVisualizationWaveForm::CVisualizationWaveForm() -{ - m_device = nullptr; -} - -//-- Destroy ------------------------------------------------------------------ -// Do everything before unload of this add-on -// !!! Add-on master function !!! -//----------------------------------------------------------------------------- -CVisualizationWaveForm::~CVisualizationWaveForm() -{ -} - -//-- Create ------------------------------------------------------------------- -// Called on load. Addon should fully initalize or return error status -//----------------------------------------------------------------------------- -ADDON_STATUS CVisualizationWaveForm::Create() -{ - m_device = Device(); - m_viewport.TopLeftX = -1; - m_viewport.TopLeftY = -1; - m_viewport.Width = 2; - m_viewport.Height = 2; - m_viewport.MinDepth = 0; - m_viewport.MaxDepth = 1; - - return ADDON_STATUS_OK; -} - -//-- Audiodata ---------------------------------------------------------------- -// Called by XBMC to pass new audio data to the vis -//----------------------------------------------------------------------------- -void CVisualizationWaveForm::AudioData(const float* pAudioData, int iAudioDataLength, float *pFreqData, int iFreqDataLength) -{ - int ipos=0; - while (ipos < 512) - { - for (int i=0; i < iAudioDataLength; i+=2) - { - m_fWaveform[0][ipos] = pAudioData[i ]; // left channel - m_fWaveform[1][ipos] = pAudioData[i+1]; // right channel - ipos++; - if (ipos >= 512) break; - } - } -} - - -//-- Render ------------------------------------------------------------------- -// Called once per frame. Do all rendering here. -//----------------------------------------------------------------------------- -void CVisualizationWaveForm::Render() -{ - Vertex_t verts[512]; - - // Left channel - GLenum errcode; - glColor3f(1.0, 1.0, 1.0); - glDisable(GL_BLEND); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - glTranslatef(0,0,-1.0); - glBegin(GL_LINE_STRIP); - for (int i = 0; i < 256; i++) - { - verts[i].col = 0xffffffff; - verts[i].x = m_viewport.TopLeftX + ((i / 255.0f) * m_viewport.Width); - verts[i].y = m_viewport.TopLeftY + m_viewport.Height * 0.33f + (m_fWaveform[0][i] * m_viewport.Height * 0.15f); - verts[i].z = 1.0; - glVertex2f(verts[i].x, verts[i].y); - } - - glEnd(); - if ((errcode=glGetError())!=GL_NO_ERROR) { - printf("Houston, we have a GL problem: %s\n", gluErrorString(errcode)); - } - - // Right channel - glBegin(GL_LINE_STRIP); - for (int i = 0; i < 256; i++) - { - verts[i].col = 0xffffffff; - verts[i].x = m_viewport.TopLeftX + ((i / 255.0f) * m_viewport.Width); - verts[i].y = m_viewport.TopLeftY + m_viewport.Height * 0.66f + (m_fWaveform[1][i] * m_viewport.Height * 0.15f); - verts[i].z = 1.0; - glVertex2f(verts[i].x, verts[i].y); - } - - glEnd(); - glEnable(GL_BLEND); - - - glPopMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - - if ((errcode=glGetError())!=GL_NO_ERROR) { - printf("Houston, we have a GL problem: %s\n", gluErrorString(errcode)); - } -} - -ADDONCREATOR(CVisualizationWaveForm) diff -Nru kodi-visualization-waveform-2.0.1/src/Main_dx.cpp kodi-visualization-waveform-3.1.0/src/Main_dx.cpp --- kodi-visualization-waveform-2.0.1/src/Main_dx.cpp 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/Main_dx.cpp 2019-10-08 21:24:28.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (C) 2008-2013 Team XBMC - * http://xbmc.org + * Copyright (C) 2008-2019 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,7 +13,7 @@ * 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 * . * */ @@ -28,6 +28,9 @@ #include #include +#include +#include + using namespace DirectX; using namespace DirectX::PackedVector; @@ -56,37 +59,35 @@ public kodi::addon::CInstanceVisualization { public: - CVisualizationWaveForm(); - virtual ~CVisualizationWaveForm(); + CVisualizationWaveForm() = default; + ~CVisualizationWaveForm() override; - virtual ADDON_STATUS Create() override; - virtual void Render() override; - virtual void AudioData(const float* audioData, int audioDataLength, float *freqData, int freqDataLength) override; + ADDON_STATUS Create() override; + bool Start(int channels, int samplesPerSec, int bitsPerSample, std::string songName) override; + void Render() override; + void AudioData(const float* audioData, int audioDataLength, float *freqData, int freqDataLength) override; private: bool init_renderer_objs(); - ID3D11Device* m_device; - ID3D11DeviceContext* m_context; - ID3D11VertexShader* m_vShader; - ID3D11PixelShader* m_pShader; - ID3D11InputLayout* m_inputLayout; - ID3D11Buffer* m_vBuffer; - ID3D11Buffer* m_cViewPort; - float m_fWaveform[2][512]; + ID3D11Device* m_device = nullptr; + ID3D11DeviceContext* m_context = nullptr; + ID3D11VertexShader* m_vShader = nullptr; + ID3D11PixelShader* m_pShader = nullptr; + ID3D11InputLayout* m_inputLayout = nullptr; + ID3D11Buffer* m_vBuffer = nullptr; + ID3D11Buffer* m_cViewPort = nullptr; + float m_fWaveform[2][1024]; D3D11_VIEWPORT m_viewport; -}; + Vertex_t m_verts[1024 * 2]; -CVisualizationWaveForm::CVisualizationWaveForm() -{ - m_device = nullptr; - m_context = nullptr; - m_vShader = nullptr; - m_pShader = nullptr; - m_inputLayout = nullptr; - m_vBuffer = nullptr; - m_cViewPort = nullptr; -} + int m_usedLinePoints = 500; + glm::vec4 m_backgroundColor = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); + glm::vec4 m_lineColor = glm::vec4(0.5f, 0.5f, 0.5f, 1.0f); + bool m_ignoreResample = false; + + bool m_startOK = false; +}; //-- Destroy ------------------------------------------------------------------ // Do everything before unload of this add-on @@ -113,10 +114,10 @@ //----------------------------------------------------------------------------- ADDON_STATUS CVisualizationWaveForm::Create() { - m_viewport.TopLeftX = X(); - m_viewport.TopLeftY = Y(); - m_viewport.Width = Width(); - m_viewport.Height = Height(); + m_viewport.TopLeftX = static_cast(X()); + m_viewport.TopLeftY = static_cast(Y()); + m_viewport.Width = static_cast(Width()); + m_viewport.Height = static_cast(Height()); m_viewport.MinDepth = 0; m_viewport.MaxDepth = 1; m_context = (ID3D11DeviceContext*)Device(); @@ -127,70 +128,157 @@ return ADDON_STATUS_OK; } +//-- Start ------------------------------------------------------------------- +// Called on load. Addon should fully initalize or return error status +//----------------------------------------------------------------------------- +bool CVisualizationWaveForm::Start(int channels, int samplesPerSec, int bitsPerSample, std::string songName) +{ + (void)channels; + (void)samplesPerSec; + (void)bitsPerSample; + (void)songName; + + kodi::CheckSettingInt("points-per-line", m_usedLinePoints); + + // If lines are 0 use the old style from before + if (m_usedLinePoints == 0) + { + m_usedLinePoints = 250; + m_ignoreResample = true; + } + else + { + m_ignoreResample = false; + } + + kodi::CheckSettingFloat("line-red", m_lineColor.r); + kodi::CheckSettingFloat("line-green", m_lineColor.g); + kodi::CheckSettingFloat("line-blue", m_lineColor.b); + + kodi::CheckSettingFloat("bg-red", m_backgroundColor.r); + kodi::CheckSettingFloat("bg-green", m_backgroundColor.g); + kodi::CheckSettingFloat("bg-blue", m_backgroundColor.b); + if (m_backgroundColor.r != 0.0f || m_backgroundColor.g != 0.0f || m_backgroundColor.b != 0.0f) + m_backgroundColor.a = 1.0f; + else + m_backgroundColor.a = 0.0f; + + return true; +} + //-- Audiodata ---------------------------------------------------------------- -// Called by XBMC to pass new audio data to the vis +// Called by Kodi to pass new audio data to the vis //----------------------------------------------------------------------------- void CVisualizationWaveForm::AudioData(const float* pAudioData, int iAudioDataLength, float *pFreqData, int iFreqDataLength) { - int ipos=0; - while (ipos < 512) + (void)pFreqData; + (void)iFreqDataLength; + + int ipos = 0; + int length = iAudioDataLength; + int usedStep; + if (m_ignoreResample) { - for (int i=0; i < iAudioDataLength; i+=2) + usedStep = 2; + } + else + { + usedStep = (iAudioDataLength / m_usedLinePoints) & ~1; + usedStep = usedStep < 2 ? 2 : usedStep; + } + + while (ipos < m_usedLinePoints) + { + for (int i=0; i < length; i+=usedStep) { m_fWaveform[0][ipos] = pAudioData[i ]; // left channel m_fWaveform[1][ipos] = pAudioData[i+1]; // right channel ipos++; - if (ipos >= 512) break; + if (ipos >= m_usedLinePoints) + break; } } } - //-- Render ------------------------------------------------------------------- // Called once per frame. Do all rendering here. //----------------------------------------------------------------------------- void CVisualizationWaveForm::Render() { - Vertex_t verts[512]; - + D3D11_MAPPED_SUBRESOURCE res; unsigned stride = sizeof(Vertex_t), offset = 0; m_context->IASetVertexBuffers(0, 1, &m_vBuffer, &stride, &offset); m_context->IASetInputLayout(m_inputLayout); - m_context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP); m_context->VSSetShader(m_vShader, 0, 0); m_context->VSSetConstantBuffers(0, 1, &m_cViewPort); m_context->PSSetShader(m_pShader, 0, 0); - float xcolor[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; + if (m_backgroundColor.a != 0.0f) + { + m_context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + + // Set background color + for (int i = 0; i < 5; i++) + m_verts[i].col = XMFLOAT4(glm::value_ptr(m_backgroundColor)); + m_verts[0].x = m_viewport.TopLeftX; + m_verts[0].y = m_viewport.TopLeftY; + m_verts[0].z = 1.0; + m_verts[1].x = m_viewport.TopLeftX; + m_verts[1].y = m_viewport.TopLeftY + m_viewport.Height; + m_verts[1].z = 1.0; + m_verts[2].x = m_viewport.TopLeftX + m_viewport.Width; + m_verts[2].y = m_viewport.TopLeftY + m_viewport.Height; + m_verts[2].z = 1.0; + m_verts[3].x = m_viewport.TopLeftX + m_viewport.Width; + m_verts[3].y = m_viewport.TopLeftY; + m_verts[3].z = 1.0; + m_verts[4].x = m_viewport.TopLeftX; + m_verts[4].y = m_viewport.TopLeftY; + m_verts[4].z = 1.0; + + // a little optimization: generate and send all vertecies for both channels + if (S_OK == m_context->Map(m_vBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res)) + { + memcpy(res.pData, m_verts, sizeof(Vertex_t) * 5); + m_context->Unmap(m_vBuffer, 0); + } + // draw background + m_context->Draw(5, 0); + } + + m_context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP); + + int j = 0; // Left channel - for (int i = 0; i < 256; i++) + for (int i = 0; i < m_usedLinePoints; i++) { - verts[i].col = XMFLOAT4(xcolor);; - verts[i].x = m_viewport.TopLeftX + ((i / 255.0f) * m_viewport.Width); - verts[i].y = m_viewport.TopLeftY + m_viewport.Height * 0.33f + (m_fWaveform[0][i] * m_viewport.Height * 0.15f); - verts[i].z = 1.0; + m_verts[j].col = XMFLOAT4(glm::value_ptr(m_lineColor)); + m_verts[j].x = m_viewport.TopLeftX + (-1.0f + ((i / float(m_usedLinePoints)) * 2.0f) * m_viewport.Width); + m_verts[j].y = m_viewport.TopLeftY + m_viewport.Height * 0.25f + (m_fWaveform[0][i] * m_viewport.Height * 0.3f); + m_verts[j].z = 1.0; + j++; } // Right channel - for (int i = 256; i < 512; i++) + for (int i = 0; i < m_usedLinePoints; i++) { - verts[i].col = XMFLOAT4(xcolor); - verts[i].x = m_viewport.TopLeftX + (((i - 256) / 255.0f) * m_viewport.Width); - verts[i].y = m_viewport.TopLeftY + m_viewport.Height * 0.66f + (m_fWaveform[1][i] * m_viewport.Height * 0.15f); - verts[i].z = 1.0; + m_verts[j].col = XMFLOAT4(glm::value_ptr(m_lineColor)); + m_verts[j].x = m_viewport.TopLeftX + (-1.0f + ((i / float(m_usedLinePoints)) * 2.0f) * m_viewport.Width); + m_verts[j].y = m_viewport.TopLeftY + m_viewport.Height * 0.75f + (m_fWaveform[1][i] * m_viewport.Height * 0.3f); + m_verts[j].z = 1.0; + j++; } // a little optimization: generate and send all vertecies for both channels - D3D11_MAPPED_SUBRESOURCE res; if (S_OK == m_context->Map(m_vBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res)) { - memcpy(res.pData, verts, sizeof(Vertex_t) * 512); + memcpy(res.pData, m_verts, sizeof(Vertex_t) * j); m_context->Unmap(m_vBuffer, 0); } // draw left channel - m_context->Draw(256, 0); + m_context->Draw(m_usedLinePoints, 0); // draw right channel - m_context->Draw(256, 256); + m_context->Draw(m_usedLinePoints, m_usedLinePoints); } bool CVisualizationWaveForm::init_renderer_objs() @@ -213,7 +301,7 @@ return false; // create buffers - CD3D11_BUFFER_DESC desc(sizeof(Vertex_t) * 512, D3D11_BIND_VERTEX_BUFFER, D3D11_USAGE_DYNAMIC, D3D11_CPU_ACCESS_WRITE); + CD3D11_BUFFER_DESC desc(sizeof(Vertex_t) * 1024 * 2, D3D11_BIND_VERTEX_BUFFER, D3D11_USAGE_DYNAMIC, D3D11_CPU_ACCESS_WRITE); if (S_OK != m_device->CreateBuffer(&desc, NULL, &m_vBuffer)) return false; diff -Nru kodi-visualization-waveform-2.0.1/src/Main_gl.cpp kodi-visualization-waveform-3.1.0/src/Main_gl.cpp --- kodi-visualization-waveform-2.0.1/src/Main_gl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/Main_gl.cpp 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,283 @@ +/* + * XMMS - Cross-platform multimedia player + * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies + * Copyright (C) 2008-2019 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 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + * Wed May 24 10:49:37 CDT 2000 + * Fixes to threading/context creation for the nVidia X4 drivers by + * Christian Zander + */ + +/* + * Ported to GLES by gimli + */ + +#include +#include + +#include +#include +#include + +#include +#include + +#define NUM_BANDS 16 + +#ifndef M_PI +#define M_PI 3.141592654f +#endif + +class ATTRIBUTE_HIDDEN CVisualizationWaveForm + : public kodi::addon::CAddonBase, + public kodi::addon::CInstanceVisualization, + public kodi::gui::gl::CShaderProgram +{ +public: + CVisualizationWaveForm() = default; + ~CVisualizationWaveForm() override = default; + + bool Start(int channels, int samplesPerSec, int bitsPerSample, std::string songName) override; + void Stop() override; + void Render() override; + bool IsDirty() override { return true; } + void AudioData(const float* audioData, int audioDataLength, float *freqData, int freqDataLength) override; + + void OnCompiledAndLinked() override; + bool OnEnabled() override; + +private: + float m_fWaveform[2][1024]; + + glm::mat4 m_modelProjMat; + +#ifdef HAS_GL + struct PackedVertex + { + glm::vec3 position; // Position x, y, z + glm::vec4 color; // Color r, g, b, a + } m_vertices[1024]; + + GLuint m_vertexVBO = 0; +#else + glm::vec3 m_position[1024]; // Position x, y, z + glm::vec4 m_color[1024]; // Color r, g, b, a +#endif + + GLint m_uModelProjMatrix = -1; + GLint m_aPosition = -1; + GLint m_aColor = -1; + + int m_usedLinePoints = 500; + glm::vec4 m_backgroundColor = glm::vec4(0.0f, 0.0f, 0.0f, 0.0f); + glm::vec4 m_lineColor = glm::vec4(0.5f, 0.5f, 0.5f, 1.0f); + bool m_ignoreResample = false; + + bool m_startOK = false; +}; + +//-- Start ------------------------------------------------------------------- +// Called on load. Addon should fully initalize or return error status +//----------------------------------------------------------------------------- +bool CVisualizationWaveForm::Start(int channels, int samplesPerSec, int bitsPerSample, std::string songName) +{ + (void)channels; + (void)samplesPerSec; + (void)bitsPerSample; + (void)songName; + + std::string fraqShader = kodi::GetAddonPath("resources/shaders/" GL_TYPE_STRING "/frag.glsl"); + std::string vertShader = kodi::GetAddonPath("resources/shaders/" GL_TYPE_STRING "/vert.glsl"); + if (!LoadShaderFiles(vertShader, fraqShader) || !CompileAndLink()) + { + kodi::Log(ADDON_LOG_ERROR, "Failed to create or compile shader"); + return false; + } + + kodi::CheckSettingInt("points-per-line", m_usedLinePoints); + + // If lines are 0 use the old style from before + if (m_usedLinePoints == 0) + { + m_usedLinePoints = 250; + m_ignoreResample = true; + } + else + { + m_ignoreResample = false; + } + + kodi::CheckSettingFloat("line-red", m_lineColor.r); + kodi::CheckSettingFloat("line-green", m_lineColor.g); + kodi::CheckSettingFloat("line-blue", m_lineColor.b); + + kodi::CheckSettingFloat("bg-red", m_backgroundColor.r); + kodi::CheckSettingFloat("bg-green", m_backgroundColor.g); + kodi::CheckSettingFloat("bg-blue", m_backgroundColor.b); + if (m_backgroundColor.r != 0.0f || m_backgroundColor.g != 0.0f || m_backgroundColor.b != 0.0f) + m_backgroundColor.a = 1.0f; + else + m_backgroundColor.a = 0.0f; + +#ifdef HAS_GL + glGenBuffers(1, &m_vertexVBO); + + for (int i = 0; i < m_usedLinePoints; i++) + m_vertices[i].color = m_lineColor; +#else + for (int i = 0; i < m_usedLinePoints; i++) + m_color[i] = m_lineColor; +#endif + + m_modelProjMat = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f ,0.0f ,-1.0f)); + m_modelProjMat = glm::rotate(m_modelProjMat, 0.0f, glm::vec3(1.0f, 0.0f, 0.0f)); + m_modelProjMat = glm::rotate(m_modelProjMat, 0.0f, glm::vec3(0.0f, 1.0f, 0.0f)); + m_modelProjMat = glm::rotate(m_modelProjMat, 0.0f, glm::vec3(0.0f, 0.0f, 1.0f)); + + m_startOK = true; + return true; +} + +void CVisualizationWaveForm::Stop() +{ + if (!m_startOK) + return; + + m_startOK = false; + +#ifdef HAS_GL + glBindBuffer(GL_ARRAY_BUFFER, 0); + glDeleteBuffers(1, &m_vertexVBO); + m_vertexVBO = 0; +#endif +} + +//-- Render ------------------------------------------------------------------- +// Called once per frame. Do all rendering here. +//----------------------------------------------------------------------------- +void CVisualizationWaveForm::Render() +{ + if (!m_startOK) + return; + +#ifdef HAS_GL + glBindBuffer(GL_ARRAY_BUFFER, m_vertexVBO); + + glVertexAttribPointer(m_aPosition, 3, GL_FLOAT, GL_FALSE, sizeof(PackedVertex), BUFFER_OFFSET(offsetof(PackedVertex, position))); + glEnableVertexAttribArray(m_aPosition); + + glVertexAttribPointer(m_aColor, 4, GL_FLOAT, GL_FALSE, sizeof(PackedVertex), BUFFER_OFFSET(offsetof(PackedVertex, color))); + glEnableVertexAttribArray(m_aColor); +#else + glVertexAttribPointer(m_aPosition, 3, GL_FLOAT, GL_FALSE, 0, m_position); + glEnableVertexAttribArray(m_aPosition); + + glVertexAttribPointer(m_aColor, 4, GL_FLOAT, GL_FALSE, 0, m_color); + glEnableVertexAttribArray(m_aColor); +#endif + + if (m_backgroundColor.a != 0.0f) + { + glClearColor(m_backgroundColor.r, m_backgroundColor.g, m_backgroundColor.b, m_backgroundColor.a); + glClear(GL_COLOR_BUFFER_BIT); + } + + glDisable(GL_BLEND); + + EnableShader(); + + // Left channel +#ifdef HAS_GL + for (int i = 0; i < m_usedLinePoints; i++) + m_vertices[i].position = glm::vec3(-1.0f + ((i / float(m_usedLinePoints)) * 2.0f), 0.5f + m_fWaveform[0][i] * 0.9f, 1.0f); + + glBufferData(GL_ARRAY_BUFFER, sizeof(m_vertices), m_vertices, GL_STATIC_DRAW); +#else + for (int i = 0; i < m_usedLinePoints; i++) + m_position[i] = glm::vec3(-1.0f + ((i / float(m_usedLinePoints)) * 2.0f), 0.5f + m_fWaveform[0][i] * 0.9f, 1.0f); +#endif + + glDrawArrays(GL_LINE_STRIP, 0, m_usedLinePoints); + + // Right channel +#ifdef HAS_GL + for (int i = 0; i < m_usedLinePoints; i++) + m_vertices[i].position = glm::vec3(-1.0f + ((i / float(m_usedLinePoints)) * 2.0f), -0.5f + m_fWaveform[1][i] * 0.9f, 1.0f); + + glBufferData(GL_ARRAY_BUFFER, sizeof(m_vertices), m_vertices, GL_STATIC_DRAW); +#else + for (int i = 0; i < m_usedLinePoints; i++) + m_position[i] = glm::vec3(-1.0f + ((i / float(m_usedLinePoints)) * 2.0f), -0.5f + m_fWaveform[1][i] * 0.9f, 1.0f); +#endif + + glDrawArrays(GL_LINE_STRIP, 0, m_usedLinePoints); + + DisableShader(); + + glDisableVertexAttribArray(m_aPosition); + glDisableVertexAttribArray(m_aColor); + + glEnable(GL_BLEND); +} + +void CVisualizationWaveForm::AudioData(const float* pAudioData, int iAudioDataLength, float *pFreqData, int iFreqDataLength) +{ + (void)pFreqData; + (void)iFreqDataLength; + + int ipos = 0; + int usedStep; + if (m_ignoreResample) + { + usedStep = 2; + } + else + { + usedStep = (iAudioDataLength / m_usedLinePoints) & ~1; + usedStep = usedStep < 2 ? 2 : usedStep; + } + while (ipos < m_usedLinePoints) + { + for (int i=0; i < iAudioDataLength; i+=usedStep) + { + m_fWaveform[0][ipos] = pAudioData[i ]; // left channel + m_fWaveform[1][ipos] = pAudioData[i+1]; // right channel + ipos++; + if (ipos >= m_usedLinePoints) + break; + } + } +} + +void CVisualizationWaveForm::OnCompiledAndLinked() +{ + m_uModelProjMatrix = glGetUniformLocation(ProgramHandle(), "u_modelViewProjectionMatrix"); + + m_aPosition = glGetAttribLocation(ProgramHandle(), "a_position"); + m_aColor = glGetAttribLocation(ProgramHandle(), "a_color"); +} + +bool CVisualizationWaveForm::OnEnabled() +{ + glUniformMatrix4fv(m_uModelProjMatrix, 1, GL_FALSE, glm::value_ptr(m_modelProjMat)); + return true; +} + +ADDONCREATOR(CVisualizationWaveForm) diff -Nru kodi-visualization-waveform-2.0.1/src/Main_gles.cpp kodi-visualization-waveform-3.1.0/src/Main_gles.cpp --- kodi-visualization-waveform-2.0.1/src/Main_gles.cpp 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/Main_gles.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,227 +0,0 @@ -/* XMMS - Cross-platform multimedia player - * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies - * - * 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 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* - * Wed May 24 10:49:37 CDT 2000 - * Fixes to threading/context creation for the nVidia X4 drivers by - * Christian Zander - */ - -/* - * Ported to GLES by gimli - */ - -#include -#include -#if defined(__APPLE__) - #include - #include -#else - #include - #include -#endif - -#include -#include "VisGUIShader.h" - -#define NUM_BANDS 16 - -#ifndef M_PI -#define M_PI 3.141592654f -#endif -#define DEG2RAD(d) ( (d) * M_PI/180.0f ) - -/*GLfloat x_angle = 20.0f, x_speed = 0.0f; -GLfloat y_angle = 45.0f, y_speed = 0.5f; -GLfloat z_angle = 0.0f, z_speed = 0.0f; -GLfloat heights[16][16], cHeights[16][16], scale; -GLfloat hSpeed = 0.025f; -GLenum g_mode = GL_TRIANGLES; -*/ - -const char *frag = "precision mediump float; \n" - "varying lowp vec4 m_colour; \n" - "void main () \n" - "{ \n" - " gl_FragColor = m_colour; \n" - "}\n"; - -const char *vert = "attribute vec4 m_attrpos;\n" - "attribute vec4 m_attrcol;\n" - "attribute vec4 m_attrcord0;\n" - "attribute vec4 m_attrcord1;\n" - "varying vec4 m_cord0;\n" - "varying vec4 m_cord1;\n" - "varying lowp vec4 m_colour;\n" - "uniform mat4 m_proj;\n" - "uniform mat4 m_model;\n" - "void main ()\n" - "{\n" - " mat4 mvp = m_proj * m_model;\n" - " gl_Position = mvp * m_attrpos;\n" - " m_colour = m_attrcol;\n" - " m_cord0 = m_attrcord0;\n" - " m_cord1 = m_attrcord1;\n" - "}\n"; - -class CVisualizationWaveForm - : public kodi::addon::CAddonBase, - public kodi::addon::CInstanceVisualization -{ -public: - CVisualizationWaveForm(); - virtual ~CVisualizationWaveForm(); - - virtual ADDON_STATUS Create() override; - virtual void Render() override; - virtual void AudioData(const float* audioData, int audioDataLength, float *freqData, int freqDataLength) override; - -private: - CVisGUIShader *m_visShader; - float m_fWaveform[2][512]; -}; - -CVisualizationWaveForm::CVisualizationWaveForm() - : m_visShader(new CVisGUIShader(vert, frag)) -{ - -} - -//-- Destroy ------------------------------------------------------------------ -// Do everything before unload of this add-on -// !!! Add-on master function !!! -//----------------------------------------------------------------------------- -CVisualizationWaveForm::~CVisualizationWaveForm() -{ - if (m_visShader) - { - m_visShader->Free(); - delete m_visShader; - } -} - -//-- Create ------------------------------------------------------------------- -// Called on load. Addon should fully initalize or return error status -//----------------------------------------------------------------------------- -ADDON_STATUS CVisualizationWaveForm::Create() -{ - if(!m_visShader->CompileAndLink()) - return ADDON_STATUS_UNKNOWN; - - return ADDON_STATUS_OK; -} - -//-- Render ------------------------------------------------------------------- -// Called once per frame. Do all rendering here. -//----------------------------------------------------------------------------- -void CVisualizationWaveForm::Render() -{ - GLfloat col[256][3]; - GLfloat ver[256][3]; - GLubyte idx[256]; - - glDisable(GL_BLEND); - - m_visShader->MatrixMode(MM_PROJECTION); - m_visShader->PushMatrix(); - m_visShader->LoadIdentity(); - //m_visShader->Frustum(-1.0f, 1.0f, -1.0f, 1.0f, 1.5f, 10.0f); - m_visShader->MatrixMode(MM_MODELVIEW); - m_visShader->PushMatrix(); - m_visShader->LoadIdentity(); - - m_visShader->PushMatrix(); - m_visShader->Translatef(0.0f ,0.0f ,-1.0f); - m_visShader->Rotatef(0.0f, 1.0f, 0.0f, 0.0f); - m_visShader->Rotatef(0.0f, 0.0f, 1.0f, 0.0f); - m_visShader->Rotatef(0.0f, 0.0f, 0.0f, 1.0f); - - m_visShader->Enable(); - - GLint posLoc = m_visShader->GetPosLoc(); - GLint colLoc = m_visShader->GetColLoc(); - - glVertexAttribPointer(colLoc, 3, GL_FLOAT, 0, 0, col); - glVertexAttribPointer(posLoc, 3, GL_FLOAT, 0, 0, ver); - - glEnableVertexAttribArray(posLoc); - glEnableVertexAttribArray(colLoc); - - for (int i = 0; i < 256; i++) - { - col[i][0] = 128; - col[i][1] = 128; - col[i][2] = 128; - //ver[i][0] = g_viewport.X + ((i / 255.0f) * g_viewport.Width); - //ver[i][1] = g_viewport.Y + g_viewport.Height * 0.33f + (m_fWaveform[0][i] * g_viewport.Height * 0.15f); - ver[i][0] = -1.0f + ((i / 255.0f) * 2.0f); - ver[i][1] = 0.5f + m_fWaveform[0][i]; - ver[i][2] = 1.0f; - idx[i] = i; - } - - glDrawElements(GL_LINE_STRIP, 256, GL_UNSIGNED_BYTE, idx); - - // Right channel - for (int i = 0; i < 256; i++) - { - col[i][0] = 128; - col[i][1] = 128; - col[i][2] = 128; - //ver[i][0] = g_viewport.X + ((i / 255.0f) * g_viewport.Width); - //ver[i][1] = g_viewport.Y + g_viewport.Height * 0.66f + (m_fWaveform[1][i] * g_viewport.Height * 0.15f); - ver[i][0] = -1.0f + ((i / 255.0f) * 2.0f); - ver[i][1] = -0.5f + m_fWaveform[1][i]; - ver[i][2] = 1.0f; - idx[i] = i; - - } - - glDrawElements(GL_LINE_STRIP, 256, GL_UNSIGNED_BYTE, idx); - - glDisableVertexAttribArray(posLoc); - glDisableVertexAttribArray(colLoc); - - m_visShader->Disable(); - - m_visShader->PopMatrix(); - - m_visShader->PopMatrix(); - m_visShader->MatrixMode(MM_PROJECTION); - m_visShader->PopMatrix(); - - glEnable(GL_BLEND); - -} - -void CVisualizationWaveForm::AudioData(const float* pAudioData, int iAudioDataLength, float *pFreqData, int iFreqDataLength) -{ - int ipos=0; - while (ipos < 512) - { - for (int i=0; i < iAudioDataLength; i+=2) - { - m_fWaveform[0][ipos] = pAudioData[i ]; // left channel - m_fWaveform[1][ipos] = pAudioData[i+1]; // right channel - ipos++; - if (ipos >= 512) break; - } - } -} - -ADDONCREATOR(CVisualizationWaveForm) diff -Nru kodi-visualization-waveform-2.0.1/src/VisGUIShader.cpp kodi-visualization-waveform-3.1.0/src/VisGUIShader.cpp --- kodi-visualization-waveform-2.0.1/src/VisGUIShader.cpp 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/VisGUIShader.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (C) 2005-2013 Team XBMC -* http://xbmc.org -* -* 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 XBMC; see the file COPYING. If not, see -* . -* -*/ - -#include "VisGUIShader.h" - -CVisGUIShader::CVisGUIShader(const char *vert, const char *frag ) : CVisGLSLShaderProgram(vert, frag) -{ - // Initialise values - m_hTex0 = 0; - m_hTex1 = 0; - m_hProj = 0; - m_hModel = 0; - m_hPos = 0; - m_hCol = 0; - m_hCord0 = 0; - m_hCord1 = 0; - - m_proj = NULL; - m_model = NULL; -} - -void CVisGUIShader::OnCompiledAndLinked() -{ - // This is called after CompileAndLink() - - // Variables passed directly to the Fragment shader - m_hTex0 = glGetUniformLocation(ProgramHandle(), "m_samp0"); - m_hTex1 = glGetUniformLocation(ProgramHandle(), "m_samp1"); - // Variables passed directly to the Vertex shader - m_hProj = glGetUniformLocation(ProgramHandle(), "m_proj"); - m_hModel = glGetUniformLocation(ProgramHandle(), "m_model"); - m_hPos = glGetAttribLocation(ProgramHandle(), "m_attrpos"); - m_hCol = glGetAttribLocation(ProgramHandle(), "m_attrcol"); - m_hCord0 = glGetAttribLocation(ProgramHandle(), "m_attrcord0"); - m_hCord1 = glGetAttribLocation(ProgramHandle(), "m_attrcord1"); - - // It's okay to do this only one time. Textures units never change. - glUseProgram( ProgramHandle() ); - glUniform1i(m_hTex0, 0); - glUniform1i(m_hTex1, 1); - glUseProgram( 0 ); -} - -bool CVisGUIShader::OnEnabled() -{ - // This is called after glUseProgram() - glUniformMatrix4fv(m_hProj, 1, GL_FALSE, GetMatrix(MM_PROJECTION)); - glUniformMatrix4fv(m_hModel, 1, GL_FALSE, GetMatrix(MM_MODELVIEW)); - - return true; -} - -void CVisGUIShader::Free() -{ - // Do Cleanup here - CVisShaderProgram::Free(); -} diff -Nru kodi-visualization-waveform-2.0.1/src/VisGUIShader.h kodi-visualization-waveform-3.1.0/src/VisGUIShader.h --- kodi-visualization-waveform-2.0.1/src/VisGUIShader.h 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/VisGUIShader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -#pragma once -/* -* Copyright (C) 2005-2013 Team XBMC -* http://xbmc.org -* -* 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 XBMC; see the file COPYING. If not, see -* . -* -*/ - -#include "VisShader.h" -#include "VisMatrixGLES.h" - -class CVisGUIShader : public CVisGLSLShaderProgram, public CVisMatrixGLES -{ -public: - CVisGUIShader(const char *vert, const char *frag); - - void OnCompiledAndLinked(); - bool OnEnabled(); - void Free(); - - GLint GetPosLoc() { return m_hPos; } - GLint GetColLoc() { return m_hCol; } - GLint GetCord0Loc() { return m_hCord0; } - GLint GetCord1Loc() { return m_hCord1; } - -protected: - GLint m_hTex0; - GLint m_hTex1; - GLint m_hProj; - GLint m_hModel; - GLint m_hPos; - GLint m_hCol; - GLint m_hCord0; - GLint m_hCord1; - - GLfloat *m_proj; - GLfloat *m_model; -}; diff -Nru kodi-visualization-waveform-2.0.1/src/VisMatrixGLES.cpp kodi-visualization-waveform-3.1.0/src/VisMatrixGLES.cpp --- kodi-visualization-waveform-2.0.1/src/VisMatrixGLES.cpp 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/VisMatrixGLES.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,369 +0,0 @@ -/* -* Copyright (C) 2005-2013 Team XBMC -* http://xbmc.org -* -* 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 XBMC; see the file COPYING. If not, see -* . -* -*/ - -#include "VisMatrixGLES.h" -#include - -#define MODE_WITHIN_RANGE(m) ((m >= 0) && (m < (int)MM_MATRIXSIZE)) - -CVisMatrixGLES::CVisMatrixGLES() -{ - for (unsigned int i=0; i < MM_MATRIXSIZE; i++) - { - m_matrices[i].push_back(MatrixWrapper()); - MatrixMode((EMATRIXMODE)i); - LoadIdentity(); - } - m_matrixMode = (EMATRIXMODE)-1; - m_pMatrix = NULL; -} - -CVisMatrixGLES::~CVisMatrixGLES() -{ -} - -GLfloat* CVisMatrixGLES::GetMatrix(EMATRIXMODE mode) -{ - if (MODE_WITHIN_RANGE(mode)) - { - if (!m_matrices[mode].empty()) - { - return m_matrices[mode].back(); - } - } - return NULL; -} - -void CVisMatrixGLES::MatrixMode(EMATRIXMODE mode) -{ - if (MODE_WITHIN_RANGE(mode)) - { - m_matrixMode = mode; - m_pMatrix = m_matrices[mode].back(); - } - else - { - m_matrixMode = (EMATRIXMODE)-1; - m_pMatrix = NULL; - } -} - -void CVisMatrixGLES::PushMatrix() -{ - if (m_pMatrix && MODE_WITHIN_RANGE(m_matrixMode)) - { - m_matrices[m_matrixMode].push_back(MatrixWrapper(m_pMatrix)); - m_pMatrix = m_matrices[m_matrixMode].back(); - } -} - -void CVisMatrixGLES::PopMatrix() -{ - if (MODE_WITHIN_RANGE(m_matrixMode)) - { - if (m_matrices[m_matrixMode].size() > 1) - { - m_matrices[m_matrixMode].pop_back(); - } - m_pMatrix = m_matrices[m_matrixMode].back(); - } -} - -void CVisMatrixGLES::LoadIdentity() -{ - if (m_pMatrix) - { - m_pMatrix[0] = 1.0f; m_pMatrix[4] = 0.0f; m_pMatrix[8] = 0.0f; m_pMatrix[12] = 0.0f; - m_pMatrix[1] = 0.0f; m_pMatrix[5] = 1.0f; m_pMatrix[9] = 0.0f; m_pMatrix[13] = 0.0f; - m_pMatrix[2] = 0.0f; m_pMatrix[6] = 0.0f; m_pMatrix[10] = 1.0f; m_pMatrix[14] = 0.0f; - m_pMatrix[3] = 0.0f; m_pMatrix[7] = 0.0f; m_pMatrix[11] = 0.0f; m_pMatrix[15] = 1.0f; - } -} - -void CVisMatrixGLES::Ortho(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) -{ - GLfloat u = 2.0f / (r - l); - GLfloat v = 2.0f / (t - b); - GLfloat w = -2.0f / (f - n); - GLfloat x = - (r + l) / (r - l); - GLfloat y = - (t + b) / (t - b); - GLfloat z = - (f + n) / (f - n); - GLfloat matrix[16] = { u, 0.0f, 0.0f, 0.0f, - 0.0f, v, 0.0f, 0.0f, - 0.0f, 0.0f, w, 0.0f, - x, y, z, 1.0f}; - MultMatrixf(matrix); -} - -void CVisMatrixGLES::Ortho2D(GLfloat l, GLfloat r, GLfloat b, GLfloat t) -{ - GLfloat u = 2.0f / (r - l); - GLfloat v = 2.0f / (t - b); - GLfloat x = - (r + l) / (r - l); - GLfloat y = - (t + b) / (t - b); - GLfloat matrix[16] = { u, 0.0f, 0.0f, 0.0f, - 0.0f, v, 0.0f, 0.0f, - 0.0f, 0.0f,-1.0f, 0.0f, - x, y, 0.0f, 1.0f}; - MultMatrixf(matrix); -} - -void CVisMatrixGLES::Frustum(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) -{ - GLfloat u = (2.0f * n) / (r - l); - GLfloat v = (2.0f * n) / (t - b); - GLfloat w = (r + l) / (r - l); - GLfloat x = (t + b) / (t - b); - GLfloat y = - (f + n) / (f - n); - GLfloat z = - (2.0f * f * n) / (f - n); - GLfloat matrix[16] = { u, 0.0f, 0.0f, 0.0f, - 0.0f, v, 0.0f, 0.0f, - w, x, y,-1.0f, - 0.0f, 0.0f, z, 0.0f}; - MultMatrixf(matrix); -} - -void CVisMatrixGLES::Translatef(GLfloat x, GLfloat y, GLfloat z) -{ - GLfloat matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - x, y, z, 1.0f}; - MultMatrixf(matrix); -} - -void CVisMatrixGLES::Scalef(GLfloat x, GLfloat y, GLfloat z) -{ - GLfloat matrix[16] = { x, 0.0f, 0.0f, 0.0f, - 0.0f, y, 0.0f, 0.0f, - 0.0f, 0.0f, z, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f}; - MultMatrixf(matrix); -} - -void CVisMatrixGLES::Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -{ - GLfloat modulous = sqrt((x*x)+(y*y)+(z*z)); - if (modulous != 0.0) - { - x /= modulous; - y /= modulous; - z /= modulous; - } - GLfloat cosine = cos(angle); - GLfloat sine = sin(angle); - GLfloat cos1 = 1 - cosine; - GLfloat a = (x*x*cos1) + cosine; - GLfloat b = (x*y*cos1) - (z*sine); - GLfloat c = (x*z*cos1) + (y*sine); - GLfloat d = (y*x*cos1) + (z*sine); - GLfloat e = (y*y*cos1) + cosine; - GLfloat f = (y*z*cos1) - (x*sine); - GLfloat g = (z*x*cos1) - (y*sine); - GLfloat h = (z*y*cos1) + (x*sine); - GLfloat i = (z*z*cos1) + cosine; - GLfloat matrix[16] = { a, d, g, 0.0f, - b, e, h, 0.0f, - c, f, i, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f}; - MultMatrixf(matrix); -} - -#if defined(__ARM_NEON__) && !defined(__arm64__) - -inline void Matrix4Mul(const float* src_mat_1, const float* src_mat_2, float* dst_mat) -{ - asm volatile ( - // Store A & B leaving room at top of registers for result (q0-q3) - "vldmia %1, { q4-q7 } \n\t" - "vldmia %2, { q8-q11 } \n\t" - - // result = first column of B x first row of A - "vmul.f32 q0, q8, d8[0]\n\t" - "vmul.f32 q1, q8, d10[0]\n\t" - "vmul.f32 q2, q8, d12[0]\n\t" - "vmul.f32 q3, q8, d14[0]\n\t" - - // result += second column of B x second row of A - "vmla.f32 q0, q9, d8[1]\n\t" - "vmla.f32 q1, q9, d10[1]\n\t" - "vmla.f32 q2, q9, d12[1]\n\t" - "vmla.f32 q3, q9, d14[1]\n\t" - - // result += third column of B x third row of A - "vmla.f32 q0, q10, d9[0]\n\t" - "vmla.f32 q1, q10, d11[0]\n\t" - "vmla.f32 q2, q10, d13[0]\n\t" - "vmla.f32 q3, q10, d15[0]\n\t" - - // result += last column of B x last row of A - "vmla.f32 q0, q11, d9[1]\n\t" - "vmla.f32 q1, q11, d11[1]\n\t" - "vmla.f32 q2, q11, d13[1]\n\t" - "vmla.f32 q3, q11, d15[1]\n\t" - - // output = result registers - "vstmia %2, { q0-q3 }" - : //no output - : "r" (dst_mat), "r" (src_mat_2), "r" (src_mat_1) // input - note *value* of pointer doesn't change - : "memory", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11" //clobber - ); -} -void CVisMatrixGLES::MultMatrixf(const GLfloat *matrix) -{ - if (m_pMatrix) - { - GLfloat m[16]; - Matrix4Mul(m_pMatrix, matrix, m); - } -} - -#else -void CVisMatrixGLES::MultMatrixf(const GLfloat *matrix) -{ - if (m_pMatrix) - { - GLfloat a = (matrix[0] * m_pMatrix[0]) + (matrix[1] * m_pMatrix[4]) + (matrix[2] * m_pMatrix[8]) + (matrix[3] * m_pMatrix[12]); - GLfloat b = (matrix[0] * m_pMatrix[1]) + (matrix[1] * m_pMatrix[5]) + (matrix[2] * m_pMatrix[9]) + (matrix[3] * m_pMatrix[13]); - GLfloat c = (matrix[0] * m_pMatrix[2]) + (matrix[1] * m_pMatrix[6]) + (matrix[2] * m_pMatrix[10]) + (matrix[3] * m_pMatrix[14]); - GLfloat d = (matrix[0] * m_pMatrix[3]) + (matrix[1] * m_pMatrix[7]) + (matrix[2] * m_pMatrix[11]) + (matrix[3] * m_pMatrix[15]); - GLfloat e = (matrix[4] * m_pMatrix[0]) + (matrix[5] * m_pMatrix[4]) + (matrix[6] * m_pMatrix[8]) + (matrix[7] * m_pMatrix[12]); - GLfloat f = (matrix[4] * m_pMatrix[1]) + (matrix[5] * m_pMatrix[5]) + (matrix[6] * m_pMatrix[9]) + (matrix[7] * m_pMatrix[13]); - GLfloat g = (matrix[4] * m_pMatrix[2]) + (matrix[5] * m_pMatrix[6]) + (matrix[6] * m_pMatrix[10]) + (matrix[7] * m_pMatrix[14]); - GLfloat h = (matrix[4] * m_pMatrix[3]) + (matrix[5] * m_pMatrix[7]) + (matrix[6] * m_pMatrix[11]) + (matrix[7] * m_pMatrix[15]); - GLfloat i = (matrix[8] * m_pMatrix[0]) + (matrix[9] * m_pMatrix[4]) + (matrix[10] * m_pMatrix[8]) + (matrix[11] * m_pMatrix[12]); - GLfloat j = (matrix[8] * m_pMatrix[1]) + (matrix[9] * m_pMatrix[5]) + (matrix[10] * m_pMatrix[9]) + (matrix[11] * m_pMatrix[13]); - GLfloat k = (matrix[8] * m_pMatrix[2]) + (matrix[9] * m_pMatrix[6]) + (matrix[10] * m_pMatrix[10]) + (matrix[11] * m_pMatrix[14]); - GLfloat l = (matrix[8] * m_pMatrix[3]) + (matrix[9] * m_pMatrix[7]) + (matrix[10] * m_pMatrix[11]) + (matrix[11] * m_pMatrix[15]); - GLfloat m = (matrix[12] * m_pMatrix[0]) + (matrix[13] * m_pMatrix[4]) + (matrix[14] * m_pMatrix[8]) + (matrix[15] * m_pMatrix[12]); - GLfloat n = (matrix[12] * m_pMatrix[1]) + (matrix[13] * m_pMatrix[5]) + (matrix[14] * m_pMatrix[9]) + (matrix[15] * m_pMatrix[13]); - GLfloat o = (matrix[12] * m_pMatrix[2]) + (matrix[13] * m_pMatrix[6]) + (matrix[14] * m_pMatrix[10]) + (matrix[15] * m_pMatrix[14]); - GLfloat p = (matrix[12] * m_pMatrix[3]) + (matrix[13] * m_pMatrix[7]) + (matrix[14] * m_pMatrix[11]) + (matrix[15] * m_pMatrix[15]); - m_pMatrix[0] = a; m_pMatrix[4] = e; m_pMatrix[8] = i; m_pMatrix[12] = m; - m_pMatrix[1] = b; m_pMatrix[5] = f; m_pMatrix[9] = j; m_pMatrix[13] = n; - m_pMatrix[2] = c; m_pMatrix[6] = g; m_pMatrix[10] = k; m_pMatrix[14] = o; - m_pMatrix[3] = d; m_pMatrix[7] = h; m_pMatrix[11] = l; m_pMatrix[15] = p; - } -} -#endif - -// gluLookAt implementation taken from Mesa3D -void CVisMatrixGLES::LookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, GLfloat centerx, GLfloat centery, GLfloat centerz, GLfloat upx, GLfloat upy, GLfloat upz) -{ - GLfloat forward[3], side[3], up[3]; - GLfloat m[4][4]; - - forward[0] = centerx - eyex; - forward[1] = centery - eyey; - forward[2] = centerz - eyez; - - up[0] = upx; - up[1] = upy; - up[2] = upz; - - GLfloat tmp = sqrt(forward[0]*forward[0] + forward[1]*forward[1] + forward[2]*forward[2]); - if (tmp != 0.0) - { - forward[0] /= tmp; - forward[1] /= tmp; - forward[2] /= tmp; - } - - side[0] = forward[1]*up[2] - forward[2]*up[1]; - side[1] = forward[2]*up[0] - forward[0]*up[2]; - side[2] = forward[0]*up[1] - forward[1]*up[0]; - - tmp = sqrt(side[0]*side[0] + side[1]*side[1] + side[2]*side[2]); - if (tmp != 0.0) - { - side[0] /= tmp; - side[1] /= tmp; - side[2] /= tmp; - } - - up[0] = side[1]*forward[2] - side[2]*forward[1]; - up[1] = side[2]*forward[0] - side[0]*forward[2]; - up[2] = side[0]*forward[1] - side[1]*forward[0]; - - m[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f; - m[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = 0.0f; - m[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = 0.0f; - m[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f; - - m[0][0] = side[0]; - m[1][0] = side[1]; - m[2][0] = side[2]; - - m[0][1] = up[0]; - m[1][1] = up[1]; - m[2][1] = up[2]; - - m[0][2] = -forward[0]; - m[1][2] = -forward[1]; - m[2][2] = -forward[2]; - - MultMatrixf(&m[0][0]); - Translatef(-eyex, -eyey, -eyez); -} - -static void __gluMultMatrixVecf(const GLfloat matrix[16], const GLfloat in[4], GLfloat out[4]) -{ - int i; - - for (i=0; i<4; i++) - { - out[i] = in[0] * matrix[0*4+i] + - in[1] * matrix[1*4+i] + - in[2] * matrix[2*4+i] + - in[3] * matrix[3*4+i]; - } -} - -// gluProject implementation taken from Mesa3D -bool CVisMatrixGLES::Project(GLfloat objx, GLfloat objy, GLfloat objz, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4], GLfloat* winx, GLfloat* winy, GLfloat* winz) -{ - GLfloat in[4]; - GLfloat out[4]; - - in[0]=objx; - in[1]=objy; - in[2]=objz; - in[3]=1.0; - __gluMultMatrixVecf(modelMatrix, in, out); - __gluMultMatrixVecf(projMatrix, out, in); - if (in[3] == 0.0) - return false; - in[0] /= in[3]; - in[1] /= in[3]; - in[2] /= in[3]; - /* Map x, y and z to range 0-1 */ - in[0] = in[0] * 0.5 + 0.5; - in[1] = in[1] * 0.5 + 0.5; - in[2] = in[2] * 0.5 + 0.5; - - /* Map x,y to viewport */ - in[0] = in[0] * viewport[2] + viewport[0]; - in[1] = in[1] * viewport[3] + viewport[1]; - - *winx=in[0]; - *winy=in[1]; - *winz=in[2]; - return true; -} diff -Nru kodi-visualization-waveform-2.0.1/src/VisMatrixGLES.h kodi-visualization-waveform-3.1.0/src/VisMatrixGLES.h --- kodi-visualization-waveform-2.0.1/src/VisMatrixGLES.h 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/VisMatrixGLES.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -#pragma once -/* -* Copyright (C) 2005-2013 Team XBMC -* http://xbmc.org -* -* 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 XBMC; see the file COPYING. If not, see -* . -* -*/ - -#if defined(TARGET_DARWIN) - #include - #include -#else - #include - #include -#endif - -#include -#include - -enum EMATRIXMODE -{ - MM_PROJECTION = 0, - MM_MODELVIEW, - MM_TEXTURE, - MM_MATRIXSIZE // Must be last! used for size of matrices -}; - -class CVisMatrixGLES -{ -public: - CVisMatrixGLES(); - ~CVisMatrixGLES(); - - GLfloat* GetMatrix(EMATRIXMODE mode); - - void MatrixMode(EMATRIXMODE mode); - void PushMatrix(); - void PopMatrix(); - void LoadIdentity(); - void Ortho(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); - void Ortho2D(GLfloat l, GLfloat r, GLfloat b, GLfloat t); - void Frustum(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); - void Translatef(GLfloat x, GLfloat y, GLfloat z); - void Scalef(GLfloat x, GLfloat y, GLfloat z); - void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); - void MultMatrixf(const GLfloat *matrix); - void LookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, GLfloat centerx, GLfloat centery, GLfloat centerz, GLfloat upx, GLfloat upy, GLfloat upz); - bool Project(GLfloat objx, GLfloat objy, GLfloat objz, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4], GLfloat* winx, GLfloat* winy, GLfloat* winz); - -protected: - - struct MatrixWrapper - { - MatrixWrapper(){}; - MatrixWrapper( const float values[16]) { memcpy(m_values,values,sizeof(m_values)); } - MatrixWrapper( const MatrixWrapper &rhs ) { memcpy(m_values, rhs.m_values, sizeof(m_values)); } - MatrixWrapper &operator=( const MatrixWrapper &rhs ) { memcpy(m_values, rhs.m_values, sizeof(m_values)); return *this;} - operator float*() { return m_values; } - operator const float*() const { return m_values; } - - float m_values[16]; - }; - - std::vector m_matrices[(int)MM_MATRIXSIZE]; - GLfloat *m_pMatrix; - EMATRIXMODE m_matrixMode; -}; diff -Nru kodi-visualization-waveform-2.0.1/src/VisShader.cpp kodi-visualization-waveform-3.1.0/src/VisShader.cpp --- kodi-visualization-waveform-2.0.1/src/VisShader.cpp 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/VisShader.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,221 +0,0 @@ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://xbmc.org - * - * 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 XBMC; see the file COPYING. If not, see - * . - * - */ - -#include "VisShader.h" -#include - -#define LOG_SIZE 1024 -#define GLchar char - -////////////////////////////////////////////////////////////////////// -// CShader -////////////////////////////////////////////////////////////////////// -bool CVisShader::LoadSource(const char *buffer) -{ - m_source = buffer; - return true; -} - -////////////////////////////////////////////////////////////////////// -// CVisGLSLVertexShader -////////////////////////////////////////////////////////////////////// - -bool CVisGLSLVertexShader::Compile() -{ - GLint params[4]; - - Free(); - - m_vertexShader = glCreateShader(GL_VERTEX_SHADER); - const char *ptr = m_source.c_str(); - glShaderSource(m_vertexShader, 1, &ptr, 0); - glCompileShader(m_vertexShader); - glGetShaderiv(m_vertexShader, GL_COMPILE_STATUS, params); - if (params[0]!=GL_TRUE) - { - GLchar log[LOG_SIZE]; - glGetShaderInfoLog(m_vertexShader, LOG_SIZE, NULL, log); - m_lastLog = log; - m_compiled = false; - } - else - { - GLchar log[LOG_SIZE]; - glGetShaderInfoLog(m_vertexShader, LOG_SIZE, NULL, log); - m_lastLog = log; - m_compiled = true; - } - return m_compiled; -} - -void CVisGLSLVertexShader::Free() -{ - if (m_vertexShader) - glDeleteShader(m_vertexShader); - m_vertexShader = 0; -} - -////////////////////////////////////////////////////////////////////// -// CVisGLSLPixelShader -////////////////////////////////////////////////////////////////////// -bool CVisGLSLPixelShader::Compile() -{ - GLint params[4]; - - Free(); - - // Pixel shaders are not mandatory. - if (m_source.length()==0) - return true; - - m_pixelShader = glCreateShader(GL_FRAGMENT_SHADER); - const char *ptr = m_source.c_str(); - glShaderSource(m_pixelShader, 1, &ptr, 0); - glCompileShader(m_pixelShader); - glGetShaderiv(m_pixelShader, GL_COMPILE_STATUS, params); - if (params[0]!=GL_TRUE) - { - GLchar log[LOG_SIZE]; - glGetShaderInfoLog(m_pixelShader, LOG_SIZE, NULL, log); - m_lastLog = log; - m_compiled = false; - } - else - { - GLchar log[LOG_SIZE]; - glGetShaderInfoLog(m_pixelShader, LOG_SIZE, NULL, log); - m_lastLog = log; - m_compiled = true; - } - return m_compiled; -} - -void CVisGLSLPixelShader::Free() -{ - if (m_pixelShader) - glDeleteShader(m_pixelShader); - m_pixelShader = 0; -} - -////////////////////////////////////////////////////////////////////// -// CVisGLSLShaderProgram -////////////////////////////////////////////////////////////////////// -void CVisGLSLShaderProgram::Free() -{ - m_pVP->Free(); - m_pFP->Free(); - if (m_shaderProgram) - glDeleteProgram(m_shaderProgram); - m_shaderProgram = 0; - m_ok = false; - m_lastProgram = 0; -} - -bool CVisGLSLShaderProgram::CompileAndLink() -{ - GLint params[4]; - - // free resources - Free(); - - // compiled vertex shader - if (!m_pVP->Compile()) - return false; - - // compile pixel shader - if (!m_pFP->Compile()) - { - m_pVP->Free(); - return false; - } - - // create program object - if (!(m_shaderProgram = glCreateProgram())) - goto error; - - // attach the vertex shader - glAttachShader(m_shaderProgram, m_pVP->Handle()); - - // if we have a pixel shader, attach it. If not, fixed pipeline - // will be used. - if (m_pFP->Handle()) - glAttachShader(m_shaderProgram, m_pFP->Handle()); - - // link the program - glLinkProgram(m_shaderProgram); - glGetProgramiv(m_shaderProgram, GL_LINK_STATUS, params); - if (params[0]!=GL_TRUE) - { - GLchar log[LOG_SIZE]; - glGetProgramInfoLog(m_shaderProgram, LOG_SIZE, NULL, log); - goto error; - } - - m_validated = false; - m_ok = true; - OnCompiledAndLinked(); - return true; - - error: - m_ok = false; - Free(); - return false; -} - -bool CVisGLSLShaderProgram::Enable() -{ - if (OK()) - { - glUseProgram(m_shaderProgram); - if (OnEnabled()) - { - if (!m_validated) - { - // validate the program - GLint params[4]; - glValidateProgram(m_shaderProgram); - glGetProgramiv(m_shaderProgram, GL_VALIDATE_STATUS, params); - if (params[0]!=GL_TRUE) - { - GLchar log[LOG_SIZE]; - glGetProgramInfoLog(m_shaderProgram, LOG_SIZE, NULL, log); - } - m_validated = true; - } - return true; - } - else - { - glUseProgram(0); - return false; - } - return true; - } - return false; -} - -void CVisGLSLShaderProgram::Disable() -{ - if (OK()) - { - glUseProgram(0); - OnDisabled(); - } -} diff -Nru kodi-visualization-waveform-2.0.1/src/VisShader.h kodi-visualization-waveform-3.1.0/src/VisShader.h --- kodi-visualization-waveform-2.0.1/src/VisShader.h 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/src/VisShader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ -#pragma once -/* - * Copyright (C) 2005-2013 Team XBMC - * http://xbmc.org - * - * 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 XBMC; see the file COPYING. If not, see - * . - * - */ - -#if defined(TARGET_DARWIN) -#include -#include -#else -#include -#include -#endif - -#include -#include - -////////////////////////////////////////////////////////////////////// -// CVisShader - base class -////////////////////////////////////////////////////////////////////// -class CVisShader -{ -public: - CVisShader() { m_compiled = false; } - virtual ~CVisShader() {} - virtual bool Compile() = 0; - virtual void Free() = 0; - virtual GLuint Handle() = 0; - virtual void SetSource(const char *src) { m_source = src; } - virtual bool LoadSource(const char *buffer); - bool OK() { return m_compiled; } - -protected: - std::string m_source; - std::string m_lastLog; - std::vector m_attr; - bool m_compiled; - -}; - - -////////////////////////////////////////////////////////////////////// -// CVisVertexShader - vertex shader class -////////////////////////////////////////////////////////////////////// -class CVisVertexShader : public CVisShader -{ -public: - CVisVertexShader() { m_vertexShader = 0; } - virtual ~CVisVertexShader() { Free(); } - virtual void Free() {} - virtual GLuint Handle() { return m_vertexShader; } - -protected: - GLuint m_vertexShader; -}; - -class CVisGLSLVertexShader : public CVisVertexShader -{ -public: - virtual void Free(); - virtual bool Compile(); -}; - -////////////////////////////////////////////////////////////////////// -// CVisPixelShader - abstract pixel shader class -////////////////////////////////////////////////////////////////////// -class CVisPixelShader : public CVisShader -{ -public: - CVisPixelShader() { m_pixelShader = 0; } - virtual ~CVisPixelShader() { Free(); } - virtual void Free() {} - virtual GLuint Handle() { return m_pixelShader; } - -protected: - GLuint m_pixelShader; -}; - - -class CVisGLSLPixelShader : public CVisPixelShader -{ -public: - virtual void Free(); - virtual bool Compile(); -}; - -////////////////////////////////////////////////////////////////////// -// CShaderProgram - the complete shader consisting of both the vertex -// and pixel programs. (abstract) -////////////////////////////////////////////////////////////////////// -class CVisShaderProgram -{ -public: - CVisShaderProgram() - { - m_ok = false; - m_shaderProgram = 0; - m_pFP = NULL; - m_pVP = NULL; - } - - virtual ~CVisShaderProgram() - { - Free(); - delete m_pFP; - delete m_pVP; - } - - // enable the shader - virtual bool Enable() = 0; - - // disable the shader - virtual void Disable() = 0; - - // returns true if shader is compiled and linked - bool OK() { return m_ok; } - - // free resources - virtual void Free() {} - - // return the vertex shader object - CVisVertexShader* VertexShader() { return m_pVP; } - - // return the pixel shader object - CVisPixelShader* PixelShader() { return m_pFP; } - - // compile and link the shaders - virtual bool CompileAndLink() = 0; - - // override to to perform custom tasks on successfull compilation - // and linkage. E.g. obtaining handles to shader attributes. - virtual void OnCompiledAndLinked() {} - - // override to to perform custom tasks before shader is enabled - // and after it is disabled. Return false in OnDisabled() to - // disable shader. - // E.g. setting attributes, disabling texture unites, etc - virtual bool OnEnabled() { return true; } - virtual void OnDisabled() { } - - virtual GLuint ProgramHandle() { return m_shaderProgram; } - -protected: - CVisVertexShader* m_pVP; - CVisPixelShader* m_pFP; - GLuint m_shaderProgram; - bool m_ok; -}; - - -class CVisGLSLShaderProgram - : virtual public CVisShaderProgram -{ -public: - CVisGLSLShaderProgram() - { - m_pFP = new CVisGLSLPixelShader(); - m_pVP = new CVisGLSLVertexShader(); - } - CVisGLSLShaderProgram(const char *vert, const char *frag) - { - m_pFP = new CVisGLSLPixelShader(); - m_pFP->LoadSource(frag); - m_pVP = new CVisGLSLVertexShader(); - m_pVP->LoadSource(vert); - } - - // enable the shader - virtual bool Enable(); - - // disable the shader - virtual void Disable(); - - // free resources - virtual void Free(); - - // compile and link the shaders - virtual bool CompileAndLink(); - -protected: - GLint m_lastProgram; - bool m_validated; -}; diff -Nru kodi-visualization-waveform-2.0.1/.travis.yml kodi-visualization-waveform-3.1.0/.travis.yml --- kodi-visualization-waveform-2.0.1/.travis.yml 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/.travis.yml 2019-10-08 21:24:28.000000000 +0000 @@ -3,8 +3,8 @@ # # Define the build matrix # -# Travis defaults to building on Ubuntu Precise when building on -# Linux. We need Trusty in order to get up to date versions of +# Travis defaults to building on Ubuntu Trusty when building on +# Linux. We need Xenial in order to get up to date versions of # cmake and g++. # env: @@ -14,26 +14,21 @@ matrix: include: - os: linux - dist: trusty + dist: xenial sudo: required compiler: gcc - os: linux - dist: trusty + dist: xenial sudo: required compiler: clang - os: osx - osx_image: xcode7.3 + osx_image: xcode9 - os: osx - osx_image: xcode6.4 + osx_image: xcode9.4 -# -# Some of the OS X images don't have cmake, contrary to what people -# on the Internet say -# before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which cmake || brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which cmake || brew install cmake ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew upgrade cmake || true; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev; fi # # The addon source is automatically checked out in $TRAVIS_BUILD_DIR, @@ -41,7 +36,7 @@ # before_script: - cd $TRAVIS_BUILD_DIR/.. - - git clone --depth=1 https://github.com/xbmc/xbmc.git + - git clone --branch Leia --depth=1 https://github.com/xbmc/xbmc.git - cd ${app_id} && mkdir build && cd build - mkdir -p definition/${app_id} - echo ${app_id} $TRAVIS_BUILD_DIR $TRAVIS_COMMIT > definition/${app_id}/${app_id}.txt diff -Nru kodi-visualization-waveform-2.0.1/visualization.waveform/addon.xml.in kodi-visualization-waveform-3.1.0/visualization.waveform/addon.xml.in --- kodi-visualization-waveform-2.0.1/visualization.waveform/addon.xml.in 2018-01-18 11:52:38.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/visualization.waveform/addon.xml.in 2019-10-08 21:24:28.000000000 +0000 @@ -1,7 +1,7 @@  @ADDON_DEPENDS@ @@ -117,5 +117,14 @@ Waveform 是一个简单的可视化效果,它在屏幕上显示两个波形图,分别与音乐左右声道的节拍相呼应。 Waveform是一個簡單的可在屏幕上顯示2波形圖的視覺效果,左右聲道會跟著音樂節拍移動 @PLATFORM@ + GPL-3.0 + https://github.com/xbmc/visualization.waveform + + resources/icon.png + resources/fanart.png + resources/screenshot-01.jpg + resources/fanart.png + resources/screenshot-02.jpg + Binary files /tmp/tmprbCYKX/6i7p_VkcKZ/kodi-visualization-waveform-2.0.1/visualization.waveform/icon.png and /tmp/tmprbCYKX/vhSN_y8hSd/kodi-visualization-waveform-3.1.0/visualization.waveform/icon.png differ Binary files /tmp/tmprbCYKX/6i7p_VkcKZ/kodi-visualization-waveform-2.0.1/visualization.waveform/resources/fanart.png and /tmp/tmprbCYKX/vhSN_y8hSd/kodi-visualization-waveform-3.1.0/visualization.waveform/resources/fanart.png differ Binary files /tmp/tmprbCYKX/6i7p_VkcKZ/kodi-visualization-waveform-2.0.1/visualization.waveform/resources/icon.png and /tmp/tmprbCYKX/vhSN_y8hSd/kodi-visualization-waveform-3.1.0/visualization.waveform/resources/icon.png differ diff -Nru kodi-visualization-waveform-2.0.1/visualization.waveform/resources/language/resource.language.en_gb/strings.po kodi-visualization-waveform-3.1.0/visualization.waveform/resources/language/resource.language.en_gb/strings.po --- kodi-visualization-waveform-2.0.1/visualization.waveform/resources/language/resource.language.en_gb/strings.po 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/visualization.waveform/resources/language/resource.language.en_gb/strings.po 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,103 @@ +# Kodi Media Center language file +# Addon Name: OpenGL Waveform +# Addon id: visualization.waveform +# Addon Provider: Team Kodi +msgid "" +msgstr "" +"Project-Id-Version: KODI Addons\n" +"Report-Msgid-Bugs-To: https://github.com/xbmc/visualization.waveform/issues\n" +"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Kodi Translation Team\n" +"Language-Team: English (https://www.transifex.com/teamxbmc/kodi-addons/language/en_GB/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#settings labels + +msgctxt "#30000" +msgid "Points per line" +msgstr "" + +msgctxt "#30001" +msgid "Positions to represent the current frequency in a line." +msgstr "" + +msgctxt "#30002" +msgid "Line color" +msgstr "" + +msgctxt "#30003" +msgid "Red" +msgstr "" + +msgctxt "#30004" +msgid "Strength of red color in the line" +msgstr "" + +msgctxt "#30005" +msgid "Green" +msgstr "" + +msgctxt "#30006" +msgid "Strength of green color in the line" +msgstr "" + +msgctxt "#30007" +msgid "Blue" +msgstr "" + +msgctxt "#30008" +msgid "Strength of blue color in the line" +msgstr "" + +msgctxt "#30009" +msgid "Alpha" +msgstr "" + +msgctxt "#30010" +msgid "Strength of alpha in the line" +msgstr "" + +msgctxt "#30011" +msgid "Background color" +msgstr "" + +msgctxt "#30012" +msgid "Red" +msgstr "" + +msgctxt "#30013" +msgid "Strength of red color in the background" +msgstr "" + +msgctxt "#30014" +msgid "Green" +msgstr "" + +msgctxt "#30015" +msgid "Strength of green color in the background" +msgstr "" + +msgctxt "#30016" +msgid "Blue" +msgstr "" + +msgctxt "#30017" +msgid "Strength of blue color in the background" +msgstr "" + +msgctxt "#30018" +msgid "Alpha" +msgstr "" + +msgctxt "#30019" +msgid "Strength of alpha in the background" +msgstr "" + +msgctxt "#30020" +msgid "Don't calculate" +msgstr "" Binary files /tmp/tmprbCYKX/6i7p_VkcKZ/kodi-visualization-waveform-2.0.1/visualization.waveform/resources/screenshot-01.jpg and /tmp/tmprbCYKX/vhSN_y8hSd/kodi-visualization-waveform-3.1.0/visualization.waveform/resources/screenshot-01.jpg differ Binary files /tmp/tmprbCYKX/6i7p_VkcKZ/kodi-visualization-waveform-2.0.1/visualization.waveform/resources/screenshot-02.jpg and /tmp/tmprbCYKX/vhSN_y8hSd/kodi-visualization-waveform-3.1.0/visualization.waveform/resources/screenshot-02.jpg differ diff -Nru kodi-visualization-waveform-2.0.1/visualization.waveform/resources/settings.xml kodi-visualization-waveform-3.1.0/visualization.waveform/resources/settings.xml --- kodi-visualization-waveform-2.0.1/visualization.waveform/resources/settings.xml 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/visualization.waveform/resources/settings.xml 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,75 @@ + +
+ + + + 500 + + 0 + 250 + 1000 + + + + + + + 0.5 + + 0.0 + 0.1 + 1.0 + + + + + 0.5 + + 0.0 + 0.1 + 1.0 + + + + + 0.5 + + 0.0 + 0.1 + 1.0 + + + + + + + 0.0 + + 0.0 + 0.1 + 1.0 + + + + + 0.0 + + 0.0 + 0.1 + 1.0 + + + + + 0.0 + + 0.0 + 0.1 + 1.0 + + + + + +
+
diff -Nru kodi-visualization-waveform-2.0.1/visualization.waveform/resources/shaders/GL/frag.glsl kodi-visualization-waveform-3.1.0/visualization.waveform/resources/shaders/GL/frag.glsl --- kodi-visualization-waveform-2.0.1/visualization.waveform/resources/shaders/GL/frag.glsl 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/visualization.waveform/resources/shaders/GL/frag.glsl 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,9 @@ +#version 150 + +in vec4 v_color; +out vec4 FragColor; + +void main() +{ + FragColor = v_color; +} diff -Nru kodi-visualization-waveform-2.0.1/visualization.waveform/resources/shaders/GL/vert.glsl kodi-visualization-waveform-3.1.0/visualization.waveform/resources/shaders/GL/vert.glsl --- kodi-visualization-waveform-2.0.1/visualization.waveform/resources/shaders/GL/vert.glsl 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/visualization.waveform/resources/shaders/GL/vert.glsl 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,14 @@ +#version 150 + +uniform mat4 u_modelViewProjectionMatrix; + +in vec4 a_position; +in vec4 a_color; + +out vec4 v_color; + +void main() +{ + gl_Position = u_modelViewProjectionMatrix * a_position; + v_color = a_color; +} diff -Nru kodi-visualization-waveform-2.0.1/visualization.waveform/resources/shaders/GLES/frag.glsl kodi-visualization-waveform-3.1.0/visualization.waveform/resources/shaders/GLES/frag.glsl --- kodi-visualization-waveform-2.0.1/visualization.waveform/resources/shaders/GLES/frag.glsl 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/visualization.waveform/resources/shaders/GLES/frag.glsl 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,10 @@ +#version 100 + +precision mediump float; + +varying vec4 v_color; + +void main() +{ + gl_FragColor = v_color; +} diff -Nru kodi-visualization-waveform-2.0.1/visualization.waveform/resources/shaders/GLES/vert.glsl kodi-visualization-waveform-3.1.0/visualization.waveform/resources/shaders/GLES/vert.glsl --- kodi-visualization-waveform-2.0.1/visualization.waveform/resources/shaders/GLES/vert.glsl 1970-01-01 00:00:00.000000000 +0000 +++ kodi-visualization-waveform-3.1.0/visualization.waveform/resources/shaders/GLES/vert.glsl 2019-10-08 21:24:28.000000000 +0000 @@ -0,0 +1,14 @@ +#version 100 + +uniform mat4 u_modelViewProjectionMatrix; + +attribute vec4 a_position; +attribute vec4 a_color; + +varying vec4 v_color; + +void main() +{ + gl_Position = u_modelViewProjectionMatrix * a_position; + v_color = a_color; +}