Compare commits

..

No commits in common. "main" and "installer" have entirely different histories.

30 changed files with 2365 additions and 4754 deletions

View file

@ -1,36 +0,0 @@
name: Check
on:
push:
workflow_dispatch:
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install and poetry and all dependencies
run: |
pip install poetry --quiet
poetry install --all-extras
- name: Run mypy
run: poetry run mypy syng --strict
ruff:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install ruff
run: pip install ruff --quiet
- name: Run ruff
run: ruff check syng

View file

@ -1,47 +0,0 @@
name: Build appimage
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# container:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
repository: christofsteel/syng
- name: Install poetry
run: pip install poetry
- name: Extract version from Poetry
id: get_version
run: echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV
shell: bash
- name: Preparing Build dir
run: |
mkdir -p app/bin
cp "${{ github.workspace }}/resources/appimage/build.sh" app/build.sh
cp "${{ github.workspace }}/resources/appimage/bin/syng" app/bin/
cp "${{ github.workspace }}/resources/appimage/bin/yt-dlp" app/bin/
- name: Building AppDir
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/christofsteel/syng-appimage-builder:main
options: -v ${{ github.workspace }}/app:/app
run: |
/app/build.sh
export APPIMAGE_EXTRACT_AND_RUN=1
/app/linuxdeploy-x86_64.AppImage --plugin qt --appdir /app/AppDir --output appimage
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Syng Version ${{ env.VERSION }} AppImage
path: "${{ github.workspace }}/app/Syng-x86_64.AppImage"

View file

@ -1,59 +0,0 @@
name: Build docker container for appimage building
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-appimage-builder
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
repository: christofsteel/syng
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
file: ./resources/appimage/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

View file

@ -42,22 +42,14 @@ jobs:
- name: Populate workdir
run: |
mkdir work
mkdir work/portable
Copy-Item -Recurse -Verbose syng work/syng
Copy-Item -Verbose requirements-client.txt work/requirements.txt
Copy-Item -Recurse -Verbose syng work/portable/syng
Copy-Item -Verbose resources/icons/syng.ico work/portable/
Copy-Item -Verbose syng/static/background.png work/portable/
Copy-Item -Verbose syng/static/background20perc.png work/portable/
Copy-Item -Verbose libmpv-2.dll work/portable/
Copy-Item -Verbose ffmpeg-7.1-full_build/bin/ffmpeg.exe work/portable/
mkdir work/install
Copy-Item -Recurse -Verbose syng work/install/syng
Copy-Item -Verbose requirements-client.txt work/install/requirements.txt
Copy-Item -Verbose resources/icons/syng.ico work/install/
Copy-Item -Verbose syng/static/background.png work/install/
Copy-Item -Verbose syng/static/background20perc.png work/install/
Copy-Item -Verbose libmpv-2.dll work/install/
Copy-Item -Verbose ffmpeg-7.1-full_build/bin/ffmpeg.exe work/install/
Copy-Item -Verbose resources/icons/syng.ico work/
Copy-Item -Verbose syng/static/background.png work/
Copy-Item -Verbose syng/static/background20perc.png work/
Copy-Item -Verbose libmpv-2.dll work/
Copy-Item -Verbose ffmpeg-7.1-full_build/bin/ffmpeg.exe work/
- uses: actions/setup-python@v5
name: Install Python
with:
@ -74,44 +66,14 @@ jobs:
- name: Install PyInstaller
run: pip install pyinstaller
- name: Installing requirements
run: pip install -r requirements.txt
working-directory: ./work
# - name: Bundle Syng (portable)
# run:
# pyinstaller -n "syng-${{ env.VERSION }}" -F -w -i'.\syng.ico' --add-data='.\syng.ico;.' --add-data='.\background.png;.' --add-data='.\background20perc.png;.' --add-binary '.\libmpv-2.dll;.' --add-binary '.\ffmpeg.exe;.' syng/main.py
# working-directory: ./work/portable
- name: Bundle Syng (install)
run:
pyinstaller -D --contents-directory data -w -i'.\syng.ico' --add-data='.\syng.ico;.' --add-data='.\background.png;.' --add-data='.\background20perc.png;.' --add-binary '.\libmpv-2.dll;.' --add-binary '.\ffmpeg.exe;.' -n syng syng/main.py
working-directory: ./work/install
# build msi
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install WiX
- name: Bundle Syng
run: |
dotnet tool install --global wix --version 5.0.2
wix extension add -g WixToolset.UI.wixext/5.0.2
- name: Copy wix file to dist
run: |
Copy-Item -Verbose resources/windows/syng.wxs work/install/dist/syng.wxs
Copy-Item -Verbose resources/windows/agpl-3.0.rtf work/install/dist/agpl-3.0.rtf
- name: Build WiX on Windows
run: wix build -ext WixToolset.UI.wixext .\syng.wxs
working-directory: ./work/install/dist
pip install -r requirements.txt
pyinstaller -n "syng-${{ env.VERSION }}" -F -w -i'.\syng.ico' --add-data='.\syng.ico;.' --add-data='.\background.png;.' --add-data='.\background20perc.png;.' --add-binary '.\libmpv-2.dll;.' --add-binary '.\ffmpeg.exe;.' syng/main.py
working-directory: ./work
# - name: Upload artifact (portable)
# uses: actions/upload-artifact@v4
# with:
# name: Syng Version ${{ env.VERSION }} portable
# path: work/portable/dist/syng-${{ env.VERSION }}.exe
- name: Upload artifact (install)
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Syng Version ${{ env.VERSION }} Installer
path: work/install/dist/syng.msi
name: Syng Version ${{ env.VERSION }}
path: work/dist/syng-${{ env.VERSION }}.exe

1
.gitignore vendored
View file

@ -1,6 +1,5 @@
docs/build
dist
build
__pycache__
.venv
.idea

View file

