From 36e956e0cbc140b720a340684c289af4765862e9 Mon Sep 17 00:00:00 2001 From: carlou Date: Mon, 12 Sep 2016 13:34:00 +0200 Subject: [PATCH] Documentation --- README.md | 42 ++++------------------------------ doc/COMPILING.rst | 55 +++++++++++++++++++++++++++++++++++++++++++++ doc/HOME.rst | 7 ++++-- doc/INTERACTION.rst | 3 ++- doc/SETUP.rst | 35 +++++++++++++++++++---------- 5 files changed, 89 insertions(+), 53 deletions(-) create mode 100644 doc/COMPILING.rst diff --git a/README.md b/README.md index 139ef08..24184bc 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,6 @@ -UdooPlayer -========== +Boîtes Électriques - Server (be-server) +======================================= -A loop player for the UDOO, based on libaudiotool +A loop player for the Raspberry Pi, forked from UDOO Player and based on libaudiotool. -Installation on a new UDOO image (Ubuntu 12.04) - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo add-apt-repository ppa:ubuntu-sdk-team/ppa - sudo apt-get update - sudo apt-get dist-upgrade - sudo apt-get install git g++-4.8 ubuntu-sdk libportaudiocpp0 libportaudio-dev libavfilter-dev libavformat-dev libavcodec-dev cmake - - -Build latest CMake and KDE Frameworks 5 Archive : - -* CMake -``` - mkdir ~/kf5 - cd ~/kf5 - wget http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz - tar -zxf cmake-3.0.0.tar.gz - cd cmake-3.0.0 - (mkdir build; cd build; cmake ..; make; make install) -``` -* Extra CMake modules -``` - git clone git://anongit.kde.org/extra-cmake-modules - cd extra-cmake-modules - (mkdir build; cd build; cmake ..; make; make install) -``` -* KArchive -``` - wget http://download.kde.org/stable/frameworks/5.0.0/karchive-5.0.0.tar.xz - tar -xf karchive-5.0.0.tar.xz - cd karchive-5.0.0.tar.xz - (mkdir build; cd build; cmake ..; make; make install) -``` - -And build. +Installation and configuration instruction can be found in the doc/ directory. diff --git a/doc/COMPILING.rst b/doc/COMPILING.rst new file mode 100644 index 0000000..2311ed4 --- /dev/null +++ b/doc/COMPILING.rst @@ -0,0 +1,55 @@ +Compiling the project +===================== + +Dependencies +------------ + +Installation on a new Raspberry Pi image (Raspbian Jessie) + + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo add-apt-repository ppa:ubuntu-sdk-team/ppa + sudo apt-get update + sudo apt-get dist-upgrade + sudo apt-get install git g++-4.8 ubuntu-sdk libportaudiocpp0 libportaudio-dev libavfilter-dev libavformat-dev libavcodec-dev cmake + + +Build latest CMake and KDE Frameworks 5 Archive : + +* CMake +``` + mkdir ~/kf5 + cd ~/kf5 + wget http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz + tar -zxf cmake-3.0.0.tar.gz + cd cmake-3.0.0 + (mkdir build; cd build; cmake ..; make; make install) +``` +* Extra CMake modules +``` + git clone git://anongit.kde.org/extra-cmake-modules + cd extra-cmake-modules + (mkdir build; cd build; cmake ..; make; make install) +``` +* KArchive +``` + wget http://download.kde.org/stable/frameworks/5.0.0/karchive-5.0.0.tar.xz + tar -xf karchive-5.0.0.tar.xz + cd karchive-5.0.0.tar.xz + (mkdir build; cd build; cmake ..; make; make install) +``` + +And build. + +Building the program +-------------------- + +First, clone the repository on the Raspberry Pi, either directly from Github or using the Git CLI:: + + $ git clone https://github.com/hixe33/boiteselec-server + +Then, we need to generate the Makefile before finally compiling the sources:: + + $ mkdir boiteselec-server/build + $ qmake -config release -o ../build/Makefile boiteselec-server/src/be-server.pro; + $ cd boiteselec-server/build + $ make diff --git a/doc/HOME.rst b/doc/HOME.rst index 82ed836..be33025 100644 --- a/doc/HOME.rst +++ b/doc/HOME.rst @@ -6,10 +6,13 @@ Table of content ================ *HOME* - Presentation of the application + Presentation of the application. + +*COMPILING* + How to build the program from the source. *SETUP* - How to install and setup the server + How to install and setup the server. *INTERACTION* How client and server interact with each other. diff --git a/doc/INTERACTION.rst b/doc/INTERACTION.rst index c60d926..3b2dfaf 100644 --- a/doc/INTERACTION.rst +++ b/doc/INTERACTION.rst @@ -7,6 +7,7 @@ General informations To communicate, client and server use the OSC protocol. By default, the server uses the IP address ``192.170.0.1``, with the port ``9988`` to send messages and ``9989`` to receive them. +These values can be changed in the configuration file. Protocol -------- @@ -97,4 +98,4 @@ The client can receive the following messages from the server to access its info ``/box/tracks_list `` Send the informations of the selected song's tracks, as ````. - ``` is the concatenation of the songs' tracks' names, separated by the character ``|``. + ```` is the concatenation of the songs' tracks' names, separated by the character ``|``. diff --git a/doc/SETUP.rst b/doc/SETUP.rst index 57bef01..71ffe36 100644 --- a/doc/SETUP.rst +++ b/doc/SETUP.rst @@ -7,6 +7,8 @@ Installation Basic Installation ~~~~~~~~~~~~~~~~~~ +Just clone the repository on the Raspberry Pi and follow the instructions of the ``COMPILING.rst`` page. + .. _daemonized: Daemonizing @@ -16,9 +18,9 @@ To make the server running in the background automatically on the RasPi startup, First, copy the ``be-server`` executable file to ``/opt/boites-electriques/``, and the ``be-server.sh`` script (located in the repo's ``share/`` directory) to ``/etc/init.d/be-server``:: - sudo mkdir /opt/boites-electriques - sudo cp build/be-server /opt/boites-electriques/be-server - sudo cp share/be-server.sh /etc/init.d/be-server + $ sudo mkdir /opt/boites-electriques + $ sudo cp build/be-server /opt/boites-electriques/be-server + $ sudo cp share/be-server.sh /etc/init.d/be-server You can then edit the ``/etc/init.d/be-server`` to change the following values: @@ -38,26 +40,26 @@ You can then edit the ``/etc/init.d/be-server`` to change the following values: Name of the program. Default : ``"be-server"`` -Then, we give the right permissions to the daemonizing script and reload the system's daemons:: +Then, we give the right permissions to the daemonizing script and reload the system's daemons (as root or with ``sudo``):: - sudo chmod 0755 /etc/init.d/be-server - sudo systemctl daemon-reload + # chmod 0755 /etc/init.d/be-server + # systemctl daemon-reload We can then test the script:: - sudo /etc/init.d/be-server start + # /etc/init.d/be-server start [ ok ] Starting be-server (via systemctl): be-server.service - sudo /etc/init.d/be-server stop + # /etc/init.d/be-server stop [....] Stopping be-server (via systemctl): be-server.service And add it to the startup scripts:: - sudo update-rc.d be-server defaults + # update-rc.d be-server defaults To remove it:: - sudo update-rc.d -f be-server remove + # update-rc.d -f be-server remove Configuration ------------- @@ -68,17 +70,21 @@ General informations The server's configuration is saved in the ``config.txt`` file in the same folder as the executable. This file is formatted with the (almost) standard `INI file format `_. +By default (if the server is ran without the ``--config`` option), the configuration file is ``~/.config/Rock & Chanson/Boites Electriques.ini``. + +The missing fields in the file will automatically be filled at the execution. + The following options are available : ``[default]`` section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``threshold`` - Default threshold's value (integer). + Default threshold value (integer). Default : ``200`` ``master`` - Default master volume's value (integer). + Default master volume (integer). Default : ``50`` ``volume`` @@ -130,3 +136,8 @@ Run --- To start the server, just run ``./be-server``, or ``sudo /etc/init.d/be-server start`` if the server has been daemonized_. + +The following options are available : + +``-c``, ``--config `` + Define the ```` file as the configuration file.