Skip to content

Commit

Permalink
Merge pull request #15 from AlwinEsch/Matrix-change
Browse files Browse the repository at this point in the history
[Matrix] API related update and improvements
  • Loading branch information
AlwinEsch authored Aug 5, 2020
2 parents fbcc3f0 + 74b8ed7 commit 250218e
Show file tree
Hide file tree
Showing 13 changed files with 501 additions and 331 deletions.
88 changes: 88 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<[a-z0-9_]+>$'
Priority: 3
- Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>$'
Priority: 3
- Regex: '^<'
Priority: 3
- Regex: '^["<](kodi|p8-platform)\/.*\.h[">]$'
Priority: 2
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60000
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
32 changes: 23 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ language: cpp
#
# 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:
Expand All @@ -21,19 +21,33 @@ matrix:
dist: xenial
sudo: required
compiler: clang
- os: linux
dist: bionic
sudo: required
compiler: gcc
env: DEBIAN_BUILD=true
- os: osx
osx_image: xcode10.2

before_install:
- if [[ $DEBIAN_BUILD == true ]]; then sudo add-apt-repository -y ppa:team-xbmc/xbmc-nightly; fi
- if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get update; fi
- if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get install fakeroot; fi

#
# The addon source is automatically checked out in $TRAVIS_BUILD_DIR,
# we'll put the Kodi source on the same level
#
before_script:
- cd $TRAVIS_BUILD_DIR/..
- git clone --branch master --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
- cmake -DADDONS_TO_BUILD=${app_id} -DADDON_SRC_PREFIX=$TRAVIS_BUILD_DIR/.. -DADDONS_DEFINITION_DIR=$TRAVIS_BUILD_DIR/build/definition -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/../xbmc/addons -DPACKAGE_ZIP=1 $TRAVIS_BUILD_DIR/../xbmc/cmake/addons
- if [[ $DEBIAN_BUILD != true ]]; then cd $TRAVIS_BUILD_DIR/..; fi
- if [[ $DEBIAN_BUILD != true ]]; then git clone --branch master --depth=1 https://github.com/xbmc/xbmc.git; fi
- if [[ $DEBIAN_BUILD != true ]]; then cd ${app_id} && mkdir build && cd build; fi
- if [[ $DEBIAN_BUILD != true ]]; then mkdir -p definition/${app_id}; fi
- if [[ $DEBIAN_BUILD != true ]]; then echo ${app_id} $TRAVIS_BUILD_DIR $TRAVIS_COMMIT > definition/${app_id}/${app_id}.txt; fi
- if [[ $DEBIAN_BUILD != true ]]; then cmake -DADDONS_TO_BUILD=${app_id} -DADDON_SRC_PREFIX=$TRAVIS_BUILD_DIR/.. -DADDONS_DEFINITION_DIR=$TRAVIS_BUILD_DIR/build/definition -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/../xbmc/addons -DPACKAGE_ZIP=1 $TRAVIS_BUILD_DIR/../xbmc/cmake/addons; fi
- if [[ $DEBIAN_BUILD == true ]]; then wget https://raw.githubusercontent.com/xbmc/xbmc/master/xbmc/addons/kodi-addon-dev-kit/tools/debian-addon-package-test.sh && chmod +x ./debian-addon-package-test.sh; fi
- if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get build-dep $TRAVIS_BUILD_DIR; fi

script: make
script:
- if [[ $DEBIAN_BUILD != true ]]; then make; fi
- if [[ $DEBIAN_BUILD == true ]]; then ./debian-addon-package-test.sh $TRAVIS_BUILD_DIR; fi
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ add_subdirectory(lib/psflib)
add_subdirectory(lib/viogsf)

set(GSF_SOURCES src/GSFCodec.cpp)
set(GSF_HEADERS src/GSFCodec.h)

set(DEPLIBS viogsf psflib ${ZLIB_LIBRARIES})

Expand Down
4 changes: 3 additions & 1 deletion audiodecoder.gsf/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="audiodecoder.gsf"
version="2.1.3"
version="3.0.0"
name="GSF Audio Decoder"
provider-name="spiff">
<requires>@ADDON_DEPENDS@</requires>
Expand All @@ -12,7 +12,9 @@
tags="true"
library_@PLATFORM@="@LIBRARY_FILENAME@"/>
<extension point="xbmc.addon.metadata">
<summary lang="de_DE">VIOGSF Audio Decoder</summary>
<summary lang="en_GB">VIOGSF Audio Decoder</summary>
<description lang="de_DE">GSF ist ein Addon für Kodi, mit dem Game Boy Advance-Musikdateien im GSF-Format (MINIGSF- und GSFLIB-Dateien) abgespielt werden können. Dieser Player basiert auf dem Visual Boy Advanced-Emulator, obwohl die Klangqualität mit Highly Advanced identisch zu sein scheint.</description>
<description lang="en_GB">GSF is a addon for Kodi which adds the ability to play Game Boy Advance music files, the GSF format (MINIGSF and GSFLIB files). This player is based on the Visual Boy Advanced emulator, although the sound quality appears to be identical to Highly Advanced.</description>
<platform>@PLATFORM@</platform>
<license>GPL-2.0-or-later</license>
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Build-Depends: debhelper (>= 9.0.0), cmake, kodi-addon-dev,
zlib1g-dev
Standards-Version: 4.1.2
Section: libs
Homepage: http://kodi.tv
Homepage: https://kodi.tv

Package: kodi-audiodecoder-gsf
Section: libs
Expand Down
7 changes: 2 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@
#export DH_VERBOSE=1

%:
dh $@
dh $@

override_dh_auto_configure:
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DUSE_LTO=1

override_dh_strip:
dh_strip --dbg-package=kodi-audiodecoder-gsf-dbg
dh_auto_configure -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=1 -DUSE_LTO=1

override_dh_installdocs:
dh_installdocs --link-doc=kodi-audiodecoder-gsf
2 changes: 1 addition & 1 deletion debian/source/format
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0 (quilt)
3.0 (native)
2 changes: 1 addition & 1 deletion lib/psflib/kodi-note.txt → lib/kodi-psflib-note.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
psflib source from https://github.com/kode54/psflib
Sync to 6cb3515
Sync to 38b1419 (28 Feb 2020)
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/psflib/psflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static int psf_load_internal(psf_load_state * state, const char * file_name)
strcat(full_path, file_name);
#endif

file = state->file_callbacks->fopen(full_path);
file = state->file_callbacks->fopen(state->file_callbacks->context, full_path);

free(full_path);

Expand Down
7 changes: 5 additions & 2 deletions lib/psflib/psflib.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
PSFLIB - Main PSF parser implementation
Copyright (c) 2012-2015 Christopher Snowhill
Copyright (c) 2012-2020 Christopher Snowhill
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -38,9 +38,12 @@ typedef struct psf_file_callbacks
/* list of characters which act as path separators, null terminated */
const char * path_separators;

/* Context pointer for fopen callback */
void * context;

/* opens the file pointed to by path read-only in binary mode,
* accepts UTF-8 encoding, returns file handle */
void * (* fopen )(const char * path);
void * (* fopen )(void * context, const char * path);

/* reads to specified buffer, returns count of size bytes read */
size_t (* fread )(void * buffer, size_t size, size_t count, void * handle);
Expand Down
Loading

0 comments on commit 250218e

Please sign in to comment.