@ -11,7 +11,7 @@ _Easily host karaoke events_
[![Flathub Version](https://img.shields.io/flathub/v/rocks.syng.Syng?logo=flathub)](https://flathub.org/apps/rocks.syng.Syng)
[![PyPI - License](https://img.shields.io/pypi/l/syng)](https://www.gnu.org/licenses/agpl-3.0.en.html)
[![Website](https://img.shields.io/website?url=https%3A%2F%2Fsyng.rocks%2F&label=syng.rocks)](https://syng.rocks)
[![Forgejo Pipeline Status](https://git.k-fortytwo.de/christofsteel/syng/badges/workflows/check.yaml/badge.svg?logo=python&label=mypy%2Bruff)](https://git.k-fortytwo.de/christofsteel/syng)
[![Gitlab Pipeline Status](https://img.shields.io/gitlab/pipeline-status/christofsteel%2Fsyng2?gitlab_url=https%3A%2F%2Fgit.k-fortytwo.de%2F&branch=main&logo=python&label=mypy%2Bruff)](https://git.k-fortytwo.de/christofsteel/syng2)
**Syng** is an all-in-one karaoke software, consisting of a *backend server*, a *web frontend* and a *playback client*.
@ -49,9 +49,7 @@ Alternatively Syng can be installed via the _Python Package Index_ (PyPI). When
This installs both the playback client (`syng client`) and a configuration GUI (`syng gui`).
**Note:** When installing via PyPI, you need to have [libmpv](https://mpv.io/) installed on machine of the playback client.
The Syng client is also packaged for Arch Linux in the [Arch Linux user repository](https://aur.archlinux.org/packages/syng-client)
**Note:** When installing via PyPI, you need to have [mpv](https://mpv.io/) installed on the playback client, and the `mpv` binary must be in your `PATH`.
### Windows
@ -153,18 +151,6 @@ sources:
max_duration: 1800
```
# Web client
The web client consists of three columns on desktop and three tabs on mobile:
- **Search:** Users can search for karaoke songs and get the results here. You can also directly add a YouTube video by using its link. Search results for YouTube videos have a second button to preview the song.
- **Queue:** Shows the current queue. The current song is highlighted at the top and each item is equipped with an ETA. If you are on an admin connection, you can drag and drop to change the order of the queue and delete items from the queue.
- **Recent:** This shows all previously played songs.
When connecting to the web client, you can give yourself a name with which your songs are queued. You can change your name by changing it in the footer. If no name is selected, a name is queried each time a song is added.
In the advanced options, you can add the admin password, that corresponds with the admin password on the playback client, to elevate this connection to an admin connection.
# Server
If you want to host your own Syng server, you can do that, but you can also use the publicly available Syng instance at https://syng.rocks.
@ -189,10 +175,6 @@ Alternatively you can run the server using docker. It listens on port 8080 and r
docker run --rm -v /path/to/your/keys.txt:/app/keys.txt -p 8080:8080 ghcr.io/christofsteel/syng -H 0.0.0.0
## Arch Linux
The Syng server is also packaged for Arch Linux in the [Arch Linux user repository](https://aur.archlinux.org/packages/syng-server)
## Configuration
Configuration is done via command line arguments, see `syng server --help` for an overview.

1786
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,7 @@ syng = "syng.main:main"
python = "^3.9"
python-socketio = "^5.10.0"
aiohttp = "^3.9.1"
# yarl = "<1.14.0"
yarl = "<1.14.0"
platformdirs = "^4.0.0"
yt-dlp = { version = ">=2024.11.18", extras = ["default"] }
minio = { version = "^7.2.0", optional = true }
@ -41,7 +41,7 @@ qrcode = { version = "^7.4.2", optional = true }
pymediainfo = { version = "^6.1.0", optional = true }
pyyaml = { version = "^6.0.1", optional = true }
alt-profanity-check = {version = "^1.4.1", optional = true}
pyqt6 = {version=">=6.7.1", optional = true}
pyqt6 = {version="^6.7.1", optional = true}
mpv = {version = "^1.0.7", optional = true}
qasync = {version = "^0.27.1", optional = true}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,118 +0,0 @@
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN sed -i 's/htt[p|ps]:\/\/archive.ubuntu.com\/ubuntu\//mirror:\/\/mirrors.ubuntu.com\/mirrors.txt/g' /etc/apt/sources.list
RUN apt update && apt install -y git \
build-essential \
pkg-config \
ninja-build \
libgl1-mesa-dev \
autotools-dev \
autoconf \
libtool \
libfribidi-dev \
libharfbuzz-dev \
libfontconfig1-dev \
libx11-dev \
nasm \
libxv-dev \
libva-dev \
liblcms2-dev \
libdrm-dev \
libasound2-dev \
libgnutls28-dev \
libmp3lame-dev \
libvorbis-dev \
libopus-dev \
libtheora-dev \
libvpx-dev \
libx264-dev \
libx265-dev \
libpulse-dev \
libxext-dev \
libxpresent-dev \
libxrandr-dev \
libxss-dev \
libwebp-dev \
libxkbcommon-dev \
libpulse-dev \
libxkbcommon-x11-dev \
binutils \
python3-pip \
fuse3 \
libpipewire-0.2-dev \
libfreetype-dev \
glslang-dev \
wget \
libxcb-cursor0 libxcb-ewmh2 libxcb-icccm4 luajit libluajit-5.1-dev libpcsclite1 libxcb-keysyms1 libxcb-shape0 libjpeg-dev \
libfontconfig1-dev \
libfreetype-dev \
libgtk-3-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-cursor-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-sync-dev \
libxcb-util-dev \
libxcb-xfixes0-dev \
libxcb-xkb-dev \
libxcb1-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxrender-dev \
libmediainfo0v5
RUN pip3 install meson
RUN useradd -m builder
RUN wget https://github.com/Kitware/CMake/releases/download/v4.0.3/cmake-4.0.3-linux-x86_64.sh -O /tmp/cmake.sh
RUN chmod +x /tmp/cmake.sh && /tmp/cmake.sh --skip-license --prefix=/usr
RUN git clone https://github.com/google/shaderc.git /deps/shaderc && cd /deps/shaderc && /deps/shaderc/utils/git-sync-deps && mkdir -p /deps/shaderc/build && cd /deps/shaderc/build && \
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON \
/deps/shaderc && \
ninja && ninja install && rm -rf /deps/shaderc
RUN git clone https://github.com/Cyan4973/xxHash.git /deps/xxHash && cd /deps/xxHash && make && make install && rm -rf /deps/xxHash
RUN git clone https://code.videolan.org/videolan/dav1d.git /deps/dav1d && cd /deps/dav1d && git checkout 1.5.1 && \
mkdir -p /deps/dav1d/build && cd /deps/dav1d/build && \
meson setup .. --default-library=static --buildtype=release --prefix=/usr && \
ninja && ninja install && rm -rf /deps/dav1d
#RUN git clone https://gitlab.freedesktop.org/wayland/wayland.git /deps/wayland
#RUN cd /deps/wayland && git checkout 1.24 && \
# meson setup build --prefix=/usr -Ddocumentation=false -Ddtd_validation=false && \
# ninja -C build install
#RUN git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git /deps/wayland-protocols
#RUN cd /deps/wayland-protocols && git checkout 1.45 && \
# meson setup build --prefix=/usr -Dtests=false && \
# ninja -C build install
RUN wget https://download.qt.io/official_releases/qt/6.9/6.9.1/single/qt-everywhere-src-6.9.1.tar.xz -O /tmp/qt.tar.xz && tar -xf /tmp/qt.tar.xz -C /deps && rm /tmp/qt.tar.xz && mkdir /deps/qt-build && cd /deps/qt-build && \
/deps/qt-everywhere-src-6.9.1/configure -opensource -confirm-license -nomake examples -nomake tests -release -prefix /usr -skip qtwayland -skip qtwebengine -skip qtwebview -skip qt3d -skip qtdeclarative -skip qtscript -skip qtserialport -skip qttools -skip qtquick3d -skip qtxmlpatterns -skip qtcanvas3d -skip qtgraphs -skip qtlocation -skip qtdoc -skip qtlottie -skip qt5compat -skip qtmqtt -skip qtopcua -skip qtquick3dphysics -skip qtquickeffectmaker -skip qtquicktimeline -skip qttranslations -skip qtvirtualkeyboard -skip qtactiveqt -skip qtshadertools -skip qtmultimedia -skip qtspeech -skip qtcoap -skip qtconnectivity -skip qtdatavis3d -skip qtcharts -skip qtgrpc -skip qtwebsockets -skip qthttpserver -skip qtlanguageserver -skip qtpositioning -skip qtnetworkauth -skip qtremoteobjects -skip qtscmxml -skip qtsensors -skip qtserialbus -skip qtwebchannel -skip qtscxml && \
cd /deps/qt-build && cmake --build . --parallel && cmake --install . && rm -rf /deps/qt-everywhere-src-6.9.1 /deps/qt-build
RUN git clone https://github.com/mpv-player/mpv-build.git /deps/mpv-build/ && cd /deps/mpv-build && echo "-Djavascript=disabled" > mpv_options \
&& echo "--disable-debug" > ffmpeg_options \
&& echo "--disable-doc" >> ffmpeg_options \
&& echo "--enable-encoder=png" >> ffmpeg_options \
&& echo "--enable-gnutls" >> ffmpeg_options \
&& echo "--enable-gpl" >> ffmpeg_options \
&& echo "--enable-version3" >> ffmpeg_options \
&& echo "--enable-libass" >> ffmpeg_options \
&& echo "--enable-libdav1d" >> ffmpeg_options \
&& echo "--enable-libfreetype" >> ffmpeg_options \
&& echo "--enable-libmp3lame" >> ffmpeg_options \
&& echo "--enable-libopus" >> ffmpeg_options \
&& echo "--enable-libtheora" >> ffmpeg_options \
&& echo "--enable-libvorbis" >> ffmpeg_options \
&& echo "--enable-libvpx" >> ffmpeg_options \
&& echo "--enable-libx264" >> ffmpeg_options \
&& echo "--enable-libx265" >> ffmpeg_options \
&& echo "--enable-libwebp" >> ffmpeg_options \
&& /deps/mpv-build/rebuild -j32 \
&& cp /deps/mpv-build/build_libs/bin/ffmpeg /usr/bin/ffmpeg \
&& cp /deps/mpv-build/mpv/build/libmpv.so.2.5.0 /usr/lib/libmpv.so.2.5.0 \
&& rm -rf /deps/mpv-build

View file

@ -1,28 +0,0 @@
#! /bin/bash
# If running from an extracted image, then export ARGV0 and APPDIR
if [ -z "${APPIMAGE}" ]; then
export ARGV0="$0"
self=$(readlink -f -- "$0") # Protect spaces (issue 55)
here="${self%/*}"
tmp="${here%/*}"
export APPDIR="${tmp%/*}"
fi
# Resolve the calling command (preserving symbolic links).
export APPIMAGE_COMMAND=$(command -v -- "$ARGV0")
# Export TCl/Tk
export TCL_LIBRARY="${APPDIR}/usr/share/tcltk/tcl8.6"
export TK_LIBRARY="${APPDIR}/usr/share/tcltk/tk8.6"
export TKPATH="${TK_LIBRARY}"
# Export SSL certificate
export SSL_CERT_FILE="${APPDIR}/opt/_internal/certs.pem"
# Call Python
export PATH="$APPDIR/usr/bin:$PATH"
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH"
export PYTHONPATH="$APPDIR/usr/lib/python3.13/site-packages"
"$APPDIR/opt/python3.13/bin/python3.13" -m syng "$@"

View file

@ -1,28 +0,0 @@
#! /bin/bash
# If running from an extracted image, then export ARGV0 and APPDIR
if [ -z "${APPIMAGE}" ]; then
export ARGV0="$0"
self=$(readlink -f -- "$0") # Protect spaces (issue 55)
here="${self%/*}"
tmp="${here%/*}"
export APPDIR="${tmp%/*}"
fi
# Resolve the calling command (preserving symbolic links).
export APPIMAGE_COMMAND=$(command -v -- "$ARGV0")
# Export TCl/Tk
export TCL_LIBRARY="${APPDIR}/usr/share/tcltk/tcl8.6"
export TK_LIBRARY="${APPDIR}/usr/share/tcltk/tk8.6"
export TKPATH="${TK_LIBRARY}"
# Export SSL certificate
export SSL_CERT_FILE="${APPDIR}/opt/_internal/certs.pem"
# Call Python
export PATH="$APPDIR/usr/bin:$PATH"
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH"
export PYTHONPATH="$APPDIR/usr/lib/python3.13/site-packages"
"$APPDIR/opt/python3.13/bin/python3.13" -m yt_dlp "$@"

View file

@ -1,169 +0,0 @@
#!/usr/bin/env bash
PKGDIR=usr/lib/python3.13/site-packages
cd /app
if [ ! -x /app/python3.13.5-cp313-cp313-manylinux2014_x86_64.AppImage ]; then
echo "Downloading Python 3.13 AppImage..."
wget https://github.com/niess/python-appimage/releases/download/python3.13/python3.13.5-cp313-cp313-manylinux2014_x86_64.AppImage
chmod +x python3.13.5-cp313-cp313-manylinux2014_x86_64.AppImage
else
echo "Python 3.13 AppImage already exists."
fi
if [ ! -x /app/linuxdeploy-x86_64.AppImage ]; then
echo "Downloading linuxdeploy AppImage..."
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
else
echo "linuxdeploy AppImage already exists."
fi
if [ ! -x /app/linuxdeploy-plugin-qt-x86_64.AppImage ]; then
echo "Downloading linuxdeploy-plugin-qt AppImage..."
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
else
echo "linuxdeploy-plugin-qt AppImage already exists."
fi
if [ ! -d /app/syng ]; then
echo "Cloning Syng repository..."
git clone https://github.com/christofsteel/syng.git /app/syng
else
echo "Syng repository already exists."
fi
# if [ ! -x /app/mpv/mpv-build/mpv/build/libmpv.so.2.5.0 ]; then
# echo "Building MPV..."
# mkdir -p /app/mpv
# cd /app/mpv
# git clone https://github.com/mpv-player/mpv-build.git
# cd mpv-build
# echo "-Dlibmpv=true" > mpv_options
# echo "-Djavascript=disabled" >> mpv_options
# echo "--disable-debug" > ffmpeg_options
# echo "--disable-doc" >> ffmpeg_options
# echo "--enable-encoder=png" >> ffmpeg_options
# echo "--enable-gnutls" >> ffmpeg_options
# echo "--enable-gpl" >> ffmpeg_options
# echo "--enable-version3" >> ffmpeg_options
# echo "--enable-libass" >> ffmpeg_options
# echo "--enable-libdav1d" >> ffmpeg_options
# echo "--enable-libfreetype" >> ffmpeg_options
# echo "--enable-libmp3lame" >> ffmpeg_options
# echo "--enable-libopus" >> ffmpeg_options
# echo "--enable-libtheora" >> ffmpeg_options
# echo "--enable-libvorbis" >> ffmpeg_options
# echo "--enable-libvpx" >> ffmpeg_options
# echo "--enable-libx264" >> ffmpeg_options
# echo "--enable-libx265" >> ffmpeg_options
# echo "--enable-libwebp" >> ffmpeg_options
# # echo "--enable-vulkan" >> ffmpeg_options
# ./rebuild -j32
#
# cd /app
# else
# echo "MPV build already exists."
# fi
if [ ! -d /app/AppDir ]; then
echo "Extracting Python AppImage..."
/app/python3.13.5-cp313-cp313-manylinux2014_x86_64.AppImage --appimage-extract
mv /app/squashfs-root /app/AppDir
echo "Copy FFmpeg and MPV libraries..."
cp /usr/bin/ffmpeg /app/AppDir/usr/bin/ffmpeg
cp /usr/lib/libmpv.so.2.5.0 /app/AppDir/usr/lib/libmpv.so.2.5.0
cp /usr/bin/ld /app/AppDir/usr/bin/ld
ln -s libmpv.so.2.5.0 /app/AppDir/usr/lib/libmpv.so.2
ln -s libmpv.so.2 /app/AppDir/usr/lib/libmpv.so
echo "Copy xcb libraries..."
# qt6 needs them
cp /usr/lib/x86_64-linux-gnu/libxcb-ewmh* /app/AppDir/usr/lib/
cp /usr/lib/x86_64-linux-gnu/libxcb-icccm* /app/AppDir/usr/lib/
cp /usr/lib/x86_64-linux-gnu/libxcb-keysyms* /app/AppDir/usr/lib/
cp /usr/lib/x86_64-linux-gnu/libxcb* /app/AppDir/usr/lib/
/app/AppDir/opt/python3.13/bin/python3.13 -m pip install syng[client] --no-binary pillow --target=/app/AppDir/$PKGDIR
echo "Modifying AppDir structure..."
rm /app/AppDir/python3.13.5.desktop /app/AppDir/python.png /app/AppDir/usr/share/applications/python3.13.5.desktop
cat <<EOF > /app/AppDir/usr/share/applications/rocks.syng.Syng.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Syng
Comment=An all-in-one karaoke player
Exec=syng
Icon=rocks.syng.Syng
Categories=AudioVideo
EOF
cp /app/syng/resources/icons/hicolor/256x256/apps/rocks.syng.Syng.png /app/AppDir/usr/share/icons/hicolor/256x256/apps/
cp /app/bin/syng /app/AppDir/usr/bin/syng
cp /app/bin/yt-dlp /app/AppDir/usr/bin/yt-dlp
cp /usr/bin/ld /app/AppDir/usr/bin/ld
chmod +x /app/AppDir/usr/bin/syng
rm /app/AppDir/AppRun
cp /app/syng/resources/flatpak/rocks.syng.Syng.yaml /app/AppDir/usr/share/metainfo/rocks.syng.Syng.appdata.xml
else
echo "Python AppImage already extracted."
fi
echo "Patching mpv.py..."
patch -p0 < libmpv.patch
echo "Removing unnecessary files..."
for plugin in assetimporters generic help "imageformats/libqpdf.so" networkinformation position qmllint renderers sceneparsers sensors tls wayland-graphics-integration-client sqldrivers webview egldeviceintegrations geometryloaders multimedia platforminputcontexts printsupport qmlls renderplugins scxmldatamodel texttospeech wayland-decoration-client wayland-shell-integration; do
rm -rf /app/AppDir/usr/lib/python3.13/site-packages/PyQt6/Qt6/plugins/$plugin
done
for lib in libavcodec.so.61 libQt6PdfQuick.so.6 libQt6Quick3DIblBaker.so.6 libQt6QuickControls2Material.so.6 libQt6QuickTimeline.so.6 libQt6Test.so.6 \
libavformat.so.61 libQt6Help.so.6 libQt6Pdf.so.6 libQt6Quick3DParticles.so.6 libQt6QuickControls2MaterialStyleImpl.so.6 libQt6QuickVectorImageGenerator.so.6 libQt6TextToSpeech.so.6 \
libavutil.so.59 libQt6LabsAnimation.so.6 libQt6PdfWidgets.so.6 libQt6Quick3DPhysicsHelpers.so.6 libQt6QuickControls2.so.6 libQt6QuickVectorImage.so.6 \
libQt6LabsFolderListModel.so.6 libQt6PositioningQuick.so.6 libQt6Quick3DPhysics.so.6 libQt6QuickControls2Universal.so.6 libQt6QuickWidgets.so.6 libQt6WaylandEglClientHwIntegration.so.6 \
libQt6LabsPlatform.so.6 libQt6Positioning.so.6 libQt6Quick3DRuntimeRender.so.6 libQt6QuickControls2UniversalStyleImpl.so.6 libQt6RemoteObjectsQml.so.6 libQt6WebChannelQuick.so.6 \
libQt6LabsQmlModels.so.6 libQt6PrintSupport.so.6 libQt6Quick3D.so.6 libQt6QuickDialogs2QuickImpl.so.6 libQt6RemoteObjects.so.6 libQt6WebChannel.so.6 \
libQt6Bluetooth.so.6 libQt6LabsSettings.so.6 libQt6QmlMeta.so.6 libQt6Quick3DSpatialAudio.so.6 libQt6QuickDialogs2.so.6 libQt6SensorsQuick.so.6 libQt6WebSockets.so.6 \
libQt6Concurrent.so.6 libQt6LabsSharedImage.so.6 libQt6QmlModels.so.6 libQt6Quick3DUtils.so.6 libQt6QuickDialogs2Utils.so.6 libQt6Sensors.so.6 \
libQt6LabsWavefrontMesh.so.6 libQt6Qml.so.6 libQt6Quick3DXr.so.6 libQt6QuickEffects.so.6 libQt6SerialPort.so.6 libQt6WlShellIntegration.so.6 \
libQt6MultimediaQuick.so.6 libQt6QmlWorkerScript.so.6 libQt6QuickControls2Basic.so.6 libQt6QuickLayouts.so.6 libQt6ShaderTools.so.6 \
libQt6Designer.so.6 libQt6Multimedia.so.6 libQt6Quick3DAssetImport.so.6 libQt6QuickControls2BasicStyleImpl.so.6 libQt6QuickParticles.so.6 libQt6SpatialAudio.so.6 \
libQt6FFmpegStub-crypto.so.3 libQt6MultimediaWidgets.so.6 libQt6Quick3DAssetUtils.so.6 libQt6QuickControls2Fusion.so.6 libQt6QuickShapes.so.6 libQt6Sql.so.6 libswresample.so.5 \
libQt6FFmpegStub-ssl.so.3 libQt6Network.so.6 libQt6Quick3DEffects.so.6 libQt6QuickControls2FusionStyleImpl.so.6 libQt6Quick.so.6 libQt6StateMachineQml.so.6 libswscale.so.8 \
libQt6FFmpegStub-va-drm.so.2 libQt6Nfc.so.6 libQt6Quick3DGlslParser.so.6 libQt6QuickControls2Imagine.so.6 libQt6QuickTemplates2.so.6 libQt6StateMachine.so.6 \
libQt6FFmpegStub-va.so.2 libQt6Quick3DHelpersImpl.so.6 libQt6QuickControls2ImagineStyleImpl.so.6 libQt6QuickTest.so.6 \
libQt6FFmpegStub-va-x11.so.2 libQt6OpenGLWidgets.so.6 libQt6Quick3DHelpers.so.6 libQt6QuickControls2Impl.so.6 libQt6QuickTimelineBlendTrees.so.6 libQt6WaylandClient.so.6; do
echo "Removing Qt library: $lib"
rm /app/AppDir/usr/lib/python3.13/site-packages/PyQt6/Qt6/lib/$lib
done
for platform in libqeglfs.so libqlinuxfb.so libqminimalegl.so libqminimal.so libqoffscreen.so libqvkkhrdisplay.so libqvnc.so libqwayland-egl.so libqwayland-generic.so; do
echo "Removing Qt platform plugin: $platform"
rm /app/AppDir/usr/lib/python3.13/site-packages/PyQt6/Qt6/plugins/platforms/$platform
done
for lib in QtHelp.abi3.so QtNfc.abi3.so QtPdfWidgets.abi3.so QtQuick3D.abi3.so QtSensors.abi3.so QtStateMachine.abi3.so QtTextToSpeech.abi3.so \
QtMultimedia.abi3.so QtPositioning.abi3.so QtQuick.abi3.so QtSerialPort.abi3.so QtWebChannel.abi3.so \
QtDesigner.abi3.so QtMultimediaWidgets.abi3.so QtOpenGLWidgets.abi3.so QtPrintSupport.abi3.so QtQuickWidgets.abi3.so QtSpatialAudio.abi3.so QtWebSockets.abi3.so \
QtBluetooth.abi3.so QtNetwork.abi3.so QtPdf.abi3.so QtQml.abi3.so QtRemoteObjects.abi3.so QtSql.abi3.so QtTest.abi3.so; do
echo "Removing PyQt6 library: $lib"
rm /app/AppDir/usr/lib/python3.13/site-packages/PyQt6/$lib
done
# rm /app/AppDir/usr/lib/python3.13/site-packages/PyQt6/Qt6/translations/*
echo "Removing unnecessary QML files..."
rm -rf /app/AppDir/usr/lib/python3.13/site-packages/PyQt6/Qt6/qml/
# ln -s python3.13/site-packages/PyQt6/Qt6/ /app/AppDir/usr/lib/qt6
# for file in /app/AppDir/usr/lib/python3.13/site-packages/PyQt6/Qt6/lib/*; do
# echo "Linking $file to /app/AppDir/usr/lib/$(basename $file)"
# relative_path=$(realpath --relative-to=/app/AppDir/usr/lib/ $file)
# ln -s "$relative_path" /app/AppDir/usr/lib/$(basename $file)
# done
# echo "Creating AppImage..."
# /app/linuxdeploy-x86_64.AppImage --plugin qt --appdir /app/AppDir --output appimage

View file

@ -1,411 +0,0 @@
{\rtf1\ansi\deff3\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq2\fcharset0 Times New Roman;}{\f5\fswiss\fprq2\fcharset0 Arial;}{\f6\froman\fprq2\fcharset0 StarSymbol{\*\falt Arial Unicode MS};}{\f7\froman\fprq2\fcharset0 Courier New;}{\f8\froman\fprq2\fcharset0 Arial;}{\f9\froman\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}{\f10\froman\fprq2\fcharset0 Liberation Mono{\*\falt Courier New};}{\f11\fmodern\fprq1\fcharset128 Liberation Mono{\*\falt Courier New};}{\f12\fnil\fprq2\fcharset0 Times New Roman;}{\f13\fnil\fprq2\fcharset0 StarSymbol{\*\falt Arial Unicode MS};}{\f14\fnil\fprq2\fcharset0 Courier New;}{\f15\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f16\fnil\fprq2\fcharset0 Liberation Mono{\*\falt Courier New};}{\f17\fnil\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}}
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
{\stylesheet{\s0\snext0\dbch\af12\langfe1081\dbch\af15\afs24\alang1081\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Normal;}
{\s1\sbasedon56\snext1\dbch\af12\langfe255\dbch\af15\afs32\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs32\lang1033\b\kerning1 Titre 1;}
{\s2\sbasedon56\snext2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1 Titre 2;}
{\s3\sbasedon56\snext3\dbch\af12\langfe255\dbch\af15\afs28\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\b\kerning1 Titre 3;}
{\s4\sbasedon56\snext4\dbch\af12\langfe255\dbch\af15\afs23\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs23\lang1033\i\b\kerning1 Titre 4;}
{\s5\sbasedon56\snext5\dbch\af12\langfe255\dbch\af15\afs23\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs23\lang1033\b\kerning1 Titre 5;}
{\s6\sbasedon56\snext6\dbch\af12\langfe255\dbch\af15\afs21\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs21\lang1033\b\kerning1 Titre 6;}
{\*\cs15\snext15 Caract\u232\'e8res de num\u233\'e9rotation;}
{\*\cs16\snext16\dbch\af13\afs18\loch\f6\fs18 Puces;}
{\*\cs17\snext17\i Accentuation;}
{\*\cs18\snext18\b Accentuation forte;}
{\*\cs19\snext19\strike Strikeout;}
{\*\cs20\snext20\super Superscript;}
{\*\cs21\snext21\sub Subscript;}
{\*\cs22\snext22\i Citation;}
{\*\cs23\snext23\dbch\af14\loch\f7 Texte non proportionnel;}
{\*\cs24\snext24\cf9\ul\ulc0 Lien Internet;}
{\*\cs25\snext25 Caract\u232\'e8res de note de bas de page;}
{\*\cs26\snext26\super Ancre de note de bas de page;}
{\*\cs27\snext27 D\u233\'e9finition;}
{\*\cs28\snext28\langfe255\cf13\lang255\ul\ulc0 Lien Internet visit\u233\'e9;}
{\*\cs29\snext29\dbch\af13\loch\f3 ListLabel 1;}
{\*\cs30\snext30\dbch\af13 ListLabel 2;}
{\*\cs31\snext31\dbch\af13 ListLabel 3;}
{\*\cs32\snext32\dbch\af13 ListLabel 4;}
{\*\cs33\snext33\dbch\af13 ListLabel 5;}
{\*\cs34\snext34\dbch\af13 ListLabel 6;}
{\*\cs35\snext35\dbch\af13 ListLabel 7;}
{\*\cs36\snext36\dbch\af13 ListLabel 8;}
{\*\cs37\snext37\dbch\af13 ListLabel 9;}
{\*\cs38\snext38\dbch\af13\loch\f3 ListLabel 10;}
{\*\cs39\snext39\dbch\af13 ListLabel 11;}
{\*\cs40\snext40\dbch\af13 ListLabel 12;}
{\*\cs41\snext41\dbch\af13 ListLabel 13;}
{\*\cs42\snext42\dbch\af13 ListLabel 14;}
{\*\cs43\snext43\dbch\af13 ListLabel 15;}
{\*\cs44\snext44\dbch\af13 ListLabel 16;}
{\*\cs45\snext45\dbch\af13 ListLabel 17;}
{\*\cs46\snext46\dbch\af13 ListLabel 18;}
{\*\cs47\snext47\dbch\af13\loch\f3 ListLabel 19;}
{\*\cs48\snext48\dbch\af13 ListLabel 20;}
{\*\cs49\snext49\dbch\af13 ListLabel 21;}
{\*\cs50\snext50\dbch\af13 ListLabel 22;}
{\*\cs51\snext51\dbch\af13 ListLabel 23;}
{\*\cs52\snext52\dbch\af13 ListLabel 24;}
{\*\cs53\snext53\dbch\af13 ListLabel 25;}
{\*\cs54\snext54\dbch\af13 ListLabel 26;}
{\*\cs55\snext55\dbch\af13 ListLabel 27;}
{\s56\sbasedon0\snext57\dbch\af12\langfe255\dbch\af15\afs28\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f8\fs28\lang1033\kerning1 Titre;}
{\s57\sbasedon0\snext57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Corps de texte;}
{\s58\sbasedon57\snext58\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Liste;}
{\s59\sbasedon0\snext59\dbch\af12\langfe255\dbch\af15\afs24\ai\ql\nowidctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 L\u233\'e9gende;}
{\s60\sbasedon0\snext60\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Index;}
{\s61\sbasedon59\snext61\dbch\af12\langfe255\dbch\af15\afs24\ai\ql\nowidctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 TableCaption;}
{\s62\sbasedon59\snext62\dbch\af12\langfe255\dbch\af15\afs24\ai\ql\nowidctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 FigureCaption;}
{\s63\sbasedon0\snext63\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Figure;}
{\s64\sbasedon63\snext64\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\keepn\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 FigureWithCaption;}
{\s65\sbasedon0\snext65\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\li567\ri567\lin567\rin567\fi0\sb144\sa144\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Citations;}
{\s66\sbasedon0\snext66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1 Texte pr\u233\'e9format\u233\'e9;}
{\s67\sbasedon0\snext67\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Definition Term;}
{\s68\sbasedon0\snext68\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\li720\ri0\lin720\rin0\fi0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Definition Definition;}
{\s69\sbasedon0\snext69\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\li43\ri43\lin43\rin43\fi0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Contenu de tableau;}
{\s70\sbasedon69\snext70\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\li43\ri43\lin43\rin43\fi0\ltrpar\cf0\loch\f4\fs24\lang1033\b\kerning1 Titre de tableau;}
{\s71\sbasedon0\snext71\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\li283\ri0\lin283\rin0\fi-283\ltrpar\cf0\loch\f4\fs20\lang1033\kerning1 Note de bas de page;}
{\s72\sbasedon0\snext72\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\tqc\tx4819\tqr\tx9638\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 En-t\u234\'eate et pied de page;}
{\s73\sbasedon0\snext73\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Pied de page;}
{\s74\sbasedon0\snext74\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb115\sa115\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Definition Term Tight;}
{\s75\sbasedon0\snext75\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\li720\ri0\lin720\rin0\fi0\sb0\sa0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 Definition Definition Tight;}
{\s76\sbasedon0\snext76\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\i\kerning1 Date;}
{\s77\sbasedon0\snext77\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\i\kerning1 Author;}
{\s78\sbasedon0\snext78\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb0\sa283\brdrb\brdrdb\brdrw5\brdrcf15\brsp0\ltrpar\cf0\loch\f4\fs12\lang1033\kerning1 Ligne horizontale;}
{\s79\sbasedon0\snext79\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1 First paragraph;}
{\s80\sbasedon56\snext80\dbch\af12\langfe255\dbch\af15\afs56\ab\qc\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f8\fs56\lang1033\b\kerning1 Titre principal;}
}{\*\listtable{\list\listtemplateid1
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li720}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li1080}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li1440}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li1800}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li2160}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li2520}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li2880}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li3240}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li3600}\listid1}
{\list\listtemplateid2
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li720}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li1080}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li1440}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li1800}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li2160}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li2520}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li2880}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li3240}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li3600}\listid2}
{\list\listtemplateid3
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li720}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li1080}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li1440}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li1800}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li2160}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li2520}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f18\fi-360\li2880}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8227 ?;}{\levelnumbers;}\f18\fi-360\li3240}
{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8259 ?;}{\levelnumbers;}\f18\fi-360\li3600}\listid3}
{\list\listtemplateid4
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}\listid4}
}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}}{\*\generator LibreOffice/7.0.4.2$Linux_X86_64 LibreOffice_project/00$Build-2}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr2024\mo3\dy19\hr18\min2}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab709
\hyphauto1\viewscale100
{\*\pgdsctbl
{\pgdsc0\pgdscuse451\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn2016\footery1440{\footer\pard\plain \s73\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\qc\nowidctlpar\tqc\tx4680\tqr\tx9360\hyphpar0\ltrpar{\rtlch\dbch\af12\langfe255\afs24 \ltrch\cf0\fs24\lang1033\kerning1
{\field{\*\fldinst PAGE }{\fldrslt 12}}}{\rtlch\dbch\af12\langfe255\afs24 \ltrch\cf0\fs24\lang1033\kerning1
}
\par }\pgdscnxt0 Style de page par d\u233\'e9faut;}}
\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1440\margr1440\margt1440\margb1440\sectd\sbknone\pgndec\sftnnar\saftnnrlc\sectunlocked1\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn2016\footery1440{\footer\pard\plain \s73\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\qc\nowidctlpar\tqc\tx4680\tqr\tx9360\hyphpar0\ltrpar{\rtlch\dbch\af12\langfe255\afs24 \ltrch\cf0\fs24\lang1033\kerning1
{\field{\*\fldinst PAGE }{\fldrslt 12}}}{\rtlch\dbch\af12\langfe255\afs24 \ltrch\cf0\fs24\lang1033\kerning1
}
\par }\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
{\*\ftnsep\chftnsep}\pgndec\pard\plain \s80\dbch\af12\langfe255\dbch\af15\afs56\ab\qc\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f8\fs56\lang1033\b\kerning1\ql\sb240\sa120{\rtlch\dbch\af17\afs36\hich\af9 \ltrch\fs36\loch\f9\loch
GNU AFFERO GENERAL PUBLIC LICENSE}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\ql{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Version 3, 19 November 2007}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af11 \ltrch\loch\f11\loch
Copyright (C) 2007 Free Software Foundation, Inc. }{{\field{\*\fldinst HYPERLINK "https://fsf.org/" }{\fldrslt {\rtlch\dbch\af15\dbch\af15\hich\af11 \ltrch\cf9\ul\ulc0\loch\f11\loch
https://fsf.org/}}}}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af11 \ltrch\loch\f11\loch
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.}
\par \pard\plain \s1\dbch\af12\langfe255\dbch\af15\afs32\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs32\lang1033\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
Preamble}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The precise terms and conditions for copying, distribution and modification follow.}
\par \pard\plain \s1\dbch\af12\langfe255\dbch\af15\afs32\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs32\lang1033\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
TERMS AND CONDITIONS}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
0. Definitions.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
"This License" refers to version 3 of the GNU Affero General Public License.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A "covered work" means either the unmodified Program or a work based on the Program.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
1. Source Code.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The Corresponding Source for a work in source code form is that same work.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
2. Basic Permissions.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
3. Protecting Users' Legal Rights From Anti-Circumvention Law.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
4. Conveying Verbatim Copies.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
5. Conveying Modified Source Versions.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.}
\par \pard\plain \s79\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
6. Conveying Non-Source Forms.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls2 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls2 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls2 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls2 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls2 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.}
\par \pard\plain \s79\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
7. Additional Terms.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls3 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls3 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls3 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls3 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls3 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\listtext\pard\plain \u8226\'95\tab}\ilvl0\ls3 \li1440\ri0\lin1440\rin0\fi-360\tx720\li720\ri0\lin720\rin0\fi-360\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.}
\par \pard\plain \s79\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\sb85\sa85{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
8. Termination.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
9. Acceptance Not Required for Having Copies.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
10. Automatic Licensing of Downstream Recipients.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
11. Patents.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
12. No Surrender of Others' Freedom.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
13. Remote Network Interaction; Use with the GNU General Public License.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
14. Revised Versions of this License.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
15. Disclaimer of Warranty.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
16. Limitation of Liability.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.}
\par \pard\plain \s2\dbch\af12\langfe255\dbch\af15\afs28\ai\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs28\lang1033\i\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
17. Interpretation of Sections 15 and 16.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\ql{\rtlch\dbch\af15\ab\hich\af3 \ltrch\b\loch\f3\loch
END OF TERMS AND CONDITIONS}
\par \pard\plain \s1\dbch\af12\langfe255\dbch\af15\afs32\ab\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\loch\f5\fs32\lang1033\b\kerning1{\rtlch\dbch\af17\hich\af9 \ltrch\loch\f9\loch
How to Apply These Terms to Your New Programs}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\sb85\sa0{\rtlch\dbch\af16\afs20\hich\af10 \ltrch\fs20\loch\f10
}{\rtlch\dbch\af16\afs20\hich\af10 \ltrch\fs20\loch\f10\loch
<one line to give the program's name and a brief idea of what it does.>}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
Copyright (C) <year> <name of author>}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
This program is free software: you can redistribute it and/or modify}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
it under the terms of the GNU Affero General Public License as}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
published by the Free Software Foundation, either version 3 of the}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
License, or (at your option) any later version.}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
This program is distributed in the hope that it will be useful,}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
but WITHOUT ANY WARRANTY; without even the implied warranty of}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
GNU Affero General Public License for more details.}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
You should have received a copy of the GNU Affero General Public License}
\par \pard\plain \s66\dbch\af12\langfe255\dbch\af15\afs20\ql\nowidctlpar\hyphpar0\sb0\sa0\ltrpar\cf0\loch\f7\fs20\lang1033\kerning1\sb0\sa85{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10
}{\rtlch\dbch\af16\dbch\af16\hich\af10 \ltrch\loch\f10\loch
along with this program. If not, see <https://www.gnu.org/licenses/>.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\sb85\sa85{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
Also add information on how to contact you by electronic and paper mail.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1{\rtlch\dbch\af15\hich\af3 \ltrch\loch\f3\loch
If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.}
\par \pard\plain \s57\dbch\af12\langfe255\dbch\af15\afs24\ql\nowidctlpar\hyphpar0\sb86\sa86\ltrpar\cf0\loch\f4\fs24\lang1033\kerning1\sb86\sa86{\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see }{{\field{\*\fldinst HYPERLINK "https://www.gnu.org/licenses/" }{\fldrslt {\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\cf9\ul\ulc0\loch\f3\loch
http}{}}}{\field{\*\fldinst HYPERLINK "https://www.gnu.org/licenses/" }{\fldrslt {\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\cf9\ul\ulc0\loch\f3\loch
s}{}}}{\field{\*\fldinst HYPERLINK "https://www.gnu.org/licenses/" }{\fldrslt {\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\cf9\ul\ulc0\loch\f3\loch
://www.gnu.org/licenses/}{}}}\rtlch\dbch\af15\dbch\af15\hich\af3 \ltrch\loch\f3\loch
.}
\par }

View file

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Language="1033"
Manufacturer="Syng.Rocks!"
Name="Syng.Rocks! Karaoke Player"
Scope="perUserOrMachine"
UpgradeCode="092e7e0b-5042-47a1-9673-544d9722f8df"
ProductCode="*"
Version="2.1.0">
<MediaTemplate EmbedCab="yes" />
<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" />
<WixVariable Id="WixUILicenseRtf" Value="agpl-3.0.rtf" />
<Icon Id="syng.ico" SourceFile="..\syng.ico"/>
<Property Id="ARPPRODUCTICON" Value="syng.ico" />
<StandardDirectory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="syng">
<Component Id="ProductComponent">
<File KeyPath="yes" Source="syng\syng.exe" Name="syng.exe"></File>
<Shortcut Id="startmenuShortcut"
Directory="ProgramMenuDir"
Name="Syng.Rocks! Karaoke Player"
WorkingDirectory='INSTALLFOLDER'
Icon="syng.ico"
IconIndex="0"
Advertise="yes" />
<Shortcut Id="UninstallProduct"
Name="Uninstall Syng.Rocks! Karaoke Player"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstalls Syng" />
<Shortcut Id="desktopShortcut"
Directory="DesktopFolder"
Name="Syng.Rocks! Karaoke Player"
WorkingDirectory='INSTALLFOLDER'
Icon="syng.ico"
IconIndex="0"
Advertise="yes" />
</Component>
<Directory Id="DataDir" Name="data">
</Directory>
</Directory>
</StandardDirectory>
<ComponentGroup Id="DataFiles" Directory="DataDir">
<Files Include="syng\data\**">
<Exclude Files="syng\syng.exe" />
</Files>
</ComponentGroup>
<StandardDirectory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="syng"/>
</StandardDirectory>
<StandardDirectory Id="DesktopFolder"/>
<Feature Id="syng">
<ComponentRef Id="ProductComponent" />
<ComponentGroupRef Id="DataFiles" />
</Feature></Package>
</Wix>

View file

@ -13,8 +13,6 @@ be one of:
"""
from __future__ import annotations
from collections.abc import Callable
from functools import partial
import logging
import os
import asyncio
@ -35,11 +33,11 @@ from uuid import UUID
from qrcode.main import QRCode
import socketio
from socketio.exceptions import ConnectionError, BadNamespaceError
from socketio.exceptions import ConnectionError
import engineio
from yaml import load, Loader
from syng.player_libmpv import Player
from syng.player_libmpv import Player, QRPosition
from . import SYNG_VERSION, jsonencoder
from .entry import Entry
@ -47,29 +45,6 @@ from .sources import configure_sources, Source
from .log import logger
class ConnectionState:
__is_connected__ = False
__mpv_running__ = False
def is_connected(self) -> bool:
return self.__is_connected__
def is_mpv_running(self) -> bool:
return self.__mpv_running__
def set_disconnected(self) -> None:
self.__is_connected__ = False
def set_connected(self) -> None:
self.__is_connected__ = True
def set_mpv_running(self) -> None:
self.__mpv_running__ = True
def set_mpv_terminated(self) -> None:
self.__mpv_running__ = False
def default_config() -> dict[str, Optional[int | str]]:
"""
Return a default configuration for the client.
@ -81,14 +56,13 @@ def default_config() -> dict[str, Optional[int | str]]:
"server": "https://syng.rocks",
"room": "",
"preview_duration": 3,
"next_up_position": "top",
"secret": None,
"last_song": None,
"waiting_room_policy": None,
"key": None,
"buffer_in_advance": 2,
"qr_box_size": 7,
"qr_position": "top-right",
"qr_box_size": 5,
"qr_position": "bottom-right",
"show_advanced": False,
"log_level": "info",
}
@ -122,8 +96,6 @@ class State:
* `preview_duration` (`Optional[int]`): The duration in seconds the
playback client shows a preview for the next song. This is accounted for
in the calculation of the ETA for songs later in the queue.
* `next_up_position` (`str`): The position of the "next up" box on the screen.
Possible values are: top or bottom.
* `last_song` (`Optional[datetime.datetime]`): A timestamp, defining the end of
the queue.
* `waiting_room_policy` (Optional[str]): One of:
@ -155,17 +127,15 @@ class State:
waiting_room: list[Entry] = field(default_factory=list)
recent: list[Entry] = field(default_factory=list)
config: dict[str, Any] = field(default_factory=default_config)
old_config: dict[str, Any] = field(default_factory=default_config)
class Client:
def __init__(self, config: dict[str, Any]):
config["config"] = default_config() | config["config"]
self.connection_event = asyncio.Event()
self.connection_state = ConnectionState()
self.is_running = False
self.set_log_level(config["config"]["log_level"])
self.sio = socketio.AsyncClient(json=jsonencoder, reconnection_attempts=-1)
self.sio = socketio.AsyncClient(json=jsonencoder)
self.loop: Optional[asyncio.AbstractEventLoop] = None
self.skipped: list[UUID] = []
self.sources = configure_sources(config["sources"])
@ -173,17 +143,12 @@ class Client:
self.currentLock = asyncio.Semaphore(0)
self.buffer_in_advance = config["config"]["buffer_in_advance"]
self.player = Player(
config["config"],
f"{config['config']['server']}/{config['config']['room']}",
1 if config["config"]["qr_box_size"] < 1 else config["config"]["qr_box_size"],
QRPosition.from_string(config["config"]["qr_position"]),
self.quit_callback,
self.state.queue,
)
self.connection_state.set_mpv_running()
logger.debug(f"MPV running: {self.connection_state.is_mpv_running()} ")
self.register_handlers()
self.queue_callbacks: list[Callable[[list[Entry]], None]] = []
def add_queue_callback(self, callback: Callable[[list[Entry]], None]) -> None:
self.queue_callbacks.append(callback)
def set_log_level(self, level: str) -> None:
match level:
@ -206,59 +171,13 @@ class Client:
self.sio.on("get-meta-info", self.handle_get_meta_info)
self.sio.on("play", self.handle_play)
self.sio.on("search", self.handle_search)
self.sio.on("client-registered", self.handle_client_registered)
self.sio.on("request-config", self.handle_request_config)
self.sio.on("msg", self.handle_msg)
self.sio.on("disconnect", self.handle_disconnect)
self.sio.on("room-removed", self.handle_room_removed)
self.sio.on("*", self.handle_unknown_message)
self.sio.on("connect_error", self.handle_connect_error)
async def handle_connect_error(self, data: dict[str, Any]) -> None:
"""
Handle the "connect_error" message.
This function is called when the client fails to connect to the server.
It will log the error and disconnect from the server.
:param data: A dictionary with the error message.
:type data: dict[str, Any]
:rtype: None
"""
logger.critical("Connection error: %s", data["message"])
await self.ensure_disconnect()
async def handle_unknown_message(self, event: str, data: dict[str, Any]) -> None:
"""
Handle unknown messages.
This function is called when the client receives a message, that is not
handled by any of the other handlers. It will log the event and data.
:param event: The name of the event
:type event: str
:param data: The data of the event
:type data: dict[str, Any]
:rtype: None
"""
logger.warning(f"Unknown message: {event} with data: {data}")
async def handle_disconnect(self) -> None:
self.connection_state.set_disconnected()
await self.ensure_disconnect()
async def ensure_disconnect(self) -> None:
"""
Ensure that the client is disconnected from the server and the player is
terminated.
"""
logger.info("Disconnecting from server")
logger.debug(f"Connection: {self.connection_state.is_connected()}")
logger.debug(f"MPV running: {self.connection_state.is_mpv_running()}")
if self.connection_state.is_connected():
await self.sio.disconnect()
if self.connection_state.is_mpv_running():
if self.player.mpv is not None:
self.player.mpv.terminate()
logger.info("Disconnected from server")
async def handle_msg(self, data: dict[str, Any]) -> None:
"""
@ -296,23 +215,6 @@ class Client:
"""
self.state.config = default_config() | data
async def send_update_config(self) -> None:
"""
Send the current configuration to the server.
This is used to update the server with the current configuration of the
client. This is done by sending a "update_config" message to the server.
:rtype: None
"""
changes = dict()
for key, value in self.state.config.items():
if key in default_config() and default_config()[key] != value:
changes[key] = value
await self.sio.emit("update_config", self.state.config)
async def handle_skip_current(self, data: dict[str, Any]) -> None:
"""
Handle the "skip-current" message.
@ -352,9 +254,7 @@ class Client:
:type data: dict[str, Any]
:rtype: None
"""
await self.connection_event.wait()
self.state.queue.clear()
self.state.queue.extend([Entry(**entry) for entry in data["queue"]])
self.state.queue = [Entry(**entry) for entry in data["queue"]]
self.state.waiting_room = [Entry(**entry) for entry in data["waiting_room"]]
self.state.recent = [Entry(**entry) for entry in data["recent"]]
@ -368,60 +268,39 @@ class Client:
if entry.ident in source.downloaded_files:
continue
logger.info("Buffering: %s (%d s)", entry.title, entry.duration)
started = datetime.datetime.now()
try:
await self.sources[entry.source].buffer(entry, pos)
logger.info(
"Buffered %s in %d seconds",
entry.title,
(datetime.datetime.now() - started).seconds,
)
except ValueError as e:
logger.error("Error buffering: %s", e)
await self.sio.emit("skip", {"uuid": entry.uuid})
for callback in self.queue_callbacks:
callback(self.state.queue)
async def handle_connect(self) -> None:
"""
Handle the "connect" message.
This is called when the client successfully connects to the server
and starts the player.
Called when the client successfully connects or reconnects to the server.
Sends a `register-client` message to the server with the initial state and
configuration of the client, consiting of the currently saved
:py:attr:`State.queue` and :py:attr:`State.recent` field of the global
:py:class:`State`, as well a room code the client wants to connect to, a
secret to secure the access to the room and a config dictionary.
Start listing all configured :py:class:`syng.sources.source.Source` to the
server via a "sources" message. This message will be handled by the
:py:func:`syng.server.handle_sources` function and may request additional
configuration for each source.
If the room code is `None`, the server will issue a room code.
If there is no song playing, start requesting the first song of the queue
with a "get-first" message. This will be handled on the server by the
:py:func:`syng.server.handle_get_first` function.
This message will be handled by the
:py:func:`syng.server.handle_register_client` function of the server.
:rtype: None
"""
logger.info("Connected to server: %s", self.state.config["server"])
self.player.start()
room = self.state.config["room"]
server = self.state.config["server"]
logger.info("Connected to room: %s", room)
qr_string = f"{server}/{room}"
self.player.update_qr(qr_string)
# this is borked on windows
if os.name != "nt":
print(f"Join here: {server}/{room}")
qr = QRCode(box_size=20, border=2)
qr.add_data(qr_string)
qr.make()
qr.print_ascii()
await self.sio.emit("sources", {"sources": list(self.sources.keys())})
if self.state.current_source is None: # A possible race condition can occur here
await self.sio.emit("get-first")
self.connection_event.set()
self.connection_state.set_connected()
logger.info("Connected to server")
data = {
"queue": self.state.queue,
"waiting_room": self.state.waiting_room,
"recent": self.state.recent,
"config": self.state.config,
"version": SYNG_VERSION,
}
await self.sio.emit("register-client", data)
async def handle_get_meta_info(self, data: dict[str, Any]) -> None:
"""
@ -480,14 +359,6 @@ class Client:
f"Playing: {entry.artist} - {entry.title} [{entry.album}] "
f"({entry.source}) for {entry.performer}"
)
logger.info(
"Playing: %s - %s [%s] (%s) for %s",
entry.artist,
entry.title,
entry.album,
entry.source,
entry.performer,
)
if entry.uuid not in self.skipped:
try:
if self.state.config["preview_duration"] > 0:
@ -498,17 +369,13 @@ class Client:
await self.player.play(video, audio, source.extra_mpv_options)
except ValueError as e:
logger.error("Error playing: %s", e)
self.skipped.append(entry.uuid)
except Exception: # pylint: disable=broad-except
print_exc()
if self.skipped:
self.skipped.remove(entry.uuid)
await self.sio.emit("get-first")
else:
try:
await self.sio.emit("pop-then-get-next")
except BadNamespaceError:
pass
await self.sio.emit("pop-then-get-next")
async def handle_search(self, data: dict[str, Any]) -> None:
"""
@ -524,7 +391,6 @@ class Client:
:type data: dict[str, Any]
:rtype: None
"""
logger.debug("Handling search: %s (%s)", data["query"], data["search_id"])
query = data["query"]
sid = data["sid"]
search_id = data["search_id"]
@ -537,12 +403,55 @@ class Client:
for source_result in results_list
for search_result in source_result
]
logger.debug("Search results: %d results", len(results))
await self.sio.emit(
"search-results", {"results": results, "sid": sid, "search_id": search_id}
)
async def handle_client_registered(self, data: dict[str, Any]) -> None:
"""
Handle the "client-registered" message.
If the registration was successfull (`data["success"]` == `True`), store
the room code in the global :py:class:`State` and print out a link to join
the webclient.
Start listing all configured :py:class:`syng.sources.source.Source` to the
server via a "sources" message. This message will be handled by the
:py:func:`syng.server.handle_sources` function and may request additional
configuration for each source.
If there is no song playing, start requesting the first song of the queue
with a "get-first" message. This will be handled on the server by the
:py:func:`syng.server.handle_get_first` function.
:param data: A dictionary containing a `success` and a `room` entry.
:type data: dict[str, Any]
:rtype: None
"""
if data["success"]:
self.player.start()
logger.info("Registered")
qr_string = f"{self.state.config['server']}/{data['room']}"
self.player.update_qr(qr_string)
# this is borked on windows
if os.name != "nt":
print(f"Join here: {self.state.config['server']}/{data['room']}")
qr = QRCode(box_size=20, border=2)
qr.add_data(qr_string)
qr.make()
qr.print_ascii()
self.state.config["room"] = data["room"]
await self.sio.emit("sources", {"sources": list(self.sources.keys())})
if self.state.current_source is None: # A possible race condition can occur here
await self.sio.emit("get-first")
else:
reason = data.get("reason", "Unknown")
logger.critical(f"Registration failed: {reason}")
await self.sio.disconnect()
async def handle_request_config(self, data: dict[str, Any]) -> None:
"""
Handle the "request-config" message.
@ -562,7 +471,6 @@ class Client:
:type data: dict[str, Any]
:rtype: None
"""
await self.connection_event.wait()
if data["source"] in self.sources:
config: dict[str, Any] | list[dict[str, Any]] = await self.sources[
data["source"]
@ -579,7 +487,6 @@ class Client:
"total": num_chunks,
},
)
await asyncio.sleep(0.1) # Avoiding qasync errors
else:
await self.sio.emit("config", {"source": data["source"], "config": config})
@ -599,99 +506,22 @@ class Client:
elif updated_config is not None:
await self.sio.emit("config", {"source": data["source"], "config": updated_config})
def signal_handler(self, loop: asyncio.AbstractEventLoop) -> None:
def signal_handler(self) -> None:
"""
Signal handler for the client.
This function is called when the client receives a signal to terminate. It
will disconnect from the server and kill the current player.
:param loop: The asyncio event loop
:type loop: asyncio.AbstractEventLoop
:rtype: None
"""
engineio.async_client.async_signal_handler()
asyncio.ensure_future(self.ensure_disconnect(), loop=loop)
def quit_callback(self) -> None:
"""
Callback function for the player, terminating the player and disconnecting
:rtype: None
"""
self.connection_state.set_mpv_terminated()
if self.loop is not None:
asyncio.run_coroutine_threadsafe(self.ensure_disconnect(), self.loop)
asyncio.run_coroutine_threadsafe(self.kill_mpv(), self.loop)
async def kill_mpv(self) -> None:
"""
Kill the mpv process. Needs to be called in a seperate thread, because of mpv...
See https://github.com/jaseg/python-mpv/issues/114#issuecomment-1214305952
:rtype: None
"""
if self.player.mpv is not None:
self.player.mpv.terminate()
async def remove_room(self) -> None:
"""
Remove the room from the server.
"""
if self.state.config["room"] is not None:
logger.info("Removing room %s from server", self.state.config["room"])
await self.sio.emit("remove-room", {"room": self.state.config["room"]})
def export_queue(self, filename: str) -> None:
"""
Export the current queue to a file.
:param filename: The name of the file to export the queue to.
:type filename: str
:rtype: None
"""
with open(filename, "w", encoding="utf8") as file:
jsonencoder.dump(
{
"queue": self.state.queue,
"waiting_room": self.state.waiting_room,
"recent": self.state.recent,
},
file,
indent=2,
ensure_ascii=False,
)
async def import_queue(self, filename: str) -> None:
"""
Import a queue from a file.
:param filename: The name of the file to import the queue from.
:type filename: str
:rtype: None
"""
with open(filename, "r", encoding="utf8") as file:
data = jsonencoder.load(file)
queue = [Entry(**entry) for entry in data["queue"]]
waiting_room = [Entry(**entry) for entry in data["waiting_room"]]
recent = [Entry(**entry) for entry in data["recent"]]
await self.sio.emit(
"import-queue", {"queue": queue, "waiting_room": waiting_room, "recent": recent}
)
async def handle_room_removed(self, data: dict[str, Any]) -> None:
"""
Handle the "room-removed" message.
This is called when the server removes the room, that this client is
connected to. We simply log this event.
:param data: A dictionary with the `room` entry.
:type data: dict[str, Any]
:rtype: None
"""
logger.info("Room removed: %s", data["room"])
def quit_callback(self) -> None:
if self.loop is not None:
asyncio.run_coroutine_threadsafe(self.sio.disconnect(), self.loop)
async def start_client(self, config: dict[str, Any]) -> None:
"""
@ -724,28 +554,22 @@ class Client:
self.state.config["key"] = ""
try:
data = {
"type": "playback",
"queue": self.state.queue,
"waiting_room": self.state.waiting_room,
"recent": self.state.recent,
"config": self.state.config,
"version": SYNG_VERSION,
}
await self.sio.connect(self.state.config["server"], auth=data)
await self.sio.connect(self.state.config["server"])
# this is not supported under windows
if os.name != "nt":
loop = asyncio.get_event_loop()
loop.add_signal_handler(signal.SIGINT, partial(self.signal_handler, loop))
asyncio.get_event_loop().add_signal_handler(signal.SIGINT, self.signal_handler)
self.is_running = True
await self.sio.wait()
except asyncio.CancelledError:
pass
except ConnectionError as e:
logger.warning("Could not connect to server: %s", e.args[0])
except ConnectionError:
logger.critical("Could not connect to server")
finally:
await self.ensure_disconnect()
self.is_running = False
if self.player.mpv is not None:
self.player.mpv.terminate()
def create_async_and_start_client(

View file

@ -28,15 +28,7 @@ except ImportError:
os.environ["QT_API"] = "pyqt6"
from qasync import QEventLoop, QApplication
from PyQt6.QtCore import (
QAbstractListModel,
QModelIndex,
QObject,
QTimer,
Qt,
pyqtSignal,
pyqtSlot,
)
from PyQt6.QtCore import QObject, QTimer, Qt, pyqtSignal, pyqtSlot
from PyQt6.QtGui import QCloseEvent, QIcon, QPixmap
from PyQt6.QtWidgets import (
QCheckBox,
@ -48,7 +40,6 @@ from PyQt6.QtWidgets import (
QLabel,
QLayout,
QLineEdit,
QListView,
QMainWindow,
QMessageBox,
QPushButton,
@ -68,7 +59,6 @@ import platformdirs
from . import resources # noqa
from .client import Client, default_config
from .log import logger
from .entry import Entry
from .sources import available_sources
from .config import (
@ -83,28 +73,6 @@ from .config import (
)
class QueueModel(QAbstractListModel):
def __init__(self, queue: list[Entry]) -> None:
super().__init__()
self.queue = queue
def update(self, queue: list[Entry]) -> None:
self.queue = queue
self.dataChanged.emit(self.index(0, 0), self.index(self.rowCount() - 1, 0))
def data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) -> Any:
if role == Qt.ItemDataRole.DisplayRole:
entry = self.queue[index.row()]
return f"{entry.title} - {entry.artist} [{entry.album}]\n{entry.performer}"
def rowCount(self, parent: QModelIndex = QModelIndex()) -> int:
return len(self.queue)
class QueueView(QListView):
pass
class OptionFrame(QWidget):
def add_bool_option(self, name: str, description: str, value: bool = False) -> None:
label = QLabel(description, self)
@ -483,11 +451,6 @@ class GeneralConfig(OptionFrame):
self.add_int_option(
"preview_duration", "Preview duration in seconds", int(config["preview_duration"])
)
self.add_int_option(
"next_up_time",
"Time remaining before Next Up Box is shown",
int(config["next_up_time"]),
)
self.add_string_option(
"key", "Key for server (if necessary)", config["key"], is_password=True
)
@ -509,6 +472,7 @@ class GeneralConfig(OptionFrame):
["debug", "info", "warning", "error", "critical"],
config["log_level"],
)
self.add_bool_option("show_advanced", "Show Advanced Options", config["show_advanced"])
self.simple_options = ["server", "room", "secret"]
@ -533,14 +497,11 @@ class GeneralConfig(OptionFrame):
class SyngGui(QMainWindow):
def closeEvent(self, a0: Optional[QCloseEvent]) -> None:
if self.client is not None:
if self.client.player is not None and self.client.player.mpv is not None:
self.client.player.mpv.terminate()
self.client.quit_callback()
self.log_label_handler.cleanup()
self.destroy()
sys.exit(0)
def add_buttons(self, show_advanced: bool) -> None:
self.buttons_layout = QHBoxLayout()
@ -568,84 +529,11 @@ class SyngGui(QMainWindow):
spacer_item = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
self.buttons_layout.addItem(spacer_item)
if os.getenv("SYNG_DEBUG", "0") == "1":
self.print_background_tasks_button = QPushButton("Print Background Tasks")
self.print_background_tasks_button.clicked.connect(
lambda: print(asyncio.all_tasks(self.loop))
)
self.buttons_layout.addWidget(self.print_background_tasks_button)
self.startbutton = QPushButton("Connect")
self.startbutton.clicked.connect(self.start_syng_client)
self.buttons_layout.addWidget(self.startbutton)
def export_queue(self) -> None:
if self.client is not None:
filename = QFileDialog.getSaveFileName(self, "Export Queue", "", "JSON Files (*.json)")[
0
]
if filename:
self.client.export_queue(filename)
else:
QMessageBox.warning(
self,
"No Client Running",
"You need to start the client before you can export the queue.",
)
def import_queue(self) -> None:
if self.client is not None:
filename = QFileDialog.getOpenFileName(self, "Import Queue", "", "JSON Files (*.json)")[
0
]
if filename:
asyncio.create_task(self.client.import_queue(filename))
else:
QMessageBox.warning(
self,
"No Client Running",
"You need to start the client before you can import a queue.",
)
def clear_cache(self) -> None:
"""
Clear the cache directory of the client.
"""
cache_dir = platformdirs.user_cache_dir("syng")
if os.path.exists(cache_dir):
answer = QMessageBox.question(
self,
"Clear Cache",
f"Are you sure you want to clear the cache directory at {cache_dir}?",
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No,
)
if answer == QMessageBox.StandardButton.Yes:
for root, dirs, files in os.walk(cache_dir, topdown=False):
for name in files:
os.remove(os.path.join(root, name))
for name in dirs:
os.rmdir(os.path.join(root, name))
QMessageBox.information(self, "Cache Cleared", "The cache has been cleared.")
def remove_room(self) -> None:
if self.client is not None:
answer = QMessageBox.question(
self,
"Remove Room",
"Are you sure you want to remove the room on the server? This will disconnect all clients and clear the queue.",
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No,
)
if answer == QMessageBox.StandardButton.Yes:
asyncio.create_task(self.client.remove_room())
else:
QMessageBox.warning(
self,
"No Client Running",
"You need to start the client before you can remove a room.",
)
def toggle_advanced(self, state: bool) -> None:
self.resetbutton.setVisible(state)
self.exportbutton.setVisible(state)
@ -738,51 +626,9 @@ class SyngGui(QMainWindow):
self.tabview.addTab(self.log_tab, "Logs")
def add_queue_tab(self) -> None:
self.queue_tab = QWidget(parent=self.central_widget)
self.queue_layout = QVBoxLayout(self.queue_tab)
self.queue_tab.setLayout(self.queue_layout)
self.queue_list_view: QueueView = QueueView(self.queue_tab)
self.queue_layout.addWidget(self.queue_list_view)
self.tabview.addTab(self.queue_tab, "Queue")
def add_admin_tab(self) -> None:
self.admin_tab = QWidget(parent=self.central_widget)
self.admin_layout = QVBoxLayout(self.admin_tab)
self.admin_layout.setAlignment(Qt.AlignmentFlag.AlignVCenter)
self.admin_tab.setLayout(self.admin_layout)
self.remove_room_button = QPushButton("Remove Room", self.admin_tab)
self.remove_room_button.clicked.connect(self.remove_room)
self.admin_layout.addWidget(self.remove_room_button)
self.remove_room_button.setDisabled(True)
self.export_queue_button = QPushButton("Export Queue", self.admin_tab)
self.export_queue_button.clicked.connect(self.export_queue)
self.admin_layout.addWidget(self.export_queue_button)
self.export_queue_button.setDisabled(True)
self.import_queue_button = QPushButton("Import Queue", self.admin_tab)
self.import_queue_button.clicked.connect(self.import_queue)
self.admin_layout.addWidget(self.import_queue_button)
self.import_queue_button.setDisabled(True)
self.update_config_button = QPushButton("Update Config")
self.update_config_button.clicked.connect(self.update_config)
self.admin_layout.addWidget(self.update_config_button)
self.update_config_button.setDisabled(True)
self.clear_cache_button = QPushButton("Clear Cache", self.admin_tab)
self.clear_cache_button.clicked.connect(self.clear_cache)
self.admin_layout.addWidget(self.clear_cache_button)
self.tabview.addTab(self.admin_tab, "Admin")
def __init__(self) -> None:
super().__init__()
self.setWindowTitle("Syng.Rocks!")
self.setWindowTitle("Syng")
if os.name != "nt":
self.setWindowIcon(QIcon(":/icons/syng.ico"))
@ -808,8 +654,6 @@ class SyngGui(QMainWindow):
for source_name in available_sources:
self.add_source_config(source_name, config["sources"][source_name])
# self.add_queue_tab()
self.add_admin_tab()
self.add_log_tab()
self.update_qr()
@ -923,42 +767,25 @@ class SyngGui(QMainWindow):
self.timer.stop()
return
if not self.client.connection_state.is_connected():
if not self.client.is_running:
self.client = None
self.set_client_button_start()
else:
self.set_client_button_stop()
def set_client_button_stop(self) -> None:
self.general_config.string_options["server"].setEnabled(False)
self.general_config.string_options["room"].setEnabled(False)
self.update_config_button.setDisabled(False)
self.remove_room_button.setDisabled(False)
self.export_queue_button.setDisabled(False)
self.import_queue_button.setDisabled(False)
self.startbutton.setText("Disconnect")
def set_client_button_start(self) -> None:
self.general_config.string_options["server"].setEnabled(True)
self.general_config.string_options["room"].setEnabled(True)
self.update_config_button.setDisabled(True)
self.remove_room_button.setDisabled(True)
self.export_queue_button.setDisabled(True)
self.import_queue_button.setDisabled(True)
self.startbutton.setText("Connect")
def start_syng_client(self) -> None:
if self.client is None or not self.client.connection_state.is_connected():
if self.client is None or not self.client.is_running:
logger.debug("Starting client")
self.save_config()
config = self.gather_config()
self.client = Client(config)
asyncio.run_coroutine_threadsafe(self.client.start_client(config), self.loop)
# model = QueueModel(self.client.state.queue)
# self.queue_list_view.setModel(model)
# self.client.add_queue_callback(model.update)
self.timer.start(500)
self.set_client_button_stop()
else:
@ -1037,7 +864,7 @@ def run_gui() -> None:
app.setWindowIcon(QIcon(os.path.join(base_dir, "syng.ico")))
else:
app.setWindowIcon(QIcon(":/icons/syng.ico"))
app.setApplicationName("Syng.Rocks!")
app.setApplicationName("Syng")
app.setDesktopFileName("rocks.syng.Syng")
window = SyngGui()
window.show()

View file

@ -34,20 +34,10 @@ class SyngEncoder(json.JSONEncoder):
def dumps(obj: Any, **kw: Any) -> str:
"""Wrap around ``json.dumps`` with the :py:class:`SyngEncoder`."""
"""Wrap around ``json.dump`` with the :py:class:`SyngEncoder`."""
return json.dumps(obj, cls=SyngEncoder, **kw)
def dump(obj: Any, fp: Any, **kw: Any) -> None:
"""Forward everything to ``json.dump``."""
json.dump(obj, fp, cls=SyngEncoder, **kw)
def loads(string: str, **kw: Any) -> Any:
"""Forward everything to ``json.loads``."""
return json.loads(string, **kw)
def load(fp: Any, **kw: Any) -> Any:
"""Forward everything to ``json.load``."""
return json.load(fp, **kw)

View file

@ -41,7 +41,6 @@ import traceback
import platformdirs
gui_exception = ""
try:
from syng.gui import run_gui
@ -111,13 +110,6 @@ def main() -> None:
server_parser.add_argument("--private", "-P", action="store_true", default=False)
server_parser.add_argument("--restricted", "-R", action="store_true", default=False)
server_parser.add_argument("--admin-password", "-A", default=None)
server_parser.add_argument("--admin-port", "-a", type=int, default=None)
server_parser.add_argument(
"--log-level",
"-l",
default="INFO",
choices=["DEBUG", "INFO", "WARNING", "ERROR", "FATAL"],
)
args = parser.parse_args()
@ -126,17 +118,12 @@ def main() -> None:
elif args.action == "server":
run_server(args)
elif args.action == "gui":
if not GUI_AVAILABLE:
print("GUI module is not available.")
print(gui_exception)
else:
run_gui()
run_gui()
else:
if not GUI_AVAILABLE:
print("GUI module is not available.")
print(gui_exception)
else:
try:
run_gui()
except NameError:
print(gui_exception)
if __name__ == "__main__":

View file

@ -2,7 +2,7 @@ import asyncio
from enum import Enum
import locale
import sys
from typing import Any, Callable, Iterable, Optional, cast
from typing import Callable, Iterable, Optional, cast
from qrcode.main import QRCode
import mpv
import os
@ -34,23 +34,21 @@ class QRPosition(Enum):
class Player:
def __init__(
self,
config: dict[str, Any],
qr_string: str,
qr_box_size: int,
qr_position: QRPosition,
quit_callback: Callable[[], None],
queue: Optional[list[Entry]] = None,
) -> None:
locale.setlocale(locale.LC_ALL, "C")
qr_string = f"{config['server']}/{config['room']}"
self.queue = queue if queue is not None else []
self.base_dir = f"{os.path.dirname(__file__)}/static"
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
self.base_dir = getattr(sys, "_MEIPASS")
self.closing = False
self.mpv: Optional[mpv.MPV] = None
self.qr_overlay: Optional[mpv.ImageOverlay] = None
self.qr_box_size = 1 if config["qr_box_size"] < 1 else config["qr_box_size"]
self.qr_position = QRPosition.from_string(config["qr_position"])
self.next_up_time = config.get("next_up_time", 20)
self.qr_box_size = qr_box_size
self.qr_position = qr_position
self.update_qr(
qr_string,
)
@ -62,57 +60,16 @@ class Player:
self.callback_audio_load: Optional[str] = None
def start(self) -> None:
self.mpv = mpv.MPV(
ytdl=True,
input_default_bindings=True,
input_vo_keyboard=True,
osc=True,
osd_border_style="background-box",
osd_back_color="#30008000",
osd_color="#50FFFFFF",
osd_outline_color="#50000000",
osd_shadow_offset=10,
osd_align_x="center",
osd_align_y="top",
)
self.next_up_overlay_id = self.mpv.allocate_overlay_id()
self.next_up_y_pos = -120
self.mpv.title = "Syng.Rocks! - Player"
self.mpv = mpv.MPV(ytdl=True, input_default_bindings=True, input_vo_keyboard=True, osc=True)
self.mpv.title = "Syng - Player"
self.mpv.keep_open = "yes"
self.mpv.play(
f"{self.base_dir}/background.png",
)
self.mpv.observe_property("osd-width", self.osd_size_handler)
self.mpv.observe_property("osd-height", self.osd_size_handler)
self.mpv.observe_property("playtime-remaining", self.playtime_remaining_handler)
self.mpv.register_event_callback(self.event_callback)
def playtime_remaining_handler(self, attribute: str, value: float) -> None:
if self.mpv is None:
print("MPV is not initialized", file=sys.stderr)
return
hidden = value is None or value > self.next_up_time
if len(self.queue) < 2:
return
if not hidden:
if self.next_up_y_pos < 0:
self.next_up_y_pos += 5
else:
self.next_up_y_pos = -120
entry = self.queue[1]
self.mpv.command(
"osd_overlay",
id=self.next_up_overlay_id,
data=f"{{\\pos({1920 // 2},{self.next_up_y_pos})}}Next Up: {entry.artist} - {entry.title} ({entry.performer})",
res_x=1920,
res_y=1080,
z=0,
hidden=hidden,
format="ass-events",
)
def event_callback(self, event: mpv.MpvEvent) -> None:
e = event.as_dict()
if e["event"] == b"shutdown":
@ -242,3 +199,4 @@ class Player:
self.mpv.play(
f"{self.base_dir}/background.png",
)
# self.mpv.playlist_next()

View file

@ -31,17 +31,6 @@ class Queue:
self.num_of_entries_sem = asyncio.Semaphore(len(self._queue))
self.readlock = asyncio.Lock()
def extend(self, entries: Iterable[Entry]) -> None:
"""
Extend the queue with a list of entries and increase the semaphore.
:param entries: The entries to add
:type entries: Iterable[Entry]
:rtype: None
"""
for entry in entries:
self.append(entry)
def append(self, entry: Entry) -> None:
"""
Append an entry to the queue, increase the semaphore.
@ -119,7 +108,7 @@ class Queue:
def find_by_name(self, name: str) -> Optional[Entry]:
"""
Find the first entry by its performer and return it.
Find an entry by its performer and return it.
:param name: The name of the performer to search for.
:type name: str
@ -131,20 +120,6 @@ class Queue:
return item
return None
def find_all_by_name(self, name: str) -> Iterable[Entry]:
"""
Find all entries by their performer and return them as an iterable.
:param name: The name of the performer to search for.
:type name: str
:returns: The entries with the performer.
:rtype: Iterable[Entry]
"""
for item in self._queue:
if item.shares_performer(name):
yield item
def find_by_uuid(self, uuid: UUID | str) -> Optional[Entry]:
"""
Find an entry by its uuid and return it.

View file

@ -16,7 +16,6 @@ from __future__ import annotations
import asyncio
import datetime
import hashlib
import logging
import os
import random
import string
@ -25,10 +24,9 @@ from json.decoder import JSONDecodeError
from argparse import Namespace
from dataclasses import dataclass
from dataclasses import field
from typing import Any, Callable, Literal, AsyncGenerator, Optional, cast
from typing import Any, Callable, Literal, AsyncGenerator, Optional
import socketio
from socketio.exceptions import ConnectionRefusedError
from aiohttp import web
try:
@ -93,7 +91,7 @@ def admin(handler: Callable[..., Any]) -> Callable[..., Any]:
async def wrapper(self: Server, sid: str, *args: Any, **kwargs: Any) -> Any:
async with self.sio.session(sid) as session:
room = session["room"]
if room not in self.clients or not await self.is_admin(self.clients[room], sid):
if ("admin" not in session or not session["admin"]) and self.clients[room].sid != sid:
await self.sio.emit("err", {"type": "NO_ADMIN"}, sid)
return
return await handler(self, sid, *args, **kwargs)
@ -196,9 +194,6 @@ class Server:
cors_allowed_origins="*", logger=True, engineio_logger=False, json=jsonencoder
)
self.app = web.Application()
self.runner = web.AppRunner(self.app)
self.admin_app = web.Application()
self.admin_runner = web.AppRunner(self.admin_app)
self.clients: dict[str, State] = {}
self.sio.attach(self.app)
self.register_handlers()
@ -213,7 +208,6 @@ class Server:
self.sio.on("meta-info", self.handle_meta_info)
self.sio.on("get-first", self.handle_get_first)
self.sio.on("waiting-room-to-queue", self.handle_waiting_room_to_queue)
self.sio.on("queue-to-waiting-room", self.handle_queue_to_waiting_room)
self.sio.on("pop-then-get-next", self.handle_pop_then_get_next)
self.sio.on("register-client", self.handle_register_client)
self.sio.on("sources", self.handle_sources)
@ -221,32 +215,13 @@ class Server:
self.sio.on("config", self.handle_config)
self.sio.on("register-web", self.handle_register_web)
self.sio.on("register-admin", self.handle_register_admin)
self.sio.on("remove-room", self.handle_remove_room)
self.sio.on("skip-current", self.handle_skip_current)
self.sio.on("move-to", self.handle_move_to)
self.sio.on("move-up", self.handle_move_up)
self.sio.on("skip", self.handle_skip)
self.sio.on("disconnect", self.handle_disconnect)
self.sio.on("connect", self.handle_connect)
self.sio.on("search", self.handle_search)
self.sio.on("search-results", self.handle_search_results)
self.sio.on("import-queue", self.handle_import_queue)
async def is_admin(self, state: State, sid: str) -> bool:
"""
Check if a given sid is an admin in a room.
:param room: The room to check
:type room: str
:param sid: The session id to check
:type sid: str
:return: True if the sid is an admin in the room, False otherwise
:rtype: bool
"""
if state.sid == sid:
return True
async with self.sio.session(sid) as session:
return "admin" in session and session["admin"]
async def root_handler(self, request: Any) -> Any:
"""
@ -264,89 +239,9 @@ class Server:
return web.FileResponse(os.path.join(self.app["root_folder"], "favicon.ico"))
return web.FileResponse(os.path.join(self.app["root_folder"], "index.html"))
def get_number_connections(self) -> int:
"""
Get the number of connections to the server.
:return: The number of connections
:rtype: int
"""
num = 0
for namespace in self.sio.manager.get_namespaces():
for room in self.sio.manager.rooms[namespace]:
for participant in self.sio.manager.get_participants(namespace, room):
num += 1
return num
def get_connections(self) -> dict[str, dict[str, list[tuple[str, str]]]]:
"""
Get all connections to the server.
:return: A dictionary mapping namespaces to rooms and participants.
:rtype: dict[str, dict[str, list[tuple[str, str]]]]
"""
connections: dict[str, dict[str, list[tuple[str, str]]]] = {}
for namespace in self.sio.manager.get_namespaces():
connections[namespace] = {}
for room in self.sio.manager.rooms[namespace]:
connections[namespace][room] = []
for participant in self.sio.manager.get_participants(namespace, room):
connections[namespace][room].append(participant)
return connections
async def get_clients(self, room: str) -> list[dict[str, Any]]:
"""
Get the number of clients in a room.
:param room: The room to get the number of clients for
:type room: str
:return: The number of clients in the room
:rtype: int
"""
clients = []
for sid, client_id in self.sio.manager.get_participants("/", room):
client: dict[str, Any] = {}
client["sid"] = sid
if sid == self.clients[room].sid:
client["type"] = "playback"
else:
client["type"] = "web"
client["admin"] = await self.is_admin(self.clients[room], sid)
clients.append(client)
return clients
async def admin_handler(self, request: Any) -> Any:
"""
Handle the admin request.
"""
rooms = [
{
"room": room,
"sid": state.sid,
"last_seen": state.last_seen.isoformat(),
"queue": state.queue.to_list(),
"waiting_room": state.waiting_room,
"clients": await self.get_clients(room),
}
for room, state in self.clients.items()
]
info_dict = {
"version": SYNG_VERSION,
"protocol_version": SYNG_PROTOCOL_VERSION,
"num_connections": self.get_number_connections(),
"connections": self.get_connections(),
"rooms": rooms,
}
return web.json_response(info_dict, dumps=jsonencoder.dumps)
async def broadcast_state(
self, state: State, /, sid: Optional[str] = None, room: Optional[str] = None
) -> None:
if room is None:
sid = state.sid if sid is None else sid
async with self.sio.session(sid) as session:
room = cast(str, session["room"])
async def broadcast_state(self, state: State) -> None:
async with self.sio.session(state.sid) as session:
room = session["room"]
await self.send_state(state, room)
async def log_to_playback(self, state: State, msg: str, level: str = "info") -> None:
@ -459,7 +354,7 @@ class Server:
entry.uid = data["uid"]
state.waiting_room.append(entry)
await self.broadcast_state(state, sid=sid)
await self.broadcast_state(state)
await self.sio.emit(
"get-meta-info",
entry,
@ -495,9 +390,7 @@ class Server:
start_time,
)
if (report_to is None or not await self.is_admin(state, report_to)) and state.client.config[
"last_song"
]:
if state.client.config["last_song"]:
if state.client.config["last_song"] < start_time:
if report_to is not None:
await self.sio.emit(
@ -511,7 +404,7 @@ class Server:
return
state.queue.append(entry)
await self.broadcast_state(state, sid=report_to)
await self.broadcast_state(state)
await self.sio.emit(
"get-meta-info",
@ -657,7 +550,6 @@ class Server:
)
return None
logger.debug(f"Appending {entry} to queue in room {state.sid}")
entry.uid = data["uid"] if "uid" in data else None
await self.append_to_queue(state, entry, sid)
@ -759,7 +651,7 @@ class Server:
if entry.uuid == data["uuid"] or str(entry.uuid) == data["uuid"]:
entry.update(**data["meta"], incomplete_data=False)
await self.broadcast_state(state, sid=sid)
await self.broadcast_state(state)
@playback
@with_state
@ -786,33 +678,6 @@ class Server:
await self.sio.emit("play", current, room=sid)
@admin
@with_state
async def handle_queue_to_waiting_room(
self, state: State, sid: str, data: dict[str, Any]
) -> None:
"""
Handle the "queue-to-waiting" message.
If on an admin-connection, removes a song from the queue and appends it to
the waiting room. If the performer has only one entry in the queue, it is
put back into the queue immediately.
:param sid: The session id of the requesting client
:type sid: str
:rtype: None
"""
entry = state.queue.find_by_uuid(data["uuid"])
if entry is not None:
performer_entries = list(state.queue.find_all_by_name(entry.performer))
print(performer_entries)
if len(performer_entries) == 1:
return
await state.queue.remove(entry)
state.waiting_room.append(entry)
await self.broadcast_state(state, sid=sid)
@admin
@with_state
async def handle_waiting_room_to_queue(
@ -900,11 +765,11 @@ class Server:
:rtype: None
"""
await self.discard_first(state)
await self.broadcast_state(state, sid=sid)
await self.broadcast_state(state)
current = await state.queue.peek()
current.started_at = datetime.datetime.now().timestamp()
await self.broadcast_state(state, sid=sid)
await self.broadcast_state(state)
await self.sio.emit("play", current, room=sid)
@ -946,7 +811,7 @@ class Server:
{"success": False, "room": None, "reason": "PROTOCOL_VERSION"},
room=sid,
)
raise ConnectionRefusedError("Client is incompatible and outdated. Please update.")
return False
if client_version > SYNG_VERSION:
await self.sio.emit(
@ -954,7 +819,12 @@ class Server:
{"type": "error", "msg": "Server is outdated. Please update."},
room=sid,
)
raise ConnectionRefusedError("Server is outdated. Please update.")
await self.sio.emit(
"client-registered",
{"success": False, "room": None, "reason": "PROTOCOL_VERSION"},
room=sid,
)
return False
if client_version < SYNG_VERSION:
await self.sio.emit(
@ -964,69 +834,8 @@ class Server:
)
return True
@admin
@with_state
async def handle_import_queue(self, state: State, sid: str, data: dict[str, Any]) -> None:
"""
Handle the "import-queue" message.
This will add entries to the queue and waiting room from the client.
The data dictionary should have the following keys:
- `queue`, a list of entries to import into the queue
- `waiting_room`, a list of entries to import into the waiting room
:param sid: The session id of the client sending this request
:type sid: str
:param data: A dictionary with the keys described above
:type data: dict[str, Any]
:rtype: None
"""
queue_entries = [Entry(**entry) for entry in data.get("queue", [])]
waiting_room_entries = [Entry(**entry) for entry in data.get("waiting_room", [])]
recent_entries = [Entry(**entry) for entry in data.get("recent", [])]
state.queue.extend(queue_entries)
state.waiting_room.extend(waiting_room_entries)
state.recent.extend(recent_entries)
await self.broadcast_state(state, sid=sid)
@admin
@with_state
async def handle_remove_room(self, state: State, sid: str, data: dict[str, Any]) -> None:
"""
Handle the "remove-room" message.
This will remove the room from the server, and delete all associated data.
This is only available on an admin connection.
:param sid: The session id of the client sending this request
:type sid: str
:rtype: None
"""
async with self.sio.session(sid) as session:
room = cast(str, session["room"])
if room not in self.clients:
await self.sio.emit(
"msg",
{"type": "error", "msg": f"Room {room} does not exist."},
room=sid,
)
return
await self.sio.emit("room-removed", {"room": room}, room=sid)
for client, _ in self.sio.manager.get_participants("/", room):
await self.sio.leave_room(client, room)
await self.sio.disconnect(client)
del self.clients[room]
logger.info("Removed room %s", room)
async def handle_register_client(self, sid: str, data: dict[str, Any]) -> None:
"""
THIS IS DEPRECATED, REGISTRATION IS NOW DONE VIA THE CONNECT EVENT.
Handle the "register-client" message.
The data dictionary should have the following keys:
@ -1071,17 +880,17 @@ class Server:
:rtype: None
"""
# if "version" not in data:
# await self.sio.emit(
# "client-registered",
# {"success": False, "room": None, "reason": "NO_VERSION"},
# room=sid,
# )
# return
#
# client_version = tuple(data["version"])
# if not await self.check_client_version(client_version, sid):
# return
if "version" not in data:
await self.sio.emit(
"client-registered",
{"success": False, "room": None, "reason": "NO_VERSION"},
room=sid,
)
return
client_version = tuple(data["version"])
if not await self.check_client_version(client_version, sid):
return
def gen_id(length: int = 4) -> str:
client_id = "".join([random.choice(string.ascii_letters) for _ in range(length)])
@ -1125,17 +934,7 @@ class Server:
config=DEFAULT_CONFIG | data["config"],
)
await self.sio.enter_room(sid, room)
await self.sio.emit(
"client-registered",
{
"success": True,
"room": room,
"queue": self.clients[room].queue,
"recent": self.clients[room].recent,
"waiting_room": self.clients[room].waiting_room,
},
room=sid,
)
await self.sio.emit("client-registered", {"success": True, "room": room}, room=sid)
await self.send_state(self.clients[room], sid)
else:
logger.warning("Got wrong secret for %s", room)
@ -1159,18 +958,8 @@ class Server:
)
await self.sio.enter_room(sid, room)
await self.sio.emit(
"client-registered",
{
"success": True,
"room": room,
"queue": self.clients[room].queue,
"recent": self.clients[room].recent,
"waiting_room": self.clients[room].waiting_room,
},
room=sid,
)
# await self.send_state(self.clients[room], sid)
await self.sio.emit("client-registered", {"success": True, "room": room}, room=sid)
await self.send_state(self.clients[room], sid)
@playback
@with_state
@ -1250,191 +1039,8 @@ class Server:
"""
state.client.sources[data["source"]] = available_sources[data["source"]](data["config"])
async def handle_connect(
self, sid: str, environ: dict[str, Any], auth: None | dict[str, Any] = None
) -> None:
"""
Handle the "connect" message.
This is called, when a client connects to the server. It will register the
client and send the initial state of the room to the client.
:param sid: The session id of the requesting client.
:type sid: str
:param data: A dictionary with the keys described in
:py:func:`handle_register_client`.
:type data: dict[str, Any]
:rtype: None
"""
logger.debug("Client %s connected", sid)
if auth is None or "type" not in auth:
logger.warning(
"Client %s connected without auth data, fall back to old registration", sid
)
return
# raise ConnectionRefusedError("No authentication data provided. Please register first.")
match auth["type"]:
case "playback":
await self.register_playback_client(sid, auth)
case "web":
await self.register_web_client(sid, auth)
async def register_web_client(self, sid: str, auth: dict[str, Any]) -> None:
if auth["room"] in self.clients:
logger.info("Client %s registered for room %s", sid, auth["room"])
async with self.sio.session(sid) as session:
session["room"] = auth["room"]
await self.sio.enter_room(sid, session["room"])
state = self.clients[session["room"]]
await self.send_state(state, sid)
is_admin = False
if "secret" in auth:
is_admin = auth["secret"] == state.client.config["secret"]
async with self.sio.session(sid) as session:
session["admin"] = is_admin
await self.sio.emit("admin", is_admin, room=sid)
else:
logger.warning(
"Client %s tried to register for non-existing room %s", sid, auth["room"]
)
raise ConnectionRefusedError(
f"Room {auth['room']} does not exist. Please register first."
)
async def register_playback_client(self, sid: str, data: dict[str, Any]) -> None:
"""
Register a new playback client and create a new room if necessary.
The data dictionary should have the following keys:
- `room` (Optional), the requested room
- `config`, an dictionary of initial configurations
- `queue`, a list of initial entries for the queue. The entries are
encoded as a dictionary.
- `recent`, a list of initial entries for the recent list. The entries
are encoded as a dictionary.
- `secret`, the secret of the room
- `version`, the version of the client as a triple of integers
- `key`, a registration key given out by the server administrator
This will register a new playback client to a specific room. If there
already exists a playback client registered for this room, this
playback client will be replaced if and only if, the new playback
client has the same secret.
If registration is restricted, abort, if the given key is not in the
registration keyfile.
If no room is provided, a fresh room id is generated.
If the client provides a new room, or a new room id was generated, the
server will create a new :py:class:`State` object and associate it with
the room id. The state will be initialized with a queue and recent
list, an initial config as well as no sources (yet).
In any case, the client will be notified of the success or failure, along
with its assigned room key via a "client-registered" message. This will be
handled by the :py:func:`syng.client.handle_client_registered` function.
If it was successfully registerd, the client will be added to its assigend
or requested room.
Afterwards all clients in the room will be send the current state.
:param sid: The session id of the requesting playback client.
:type sid: str
:param data: A dictionary with the keys described above
:type data: dict[str, Any]
:rtype: None
"""
if "version" not in data:
pass
# TODO: Fallback to old registration method
# await self.sio.emit(
# "client-registered",
# {"success": False, "room": None, "reason": "NO_VERSION"},
# room=sid,
# )
return
client_version = tuple(data["version"])
if not await self.check_client_version(client_version, sid):
return
def gen_id(length: int = 4) -> str:
client_id = "".join([random.choice(string.ascii_letters) for _ in range(length)])
if client_id in self.clients:
client_id = gen_id(length + 1)
return client_id
if "key" in data["config"]:
data["config"]["key"] = hashlib.sha256(data["config"]["key"].encode()).hexdigest()
if self.app["type"] == "private" and (
"key" not in data["config"] or not self.check_registration(data["config"]["key"])
):
await self.sio.emit(
"client-registered",
{
"success": False,
"room": None,
"reason": "PRIVATE",
},
room=sid,
)
raise ConnectionRefusedError(
"Private server, registration key not provided or invalid."
)
room: str = (
data["config"]["room"]
if "room" in data["config"] and data["config"]["room"]
else gen_id()
)
async with self.sio.session(sid) as session:
session["room"] = room
if room in self.clients:
old_state: State = self.clients[room]
if data["config"]["secret"] == old_state.client.config["secret"]:
logger.info("Got new playback client connection for %s", room)
old_state.sid = sid
old_state.client = Client(
sources=old_state.client.sources,
sources_prio=old_state.client.sources_prio,
config=DEFAULT_CONFIG | data["config"],
)
await self.sio.enter_room(sid, room)
await self.send_state(self.clients[room], sid)
else:
logger.warning("Got wrong secret for %s", room)
raise ConnectionRefusedError(f"Wrong secret for room {room}.")
else:
logger.info("Registerd new playback client %s", room)
initial_entries = [Entry(**entry) for entry in data["queue"]]
initial_waiting_room = [Entry(**entry) for entry in data["waiting_room"]]
initial_recent = [Entry(**entry) for entry in data["recent"]]
self.clients[room] = State(
queue=Queue(initial_entries),
waiting_room=initial_waiting_room,
recent=initial_recent,
sid=sid,
client=Client(
sources={},
sources_prio=[],
config=DEFAULT_CONFIG | data["config"],
),
)
await self.sio.enter_room(sid, room)
await self.send_state(self.clients[room], sid)
async def handle_register_web(self, sid: str, data: dict[str, Any]) -> bool:
"""
THIS IS DEPRECATED, REGISTRATION IS NOW DONE VIA THE CONNECT EVENT.
Handle a "register-web" message.
Adds a web client to a requested room and sends it the initial state of the
@ -1459,8 +1065,6 @@ class Server:
@with_state
async def handle_register_admin(self, state: State, sid: str, data: dict[str, Any]) -> bool:
"""
THIS IS DEPRECATED, REGISTRATION IS NOW DONE VIA THE CONNECT EVENT.
Handle a "register-admin" message.
If the client provides the correct secret for its room, the connection is
@ -1494,7 +1098,7 @@ class Server:
"""
old_entry = await self.discard_first(state)
await self.sio.emit("skip-current", old_entry, room=state.sid)
await self.broadcast_state(state, sid=sid)
await self.broadcast_state(state)
@admin
@with_state
@ -1512,7 +1116,7 @@ class Server:
:rtype: None
"""
await state.queue.move_to(data["uuid"], data["target"])
await self.broadcast_state(state, sid=sid)
await self.broadcast_state(state)
@admin
@with_state
@ -1530,7 +1134,7 @@ class Server:
:rtype: None
"""
await state.queue.move_up(data["uuid"])
await self.broadcast_state(state, sid=sid)
await self.broadcast_state(state)
@admin
@with_state
@ -1567,7 +1171,7 @@ class Server:
state.waiting_room[first_entry_index],
)
del state.waiting_room[first_entry_index]
await self.broadcast_state(state, sid=sid)
await self.broadcast_state(state)
async def handle_disconnect(self, sid: str) -> None:
"""
@ -1701,13 +1305,14 @@ class Server:
logger.info("Start Cleanup")
to_remove: list[str] = []
for sid, state in self.clients.items():
logger.debug("Client %s, last seen: %s", sid, str(state.last_seen))
logger.info("Client %s, last seen: %s", sid, str(state.last_seen))
if state.last_seen + datetime.timedelta(hours=4) < datetime.datetime.now():
logger.info("No activity for 4 hours, removing %s", sid)
to_remove.append(sid)
for sid in to_remove:
await self.sio.disconnect(sid)
del self.clients[sid]
logger.info("End Cleanup")
# The internal loop counter does not use a regular timestamp, so we need to convert between
# regular datetime and the async loop time
@ -1717,7 +1322,7 @@ class Server:
offset = next_run.timestamp() - now.timestamp()
loop_next = asyncio.get_event_loop().time() + offset
logger.info("End cleanup, next cleanup at %s", str(next_run))
logger.info("Next Cleanup at %s", str(next))
asyncio.get_event_loop().call_at(loop_next, lambda: asyncio.create_task(self.cleanup()))
async def background_tasks(
@ -1741,35 +1346,6 @@ class Server:
iapp["repeated_cleanup"].cancel()
await iapp["repeated_cleanup"]
async def run_apps(self, host: str, port: int, admin_port: Optional[int]) -> None:
"""
Run the main and admin apps.
This is used to run the main app and the admin app in parallel.
:param host: The host to bind to
:type host: str
:param port: The port to bind to
:type port: int
:param admin_port: The port for the admin interface, or None if not used
:type admin_port: Optional[int]
:rtype: None
"""
if admin_port:
logger.info("Starting admin interface on port %d", admin_port)
print(f"==== Admin Interface on {host}:{admin_port} ====")
await self.admin_runner.setup()
admin_site = web.TCPSite(self.admin_runner, host, admin_port)
await admin_site.start()
logger.info("Starting main server on port %d", port)
print(f"==== Server on {host}:{port} ====")
await self.runner.setup()
site = web.TCPSite(self.runner, host, port)
await site.start()
while True:
await asyncio.sleep(3600)
def run(self, args: Namespace) -> None:
"""
Run the server.
@ -1781,7 +1357,6 @@ class Server:
- `registration_keyfile`, the file containing the registration keys
- `private`, if the server is private
- `restricted`, if the server is restricted
- `admin_port`, the port for the admin interface
:param args: The command line arguments
:type args: Namespace
@ -1802,27 +1377,12 @@ class Server:
self.app.router.add_route("*", "/", self.root_handler)
self.app.router.add_route("*", "/{room}", self.root_handler)
self.app.router.add_route("*", "/{room}/", self.root_handler)
self.admin_app.router.add_route("*", "/", self.admin_handler)
self.app.cleanup_ctx.append(self.background_tasks)
if args.admin_password:
self.sio.instrument(auth={"username": "admin", "password": args.admin_password})
try:
asyncio.run(
self.run_apps(
args.host,
args.port,
args.admin_port,
)
)
except KeyboardInterrupt:
pass
finally:
logger.info("Shutting down server...")
asyncio.run(self.runner.cleanup())
asyncio.run(self.admin_runner.cleanup())
logger.info("Server shut down.")
web.run_app(self.app, host=args.host, port=args.port)
def run_server(args: Namespace) -> None:
@ -1833,8 +1393,5 @@ def run_server(args: Namespace) -> None:
:type args: Namespace
:rtype: None
"""
loglevel = getattr(logging, args.log_level.upper(), logging.WARNING)
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logger.setLevel(loglevel)
server = Server()
server.run(args)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -5,8 +5,8 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Syng Rocks!</title>
<script type="module" crossorigin src="/assets/index.5e369434.js"></script>
<link rel="stylesheet" href="/assets/index.f2d50df7.css">
<script type="module" crossorigin src="/assets/index.520c2769.js"></script>
<link rel="stylesheet" href="/assets/index.ed7016c8.css">
</head>
<body>
<div id="app"></div>

View file

@ -25,13 +25,7 @@ class MPV:
title: str
def __init__(
self,
ytdl: bool,
input_default_bindings: bool,
input_vo_keyboard: bool,
osc: bool,
*args: Any,
**kwargs: Any,
self, ytdl: bool, input_default_bindings: bool, input_vo_keyboard: bool, osc: bool
) -> None: ...
def terminate(self) -> None: ...
def play(self, file: str) -> None: ...
@ -53,5 +47,3 @@ class MPV:
def register_event_callback(self, callback: Callable[..., Any]) -> None: ...
def __setitem__(self, key: str, value: str) -> None: ...
def __getitem__(self, key: str) -> str: ...
def command(self, command: str, *args: Any, **kwargs: Any) -> None: ...
def allocate_overlay_id(self) -> int: ...

View file

@ -11,13 +11,7 @@ class _session_context_manager:
async def __aenter__(self) -> dict[str, Any]: ...
async def __aexit__(self, *args: list[Any]) -> None: ...
class Manager:
rooms: dict[str, set[str]]
def get_namespaces(self) -> list[str]: ...
def get_participants(self, namespace: str, room: str) -> list[tuple[str, str]]: ...
class AsyncServer:
manager: Manager
def __init__(
self,
cors_allowed_origins: str,
@ -42,11 +36,11 @@ class AsyncServer:
def instrument(self, auth: dict[str, str]) -> None: ...
class AsyncClient:
def __init__(self, json: Any = None, reconnection_attempts: int = 0): ...
def __init__(self, json: Any = None): ...
def on(
self, event: str, handler: Optional[Callable[..., Any]] = None
) -> Callable[[ClientHandler], ClientHandler]: ...
async def wait(self) -> None: ...
async def connect(self, server: str, auth: dict[str, Any]) -> None: ...
async def connect(self, server: str) -> None: ...
async def disconnect(self) -> None: ...
async def emit(self, message: str, data: Any = None) -> None: ...

View file

@ -1,3 +1 @@
class ConnectionError(Exception): ...
class ConnectionRefusedError(ConnectionError): ...
class BadNamespaceError(Exception): ...